Script API - v1.26.10.22
    Preparing search index...

    Class BlockPermutation

    Index

    Constructors

    Properties

    localizationKey: string
    type: BlockType

    Methods

    • Parameters

      Returns boolean

      This function can't be called in read-only mode.

      This function can throw errors.

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

    • Parameters

      Returns boolean

      This function can't be called in read-only mode.

      This function can throw errors.

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

    • Returns Record<string, string | number | boolean>

      This function can't be called in read-only mode.

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

    • Parameters

      • stateName: string

      Returns string | number | boolean

      This function can't be called in read-only mode.

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

    • Returns string[]

      This function can't be called in read-only mode.

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

    • Parameters

      • tag: string

      Returns boolean

      This function can't be called in read-only mode.

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

    • Parameters

      Returns boolean

      This function can't be called in read-only mode.

      This function can throw errors.

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

    • Parameters

      Returns boolean

      This function can't be called in read-only mode.

      This function can throw errors.

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

    • Parameters

      • blockName: string
      • Optionalstates: Record<string, string | number | boolean>

      Returns boolean

      This function can't be called in read-only mode.

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

      // Script by WavePlayz

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

      /**
      Function to check if a given block is red wool
      @param {import('@minecraft/server').Block} block
      @returns true if a given block is red wool
      /
      function isRedWool(block) {
      // Define the type id of block we are checking for
      let typeId = "wool";

      // Define the block state we are looking for
      // In this case, we want the color to be red
      let states = { color: "red" };

      // Check if the block matches the specified type and states
      // The 'matches' method returns true if the block is of the specified type and has the specified states
      return block.matches(typeId, states);
      }
    • Parameters

      • blockName: string
      • Optionalstates: Record<string, string | number | boolean>

      Returns BlockPermutation

      This function can't be called in read-only mode.

      This function can throw errors.

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