Skip to content
On this page
通用

KattonBlockEntityApi

common/src/main/kotlin/top/katton/api/dpcaller/KattonBlockEntityApi.kt
以类似 Map 的方式按位置访问关卡中的方块实体。

KattonLevelBlockEntityCollection

KattonLevelBlockEntityCollection通用
kotlin
class KattonLevelBlockEntityCollection( val level: Level )

以类似 Map 的方式按位置访问关卡中的方块实体。

属性

属性说明
level包含这些方块实体的 Level。

KattonLevelBlockEntityCollection.get

KattonLevelBlockEntityCollection.get通用函数
kotlin
operator fun get(blockPos: BlockPos): BlockEntity?

获取方块Entity at a 位置。

KattonLevelBlockEntityCollection.set

KattonLevelBlockEntityCollection.set通用函数
kotlin
operator fun set(blockPos: BlockPos, blockEntity: BlockEntity)

在指定位置设置一个方块实体。 方块实体自身的位置必须与目标位置一致。

KattonLevelBlockEntityCollection.set

KattonLevelBlockEntityCollection.set通用函数
kotlin
fun set(blockEntity: BlockEntity)

在关卡中按方块实体自身的位置设置它。

nbt

nbt通用属性
kotlin
var BlockEntity.nbt: CompoundTag

用于读取或设置方块实体 NBT 数据的扩展属性。