Overview#
Modular Machinery is a powerful utility mod designed for modpack creators. It provides the framework to build massive, complex, and unique multiblock machines from scratch. Unlike standard tech mods, Modular Machinery does not come with a pre-defined progression; instead, it offers a 'blank slate' where every machine's shape, requirements, and recipes are defined via JSON files or CraftTweaker scripts.
Key features include:
- Custom Multiblocks: Define any shape or size for your machines.
- Tiered Components: Configurable hatches and buses for items, fluids, and energy.
- Deep Integration: Native support for CraftTweaker, GameStages, and NBT checking.
- Visual Feedback: Built-in structure ghosting and JEI integration for custom recipes.
Blocks and Components#
Machines are constructed using a variety of functional blocks. Every machine requires exactly one Machine Controller and a combination of hatches or buses to handle inputs and outputs.
Machine Controller
The brain of the multiblock. It stores the machine's state, checks for structure validity, and handles recipe processing. Right-clicking a controller with a Blueprint will show the required structure.
Input and Output Hatches
These blocks act as the interface between the machine and the world. They come in various tiers, each increasing the internal capacity.
| Component | Tiers | Function |
|---|---|---|
| Item Bus | Tiny, Small, Normal, Reinforced, Big, Huge, Ludicrous, Ultimate | Stores items for recipes. Higher tiers provide more slots (1 to 100+). |
| Fluid Hatch | Tiny, Small, Normal, Reinforced, Big, Huge, Ludicrous, Ultimate | Stores liquids. Capacity ranges from 1,000mB to 1,024,000mB+. |
| Energy Hatch | Tiny, Small, Normal, Reinforced, Big, Huge, Ludicrous, Ultimate | Stores FE/RF. Capacity scales exponentially per tier. |
Machine Casings
Decorative and structural blocks used to form the body of the multiblock. The standard casing is the Machine Casing, often crafted from Modularium.
Items and Tools#
While primarily a block-based mod, several items are essential for machine creation and maintenance.
Key Items
- Modularium Ingot: The base alloy used for most components. Typically created in a furnace or alloy smelter.
- Machine Circuitry: Used in the crafting of controllers and high-tier hatches.
- Blueprint: A tool used to visualize machine structures. When bound to a machine type, it can project a 'ghost' of the blocks required in the world.
Crafting Materials
| Item | Usage |
|---|---|
| Modularium Ingot | Primary crafting ingredient for casings and hatches. |
| Machine Circuitry | Advanced component for controllers. |
| Machine Casing | The structural block for most multiblocks. |
Machine Definition (JSON)#
Machines are defined in .json files located in the config/modularmachinery/machines folder. A machine definition requires a registry name, a localized name, and a structure layout.
Example Machine Format
{
"registryName": "alloy_smelter",
"localizedName": "Industrial Alloy Smelter",
"color": "#FF5500",
"structure": [
{
"z": 0, "y": 0, "x": 0,
"blocks": [ "modularmachinery:controller" ]
},
{
"z": 1, "y": 0, "x": 0,
"blocks": [ "modularmachinery:casing" ]
}
]
}
Structure Variables
- x, y, z: Coordinates relative to the controller.
- blocks: An array of block IDs (e.g.,
minecraft:stone) or tags that are valid for that position.
Recipe Definition#
Recipes are defined in the config/modularmachinery/recipes folder. Each recipe is tied to a specific machine registry name.
Recipe Requirements
Recipes can require multiple types of inputs and produce various outputs:
- Item: Specific items or OreDictionary entries.
- Fluid: Specific fluids and millibucket amounts.
- Energy: Total FE required for the process.
- NBT: Advanced recipes can check for specific NBT data on input items.
Example Recipe JSON
{
"machine": "alloy_smelter",
"registryName": "steel_ingot_recipe",
"recipeTime": 200,
"requirements": [
{ "type": "item", "io-type": "input", "item": "minecraft:iron_ingot", "amount": 1 },
{ "type": "item", "io-type": "input", "item": "minecraft:coal", "amount": 2 },
{ "type": "item", "io-type": "output", "item": "thermalfoundation:material:160", "amount": 1 },
{ "type": "energy", "io-type": "input", "amount": 5000 }
]
}Mechanics and Advanced Features#
Redstone Interaction
The Machine Controller provides redstone feedback:
- Comparator Output:
0: No valid structure found.1: Structure valid, but no recipe is currently running.15: Machine is actively processing a recipe.
- Redstone Control: Applying a direct redstone signal to the controller will pause the machine's operation.
Recipe Modifiers
Advanced users can define Recipe Modifiers that change recipe behavior based on the blocks used in the structure. For example, replacing a standard casing with a 'Reinforced Casing' could reduce energy consumption or speed up the recipe.
CraftTweaker Integration
Recipes can be added dynamically via ZenScript:
mods.modularmachinery.RecipeBuilder.newBuilder("my_recipe_id", "alloy_smelter", 100)
.addItemInput(<minecraft:iron_ingot>)
.addItemOutput(<minecraft:gold_ingot>)
.addEnergyPerTickInput(20)
.build;Commands and Configuration#
Commands
/modularmachinery reload: Reloads all machine and recipe JSON files without restarting the game. Essential for testing new definitions.
Configuration
The modularmachinery.cfg file allows for global changes:
- Color Customization: Change the default colors for machine highlights.
- Performance Settings: Adjust how often the controller checks for structure validity.
- Hatch Capacities: Globally override the default storage capacities for all tiers of energy, fluid, and item components.