Class in @minecraft/server
The world’s structures.
import { StructureManager } from '@minecraft/server';Example
Section titled “Example”import { world, type StructureManager } from '@minecraft/server';
const structureManager: StructureManager = world.structureManager;import { world } from '@minecraft/server';
const structureManager = world.structureManager;Methods
Section titled “Methods”get(identifier: string): Structure | undefined;Parameters
identifierstring
Returns
Structure | undefinedTypes
has(identifier: string): boolean;Whether a structure by this id is in memory, the world or the folder.
Parameters
identifierstring
Returns
booleanplace(structure: string | Structure, dimension: Dimension, location: Vector3, options?: StructurePlaceOptions): void;Places a structure with its lowest corner at location.
Parameters
structurestring | StructuredimensionDimensionlocationVector3optionsoptionalStructurePlaceOptions
Throws
- If there’s no such structure or its chunks can’t be loaded.
createFromWorld
Section titled “createFromWorld”createFromWorld( identifier: string, dimension: Dimension, from: Vector3, to: Vector3, options?: StructureCreateOptions,): Structure;Copies the blocks between two corners, and the mobs among them if asked.
Parameters
identifierstringdimensionDimensionfromVector3toVector3optionsoptionalStructureCreateOptions
Returns
Structuredelete
Section titled “delete”delete(structure: string | Structure): boolean;Takes it out of memory and the world; files in the folder are left alone.
Parameters
structurestring | Structure
Returns
booleanTypes
getWorldStructureIds
Section titled “getWorldStructureIds”getWorldStructureIds(): string[];Every structure in memory, the world and the folder.
Returns
string[]