-
Notifications
You must be signed in to change notification settings - Fork 0
Debugging
When working with complex multiblock structures and YAML configurations, things can sometimes go wrong. This guide will help you diagnose and fix common issues.
The MultiBlockEngine includes a built-in visualizer to help you see exactly how the plugin interprets your structure patterns in the world.
/mb debug <structure_id> [player]
-
structure_id: The ID of the multiblock you want to visualize (e.g.,
miner_machine). - player (Optional): The player who will see the particles (defaults to you).
Requirement: You must be looking at a block that will serve as the Anchor (Controller) position for the visualization.
- Blue Particles: The Anchor (Controller) position.
- Green Particles: Blocks that MATCH the pattern correctly.
- Red Particles: Blocks that are MISSING or INCORRECT according to the pattern.
You can customize the debug session in config.yml:
debug:
renderer: PARTICLES # Currently only PARTICLES is supported
duration: 10 # How many seconds the visualization lastsSymptoms: You build the structure, right-click the controller, but nothing happens (no hologram, no "created" message).
Possible Causes:
-
Pattern Mismatch: The blocks placed in the world do not exactly match the
patterndefined in YAML. Check for:- Correct materials (e.g.,
STONEvsCOBBLESTONE). - Block data (e.g., stairs facing the wrong way, logs with wrong axis).
- Empty spaces (air) where blocks should be, or vice versa.
- Correct materials (e.g.,
-
Controller Position: You are clicking a block that is not defined as the
controllerin the YAML, or the controller is not in the correct relative position within the pattern. - YAML Syntax Error: If the file has invalid YAML, it might not have loaded at all. Check the console on startup.
Symptoms: The structure is formed (hologram appears), but interactions don't do anything.
Possible Causes:
-
Event Mismatch: You are listening for
on_interactbut trying to trigger it by walking (on_tickneeded) or breaking (on_breakneeded). -
Conditions Failing: If you have
conditionalactions, theelseblock might be empty, so it fails silently. Add a message to theelseblock to debug. - Cooldowns: If you implemented a variable-based cooldown, ensure it's resetting correctly.
Symptoms: You break the structure, but the text display remains floating.
Fix:
- Ensure the plugin is updated to the latest version (fixes were made to handle race conditions).
- Run
/mbe reloador restart the server to clear "ghost" instances (though persistent data should handle this).
The MultiBlockEngine comes with a built-in debug mode that prints detailed information to the console.
To enable:
- Open
config.yml. - Set
debug: true. - Run
/mbe reload.
What to look for in logs:
-
[MultiBlockEngine] Loading multiblock: my_structure...- Confirms the file is found. -
[MultiBlockEngine] Pattern check failed at (x, y, z). Expected: STONE, Found: DIRT- Extremely helpful for fixing pattern issues. -
[MultiBlockEngine] Executing action: message- Confirms the event fired.
YAML is sensitive to indentation.
- Do not use tabs. Use spaces (usually 2 or 4).
- Use a linter (like YAMLLint) to verify your files before uploading.
If you believe you've found a bug in the plugin itself (e.g., a crash or unexpected behavior not explained by config), please report it with:
- Your
config.ymland the specific multiblock YAML file. - The server log (latest.log) showing the error stack trace.
- Steps to reproduce the issue.