Using it

The main menu and GUI files

The menus are plain YAML in plugins/mcCoinShop/guis/.

  • main.yml: the main menu (title, size, buttons, category buttons).
  • featured_packages.yml: shop items shown straight on the main menu.
  • menus.yml: the look of every other menu (confirm, deals, history, claim, subscriptions, search), the colored corners and the lines added to item lore.

Buttons and actions#

Static buttons and category buttons have material, name, lore, slot, optional glow, skull-owner and page, and a list of actions. The actions listed in the file are:

# Actions for buttons:
#   [OPEN] main | deals | history | subscriptions | claim | <category>
#   [PAGE] NEXT | PREV | <number>
#   [MESSAGE] text        [BROADCAST] text     [SOUND] name
#   [COMMAND] command     [CONSOLE] command    [PERMISSION] node (stops if missing)
#   [REFRESH]             [CLOSE]              [DAILY]
#

[PERMISSION] stops the remaining actions when the player does not have the node. Placeholders %coinshop_...% work in menus with or without PlaceholderAPI, and other PlaceholderAPI placeholders work when it is installed. The main menu also understands %deal_best% (the best deal discount) and %player%.

Adding a category button#

Add an entry under category-items. The key is the category id, or set category: to the id:

category-items:
  ranks:
    material: NETHER_STAR
    slot: 10
    glow: true
    name: "&6&lRanks"
    lore:
      - "&7Perks that last."
      - ""
      - "&eClick to browse"

To show any shop item on the main menu, add it to guis/featured_packages.yml. It keeps its price, sale, stock and limits and can be bought from there:

featured:
  vip_rank:
    enabled: true
    category: ranks
    item-id: vip
    slot: 22

Opening menus from other plugins#

/mccs open <player> [category] opens the shop (or a category) for an online player. This works from NPC plugins and console. Players can also use /coinshop open <category|deals|history|subscriptions|claim>.