-
Notifications
You must be signed in to change notification settings - Fork 5
Debugging MPL
Sometimes when developping an application, the running system just does not want to do what you want it to do. In these cases it can be very helpful to follow the execution step by step.
When compiling MPL code with the compiler option debug, the command blocks are spaces out to allow easy access. Additionally all breakpoints defines in the source code are generated (these are ignored during normal compilation).
A breakpoint is defined by using the keyword breakpoint
wich can be modified with conditional or invert:
breakpoint
conditional: breakpoint
invert: breakpoint
if: /testfor ...
then {
breakpoint
}
When a breakpoint is encountered during program execution, a message containing file and line number is printed and you get the option to teleport yourself to the breakpoint or continue the execution via tellraw. During this time all processes of that program are suspended, so you can savely view and edit the environment like scoreboard values and entities.