Package-level declarations

Functions

Link copied to clipboard
fun Inventory.addItemCorrectly(itemStack: ItemStack): Int

Adds an ItemStack to an Inventory while respecting both the max stack size of the inventory and the max stack size of the item type.

Link copied to clipboard
fun Player.addToInventoryOrDrop(items: List<ItemStack>)
fun Player.addToInventoryOrDrop(vararg items: ItemStack)

Adds items to the Player's inventory or drops them on the ground if there is not enough space.

Link copied to clipboard
fun LivingEntity.addToInventoryPrioritizedOrDrop(prioritizedSlot: EquipmentSlot, itemStack: ItemStack)
fun Player.addToInventoryPrioritizedOrDrop(prioritizedSlot: Int, itemStack: ItemStack)

Puts an ItemStack on the prioritizedSlot or adds it to the Inventory if the given slot is occupied or drops it on the ground if there is not enough space.

Link copied to clipboard
fun LivingEntity.damageItemInHand(hand: EquipmentSlot, damage: Int = 1): Boolean

Damages the item in the specified hand by damage amount as if the entity caused it and returns whether the item broke.