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

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

Get an item from a container slot.

set

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

Set an item into a container slot.

minusAssign

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

Remove an item from an inventory.

plusAssign

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

Add an item to an inventory.

get

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

Get an item from a slot provider at a KattonItemSlot.

set

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

Set an item into a slot provider at a KattonItemSlot.

get

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

Get items from multiple slots in a container.

slots

CommonProperty
kotlin
val Container.slots: KattonItemCollection

Extension property to access a container's slots.

KattonItemCollection

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

Collection of item slots with convenient access patterns.

Properties

PropertyDescription
containerThe underlying Container

KattonItemCollection.get

CommonFunction
kotlin
operator fun get(slot: KattonItemSlot): SlotAccess?

Get a SlotAccess for a specific slot.

KattonItemCollection.get

CommonFunction
kotlin
operator fun get(slots: List<KattonItemSlot>): List<SlotAccess?>

Get SlotAccesses for multiple slots.

KattonItemCollection.KattonItemSlot

CommonClass
kotlin
open class KattonItemSlot( val index: Int )

Represents a single item slot by index.

KattonItemCollection.KattonItemSlotGroup

CommonInterface
kotlin
interface KattonItemSlotGroup

Interface for groups of item slots.

KattonItemCollection.KattonItemSlotList

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

A list of consecutive item slots.

KattonItemCollection.Contents

CommonObject
kotlin
object Contents : KattonItemSlot(0)

The first content slot.

KattonItemCollection.Container

CommonObject
kotlin
object Container : KattonItemSlotList(0, 54)

All container slots (0-53).

KattonItemCollection.Hotbar

CommonObject
kotlin
object Hotbar : KattonItemSlotList(0, 9)

Hotbar slots (0-8).

KattonItemCollection.Inventory

CommonObject
kotlin
object Inventory : KattonItemSlotList(9, 27)

Main inventory slots (9-35).

KattonItemCollection.EnderChest

CommonObject
kotlin
object EnderChest : KattonItemSlotList(200, 27)

Ender chest slots (200-226).

KattonItemCollection.MobInventory

CommonObject
kotlin
object MobInventory : KattonItemSlotList(300, 8)

Mob inventory slots (300-307).

KattonItemCollection.Horse

CommonObject
kotlin
object Horse : KattonItemSlotList(500, 15)

Horse inventory slots (500-514).

KattonItemCollection.Weapon

CommonObject
kotlin
object Weapon : KattonItemSlotGroup

Weapon slots (main hand and off hand).

KattonItemCollection.Weapon.MainHand

CommonObject
kotlin
object MainHand : KattonItemSlot(EquipmentSlot.MAINHAND.getIndex(98))

Main hand slot.

KattonItemCollection.Weapon.OffHand

CommonObject
kotlin
object OffHand : KattonItemSlot(EquipmentSlot.OFFHAND.getIndex(98))

Off hand slot.

KattonItemCollection.Armor

CommonObject
kotlin
object Armor : KattonItemSlotGroup

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

KattonItemCollection.Armor.Head

CommonObject
kotlin
object Head : KattonItemSlot(EquipmentSlot.HEAD.getIndex(100))

Head armor slot.

KattonItemCollection.Armor.Chest

CommonObject
kotlin
object Chest : KattonItemSlot(EquipmentSlot.CHEST.getIndex(100))

Chest armor slot.

KattonItemCollection.Armor.Legs

CommonObject
kotlin
object Legs : KattonItemSlot(EquipmentSlot.LEGS.getIndex(100))

Leg armor slot.

KattonItemCollection.Armor.Feet

CommonObject
kotlin
object Feet : KattonItemSlot(EquipmentSlot.FEET.getIndex(100))

Feet armor slot.