Inventory.yml Tutorial
Here you can modify aspects of the inventories of Codex.
Inventories
There are different inventories on the plugin:
main_inventory: Main inventory opened using the
/codex
command. Categories will appear here. You can even create more inventories like this one.
The main_inventory
inventory must not be removed from the inventory.yml file. You can create your own inventories following the same format under the inventories path if you need to.
category_<category>: You must create inventories associated with a category, replacing the
<category>
tag with the name of the category. For example,category_monsters
represents the inventory for themonsters
category (monsters.yml file). If you create a new category file, for example"npcs.yml"
, then you must add a new inventory on the inventory.yml file calledcategory_npcs
.
If you want to create multiple inventories associated with a category, for example multiple pages, you can add an inventory with the following name:
category_<category>;<something>
This inventory will be also associated with the selected category, meaning you can add its discoveries inside. For example, if you need multiple pages for the monsters category, you can create the following inventories:
category_monsters
category_monsters;page2
category_monsters;page3
Then, using the open_inventory property, you can redirect the player to the different pages.
Inventories Properties
Each inventory has 3 properties show below:
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.
Format 2
This will set the same item on slots 0, 8 and 16.
Format 3
This will set the same item from slots 0 to 8 (0, 1, 2, 3, 4, 5, 6, 7, 8).
Combining formats
This will set the same item on slots 0 to 7, 9, and 17 to 26.
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.
Open Inventory
Add this option to open another created inventory when the player clicks on this item.
Click Actions
Adds a list of actions to be executed when clicking on the item. List of actions HERE.
Type: Category
You can place a category display item on the GUI by using the type: category
option. If you do so, all other item properties are ignored. Format: type: "category: <category_name>"
Type: Discovery
You can place a discovery display item on the GUI by using the type: discovery
option. If you do so, all other item properties are ignored. Format: type: "discovery: <discovery_id>"
You can only use this type of item inside a category_<category>
inventory.
Last updated