Precise Testing
These actions are for tests that check exact numbers. Nothing sleeps and hopes. The bot holds keys for a set number of ticks, jumps at a known moment, and waits for the packet or line that proves something happened.
In a scenario they go in an action step, {do: action, action: jumpApex}. Over the API they are /act?action=....
Actions
| Action | Parameters | What it does |
|---|---|---|
hold | keys=forward,back,left,right,jump,sneak,sprint, ticks=20, wait=1 | Holds keys for a number of ticks, like a player pressing them. Overrides pathing while it lasts |
jump | Jumps as soon as the bot stands on something. A jump asked for mid-air or right after a teleport waits for the ground instead of being lost | |
jumpApex | timeout=2000 | Jumps and returns at the top of the arc |
airJump | timeout=2000 | Jumps, then sends the flight toggle at the top. This is the double jump a server sees through allowFlight |
use | hand, swing=1 | One right click in the air. No arm swing unless asked for: the client only swings for items that say so, and a swing with no block in reach reaches plugins as a left click |
useHold | hand, ms=1000, every | Holds right click, then lets go. See below |
release | Lets go of right click | |
hud | Action bar, title, subtitle and boss bars on screen now | |
hudEvents | kind, match, since, n=50 | History of action bars, boss bars, titles, sounds and particles |
mark | The current position of the chat, packet and HUD streams | |
waitFor | type, match, packet, entity, since, timeout=5000, distance, absent=1 | Blocks until something happens, or fails after the timeout. With absent=1 it is the other way round: it passes when nothing matched until the timeout and fails with what showed up |
chat | until=<regex> | Returns the moment a line matches instead of waiting the full wait |
packets | since=<mark>, entity=<id> | Only packets after a mark, only packets about one entity |
inv | full=1 | Every slot, armor and off hand included, with every component value. Bukkit PDC shows up under custom_data |
Holding right click
A held key uses the item again every 4 ticks (every=200 ms), so a gun keeps firing. For an item with a use time (bow, crossbow, trident, shield, food, potions) it is one press that is held. A custom item counts as one of those when it carries a consumable, food or blocks_attacks component. every=0 forces a single press, and the answer has presses.
Waiting for something
waitFor types:
| Type | Matches on |
|---|---|
chat, actionbar, bossbar, title, subtitle, sound, particle | match |
packet | packet= a name part, entity= an id, match against the fields |
entityGone | entity= |
entity | A type or name shows up, match |
move | The bot moved distance blocks |
waitFor counts from the moment it is called. To catch something the previous action caused, take a mark first and pass the number as since:
curl "localhost:8767/act?bot=Tester&action=mark"
curl "localhost:8767/attack?bot=Tester&id=42"
curl "localhost:8767/act?bot=Tester&action=waitFor&type=packet&packet=DamageEvent&entity=42&since=613"In a scenario, action takes as and field to keep the mark: action: mark, as: seen, field: packets, then since: ${seen} later.
timeout on an action step reaches actions that wait on their own (waitFor, jumpApex, airJump), so their own message explains a failure. The step gives them two extra seconds before it gives up.
Movement and physics
The bot's movement also takes the velocity the server sends: knockback, launches, setVelocity from plugins, explosions. Its physics knows Speed, Slowness, Jump Boost, Slow Falling and Levitation.