Script API - v26.60
    Preparing search index...

    Class BiomeType

    Describes a type of biome.

    export class BiomeType {
    private constructor();
    readonly id: string;
    getTags(): string[];
    hasTags(tags: string[]): boolean;
    }
    Index
    id: string

    Identifier of the biome type.

    This property can't be read in early-execution mode.

    import { BiomeTypes, Player, system } from "@minecraft/server";

    // Run `/scriptevent example:findbiome` in chat to locate the nearest plains biome.
    system.afterEvents.scriptEventReceive.subscribe(({ id, sourceEntity }) => {
    if (id !== "example:findbiome" || !(sourceEntity instanceof Player)) return;

    const biomeType = BiomeTypes.get("minecraft:plains");
    if (!biomeType) return;

    const searchOptions = {
    boundingSize: { x: 100, y: 100, z: 100 },
    };
    const biomeLocation = sourceEntity.dimension.calculateClosestBiomeFromSeed(
    sourceEntity.location,
    biomeType,
    searchOptions,
    );

    if (biomeLocation) {
    sourceEntity.sendMessage(
    `Found '${biomeType.id}' at ${biomeLocation.x}, ${biomeLocation.y}, ${biomeLocation.z}.`,
    );
    } else {
    sourceEntity.sendMessage(`Biome '${biomeType.id}' was not found within 100 blocks.`);
    }
    });
    • Returns string[]

      Returns a list of the biome's tags.

      This function can't be called in early-execution mode.

    • Parameters

      • tags: string[]

        The list of tags to check against the biome.

      Returns boolean

      Checks if the biome has all of the provided tags.

      This function can't be called in early-execution mode.