Mcfunction Debug
This mod significantly simplifies the development of mcfunction files by providing comprehensive debugging tools directly in the game!
Main Features
Breakpoints - the /breakpoint command allows you to stop function execution at a specific line. During the pause, execution stops at the current command, while tick functions and load functions do not run. However, manually entered commands and command block commands continue to work, making the debugging process extremely convenient. You can view the stack trace at the breakpoint.
Conditional breakpoints - use the /execute if ... run breakpoint construct to create conditional breakpoints.
Resume execution - the /resume command continues execution after a breakpoint.
Step-by-step execution - after setting a breakpoint, you can use /step to execute the next line of code. This allows for line-by-line debugging until the entire root function is completed. Stack trace is available after each step.
Information Output Tools
Quick printing - the /print command provides convenient tools for outputting debug information. Results are automatically broadcast to all operators, so you can run them in functions and see the output in debug mode.
/print context- outputs the execution context, including the entity executor (execute as), location (execute at), and rotation (execute facing)/print score [target] [objective]- displays the scores of selected entities or targets in the specified objective/print selector [selector]- shows all entities matching the specified selector/print data [data target] [path]- outputs data of the specified target with the option to filter by path
Displaying entities using commands (for example, /say) has become much more informative. When using /print selector @e[type=slime] or /say @e[type=slime], the tags and location of each entity will be shown.
Additional Features
By default, the mod disables Minecraft's error suppression when executing functions. This behavior can be changed in the settings. For each error, stack trace is available, which significantly simplifies finding and fixing code problems.