AbstractStaticgetThe entity to query.
The entity's inventory component, or undefined if it doesn't have one.
StaticgetGets the equipment component from an entity if it exists.
The entity to query.
The entity's equippable component, or undefined.
StaticgetGets a container from an entity or container instance.
The container instance, or undefined if none exists.
StaticgetGets the currently selected hotbar slot of a player.
The player to query.
The selected slot or undefined.
StaticgetStaticsetStaticgetGets the mainhand equipment slot.
The entity to query.
The mainhand ContainerSlot or undefined.
StaticgetStaticsetStaticgetStaticgetStaticgetStaticconsumeConsumes (removes one) of the player's selected item. Optionally spawns a return item at their location.
StaticreduceStaticremoveStaticremoveRemoves an amount of an item by ID from a container or entity's inventory. It can fail if you require there to exist that amount of the item.
True if all items were removed.
StaticremoveRemoves an array of item types from a container or entity's inventory. It can fail if there is not enough of the item in the inventory
True if all items were removed.
StaticclearStaticgiveGives an ItemStack to an entity's inventory, dropping any leftovers.
Target entity.
ItemStack to give.
Optional lock mode.
Should item persist on death.
StaticgiveGives an ItemStack to a container.
Target container.
ItemStack to give.
Optional lock mode.
Should item persist on death.
Any leftover ItemStack that couldn't fit.
StaticgiveCreates a new ItemStack and gives it to an entity.
Target entity.
Item typeId.
Amount to give (default 1).
Optional lock mode.
Should item persist on death.
StatichasStaticfindStaticconsumeStaticgetReturns the slots that contains the item up to the amount specified. This can overshoot the amount of items.
True if all items were removed.
StaticisChecks if an entity or container has a completely empty inventory.
True if all inventory slots are empty.
Gets the inventory component from an entity if it exists.