Inventory.yml Tutorial

In this file you can completely modify the inventories of the plugin, which are: main, options, whitelist and ammunition.

Inventories properties

Each inventory has 3 properties show below

Inventories:
  main:
    slots: 27
    title: "&9Turret Inventory"
    0:
      item: BLACK_STAINED_GLASS_PANE
      name: " "

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.

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.

0:
  item: BLACK_STAINED_GLASS_PANE
  name: " "

Format 2

This will set the same item on slots 0, 8 and 16.

0;8;16:
  item: 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)

0-8:
  item: 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: BLACK_STAINED_GLASS_PANE
  name: " "

Item Properties

You can create your own items or use the ones in the config.yml file. The already created ones on that file will be used on specific cases. For example, the attack_animals_item on config.yml file, will change depending on the Attack Animals option from the turret.

Item ID

The item name or material.

1.16 Item IDs: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html 1.8 Item IDs: https://github.com/Attano/Spigot-1.8/blob/master/org/bukkit/Material.java

If you want to use a player head with custom texture, you just need to set the base64 texture value.

0:
  id: "CHEST"
1:
  id: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmNlZjlhYTE0ZTg4NDc3M2VhYzEzNGE0ZWU4OTcyMDYzZjQ2NmRlNjc4MzYzY2Y3YjFhMjFhODViNyJ9fX0=

Name and lore

Display name and lore for this item.

8:
  id: "CHEST"
  name: "&aTurret Options"
  lore:
  - "&7Click to edit the options for"
  - "&7your turret."

Type

When selecting a type, the item will be replaced with a custom plugin item from the config.yml file. You don't need to add any other property.

# This will set the delete_turret_item item from config.yml which
# will remove the turret when the player clicks on it.
26:
   type: delete_turret_item

# This will set the whitelisted_players_item item from config.yml which
# will show the whitelisted players from the turret and will open the
# whitelist inventory when a player clicks on it.
22:
   type: whitelisted_players_item

Open Inventory

This option is used to open another inventory when clicking on an item.

8:
   id: "CHEST"
   name: "&aTurret Options"
   open_inventory: options

Custom Model Data

Adds a specific custom model data value to the item.

8:
   id: "DIAMOND"
   custom_model_data: 1

Item 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.

'9':
      id: DIAMOND
      name: '&aCommand'
      lore:
      - "&7Click to execute a command."
      click_commands:
      - "msg %player% &4You have executed a command!"
      - "eco give %player% 5000"

Ammunition and Whitelist inventories details

You must be careful with these two invetories in particular.

Whitelist Inventory

First, the whitelist inventory requires space to place the player heads of the whitelisted players. On the default inventory it looks like this:

0-35:
    type: whitelist_player_item

This means, the whitelisted players will be placed from slot 0 to slot 35. If for some reason you want to do something more decorative, like placing the player heads just on the center of the inventory you can do it as well. Just use the different item slot formats.

Ammunition inventory

The ammunition inventory instead, is more limited. You can also modify the slots of the LAST ROW of the inventory. The previous slots will be fill with the ammunition items. I suggest you to leave this inventory by default, only changing the materials or translating the items.

ammunition:
    title: "&9Turret Ammunition"
    1-7:
      id: BLACK_STAINED_GLASS_PANE
      name: " "
    0:
      id: "ARROW"
      name: "&7Back"
      open_inventory: options
    6:
      type: ammo_previous_page
    7:
      type: ammo_next_page
    8:
      type: infinite_ammo_item

Default file

Inventories:
  main:
    slots: 27
    title: "&9Turret Inventory"
    0-7;9;17-26:
      id: BLACK_STAINED_GLASS_PANE
      name: " "
    10;16:
      id: BLUE_STAINED_GLASS_PANE
      name: " "
    11;12;14;15:
      id: WHITE_STAINED_GLASS_PANE
      name: " "
    8:
      id: "CHEST"
      name: "&aTurret Options"
      open_inventory: options
    13:
      type: turret_upgrade
    26:
      type: delete_turret_item
  options:
    slots: 45
    title: "&9Turret Options"
    0-9;17;18;26;27;35-44:
      id: BLACK_STAINED_GLASS_PANE
      name: " "
    10;16;28;34:
      id: WHITE_STAINED_GLASS_PANE
      name: " "
    8:
      type: turret_status_item
    20:
      type: attack_players_item
    21:
      type: attack_monsters_item
    22:
      type: whitelisted_players_item
    23:
      type: attack_animals_item
    24:
      type: attack_others_item
    36:
      id: "ARROW"
      name: "&7Back"
      open_inventory: main
    40:
      type: priority_item  
    44:
      type: turret_ammo_item
  whitelist:
    slots: 45
    title: "&9Turret Player Whitelist"
    37-43:
      id: BLACK_STAINED_GLASS_PANE
      name: " "
    0-35:
      type: whitelist_player_item
    36:
      id: "ARROW"
      name: "&7Back"
      open_inventory: options
    40:
      type: whitelist_add_player_item
    44:
      type: whitelist_apply_item
  ammunition:
    title: "&9Turret Ammunition"
    1-7:
      id: BLACK_STAINED_GLASS_PANE
      name: " "
    0:
      id: "ARROW"
      name: "&7Back"
      open_inventory: options
    6:
      type: ammo_previous_page
    7:
      type: ammo_next_page
    8:
      type: infinite_ammo_item

Last updated