Quick Mod
A toolbox menu for admins. The menu itself is gated at the top level via rules: ${rulesAdmin} - non-admins running /ame_mod are blocked from opening at all (no need to gate every individual click).
What it teaches
Section titled “What it teaches”- Menu-level rules: top-level
rules: ...blocks the open instead of just hiding items - The
setGamemodeaction with vanilla mode names - The
broadcastaction for server-wide chat - The
commandaction withplayer:(run as the player) vsconsole:(run as console) - Chaining hubs: this admin menu opens Online Players for finer-grained moderation
Menu-level vs item-level rules
Section titled “Menu-level vs item-level rules”Two ways to gate access:
Menu-level (this example):
rules: ${rulesAdmin}At the top of the file. If the rule fails when the activator fires, the menu doesn’t open at all.
Item-level:
{ slot: 4 ... click { rules { permission: "..." } actions { ... } }}Inside an item’s click block. The menu opens for everyone, but specific items are gated.
For an admin toolbox, menu-level is right - non-admins shouldn’t see the layout. For a shop with VIP items, item-level is right - everyone should see what’s available.
command action
Section titled “command action”command runs server commands via the action handler:
command { player: "spawn" # runs /spawn as the player}Or as console:
command { console: "kick %ctg_player_name%" # runs /kick ... from console}player: form respects the player’s permissions - they need to be allowed to use the command. console: form bypasses permissions (use carefully). For admin commands like /ban, prefer console: from a permission-gated menu to avoid double-checking the same auth twice.
Try it
Section titled “Try it”- Drop the bundle into
plugins/AbstractMenus/menus/example/. /am reload.- Grant yourself
abstractmenus.admin(therulesAdminshared template references this node). - Type
/ame_modin-game.