Skip to main content

Multiblocks

A multiblock is a structure of several blocks that works as one machine: a tank, a reactor, an altar. Each of its blocks is a machine with the machineengine:multiblock_member behavior. One of them, the anchor, holds the structure's storages.

  • The structure forms as soon as its last block is placed, and unforms when one is broken.
  • The anchor checks the structure again every few seconds (a block placed inside, a part added).
  • While formed, the anchor's storages are sized by capacities.

Formed multiblocks seen from outside, with their ports

Formed multiblocks, seen from outside.

Declare structures in the multiblocks: section of a definitions file. Two shapes:

Boxes​

A hollow box (Mekanism's tanks and reactors are boxes): casing blocks on the edges and corners, walls of allowed blocks, and an interior.

multiblocks:
mypack:vat:
box:
casing: mypack:vat_casing # edges and corners
faces: [mypack:vat_casing, mypack:vat_valve, minecraft:glass]
interior: [minecraft:air] # optional, default any block
capacities: {fluid: {per-block: 16000}} # per interior block
KeyDefaultMeaning
casingβ€”Required. Block of the edges and corners.
facesβ€”Blocks allowed in the walls.
interioranyBlocks allowed inside.
min-size3Smallest side, in blocks (at least 3).
max-size18Largest side.
width0Fixed width; 0 for any.
open-topfalseNo top layer.
controllernoneA block that must appear exactly once in the walls.

The anchor of a box is its lowest corner casing block, so the casing's machine type declares the structure's storages.

Patterns​

Any fixed shape, written as layers of rows with a character key β€” like a crafting recipe in 3D. It is found in any of the four horizontal rotations.

multiblocks:
mypack:altar:
pattern:
layers: # bottom up; rows north to south; characters west to east
- ['CCC', 'C#C', 'CCC']
- [' ', ' G ', ' '] # a space is any block
key:
C: mypack:altar_casing
'#': mypack:altar_core
G: [minecraft:glass, minecraft:tinted_glass] # any of these
anchor: '#'
rotate: true # optional, default true
capacities: {mana: 64000}

The anchor character must appear exactly once, and must be a member machine.

capacities​

The anchor's storages while the structure is formed, by storage id: a number, or { per-block: N } for N per interior block (boxes).

The member blocks​

Every block of the structure that is a machine uses the machineengine:multiblock_member behavior:

machines:
mypack:altar_core:
storages: {mana: {capacity: 1}} # the anchor declares the storages
behavior:
type: machineengine:multiblock_member
multiblocks: [mypack:altar]
mypack:altar_casing:
behavior:
type: machineengine:multiblock_member
multiblocks: [mypack:altar]
mypack:altar_valve:
behavior:
type: machineengine:multiblock_member
multiblocks: [mypack:altar]
role: valve
storages: [mana]
KeyDefaultMeaning
multiblocksβ€”Required. The structures this block can be part of.
roleframeframe (casing, glass…), valve or port.
storagesnoneValves and ports: the anchor's storages they pass through, on all their sides (pipes and cables connect there).
exclusivefalseValves: the structure holds one of those storages at a time (a tank holds a fluid or a chemical).
output-rateβ€”Ports: amount per tick pushed to neighbors when the port is in output mode.

A port is in input mode by default; an addon's tool (Mekanized's configurator) switches it to output.

In Java​

Addons build the same structures with api.multiblock: MultiblockType, MultiblockShape and MultiblockMember.of(types).