Skip to Content
Foundry Apparatus

Machines

Available since 0.1.0

What a machine file contains, how to make it a block in the world, how it rotates and how players mine it.

A machine is one file in foundry_apparatus/machines/. It says who the machine is, what shape it has, what it holds and what its screen looks like. If you have not built one yet, start with Your First Machine: it walks through a complete one.

The smallest machine

Here is the smallest machine that can do something useful: a block with an input and an output.

foundry_apparatus/machines/crusher.json
{
  "schema_version": 1,
  "id": "mypack:crusher",
  "display_name": "Crusher",
  "carrier": {
    "type": "single_block"
  },
  "storages": [
    {
      "id": "input",
      "resource_type": "foundry_apparatus:item",
      "slots": 1,
      "direction": "in"
    },
    {
      "id": "output",
      "resource_type": "foundry_apparatus:item",
      "slots": 1,
      "direction": "out"
    }
  ]
}
  • schema_version is always 1.
  • id is the machine's unique name (see ids).
  • display_name is the name players see.
  • carrier is the machine's shape (more below).
  • storages is what the machine holds: inventories, tanks and batteries. They have their own page.

This machine has no screen, so right-clicking it does nothing; hoppers and pipes still work. Add a screen when players should see inside.

Carriers: the shape of the machine

The carrier says what the machine physically is. Today a machine is a single block you place in the world:

"carrier": {
  "type": "single_block"
}

Multiblock structures and machines that live inside an item are already accepted by the validator, and they arrive in the game in a later release.

How it breaks and how strong it is

properties describes the block like any other Minecraft block:

"carrier": {
  "type": "single_block",
  "properties": {
    "hardness": 3.5,
    "blast_resistance": 6,
    "mining_tool": "pickaxe",
    "requires_correct_tool": true
  }
}
  • hardness: how long it takes to mine. Stone is 1.5, iron blocks are 5.
  • blast_resistance: how well it survives explosions. Stone is 6.
  • mining_tool: the tool that mines it fastest, such as pickaxe or axe.
  • requires_correct_tool: when true, mining it with the wrong tool drops nothing.

Rotation

By default a machine faces the player who places it, like a furnace. rotation changes that:

"carrier": {
  "type": "single_block",
  "rotation": "all_directions"
}
ValueWhat it does
horizontal (default)Faces north, south, east or west, towards the player.
all_directionsCan also face up or down, when the player looks up or down.
noneNever rotates.

Rotation matters because the sides of a machine (front, back, left, right, top, bottom) follow it: the front is always where the machine faces.

What is next

A machine on its own just sits there. Give it storages to hold things, recipes to know what to do, and a screen for players. Every field is listed in the machine reference.

On this page