You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-34Lines changed: 34 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,26 +66,22 @@ The following options are available:
66
66
}
67
67
```
68
68
69
-
3. Start Minecraft with the Sniffer mod installed
70
-
4. In VSCode, press F5 or click the "Run and Debug" button
71
-
5. Select "Connect to Minecraft" from the dropdown menu
69
+
In this case, after the game executes `say 2`, the game will be "frozen" because it meets the breakpoint.
72
70
73
-
You can now place breakpoints in your `.mcfunction` files and execute it from the game to step through the code.
71
+
When the game is "frozen", you can still move around, do whatever you want, just like execute the command `tick freeze`.
72
+
So you can check the game state, or do some debugging.
74
73
75
-
## Usage in Minecraft
74
+
* Step
76
75
77
76
### Breakpoint
78
77
79
78
The debugger can be controlled directly from Minecraft using the following commands:
80
79
81
-
-`/breakpoint continue`: Resume execution after hitting a breakpoint
82
-
-`/breakpoint step`: Execute the next command and pause
83
-
-`/breakpoint step_over`: Skip to the next command in the current function
84
-
-`/breakpoint step_out`: Continue execution until the current function returns
80
+
* Continue
85
81
86
-
All commands require operator permissions (level 2) to use.
82
+
When the game is "frozen", you can use the command `/breakpoint move`to unfreeze the game and continue running.
87
83
88
-
When execution is paused at a breakpoint, the gametick will be freezed.
84
+
* Get Macro Arguments
89
85
90
86
### Debug Command
91
87
@@ -194,40 +190,44 @@ Command Syntax:
194
190
-`watch reload`: Trigger the hot loading to apply changes.
195
191
-`watch auto [true|false]`: Set whether auto reloading is enabled. Auto reloading will apply any change once the watcher detects it. Default is `false`. If value is not provided, it will tell you if the auto reloading is enabled.
196
192
197
-
## Development
198
-
199
-
### Project Structure
193
+
say start
194
+
#breakpoint
195
+
$say $(msg)
196
+
say end
197
+
```
200
198
201
-
-`src/main`: Main mod code for Minecraft
202
-
-`src/client`: Client-side mod code
203
-
-`vscode`: VSCode extension source code
199
+
After executing `function test:test_macro {"msg":"test"}`, we passed the value `test` to the macro argument `msg` and
200
+
then the game will pause before `$say $(msg)`. At this time, you can use `/breakpoint get msg` to get the value `test`.
204
201
205
-
### Building the Project
202
+
* Get Function Stack
206
203
207
-
To build the Minecraft mod:
204
+
By using `/breakpoint stack`, you can get the function stack of the current game. For example, if we have following two
205
+
functions:
208
206
209
-
```bash
210
-
./gradlew build
211
-
```
207
+
```mcfunction
208
+
#test:test1
212
209
213
-
To build the VSCode extension:
210
+
say 1
211
+
function test:test2
212
+
say 2
214
213
215
-
```bash
216
-
cd vscode
217
-
npm install
218
-
npm run build
214
+
#test: test2
215
+
say A
216
+
#breakpoint
217
+
say B
219
218
```
220
219
221
-
## License
222
-
223
-
This project is licensed under the MPL-2.0 License - see the [LICENSE](LICENSE) file for details.
220
+
When the game pauses at the breakpoint, you can use `/breakpoint stack` and the function stack will be printed in the
221
+
chat screen:
224
222
225
-
## Contributing
223
+
```
224
+
test:test2
225
+
test:test
226
226
227
-
Contributions are welcome! Please feel free to submit a Pull Request.
227
+
```
228
228
229
-
## Acknowledgements
229
+
* Run command in current context
230
230
231
231
-[Fabric](https://fabricmc.net/) - Mod loader for Minecraft
232
232
-[VSCode Debug Adapter](https://code.visualstudio.com/api/extension-guides/debugger-extension) - VSCode debugging API
233
-
-[Datapack Debugger](https://github.com/Alumopper/Datapack-Debugger/) by [Alumopper](https://github.com/Alumopper) - Original implementation of the debugger, without the DAP layer
233
+
-[Datapack Debugger](https://github.com/Alumopper/Datapack-Debugger/) by [Alumopper](https://github.com/Alumopper) - Original implementation of the debugger, without the DAP layer
0 commit comments