Skip to content

Structure

Load structure templates (.nbt files) and place them in the world with rotation, mirror, and entity callback support.

Structures are loaded from the server’s structures/ folder or from absolute file paths.

Metatable name: "structure"

Loads a structure from the server’s structures/ folder.

  • id (string) — Structure name (without .nbt)

Returns a structure wrapper or nil.

local struct = mc.loadStructure("my_house")

Loads a structure from a file path.

  • path (string) — Absolute or server-relative path

Returns a structure wrapper or nil.

local struct = mc.loadStructureFile("config/ignis/my_build.nbt")

type: table ({x, y, z})

Dimensions of the structure. Read-only.

Places the structure in the world.

  • world (World) — Target world
  • pos (table) — {x, y, z} block position
  • params (table, optional) — Placement parameters

params table:

KeyTypeDefaultDescription
rotationstring"none""none" / "0", "clockwise_90" / "90", "clockwise_180" / "180", "counterclockwise_90" / "270"
mirrorstring"none""none", "left_right", "front_back"
on_entityfunctionnilCallback per entity; return false to skip spawning

Entity UUIDs are regenerated automatically — no duplicates.

struct:place(world, Vec(100, 64, 200), {
rotation = "clockwise_90",
mirror = "left_right",
on_entity = function(entity)
if entity:isMob() then return false end
end
})