Skip to content
On this page
Common

KattonSlotProviderApi

top.katton.api.dpcallercommon/src/main/kotlin/top/katton/api/dpcaller/KattonSlotProviderApi.kt
Get an item from a container slot.

get

getCommonFunction
kotlin
operator fun Container.get(slot: Int): ItemStack

Get an item from a container slot.

set

setCommonFunction
kotlin
operator fun Container.set(slot: Int, itemStack: ItemStack)

Set an item into a container slot.

minusAssign

minusAssignCommonFunction
kotlin
operator fun Inventory.minusAssign(itemStack: ItemStack)

Remove an item from an inventory.

plusAssign

plusAssignCommonFunction
kotlin
operator fun Inventory.plusAssign(itemStack: ItemStack)

Add an item to an inventory.

get

getCommonFunction
kotlin
operator fun SlotProvider.get(slot: KattonItemCollection.KattonItemSlot): ItemStack?

Get an item from a slot provider at a KattonItemSlot.

set

setCommonFunction
kotlin
operator fun SlotProvider.set(slot: KattonItemCollection.KattonItemSlot, itemStack: ItemStack)

Set an item into a slot provider at a KattonItemSlot.

get

getCommonFunction
kotlin
operator fun Container.get(slots: List<KattonItemCollection.KattonItemSlot>): List<ItemStack?>

Get items from multiple slots in a container.

slots

slotsCommonProperty
kotlin
val Container.slots: KattonItemCollection

Extension property to access a container's slots.

KattonItemCollection

KattonItemCollectionCommonClass
kotlin
class KattonItemCollection(val container: net.minecraft.world.Container)

Collection of item slots with convenient access patterns.

Properties

PropertyDescription
containerThe underlying Container

KattonItemCollection.get

KattonItemCollection.getCommonFunction
kotlin
operator fun get(slot: KattonItemSlot): SlotAccess?

Get a SlotAccess for a specific slot.

KattonItemCollection.get

KattonItemCollection.getCommonFunction
kotlin
operator fun get(slots: List<KattonItemSlot>): List<SlotAccess?>

Get SlotAccesses for multiple slots.

KattonItemCollection.KattonItemSlot

KattonItemCollection.KattonItemSlotCommonClass
kotlin
open class KattonItemSlot( val index: Int )

Represents a single item slot by index.

KattonItemCollection.KattonItemSlotGroup

KattonItemCollection.KattonItemSlotGroupCommonInterface
kotlin
interface KattonItemSlotGroup

Interface for groups of item slots.

KattonItemCollection.KattonItemSlotList

KattonItemCollection.KattonItemSlotListCommonClass
kotlin
open class KattonItemSlotList( val offset: Int, size: Int ) : Iterable<KattonItemSlot>, KattonItemSlotGroup

A list of consecutive item slots.

KattonItemCollection.Contents

KattonItemCollection.ContentsCommonObject
kotlin
object Contents : KattonItemSlot(0)

The first content slot.

KattonItemCollection.Container

KattonItemCollection.ContainerCommonObject
kotlin
object Container : KattonItemSlotList(0, 54)

All container slots (0-53).

KattonItemCollection.Hotbar

KattonItemCollection.HotbarCommonObject
kotlin
object Hotbar : KattonItemSlotList(0, 9)

Hotbar slots (0-8).

KattonItemCollection.Inventory

KattonItemCollection.InventoryCommonObject
kotlin
object Inventory : KattonItemSlotList(9, 27)

Main inventory slots (9-35).

KattonItemCollection.EnderChest

KattonItemCollection.EnderChestCommonObject
kotlin
object EnderChest : KattonItemSlotList(200, 27)

Ender chest slots (200-226).

KattonItemCollection.MobInventory

KattonItemCollection.MobInventoryCommonObject
kotlin
object MobInventory : KattonItemSlotList(300, 8)

Mob inventory slots (300-307).

KattonItemCollection.Horse

KattonItemCollection.HorseCommonObject
kotlin
object Horse : KattonItemSlotList(500, 15)

Horse inventory slots (500-514).

KattonItemCollection.Weapon

KattonItemCollection.WeaponCommonObject
kotlin
object Weapon : KattonItemSlotGroup

Weapon slots (main hand and off hand).

KattonItemCollection.Weapon.MainHand

KattonItemCollection.Weapon.MainHandCommonObject
kotlin
object MainHand : KattonItemSlot(EquipmentSlot.MAINHAND.getIndex(98))

Main hand slot.

KattonItemCollection.Weapon.OffHand

KattonItemCollection.Weapon.OffHandCommonObject
kotlin
object OffHand : KattonItemSlot(EquipmentSlot.OFFHAND.getIndex(98))

Off hand slot.

KattonItemCollection.Armor

KattonItemCollection.ArmorCommonObject
kotlin
object Armor : KattonItemSlotGroup

Armor slots (head, chest, legs, feet).

KattonItemCollection.Armor.Head

KattonItemCollection.Armor.HeadCommonObject
kotlin
object Head : KattonItemSlot(EquipmentSlot.HEAD.getIndex(100))

Head armor slot.

KattonItemCollection.Armor.Chest

KattonItemCollection.Armor.ChestCommonObject
kotlin
object Chest : KattonItemSlot(EquipmentSlot.CHEST.getIndex(100))

Chest armor slot.

KattonItemCollection.Armor.Legs

KattonItemCollection.Armor.LegsCommonObject
kotlin
object Legs : KattonItemSlot(EquipmentSlot.LEGS.getIndex(100))

Leg armor slot.

KattonItemCollection.Armor.Feet

KattonItemCollection.Armor.FeetCommonObject
kotlin
object Feet : KattonItemSlot(EquipmentSlot.FEET.getIndex(100))

Feet armor slot.