Cake Shop
Cake Shop is the smallest possible shop. Three items, three prices, one click to buy. Read this first if you’ve never written an AbstractMenus menu.
What it teaches
Section titled “What it teaches”- The
moneyrule for “is the player rich enough?” - The
takeMoneyaction to deduct cost - The
itemAddaction to give the bought item - A
denyActionsblock that fires when rules fail - Reusing shared templates via
${...}substitution
How it works
Section titled “How it works”The menu has size 3 (a single chest row plus the 18-slot border above and below). Three rows of glass-pane border are added by referencing ${border_black} from the shared templates and assigning a slot range.
Each item slot defines a click block with two parts:
rules- a list of conditions. Here,money: 100means “the player must have at least $100.” If any rule fails, the actions indenyActionsrun instead.actions- the success path. We deduct money, give the item, play a confirmation sound, and send a chat message.
The denyActions: ${deny_no_money} substitution pulls a pre-built action sequence from _shared/templates.conf that plays a deny sound and sends a “You don’t have enough money” message. Reusable across all economy menus.
Try it
Section titled “Try it”After installing the example pack:
- Drop the bundle into
plugins/AbstractMenus/menus/example/. /am reload.- Type
/ame_cake_shopin-game.
Next steps
Section titled “Next steps”- See the paginated shop for handling many items across multiple pages.
- See the rank-gated shop for permission-based pricing.