Skip to content

Commit 549bf24

Browse files
committed
Refactor Python client into generated full Baritone command API
1 parent 98edb2a commit 549bf24

26 files changed

Lines changed: 3646 additions & 104 deletions

python/README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,37 @@ pip install pyritone
1414
from pyritone import PyritoneClient
1515

1616
with PyritoneClient() as client:
17-
client.goto(100, 70, 100)
17+
dispatch = client.goto(100, 70, 100)
18+
task_id = dispatch.get("task_id")
19+
if task_id:
20+
terminal = client.wait_for_task(task_id)
21+
print(terminal["event"])
1822
```
1923

20-
## Advanced usage
24+
## Command API
2125

22-
For developer workflows, lower-level APIs are still available:
26+
All top-level Baritone v1.15.0 commands are exposed as Python methods on:
27+
28+
- `PyritoneClient` (sync)
29+
- `AsyncPyritoneClient` (async)
30+
31+
Each command returns immediate dispatch info:
32+
33+
- `command_text`
34+
- `raw` bridge response
35+
- optional `task_id`
36+
- optional `accepted`
37+
38+
Command aliases are exposed too (`qmark`, `stop`, `wp`, etc). Full generated reference:
39+
40+
- `python/docs/baritone-commands.md`
41+
42+
## Low-level API still available
2343

2444
- `execute("...")`
45+
- `cancel()`
46+
- `ping()`
47+
- `status_get()`
2548
- `next_event()`
2649
- `wait_for_task(task_id)`
2750

@@ -47,6 +70,12 @@ pyritone cancel
4770
pyritone events
4871
```
4972

73+
## Regenerate command wrappers/docs
74+
75+
```bash
76+
python tools/generate_baritone_commands.py
77+
```
78+
5079
## End-to-End Dev Test
5180

5281
1. Start Minecraft dev client from the mod folder:

0 commit comments

Comments
 (0)