your current location:首页 > news>DataPack Debugger) Minecraft

DataPack Debugger) Minecraft

2024-12-12 09:19:42|Myriagame |source:minecraft skins

This is a Fabric module suitable for Minecraft 1.21, introducing important breakpoint debugging functions for the development of data packets.

In the packet, you can insert the #Breakpoint annotation in the .mcfunction file to set the breakpoint.For example:

#test: testsay 1say 2#Breakpointsay 3SAY 4 

In this example, when the game executes SAY 2, the game will encounter breakpoints, which will be "frozen", or enter the "breakpoint debug mode".At this time you can still move around, or execute commands, etc., anything you want to do.The effect of this "freezing" is similar to the effect after performing the Tick Freeze command.

When the game is frozen, execute some commands to observe the amount of your data packet, or perform some debugging.However, it should be noted that only the command executed in the chat bar will be running normally. Even if the function is executed by the chat bar, the statement in the executed function will be frozen.

When the game is frozen, you can use the command /Breakpoint Step to execute the next command.In the above example, when the game encounters breakpoints, you can use /Breakpoint Step to execute SAY 3, and then use /Breakpoint Step to execute SAY 4.When all commands are executed, the game will be thawed and continue to run.

When the game is frozen, you can use the command/Breakpoint Move to thaw the game and continue running.

Using /Breakpoint Get You can get the value of the macro ginseng in the macro function.For example:

#test: test_macrosay start#Breakpoint $ said $ (msg) say end 

After executing /function test: test_macro {"msg": "test"}, the author passed the value test to the macro ginseng MSG.At the same time, during the process of executing the function, the game will trigger the breakpoint before the $ SAY $ (MSG).At this time, you can use /Breakpoint Get MSG to get the value test.

Use/breakpoint stack to get the function stack of the current game.

For example, if there are two functions:

#test: test1Say 1Function test: test2say 2#test: test2say a#Breakpointsay b 

When the game is suspended at the breakpoint position, execute /Breakpoint Stack in the chat bar to print the function call stack in the chat bar.

 test: test2test: test 

Through/Breakpoint Run , you can run any commands in the current context, just like Execute ... Run ....