Skip to content
On this page

Common

KattonBlockEntityApi

top.katton.api.dpcallercommon/src/main/kotlin/top/katton/api/dpcaller/KattonBlockEntityApi.kt
Map-like access to block entities in a level by position.

KattonLevelBlockEntityCollection

CommonClass
kotlin
class KattonLevelBlockEntityCollection( val level: Level )

Map-like access to block entities in a level by position.

Properties

PropertyDescription
levelThe Level containing the block entities

KattonLevelBlockEntityCollection.get

CommonFunction
kotlin
operator fun get(blockPos: BlockPos): BlockEntity?

Get the BlockEntity at a position.

KattonLevelBlockEntityCollection.set

CommonFunction
kotlin
operator fun set(blockPos: BlockPos, blockEntity: BlockEntity)

Set a BlockEntity at a specific position.

The block entity's position must match the target position.

KattonLevelBlockEntityCollection.set

CommonFunction
kotlin
fun set(blockEntity: BlockEntity)

Set a BlockEntity in the level at its own position.

nbt

CommonProperty
kotlin
var BlockEntity.nbt: CompoundTag

Extension property to get/set NBT data on a BlockEntity.