Skip to content

Commit ee1f461

Browse files
authored
Merge branch 'master' into master
2 parents f704040 + 133c7b9 commit ee1f461

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

README.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,22 @@ The following options are available:
6666
}
6767
```
6868

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.
7270

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.
7473

75-
## Usage in Minecraft
74+
* Step
7675

7776
### Breakpoint
7877

7978
The debugger can be controlled directly from Minecraft using the following commands:
8079

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
8581

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.
8783

88-
When execution is paused at a breakpoint, the gametick will be freezed.
84+
* Get Macro Arguments
8985

9086
### Debug Command
9187

@@ -194,40 +190,44 @@ Command Syntax:
194190
- `watch reload`: Trigger the hot loading to apply changes.
195191
- `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.
196192

197-
## Development
198-
199-
### Project Structure
193+
say start
194+
#breakpoint
195+
$say $(msg)
196+
say end
197+
```
200198
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`.
204201
205-
### Building the Project
202+
* Get Function Stack
206203
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:
208206
209-
```bash
210-
./gradlew build
211-
```
207+
```mcfunction
208+
#test:test1
212209
213-
To build the VSCode extension:
210+
say 1
211+
function test:test2
212+
say 2
214213
215-
```bash
216-
cd vscode
217-
npm install
218-
npm run build
214+
#test: test2
215+
say A
216+
#breakpoint
217+
say B
219218
```
220219

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:
224222

225-
## Contributing
223+
```
224+
test:test2
225+
test:test
226226
227-
Contributions are welcome! Please feel free to submit a Pull Request.
227+
```
228228

229-
## Acknowledgements
229+
* Run command in current context
230230

231231
- [Fabric](https://fabricmc.net/) - Mod loader for Minecraft
232232
- [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

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ maven_group=net.gunivers
1818
archives_base_name=sniffer
1919

2020
# Dependencies
21-
fabric_version=0.138.3+1.21.10
21+
fabric_version=0.138.3+1.21.10

0 commit comments

Comments
 (0)