Skip to content
Create 3 Advanced/Custom GUIs authored by Guillaume Vandenneucker's avatar Guillaume Vandenneucker
![banner](https://i.postimg.cc/Qdr0cnKt/banner.png)
# Custom GUIs
Customizable GUIs can be shown using either the menu command or by interacting with a configured trigger.
Every GUI can have a title, a size, and content items.
Every content item can have a slot, a type, a name, a lore, enchants, nbts, etc.
You can link commands to content itemS.
You can link actions to content items with different click types (either DEFAULT for any click that's not overriden, or any other spigot click type that is on an item : https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/ClickType.html).
Action types :
- `OPEN_GUI {gui_id}` to open another GUI (useful to create a navigable sub-GUIs system)
- `OPEN_PLAYER_SHOPS` to open a GUI to list player shops (either GUI shops or physical shops that are remote)
- `OPEN_PLAYER_SHOPS_BY_OWNER` to open a GUI to list player shops by owner
- `OPEN_PLAYER_SHOPS_CLICKER` to open a GUI to list the shops of the player who's viewing the GUI, and there he can also create GUI shops
- `OPEN_PLAYER_MERCHANTS` to open a GUI to list player merchants (merchants that are remote)
- `OPEN_PLAYER_MERCHANTS_BY_OWNER` to open a GUI to list player merchants by owner
- `OPEN_PLAYER_MERCHANTS_CLICKER` to open a GUI to list the merchants of the player who's viewing the GUI
- `OPEN_ADMIN_SHOP_TRADE {admin_shop_id},{trade_id}` to open an admin shop trade
- `QUICK_SELL_ADMIN_FOR_VAULT_MONEY` to quick sell all the items in the player's inventory to all the admin trades present in the opened GUI (not sub GUIs)
There's also an automatic page system if there are too many items, or if a slot is bound twice to an item.
## Edit custom GUIs
You can create and edit triggers either in-game using the `/supremeshops edit` command, or in the configuration folder located at `/plugins/SupremeShops/guis/`.
Example, `main_gui.yml` :
```YAML
#----------------------------------------------------------------------------------------------------
# GUI configuration file (file name without the extension is the GUI identifier)
#----------------------------------------------------------------------------------------------------
# Settings
name: 'Shops'
size: 54
# Content : items of this GUI
content:
# admin shops GUIs
adminshop_tools:
item:
slot: 10
type: IRON_PICKAXE
name: '&fTools'
click_actions:
DEFAULT: OPEN_GUI adminshop_tools
adminshop_miner:
item:
slot: 11
type: DIAMOND
name: '&bMiner'
click_actions:
DEFAULT: OPEN_GUI adminshop_miner
adminshop_explorer:
item:
slot: 12
type: MOSSY_COBBLESTONE
name: '&2Explorer'
click_actions:
DEFAULT: OPEN_GUI adminshop_explorer
adminshop_ocean:
item:
slot: 13
type: SPONGE
name: '&1Ocean'
click_actions:
DEFAULT: OPEN_GUI adminshop_ocean
adminshop_woodcutter:
item:
slot: 14
type: BIRCH_LOG
name: '&fWoodcutter'
click_actions:
DEFAULT: OPEN_GUI adminshop_woodcutter
adminshop_gardener:
item:
slot: 15
type: POPPY
name: '&4Gardener'
click_actions:
DEFAULT: OPEN_GUI adminshop_gardener
adminshop_farmer:
item:
slot: 16
type: WHEAT
name: '&eFarmer'
click_actions:
DEFAULT: OPEN_GUI adminshop_farmer
adminshop_food:
item:
slot: 19
type: APPLE
name: '&cFood'
click_actions:
DEFAULT: OPEN_GUI adminshop_food
adminshop_loot:
item:
slot: 20
type: ENDER_PEARL
name: '&3Loot'
click_actions:
DEFAULT: OPEN_GUI adminshop_loot
adminshop_brewing:
item:
slot: 21
type: BREWING_STAND
name: '&6Brewing'
click_actions:
DEFAULT: OPEN_GUI adminshop_brewing
adminshop_dye:
item:
slot: 22
type: PINK_DYE
name: '&dDye'
click_actions:
DEFAULT: OPEN_GUI adminshop_dye
adminshop_furniture:
item:
slot: 23
type: FURNACE
name: '&8Furniture'
click_actions:
DEFAULT: OPEN_GUI adminshop_furniture
adminshop_openable:
item:
slot: 24
type: IRON_TRAPDOOR
name: '&7Openable'
click_actions:
DEFAULT: OPEN_GUI adminshop_openable
adminshop_redstone:
item:
slot: 25
type: REDSTONE_TORCH
name: '&cRedstone'
click_actions:
DEFAULT: OPEN_GUI adminshop_redstone
adminshop_enchanted_books:
item:
slot: 28
type: ENCHANTED_BOOK
name: '&4Enchanted books'
click_actions:
DEFAULT: OPEN_GUI adminshop_enchanted_books
adminshop_regular_potions:
item:
slot: 29
type: GLASS_BOTTLE
name: '&6Regular potions'
click_actions:
DEFAULT: OPEN_GUI adminshop_regular_potions
adminshop_splash_potions:
item:
slot: 30
type: GLASS_BOTTLE
name: '&9Splash potions'
click_actions:
DEFAULT: OPEN_GUI adminshop_splash_potions
adminshop_lingering_potions:
item:
slot: 31
type: GLASS_BOTTLE
name: '&bLingering potions'
click_actions:
DEFAULT: OPEN_GUI adminshop_lingering_potions
adminshop_mob_eggs:
item:
slot: 32
type: CREEPER_SPAWN_EGG
name: '&aSpawn eggs'
click_actions:
DEFAULT: OPEN_GUI adminshop_mob_eggs
# open the player merchants menu
player_merchants:
item:
slot: 43
type: PLAYER_HEAD
name: '&aPlayer shops and merchants'
lore:
- '&7Managed by players'
click_actions:
DEFAULT: OPEN_GUI player_shops_and_merchants
```
Example, `player_shops_and_merchants.yml` :
```YAML
#----------------------------------------------------------------------------------------------------
# GUI configuration file (file name without the extension is the GUI identifier)
#----------------------------------------------------------------------------------------------------
# Settings
name: 'Shops > Player shops and merchants'
size: 45
# Content : items of this GUI
content:
# open the player merchants menu
player_merchants:
item:
slot: 10
type: EMERALD
name: '&aPlayer merchants'
lore:
- '&7Merchants managed by players'
click_actions:
DEFAULT: OPEN_PLAYER_MERCHANTS
# open the owner selection menu
player_merchants_by_owner:
item:
slot: 11
type: NAME_TAG
name: '&aPlayer merchants - by owner'
lore:
- '&7Merchants managed by players'
- '&7 (per seller list)'
click_actions:
DEFAULT: OPEN_PLAYER_MERCHANTS_BY_OWNER
# open the player merchants menu for the player
player_merchants_clicker:
item:
slot: 12
type: EMERALD
name: '&aYour merchants'
lore:
- '&7Manage your remote merchants'
click_actions:
DEFAULT: OPEN_PLAYER_MERCHANTS_CLICKER
# open the player shops menu
player_shops:
item:
slot: 14
type: OAK_SIGN
name: '&aPlayer shops'
lore:
- '&7Shops managed by players'
click_actions:
DEFAULT: OPEN_PLAYER_SHOPS
# open the owner selection menu
player_shops_by_owner:
item:
slot: 15
type: NAME_TAG
name: '&aPlayer shops - by owner'
lore:
- '&7Shops managed by players'
- '&7 (per seller list)'
click_actions:
DEFAULT: OPEN_PLAYER_SHOPS_BY_OWNER
# open the player shops menu for the player
player_shops_clicker:
item:
slot: 16
type: ENDER_CHEST
name: '&aYour shops'
lore:
- '&7Manage your menu/remote shops'
click_actions:
DEFAULT: OPEN_PLAYER_SHOPS_CLICKER
# open the player shops menu for the player
back:
item:
slot: 34
type: ARROW
name: '&6Go back'
click_actions:
DEFAULT: OPEN_GUI main_gui
```
Example, `adminshop_brewing.yml` :
```YAML
#----------------------------------------------------------------------------------------------------
# GUI configuration file (file name without the extension is the GUI identifier)
# This file was generated automatically from file using the admin generation command
#----------------------------------------------------------------------------------------------------
# Settings
name: 'Shops > Brewing'
size: 54
# Content : items of this GUI
content:
# open the player shops menu for the player
back:
item:
slot: 53
type: ARROW
name: '&6Go back'
click_actions:
DEFAULT: OPEN_GUI main_gui
# sell every item the player has quickly in the first admin trade that gives money
sell_all:
item:
slot: 52
type: EMERALD
name: '&6Quick sell for money'
lore:
- '&7Sell every item you have &7 in the shops'
- '&7 listed here, if it can be sold for money'
click_actions:
DEFAULT: QUICK_SELL_ADMIN_FOR_VAULT_MONEY
# Admin shops trades
dff42de6b5:
item:
slot: 0
type: BREWING_STAND
amount: 1
name: '&7&cMoney &7-> &aBrewing Stand &7(left click)'
lore:
- '&7&cBrewing Stand &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:dff42de6b5
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:5b6ed24ffd
fe36c73471:
item:
slot: 1
type: CAULDRON
amount: 1
name: '&7&cMoney &7-> &aCauldron &7(left click)'
lore:
- '&7&cCauldron &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:fe36c73471
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:17437c63ef
844aa5cf95:
item:
slot: 2
type: GHAST_TEAR
amount: 1
name: '&7&cMoney &7-> &aGhast Tear &7(left click)'
lore:
- '&7&cGhast Tear &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:844aa5cf95
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:59fc5aa448
28a7f4e724:
item:
slot: 3
type: FERMENTED_SPIDER_EYE
amount: 1
name: '&7&cMoney &7-> &aFermented Spider Eye &7(left click)'
lore:
- '&7&cFermented Spider Eye &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:28a7f4e724
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:427e4f7a82
5baa8b18a5:
item:
slot: 4
type: BLAZE_POWDER
amount: 1
name: '&7&cMoney &7-> &aBlaze Powder &7(left click)'
lore:
- '&7&cBlaze Powder &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:5baa8b18a5
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:5a81b8aab5
28cefb58b3:
item:
slot: 5
type: MAGMA_CREAM
amount: 1
name: '&7&cMoney &7-> &aMagma Cream &7(left click)'
lore:
- '&7&cMagma Cream &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:28cefb58b3
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:3b85bfec82
6f9f82ac03:
item:
slot: 6
type: GLISTERING_MELON_SLICE
amount: 1
name: '&7&cMoney &7-> &aGlistering Melon Slice &7(left click)'
lore:
- '&7&cGlistering Melon Slice &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:6f9f82ac03
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:30ca28f9f6
a960b7ea4f:
item:
slot: 7
type: GOLDEN_CARROT
amount: 1
name: '&7&cMoney &7-> &aGolden Carrot &7(left click)'
lore:
- '&7&cGolden Carrot &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:a960b7ea4f
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:f4ae7b069a
9d78803233:
item:
slot: 8
type: RABBIT_FOOT
amount: 1
name: '&7&cMoney &7-> &aRabbit Foot &7(left click)'
lore:
- '&7&cRabbit Foot &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:9d78803233
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:33230887d9
2d7084cee3:
item:
slot: 9
type: DRAGON_BREATH
amount: 1
name: '&7&cMoney &7-> &aDragon Breath &7(left click)'
lore:
- '&7&cDragon Breath &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:2d7084cee3
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:3eec4807d2
02380c2b6f:
item:
slot: 10
type: PHANTOM_MEMBRANE
amount: 1
name: '&7&cMoney &7-> &aPhantom Membrane &7(left click)'
lore:
- '&7&cPhantom Membrane &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:02380c2b6f
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:f6b2c08320
371bbd20e8:
item:
slot: 11
type: REDSTONE
amount: 1
name: '&7&cMoney &7-> &aRedstone &7(left click)'
lore:
- '&7&cRedstone &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:371bbd20e8
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:8e02dbb173
e88830b5fd:
item:
slot: 12
type: GLOWSTONE_DUST
amount: 1
name: '&7&cMoney &7-> &aGlowstone Dust &7(left click)'
lore:
- '&7&cGlowstone Dust &7-> &aMoney &7(right click)'
click_actions:
LEFT: OPEN_ADMIN_SHOP_TRADE brewing:e88830b5fd
RIGHT: OPEN_ADMIN_SHOP_TRADE brewing:df5b03888e
```
\ No newline at end of file