operator fun Container.get(slot: Int): ItemStackGet an item from a container slot.
Common
operator fun Container.get(slot: Int): ItemStackGet an item from a container slot.
operator fun Container.set(slot: Int, itemStack: ItemStack)Set an item into a container slot.
operator fun Inventory.minusAssign(itemStack: ItemStack)Remove an item from an inventory.
operator fun Inventory.plusAssign(itemStack: ItemStack)Add an item to an inventory.
operator fun SlotProvider.get(slot: KattonItemCollection.KattonItemSlot): ItemStack?Get an item from a slot provider at a KattonItemSlot.
operator fun SlotProvider.set(slot: KattonItemCollection.KattonItemSlot, itemStack: ItemStack)Set an item into a slot provider at a KattonItemSlot.
operator fun Container.get(slots: List<KattonItemCollection.KattonItemSlot>): List<ItemStack?>Get items from multiple slots in a container.
val Container.slots: KattonItemCollectionExtension property to access a container's slots.
class KattonItemCollection(val container: net.minecraft.world.Container)Collection of item slots with convenient access patterns.
| Property | Description |
|---|---|
container | The underlying Container |
operator fun get(slot: KattonItemSlot): SlotAccess?Get a SlotAccess for a specific slot.
operator fun get(slots: List<KattonItemSlot>): List<SlotAccess?>Get SlotAccesses for multiple slots.
open class KattonItemSlot( val index: Int )Represents a single item slot by index.
interface KattonItemSlotGroupInterface for groups of item slots.
open class KattonItemSlotList( val offset: Int, size: Int ) : Iterable<KattonItemSlot>, KattonItemSlotGroupA list of consecutive item slots.
object Contents : KattonItemSlot(0)The first content slot.
object Container : KattonItemSlotList(0, 54)All container slots (0-53).
object Hotbar : KattonItemSlotList(0, 9)Hotbar slots (0-8).
object Inventory : KattonItemSlotList(9, 27)Main inventory slots (9-35).
object EnderChest : KattonItemSlotList(200, 27)Ender chest slots (200-226).
object MobInventory : KattonItemSlotList(300, 8)Mob inventory slots (300-307).
object Horse : KattonItemSlotList(500, 15)Horse inventory slots (500-514).
object Weapon : KattonItemSlotGroupWeapon slots (main hand and off hand).
object MainHand : KattonItemSlot(EquipmentSlot.MAINHAND.getIndex(98))Main hand slot.
object OffHand : KattonItemSlot(EquipmentSlot.OFFHAND.getIndex(98))Off hand slot.
object Armor : KattonItemSlotGroupArmor slots (head, chest, legs, feet).
object Head : KattonItemSlot(EquipmentSlot.HEAD.getIndex(100))Head armor slot.
object Chest : KattonItemSlot(EquipmentSlot.CHEST.getIndex(100))Chest armor slot.
object Legs : KattonItemSlot(EquipmentSlot.LEGS.getIndex(100))Leg armor slot.
object Feet : KattonItemSlot(EquipmentSlot.FEET.getIndex(100))Feet armor slot.