Inventory.yml Tutorial

Here you can modify all aspects of the inventories of PlayerKits 2.

Inventories

There are different inventories on the plugin:

  • main_inventory: Main inventory opened using the /kit command.

  • preview_inventory: Kit preview inventory when you right click a kit item.

  • buy_requirements_inventory: Inventory that will open when the kit has requirements.

You must not remove these inventories from the config or the plugin will not work!

You can also create your own inventories (like the premium_kits_inventory inventory on the default config), for example to create multiple pages, or even a category system.

Inventories Properties

Each inventory has 3 properties show below:

inventories:
  preview_inventory:
    slots: 54
    title: "&4&lKit Preview"
    45:
      item:
        id: "ARROW"
        name: "&7Go Back"
      open_inventory: previous

Slots

Defines the amount of slots this inventory will have. You can only use 9, 18, 27, 36, 45 or 54.

Title

Defines the title of this inventory.

You can use the %kit% variable to display the kit name, only on buy_requirements_inventory and preview_inventory inventories.

Item Slot

Position of an item in the inventory. For a much simpler way of placing items on inventories you can use some formats:

Format 1

This will set an item on the slot 0. Format: <slot>: <item>

0:
  item: 
    id: BLACK_STAINED_GLASS_PANE
    name: " "

Format 2

This will set the same item on slots 0, 8 and 16. Format: <slot1>;<slot2>;<slotN>: <item>

0;8;16:
  item: 
    id: BLACK_STAINED_GLASS_PANE
    name: " "

Format 3

This will set the same item from slots 0 to 8 (0, 1, 2, 3, 4, 5, 6, 7, 8). Format: <slot1>-<slotN>: <item>

0-8:
  item: 
    id: BLACK_STAINED_GLASS_PANE
    name: " "

Combining formats

This will set the same item on slots 0 to 7, 9, and 17 to 26.

0-7;9;17-26:
  item: 
    id: BLACK_STAINED_GLASS_PANE
    name: " "

Item Slots Properties

On these item slots you can create your own items.

Item

This is the item itself. Use the guide from HERE to create them.

0-9;17;18;26;27;35;36-44:
       item:
         id: "BLACK_STAINED_GLASS_PANE"
         name: " "

Open Inventory

Add this option to open another inventory when the player clicks on this item.

49:
   item:
     id: "DIAMOND_BLOCK"
     name: "&ePremium Kits"
   open_inventory: premium_kits_inventory

You can use open_inventory: previous to open the previous PlayerKits 2 inventory the player was in.

45:
   item:
     id: "ARROW"
     name: "&7Go Back"
   open_inventory: previous

Click Commands

Adds a list of commands to be executed from the console when clicking on the item.

  • You can use the msg %player% command to send a simple message to the player.

  • You can use the close_inventory text to close the player inventory when clicking on the item.

36:
   item:
     id: "ARROW"
     name: "&7Go Back to an external Inventory"
   click_commands:
   - "msg %player% &aOpening the main server menu" 
   - "chestcommands open %player% menu_server"

Type: Kit

You can place a kit display item on the GUI by using the type: kit option. If you do so, all other properties are ignored. Format: type: "kit: <kit_name>"

22:
   type: "kit: diamond"

Type: Buy Yes, Buy No

On the buy_requirements_inventory inventory you can set the type of an item to buy_yes and buy_no:

  • buy_yes: Clicking the item will proceed to buy the kit.

'16':
      type: buy_yes
      item:
        id: GREEN_STAINED_GLASS_PANE
        name: '&aBuy'
        amount: 1
  • buy_no: Clicking the item will send you back to the previous inventory.

'10':
      type: buy_no
      item:
        id: RED_STAINED_GLASS_PANE
        name: '&cGo Back'
        amount: 1

Last updated