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.
{
"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_versionis always1.idis the machine's unique name (see ids).display_nameis the name players see.carrieris the machine's shape (more below).storagesis 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 is1.5, iron blocks are5.blast_resistance: how well it survives explosions. Stone is6.mining_tool: the tool that mines it fastest, such aspickaxeoraxe.requires_correct_tool: whentrue, 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"
}| Value | What it does |
|---|---|
horizontal (default) | Faces north, south, east or west, towards the player. |
all_directions | Can also face up or down, when the player looks up or down. |
none | Never 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.