Skip to content

mcutils:height

Vanilla snow layer block behavior.

Registering

Before you can use this component you need to register it.

js
import { system } from "@minecraft/server";
import { HeightComponent } from "@lpsmods/mc-utils";

system.beforeEvents.startup.subscribe((event) => {
  event.blockComponentRegistry.registerCustomComponent(HeightComponent.typeId, new HeightComponent());
});

Component

Options

NameTypeDefaultDescription
layers_statestringmcutils:layers
max_layersnumber8

Examples

Height

json
{
  "format_version": "1.21.100",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:custom_height",
      "states": {
        "mcutils:layers": [1, 2, 3, 4, 5, 6, 7, 8]
      },
      "traits": {
        "minecraft:placement_position": {
          "enabled_states": ["minecraft:vertical_half"]
        }
      }
    },
    "components": {
      "mcutils:height": {
        "layers_state": "mcutils:layers",
        "max_layers": 8
      }
    }
  }
}

Not associated with or approved by Mojang Studios or Microsoft