kotlin
var ItemStack.nbt: CompoundTagExtension property to get/set NBT data on an ItemStack.
Common
var ItemStack.nbt: CompoundTagExtension property to get/set NBT data on an ItemStack.
fun modifyBlockItem(pos: BlockPos, slot: Int, modifier: LootItemFunction)Applies a LootItemFunction modifier to a block container slot.
| Parameter | Description |
|---|---|
pos | Block position of the container |
slot | Slot index to modify |
modifier | LootItemFunction to apply |
fun modifyEntityItem(entity: Entity, slot: Int, modifier: LootItemFunction)Applies a LootItemFunction to an entity equipment slot.
| Parameter | Description |
|---|---|
entity | Target entity |
slot | Equipment slot index |
modifier | LootItemFunction to apply |
fun setBlockItem(pos: BlockPos, slot: Int, itemStack: ItemStack)Sets an item into a container block slot.
| Parameter | Description |
|---|---|
pos | Block position |
slot | Slot index |
itemStack | ItemStack to set |
fun setEntityItem(entity: Entity, slot: Int, itemStack: ItemStack)Sets an item into an entity slot.
| Parameter | Description |
|---|---|
entity | Target entity |
slot | Slot index |
itemStack | ItemStack to set |