Class BlockPermutationBeta

Contains the combination of type BlockType and properties (also sometimes called block state) which describe a block (but does not belong to a specific Block). This type was introduced as of version 1.17.10.21.

Hierarchy

  • BlockPermutation

Constructors

Properties

type: BlockType

The BlockType that the permutation has.

Methods

  • Beta

    Returns Record<string, string | number | boolean>

    Returns the list of all of the properties that the permutation has.

    Remarks

    Returns all available properties associated with this block.

  • Parameters

    • Optional amount: number

    Returns ItemStack

  • Beta

    Parameters

    • propertyName: string

    Returns undefined | string | number | boolean

    Returns the property if the permutation has it, else null.

    Remarks

    Gets a property for the permutation.

  • Beta

    Returns string[]

    Remarks

    Creates a copy of the permutation.

  • Beta

    Parameters

    • tag: string

    Returns boolean

    Returns true if the permutation has the tag, else false.

    Remarks

    Checks to see if the permutation has a specific tag.

    Example

    check_block_tags.js

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

    // Fetch the block
    const block = world.getDimension("overworld").getBlock({ x: 1, y: 2, z: 3 });
    const blockPerm = block.getPermutation();

    console.log(`Block is dirt: ${blockPerm.hasTag("dirt")}`);
    console.log(`Block is wood: ${blockPerm.hasTag("wood")}`);
    console.log(`Block is stone: ${blockPerm.hasTag("stone")}`);
  • Parameters

    • blockName: string
    • Optional properties: Record<string, string | number | boolean>

    Returns boolean

  • Parameters

    • blockName: string
    • Optional properties: Record<string, string | number | boolean>

    Returns BlockPermutation