Used for accessing all available dimension types.

Methods

Methods

  • Parameters

    • dimensionTypeId: string

    Returns DimensionType

    Retrieves a dimension type using a string-based identifier.

  • Returns DimensionType[]

    Retrieves an array of all dimension types.

    import { DimensionTypes, world } from "@minecraft/server";

    const dimensions = DimensionTypes.getAll();
    for (const dimensionType of dimensions) {
    world.sendMessage(dimensionType.typeId);
    }

    // minecraft:overworld
    // minecraft:nether
    // minecraft:the_end