Multi-Category Shop
When a shop has more items than fit comfortably on one page, the natural pattern is a hub plus per-category sub-shops. This example shows the structure with three menus in one file: a hub and two categories.
What it teaches
Section titled “What it teaches”- Multi-menu files using the
menus { ... }wrapper - Cross-menu navigation via
openMenu - Repeating the buy pattern across categories without duplication
- Mixing static borders with shop items
- The
flags: HIDE_ATTRIBUTESshortcut for tool/weapon icons
How it works
Section titled “How it works”The file uses the menus { ... } wrapper to declare three named menus:
ame_shopis the main hub. It carries thecommand: "ame_shop"activator and shows category tiles.ame_shop_foodandame_shop_toolsare sub-shops opened from the hub.
Each tile in the hub is just an item with click { openMenu: "ame_shop_food" }. No money rule, no actions on top of the navigation. Sub-shops are reached by name reference.
Within a sub-shop, the items follow the same pattern as the Cake Shop: rules { money: ... }, an actions {} block that takes the money and gives the item, and denyActions: ${denyNoMoney} from shared templates for the failure path.
The back button uses openMenu: "ame_shop" to return to the hub. There’s no built-in “back” verb. Navigating menus is just calling openMenu with the previous menu’s name.
Scaling out
Section titled “Scaling out”Adding a new category is mechanical:
- Add a new tile to the hub items list with
click { openMenu: "ame_shop_<your_category>" }. - Copy any sub-shop block (e.g.
ame_shop_food), rename it toame_shop_<your_category>, swap the items. - Reload the menu with
/am reload.
Try it
Section titled “Try it”After installing the example pack:
- Drop the bundle into
plugins/AbstractMenus/menus/example/. /am reload.- Type
/ame_shopin-game.
Next steps
Section titled “Next steps”- See Cake Shop for the simplest single-menu shop.
- See the generation docs for pagination over a dynamic catalog (when items come from a code-side source like online players or worlds).