Skip to content

mcutils:multiblock

Vanilla multiblock behavior. (like; doors, tall grass, beds)

Registering

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

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

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

Component

Options

NameTypeDefaultDescription
part_statestringmcutils:part
direction_statestring
sync_statesbooleanfalse
partsstring[][]

Examples

Tall Block

json
{
  "format_version": "1.21.100",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:custom_tall_block",
      "states": {
        "mcutils:half": ["lower", "upper"]
      }
    },
    "components": {
      "mcutils:multiblock": {
        "part_state": "mcutils:half",
        "parts": ["lower,0,0,0", "upper,0,1,0"],
        "sync_states": true
      }
    }
  }
}

Tall Crop

json
{
  "format_version": "1.21.100",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:custom_tall_crop",
      "states": {
        "mcutils:growth": [0, 1, 2, 3, 4, 5, 6, 7],
        "mcutils:half": ["bottom", "top"]
      }
    },
    "components": {
      "mcutils:crop": {
        "growth_state": "mcutils:growth",
        "max_stage": 7
      },
      "mcutils:fertilizable": {
        "growth_state": "mcutils:growth",
        "max_stage": 7
      },
      "mcutils:multiblock": {
        "part_state": "mcutils:half",
        "parts": ["bottom,0,0,0", "top,0,1,0"],
        "sync_states": true
      }
    }
  }
}

Large Crafting Table

json
{
  "format_version": "1.21.100",
  "minecraft:block": {
    "description": {
      "identifier": "wiki:large_crafting_table",
      "traits": {
        "minecraft:placement_direction": {
          "enabled_states": ["minecraft:cardinal_direction"]
        }
      },
      "states": {
        "mcutils:model": ["main", "side"]
      }
    },
    "components": {
      "mcutils:multiblock": {
        "part_state": "mcutils:model",
        "direction_state": "minecraft:cardinal_direction",
        "parts": ["main,0,0,0", "side,^1,^,^"]
      }
    }
  }
}

Not associated with or approved by Mojang Studios or Microsoft