2. DynaShop Modes - Tylwen/ShopGUIPlus-DynaShop GitHub Wiki

DynaShop Modes

Each item can work in a specific DynaShop mode:

Mode Description Config key (typeDynaShop)
DYNAMIC Dynamic price, no stock management DYNAMIC
STOCK Dynamic price + stock management (limited quantity) STOCK
STATIC_STOCK Fixed price, but with stock management STATIC_STOCK
RECIPE Price automatically calculated from crafting recipe RECIPE
LINK Item inherits price from another item (shopID:itemID) LINK

Item Configuration by Mode

1. DYNAMIC Mode

This mode allows dynamic pricing without stock management. Prices can change based on supply and demand.

items:
  diamond:
    typeDynaShop: DYNAMIC
    buyPrice: 1000     # Base buy price
    dynaShop:
      buyDynamic:
        min: 800       # Minimum buy price
        max: 1200      # Maximum buy price
        growth: 1.01   # Price growth factor
        decay: 0.99    # Price decay factor
      sellPrice: 900   # Base sell price
      sellDynamic:
        min: 700       # Minimum sell price
        max: 1100      # Maximum sell price
        growth: 1.01   # Price growth factor
        decay: 0.99    # Price decay factor

2. STOCK Mode

This mode combines dynamic pricing with stock management. The item has a limited stock that affects the price.

items:
  iron:
    typeDynaShop: STOCK
    buyPrice: 100
    buyDynamic:
      min: 50              # Minimum buy price
      max: 200             # Maximum buy price
    sellPrice: 80
    sellDynamic:
      min: 40              # Minimum sell price
      max: 160             # Maximum sell price
    stock:
      base: 1000           # Base stock
      min: 0               # Minimum stock
      max: 10000           # Maximum stock
      buyModifier: 1.0     # Buy price modifier based on stock (Optional)
      sellModifier: 1.0    # Sell price modifier based on stock (Optional)

3. STATIC_STOCK Mode

items:
  gold:
    typeDynaShop: STATIC_STOCK
    buyPrice: 200         # Fixed buy price
    sellPrice: 150        # Fixed sell price
    stock:
      base: 500           # Base stock
      min: 0              # Minimum stock
      max: 5000           # Maximum stock

4. RECIPE Mode

items:
  diamond_block:
    typeDynaShop: RECIPE
    recipe:
      type: SHAPED         # Recipe type (SHAPED, SHAPELESS, FURNACE, SMITHING, STONECUTTER)
      pattern:             # For SHAPED, define the pattern and ingredients
        - "XXX"
        - "XXX"
        - "XXX"
      ingredients:
        X: diamond
      output: 1            # (Optional) Output quantity for this recipe
      modifier: 1.0        # (Optional) Price modifier for this recipe
    buyPrice: 0            # Optional, will be calculated
    sellPrice: 0           # Optional, will be calculated

  custom_mix:
    typeDynaShop: RECIPE
    recipe:
      type: SHAPELESS            # For SHAPELESS, no pattern needed
      ingredients:
        A: minerais:emerald      # reference to another item in a shop
        B: minerais:iron_ingot
        C: minerais:diamond
    buyPrice: 0
    sellPrice: 0

  iron_ingot_from_ore:
    typeDynaShop: RECIPE
    recipe:
      type: FURNACE              # For FURNACE, use input: instead of ingredients:
      input: minerais:iron_ore   # reference to another item in a shop
    buyPrice: 0
    sellPrice: 0
    
  netherite_helmet:
    typeDynaShop: RECIPE
    recipe:
      type: SMITHING
      base: armures:diamond_helmet
      addition: backend:netherite_upgrade_smithing_template
      material: minerais:netherite_ingot
      output: 1
    buyPrice: 0
    sellPrice: 0
    
  stone_bricks:
    typeDynaShop: RECIPE
    recipe:
      type: STONECUTTER
      input: stone
      output: 4
    buyPrice: 0
    sellPrice: 0
  • type: SHAPED, SHAPELESS, FURNACE, SMITHING, STONECUTTER
  • ingredients: For each symbol, use either a material name (e.g. DIAMOND) or a reference shopID:itemID (e.g. minerais:iron_ore)
  • input: For FURNACE and STONECUTTER, use input: instead of ingredients:
  • base, addition, material: For SMITHING
  • output: (Optional) Output quantity for the recipe (default: 1)
  • modifier: (Optional) Multiplies the recipe price (default: 1.0) (it will override the parameter in the config file)

