4. ShopGUIPlus GUI & DynaShop Placeholders Setup - Tylwen/ShopGUIPlus-DynaShop GitHub Wiki
Replace the default %buy%
and %sell%
with DynaShop placeholders for dynamic prices and stock in file plugins/ShopGUIPlus/config.yml
:
shopItemLoreFormat:
# Lore for items in the main shop GUI
item:
- ""
- "&7&l» &fBuy price: &c%dynashop_current_buy%"
- "&7&l» &fSell price: &a%dynashop_current_sell%"
- "&7&l» &fStock: &a%dynashop_current_colored_stock_ratio%"
- ""
- "&f➢ Right-click to &asell"
- "&f➤ Middle-click to &bsell all"
- "&f➣ Left-click to &cbuy"
- ""
# Lore for items in the buy GUI (amount selection)
itemBuyGUI:
- ""
- "&7&l» &fBuy price: &c%dynashop_current_buy%"
- "&7&l» &fStock: &a%dynashop_current_colored_stock_ratio%"
- ""
# Lore for items in the sell GUI (amount selection)
itemSellGUI:
- ""
- "&7&l» &fSell price: &a%dynashop_current_sell%"
- "&7&l» &fStock: &a%dynashop_current_colored_stock_ratio%"
- ""
# Lore for the sell all button in the sell GUI
itemSellGUISellAll:
- ""
- "&7&l» &fSell all for: &a%dynashop_current_sell%"
- "&7&l» &fStock: &a%dynashop_current_colored_stock_ratio%"
- ""
- "&f➤ Click to &bsell all"
- ""
-
%dynashop_current_buyPrice%
: Raw buy price -
%dynashop_current_sellPrice%
: Raw sell price -
%dynashop_current_buyMinPrice%
/%dynashop_current_buyMaxPrice%
-
%dynashop_current_sellMinPrice%
/%dynashop_current_sellMaxPrice%
-
%dynashop_current_buy%
/%dynashop_current_sell%
: Formatted price (with min/max if applicable) -
%dynashop_current_stock%
: Current stock -
%dynashop_current_maxstock%
: Max stock -
%dynashop_current_stock_ratio%
: Current/max stock -
%dynashop_current_colored_stock_ratio%
: Current/max stock with color -
%dynashop_current_buy_modifier%
: Buy price modifier (e.g., +5% or -3%) -
%dynashop_current_sell_modifier%
: Sell price modifier (e.g., +5% or -3%)
-
%dynashop_current_buy_limit%
: Remaining buy limit -
%dynashop_current_sell_limit%
: Remaining sell limit -
%dynashop_current_buy_reset_time%
: Time until buy limit reset -
%dynashop_current_sell_reset_time%
: Time until sell limit reset -
%dynashop_current_buy_limit_status%
: Complete status message for buy limit -
%dynashop_current_sell_limit_status%
: Complete status message for sell limit
-
%dynashop_current_buy_trend%
: Shows price trend (↗ Rising, ↘ Falling, → Stable) -
%dynashop_current_sell_trend%
: Shows price trend (↗ Rising, ↘ Falling, → Stable) -
%dynashop_current_buy_variation%
: Price variation for buy (e.g., +5% or -3%) -
%dynashop_current_sell_variation%
: Price variation for sell (e.g., +5% or -3%)
Tip:
Lines with placeholders are automatically hidden if the value is "N/A" or "-1" (see hideBuyPriceForUnbuyable
and hideSellPriceForUnsellable
in your config).
Note:
You can also use any PlaceholderAPI placeholders in your item lores, buttons, and GUIs.
If PlaceholderAPI is installed, all %placeholder%
variables (from any supported plugin) will be replaced automatically in the lore, alongside DynaShop placeholders.
For example:
shopItemLoreFormat:
item:
- "&7&l» &fBuy price: &c%dynashop_current_buy%"
- "&7&l» &fPlayer: &b%player_name%"
- "&7&l» &fBalance: &a%vault_eco_balance_formatted%"
This allows you to display player names, balances, stats, and any other dynamic info supported by PlaceholderAPI, together with DynaShop dynamic prices and stock.
You can also use DynaShop placeholders in the lore of your custom buttons (for example, in bulk buy/sell GUIs):
amountSelectionGUIBulkBuy:
buttons:
buy1:
item:
material: CHEST
quantity: 1
name: "&aBuy 1 stack"
lore:
- "&7Price: &c%dynashop_current_buy%"
value: 1
slot: 0
# ...repeat for buy2, buy3, etc.
cancel:
item:
material: RED_STAINED_GLASS
quantity: 1
name: "&c&lCancel"
slot: 13
Same for amountSelectionGUIBulkSell
(replace %buy%
/%sell%
with %dynashop_current_buy%
/%dynashop_current_sell%
).
You can customize the main menu items as usual, but you can also add dynamic info in the lore if you want:
shopMenuItems:
1:
item:
material: GRASS_BLOCK
quantity: 1
name: "&9&lBlocks"
lore:
- "&7Click to open the blocks shop!"
shop: "blocks"
slot: 11
# ...etc.
If you want to show min/max prices, add these lines in your lore:
- "&7Min: &a%dynashop_current_buyMinPrice% &7/ Max: &c%dynashop_current_buyMaxPrice%"
- "&7Min: &a%dynashop_current_sellMinPrice% &7/ Max: &c%dynashop_current_sellMaxPrice%"
- You can use all DynaShop placeholders in any lore or button.
- Placeholders work in all GUIs: shop, buy, sell, bulk buy/sell.
- For more info, see your config.yml and the ShopGUIPlus documentation.
Result:
Your GUIs will always display up-to-date prices and stock, and your players will see dynamic info everywhere!