locateStructure

fun locateStructure(structureKey: ResourceKey<Structure>, level: ServerLevel, startPos: BlockPos = BlockPos.ZERO): BlockPos?

Locate a structure by ResourceKey.

Return

nearest BlockPos of the structure or null if not found

Parameters

structureKey

structure resource key

level

server level to search in

startPos

starting position for search


fun locateStructure(structureKey: TagKey<Structure>, level: ServerLevel, startPos: BlockPos = BlockPos.ZERO): BlockPos?

Locate a structure by TagKey.

Return

nearest BlockPos or null if not found

Parameters

structureKey

structure tag key

level

server level to search in

startPos

starting position