Skip to content

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) โ€‹

type is case-insensitive. The spellings in the "Aliases" column below have exactly the same effect.

typeAliasesvalue formatDescription
commandcmdcommand (without /)Run from the console
console_commandconsole_cmdcommandRun from the console (same as above)
player_commandplayer_cmdcommandRun as the player
messagemsgtext (& codes + placeholders)Send a message to the player
broadcastโ€”textBroadcast to the whole server
soundโ€”soundName,volume,pitchPlay a sound
open_guiguiGUI idOpen another menu
closeโ€”emptyClose the menu
refreshโ€”emptyRefresh the current menu
teleportโ€”x,y,z[,world]Teleport
give_itemโ€”material:amountGive item
take_itemโ€”material:amountRemove item
clear_inventoryโ€”emptyClear inventory
healโ€”number (default full health)Heal
feedโ€”number (default 20)Feed
gamemodeโ€”SURVIVAL/CREATIVE/ADVENTURE/SPECTATORChange game mode
flyโ€”true/false/empty (toggle)Toggle flight
effectโ€”effectName,durationTicks,levelApply potion effect
give_moneygivemoneysee ็ปๆตŽๅŠจไฝœ.mdGive money
take_moneytakemoney,remove_moneysee ็ปๆตŽๅŠจไฝœ.mdTake money
set_moneysetmoneysee ็ปๆตŽๅŠจไฝœ.mdSet balance
javascriptjs,run_script,scriptscript reference or codeRun JS

๐Ÿ“‹ Example for Each โ€‹

yaml
# 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_money have 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:

ValueMeaning
LEFTLeft click
RIGHTRight click
MIDDLEMiddle click
ALL / ANYAny click method
yaml
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).

typeAliasesvalueDescription
permissionโ€”permission nodeWhether the player has the permission
has_itemโ€”material:amountWhether the inventory contains the item
levelโ€”comparator + number, e.g. >=10Level
moneyโ€”comparator + number[:provider], e.g. >=1000:moneyBalance
healthโ€”comparator + numberHealth
foodโ€”comparator + number (0-20)Hunger
worldโ€”world nameCurrent world
gamemodeโ€”SURVIVAL/CREATIVE/โ€ฆGame mode
javascriptjs,scriptscript reference/code (returns boolean)Custom

๐Ÿ”ข Comparators โ€‹

SymbolMeaning
>=Greater than or equal (default, used when no symbol is given)
<=Less than or equal
>Greater than
<Less than
==Equal

๐Ÿ“‹ Example for Each โ€‹

yaml
# 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":

yaml
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) โ€‹

yaml
"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 javascript action instead and write both the deduction and the item grant in a single script โ€” see ่„šๆœฌๅ…ฅ้—จ.md.

Recipe B: Admin-only button (permission) โ€‹

yaml
"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_panel

Recipe C: Regular-player tip (permission + negate) โ€‹

yaml
"26":
  material: PAPER
  name: "&7You are not an admin"
  view-requirement:
    type: permission
    value: "myserver.admin"
    negate: true                  # only players without the permission see it

Recipe D: Restore button (appears only when hungry + feed + heal + sound) โ€‹

yaml
"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 โ€‹