Common
KattonLootTableApi
Get drops for a block as if it were broken with a tool.
dropBlockLoot
dropKillLoot
dropChestLoot
dropFishingLoot
dropToBlock
kotlin
fun dropToBlock(block: BlockPos, itemStacks: List<ItemStack>)Attempt to deposit item stacks into a container block.
Parameters
| Parameter | Description |
|---|---|
block | container block position |
itemStacks | list of ItemStack to deposit (may be modified) |
dropToBlockReplace
kotlin
fun dropToBlockReplace(block: BlockPos, i: Int, j: Int, itemStacks: List<ItemStack>)Replace a range of slots in a container block with given item stacks.
Parameters
| Parameter | Description |
|---|---|
block | container position |
i | start slot index |
j | number of slots to replace |
itemStacks | list of ItemStacks to place (shorter lists fill with empty) |
dropToPlayer
kotlin
fun dropToPlayer(player: ServerPlayer, itemStacks: List<ItemStack>)Give item stacks to players (adds copies to inventory).
Parameters
| Parameter | Description |
|---|---|
player | target ServerPlayer |
itemStacks | list of ItemStack to give |
dropToEntity
kotlin
fun dropToEntity(entity: Entity, i: Int, j: Int, itemStacks: List<ItemStack>)Set item stacks into entity slots.
Parameters
| Parameter | Description |
|---|---|
entity | target entity |
i | starting slot index |
j | number of slots to set |
itemStacks | list of ItemStacks to set |
dropTo
kotlin
fun dropTo(level: Level, pos: Vec3, itemStacks: List<ItemStack>)Drop item stacks into the world at a position.
Parameters
| Parameter | Description |
|---|---|
level | world level |
pos | drop position |
itemStacks | list of ItemStack to spawn |