Note:
The syntax shopID:itemID allows you to use any item from another shop as an ingredient, making the system very flexible.

5. LINK Mode

items:
  deepslate_coal:
    typeDynaShop: LINK
    link: ores:1 # target shopID:itemID
    buyPrice: -1 # Optional, will be ignored
    sellPrice: 25

Advanced: Different type for buy and sell

You can define a different DynaShop type for buying and selling the same item using buyType and sellType:

items:
  gold_block:
    typeDynaShop: DYNAMIC         # General type (fallback) or set NONE
    dynaShop:
      buyType: RECIPE              # Use RECIPE mode for buying
      sellType: DYNAMIC           # Use DYNAMIC mode for selling (Optional in this case)
    buyPrice: 500
    sellPrice: 300
    recipe:
      type: SHAPED
      pattern:
        - "XXX"
        - "XXX"
        - "XXX"
      ingredients:
        X: ores:gold_ingot
    buyDynamic:
      min: 400
      max: 600
    sellDynamic:
      min: 250
      max: 350
  • dynaShop.buyType: Type used for buying (e.g. DYNAMIC, RECIPE, LINK)
  • dynaShop.sellType: Type used for selling

If not set, the plugin uses the general typeDynaShop for both buy and sell.

This allows you to, for example, have a fixed price for selling but a dynamic price for buying, or use stock only for one direction.


Advanced: minLink and maxLink

You can link the minimum or maximum price of an item to another item (even from another shop) using minLink and maxLink:

items:
  diamond:
    typeDynaShop: DYNAMIC
    buyPrice: 1000
    buyDynamic:
      min: 800
      max: 1200
      minLink: minerais:1      # Link min price to item 1 in shop 'minerais'
      maxLink: shop2:diamond   # Link max price to 'diamond' in shop2
      growth: 1.01
      decay: 0.99
    sellPrice: 900
    sellDynamic:
      min: 700
      max: 1100
  • minLink: The minimum price will always be at least the min price of the linked item.
  • maxLink: The maximum price will never exceed the max price of the linked item.
  • You can use shopID:itemID syntax to reference any item in any shop.

Tip:
This is useful to synchronize price floors/ceilings between related items (for example, ores and ingots) and prevent prices from crossing (security).


Enchantment Price Modifier

You can enable a price multiplier for enchanted items.
If enabled, the price of an item will be multiplied according to its enchantments and the multipliers defined in your config.

How to enable

Add this in your item config (per item):

items:
  diamond_sword:
    typeDynaShop: DYNAMIC
    buyPrice: 1000
    dynaShop:
      enchantment: true   # Enable enchantment price modifier for this item

How it works

  • If enchantment: true is set, the plugin will check the item's enchantments.
  • The price will be multiplied by the value defined for each enchantment and level in your config (see below).
  • If not set, the price is not affected by enchantments.

Example: Define multipliers

In your config (usually plugins/ShopGUIPlus-DynaShop/config.yml):

enchant_multipliers:
  SHARPNESS:
    1: 1.2
    2: 1.4
    3: 1.7
    4: 2.0
    5: 2.5
  LOOTING:
    1: 1.1
    2: 1.3
    3: 1.6
  • The price will be multiplied by all applicable multipliers (one per enchantment/level).
  • If a multiplier is not set for a level, it defaults to 1.0 (no change).

Result

If a player tries to buy or sell an enchanted item, the price will be higher according to the multipliers you set.


Tip:
You can combine this with all DynaShop modes and placeholders.
If you want to disable the enchantment modifier for a specific item, set enchantment: false in its config or simply don't set it at all (default is false).


⚠️ **GitHub.com Fallback** ⚠️