Skip to content
laz edited this page Jul 6, 2026 · 1 revision

Inventory

Inventory is used to store Player items. It is accessible using Player.Inventory

GetHand()

This function will return Item that player is holding in his hand or Air if player is not holding any item.

Log.debug(inventory.GetHand()) //[DEBUG] IronSword

OnChest(Item);

Put armor item on Player's chest.

inventory.OnChest(new Items.VanillaItems.DiamondChestplate());

OnFeet(Item);

Put armor item on Player's feet.

inventory.OnFeet(new Items.VanillaItems.NetheriteBoots());

OnHead(Item);

Put armor item on Player's head.

inventory.OnHead(new Items.VanillaItems.NetheriteHelmet());

OnLegs(Item);

Put armor item on Player's legs.

inventory.OnLegs(new Items.VanillaItems.DiamondLeggings());

Set(int, int, Item);

Put item in player's inventory. In this first int is container id and second is slot. Slot range is 0 - 35. 0 - 10 are also player's hotbar slots. 10 - 35 the rest inventory slots that are visable only when opening inventory. This example is showing how to put item in player's inventorys 2nd slot that is also hotbar 2nd slot. 0 is 1st slot.

Inventory.Set(0, 1, new Items.VanillaItems.DiamondLeggings());

Send(int, int, Item);

Similar to set but difference between Set and Send is that Send wont save item in player's inventory but just send it for visual effects.

Inventory.Send(0, 1, new Items.VanillaItems.DiamondLeggings());

Clone this wiki locally