setBlockNbt

fun setBlockNbt(block: BlockEntity, tag: CompoundTag)

Replace the NBT data of a block entity.

Parameters

block

the target BlockEntity

tag

the CompoundTag to set on the block entity


fun setBlockNbt(level: Level, pos: BlockPos, tag: CompoundTag): Boolean

Set the NBT of a block entity at the given position.

Return

true if set succeeded, false if no block entity present

Parameters

level

level to modify

pos

block position

tag

CompoundTag to set