-
Notifications
You must be signed in to change notification settings - Fork 0
Inheritance
DarkBladeDev edited this page Dec 27, 2025
·
1 revision
The MultiBlockEngine supports a powerful inheritance system that allows you to create "template" structures and extend them to create variations. This reduces duplication and makes managing complex sets of machines much easier.
Any multiblock YAML file can include the extends key pointing to another multiblock's id.
id: my_advanced_machine
extends: my_base_machineWhen the plugin loads, it:
- Loads all files.
- Builds a dependency graph (who extends who).
- Resolves them in order (Base -> Child -> Grandchild).
- Merges the configurations.
- Scalars (Strings, Numbers, Booleans): The child's value overrides the parent's value.
- Lists (Actions, Patterns): The child's list completely replaces the parent's list. There is currently no "append" logic.
- Maps/Sections (Variables, Behavior): These are deep merged. You can add new keys to a section without losing the parent's keys.
id: base_machine
tick_interval: 20
controller: IRON_BLOCK
pattern:
- offset: [0, -1, 0]
match: COAL_BLOCK
actions:
on_break:
- type: message
value: "&cMachine broken!"id: fast_machine
extends: base_machine
tick_interval: 5 # OVERRIDES parent (20 -> 5)
# INHERITS controller (IRON_BLOCK)
# INHERITS pattern (Coal block below)
# INHERITS on_break action
actions:
on_create: # ADDS new event listener (didn't exist in parent)
- type: message
value: "&aFast machine created!"- Circular Inheritance: You cannot have A extends B and B extends A. The plugin will detect this and disable both with an error.
-
Missing Parent: If the parent
idcannot be found, the child will fail to load.