Previous: ่ชๅฎไนGUI.md ยท Next: ็ปๆตๅจไฝ.md Related: ่ๆฌๅ ฅ้จ.md ยท ็ปๆตๅจไฝ.md ยท GUI็ผ็จAPI.md
๐ GUI Actions & Conditions Quick Reference โ
This is a pure quick-reference page: all click actions (type) and all visibility conditions (view-requirement), each with a copy-paste-ready YAML snippet. For the basic GUI structure, read ่ชๅฎไนGUI.md first.
๐ฑ๏ธ Full Table of Click Action Types (ActionExecutor) โ
typeis case-insensitive. The spellings in the "Aliases" column below have exactly the same effect.
| type | Aliases | value format | Description |
|---|---|---|---|
command | cmd | command (without /) | Run from the console |
console_command | console_cmd | command | Run from the console (same as above) |
player_command | player_cmd | command | Run as the player |
message | msg | text (& codes + placeholders) | Send a message to the player |
broadcast | โ | text | Broadcast to the whole server |
sound | โ | soundName,volume,pitch | Play a sound |
open_gui | gui | GUI id | Open another menu |
close | โ | empty | Close the menu |
refresh | โ | empty | Refresh the current menu |
teleport | โ | x,y,z[,world] | Teleport |
give_item | โ | material:amount | Give item |
take_item | โ | material:amount | Remove item |
clear_inventory | โ | empty | Clear inventory |
heal | โ | number (default full health) | Heal |
feed | โ | number (default 20) | Feed |
gamemode | โ | SURVIVAL/CREATIVE/ADVENTURE/SPECTATOR | Change game mode |
fly | โ | true/false/empty (toggle) | Toggle flight |
effect | โ | effectName,durationTicks,level | Apply potion effect |
give_money | givemoney | see ็ปๆตๅจไฝ.md | Give money |
take_money | takemoney,remove_money | see ็ปๆตๅจไฝ.md | Take money |
set_money | setmoney | see ็ปๆตๅจไฝ.md | Set balance |
javascript | js,run_script,script | script reference or code | Run JS |
๐ Example for Each โ
# command / console_command โโ run from the console
buy:
type: command
value: "give {player} diamond 1"
# player_command โโ run as the player
home:
type: player_command
value: "home"
# message โโ send a message to the player
tip:
type: message
value: "&aWelcome, {player}!"
# broadcast โโ broadcast to the whole server
ann:
type: broadcast
value: "&e{player} triggered the hidden easter egg!"
# sound โโ soundName,volume,pitch
ding:
type: sound
value: "ENTITY_EXPERIENCE_ORB_PICKUP,1,1"
# open_gui โโ open another menu
go:
type: open_gui
value: shop
# close โโ close (leave value empty)
x:
type: close
# refresh โโ refresh the current menu
r:
type: refresh
# teleport โโ x,y,z[,world]
tp:
type: teleport
value: "100,64,-200,world"
# give_item / take_item โโ material:amount
g:
type: give_item
value: "GOLDEN_APPLE:3"
t:
type: take_item
value: "DIRT:64"
# clear_inventory โโ clear inventory
clr:
type: clear_inventory
# heal โโ number, leave empty for full health
h:
type: heal
value: "20"
# feed โโ number, default 20
f:
type: feed
value: "20"
# gamemode
gm:
type: gamemode
value: "CREATIVE"
# fly โโ true/false/empty toggles
fl:
type: fly
value: "true"
# effect โโ effectName,durationTicks,level
buff:
type: effect
value: "SPEED,200,1"
# javascript โโ script reference or inline code
js:
type: javascript
value: "myscript.js"๐ฐ The three economy actions
give_money/take_money/set_moneyhave a more complex value syntax (including provider, currency, failure message), documented separately in ็ปๆตๅจไฝ.md.
๐ฑ๏ธ click-types Values โ
click-types determines which click method triggers this action; written as a list:
| Value | Meaning |
|---|---|
LEFT | Left click |
RIGHT | Right click |
MIDDLE | Middle click |
ALL / ANY | Any click method |
click-actions:
left_only:
click-types: [LEFT]
type: message
value: "&aLeft click"
any:
click-types: [ALL]
type: message
value: "&7Any click works"You can also add
shift: true, meaning the action only triggers on "Shift + click" (see ่ชๅฎไนGUI.md).
๐๏ธ Full Table of Visibility Condition Types (ConditionChecker) โ
view-requirement structure: type + value + optional negate (true = invert; shows only when NOT met).
| type | Aliases | value | Description |
|---|---|---|---|
permission | โ | permission node | Whether the player has the permission |
has_item | โ | material:amount | Whether the inventory contains the item |
level | โ | comparator + number, e.g. >=10 | Level |
money | โ | comparator + number[:provider], e.g. >=1000:money | Balance |
health | โ | comparator + number | Health |
food | โ | comparator + number (0-20) | Hunger |
world | โ | world name | Current world |
gamemode | โ | SURVIVAL/CREATIVE/โฆ | Game mode |
javascript | js,script | script reference/code (returns boolean) | Custom |
๐ข Comparators โ
| Symbol | Meaning |
|---|---|
>= | Greater than or equal (default, used when no symbol is given) |
<= | Less than or equal |
> | Greater than |
< | Less than |
== | Equal |
๐ Example for Each โ
# permission โโ shown only with the permission
view-requirement:
type: permission
value: "myserver.vip"
# has_item โโ shown only when the inventory has 16 emeralds
view-requirement:
type: has_item
value: "EMERALD:16"
# level โโ level >= 10
view-requirement:
type: level
value: ">=10"
# money โโ balance >= 1000, using the money currency
view-requirement:
type: money
value: ">=1000:money"
# health โโ health > 10
view-requirement:
type: health
value: ">10"
# food โโ hunger < 6 (the "eat" button shows only when hungry)
view-requirement:
type: food
value: "<6"
# world โโ shown only in world_nether
view-requirement:
type: world
value: "world_nether"
# gamemode โโ shown only in survival mode
view-requirement:
type: gamemode
value: "SURVIVAL"
# javascript โโ shown only when the script returns true
view-requirement:
type: javascript
value: "check_vip.js"๐ negate (invert) โ
negate: true inverts the condition โ it shows only when the condition is NOT met. For example, a tip "shown only to non-admins":
view-requirement:
type: permission
value: "myserver.admin"
negate: true # only players WITHOUT the admin permission see this slot๐ณ Common Combo Recipes โ
Recipe A: Buy button (condition + take money + give item + message) โ
"13":
material: DIAMOND
name: "&bBuy Diamond &7(100 coins)"
view-requirement: # if the player can't afford it, this slot simply doesn't show
type: money
value: ">=100"
click-actions:
pay:
click-types: [LEFT]
type: take_money
value: "100 | Insufficient balance"
give:
click-types: [LEFT]
type: give_item
value: "DIAMOND:1"
msg:
click-types: [LEFT]
type: message
value: "&aPurchase successful, 100 coins deducted"โ ๏ธ The three actions above run in order. If you want an atomic transaction like "don't give the item if taking money fails", use a
javascriptaction instead and write both the deduction and the item grant in a single script โ see ่ๆฌๅ ฅ้จ.md.
Recipe B: Admin-only button (permission) โ
"26":
material: COMMAND_BLOCK
name: "&cAdmin Panel"
view-requirement:
type: permission
value: "myserver.admin" # only admins can see it
click-actions:
open:
type: open_gui
value: admin_panelRecipe C: Regular-player tip (permission + negate) โ
"26":
material: PAPER
name: "&7You are not an admin"
view-requirement:
type: permission
value: "myserver.admin"
negate: true # only players without the permission see itRecipe D: Restore button (appears only when hungry + feed + heal + sound) โ
"11":
material: COOKED_BEEF
name: "&aSupplies"
view-requirement:
type: food
value: "<20" # shown only when not full
click-actions:
feed:
type: feed
value: "20"
heal:
type: heal
sound:
type: sound
value: "ENTITY_PLAYER_BURP,1,1"๐ Further Reading โ
- ๐ผ๏ธ ่ชๅฎไนGUI.md โ Full GUI structure and fields
- ๐ฐ ็ปๆตๅจไฝ.md โ value syntax for the three economy actions
- ๐ ่ๆฌๅ
ฅ้จ.md โ
javascriptconditions and actions - ๐งฐ GUI็ผ็จAPI.md โ Developer extension actions and data sources