API docs
One WebSocket per fighting player. A JSON hello, then one binary frame of game state per tick in and one binary action per tick out. Everything is little-endian.
1. Ask for a session, then connect to the GPU directly
Your client streams straight to the GPU that runs the models, so a frame and its
answer cross the internet once. First ask the API for a session with your key
(in the header, never in a URL). Send a User-Agent that names your client:
requests carrying Python urllib's default one are refused by our CDN (error 1010).
Choose Europe (EU), North America (NA) or Asia for each API key on your account page. Existing keys use EU. The key determines the region; all regions share your credits and plan limits. Pro allows two bots to run together, in any regions. EU usually runs in a German datacenter, NA in a Texas datacenter, and Asia in a South Korean datacenter. GPUs are rented on demand from datacenters we do not own. When every GPU at a region's usual site is taken by other renters, your session starts at the next datacenter in the same region instead, which can add delay. For EU that is another European datacenter (currently Ireland or Czechia), for NA another US or Canadian datacenter; Asia has none, so it waits or reports gpu_unavailable. Asia’s GPUs cost about 2.6 times as much, so a minute there costs 1.5 times the model’s credits (the session reply’s credits_per_min shows the rate you are paying). Changing a key’s region ends its sessions; reconnect to get a new regional ticket.
POST https://minecraftcombatai.com/api/v1/session
Authorization: Bearer mca_live_…
{"model": "v32"}
While a GPU is starting you get 202 with retry_after
seconds; ask again until you get 200:
{"url": "wss://85.10.218.46:37081/v1/stream",
"cert_sha256": "9f2c…", "ticket": "eyJ2Ijox…", "session": "…",
"expires_in": 60, "credits_per_min": 1.0, "region": "eu"}
Pin the certificate. The GPU presents a certificate made for that
rental, which no public authority signed. Connect with TLS 1.3, compute the SHA-256
of the server's certificate (DER bytes) and close the connection unless it
equals cert_sha256, before sending anything. Then open the
WebSocket and send the ticket within 60 seconds. A ticket works once. After ready, send a frame every game tick straight away: the server never speaks first, and a session with no frame within 15 seconds is closed.
{"type": "hello", "ticket": "eyJ2Ijox…", "client": "mymod/1.0"}
// -> {"type": "ready", "session": "…", "model": "v32", "frame_bytes": 221, …}
Java (inside your TrustManager's checkServerTrusted):
byte[] der = chain[0].getEncoded();
String got = HexFormat.of().formatHex(MessageDigest.getInstance("SHA-256").digest(der));
if (!MessageDigest.isEqual(got.getBytes(), pin.getBytes()))
throw new CertificateException("GPU certificate does not match the pin");
Models: v32, reforge, v29 (Pro), and crystal (its own frame, section 7).
2. Each tick: frame in, action out
Send one 221-byte binary message per game tick with the state as your client sees
it at the end of that tick; the reply is a 16-byte binary message. Apply it during
the next tick. Send ticks in order with a strictly increasing tick, and
do not wait for a reply before sending the next frame: replies come back in order,
tagged with their tick.
| Offset | Field | Type | Meaning |
|---|---|---|---|
| 0 | pos x, y, z | 3 × f64 | Your position, world coordinates |
| 24 | prevPos x, y, z | 3 × f64 | Your position last tick (vanilla xo/yo/zo). Must equal the previous frame's pos |
| 48 | motion x, y, z | 3 × f64 | Your velocity, blocks per tick |
| 72 | yaw, pitch | 2 × f32 | Your view angles in degrees |
| 80 | health | f32 | Your health, 0–20 |
| 84 | fallDistance | f32 | Blocks fallen since last on ground |
| 88 | saturation | f32 | Food saturation |
| 92 | hurtTime | i32 | Ticks of hurt animation left (10 → 0) |
| 96 | jumpTicks | i32 | LivingEntity.noJumpDelay (10 after a jump, counts down) |
| 100 | foodLevel | i32 | Hunger bar, 0–20 |
| 104 | attackStrengthTicker | i32 | Raw ticks since your last swing (not the 0–1 scale) |
| 108 | onGround, sprinting, sneaking, collidedHorizontally | 4 × u8 | 0 or 1. sneaking is the crouching pose |
| 112 | oPos x, y, z | 3 × f64 | Opponent position as rendered |
| 136 | oPrevPos x, y, z | 3 × f64 | Opponent position last tick |
| 160 | oMotion x, y, z | 3 × f64 | Opponent velocity as your client knows it |
| 184 | oYaw, oPitch | 2 × f32 | Opponent view angles |
| 192 | oHealth | f32 | Opponent health as visible to you; send 20 if the server hides it |
| 196 | oHurtTime | i32 | Opponent hurt animation ticks |
| 200 | oOnGround, oSprinting, oSneaking, oSwinging, oCrouchPose | 5 × u8 | 0 or 1 |
| 205 | tick | i32 | Game tick, strictly increasing |
| 209 | pingMs | i32 | Your ping to the game server |
| 213 | sensitivity | f32 | Mouse sensitivity option, 0–1 (0.5 if not applicable) |
| 217 | lastAttack | u8 | 1 if you actually swung last tick |
| 218 | padding | 3 × u8 | Zero |
| Offset | Field | Type | Meaning |
|---|---|---|---|
| 0 | tick | i32 | The frame this answers; drop replies more than two ticks old |
| 4 | yawDelta, pitchDelta | 2 × f32 | Degrees to turn this tick. Apply verbatim |
| 12 | keys | u8 | Bits: 0 forward, 1 back, 2 left, 3 right, 4 jump, 5 sprint, 6 sneak, 7 attack |
| 13 | padding | 3 × u8 | Zero |
3. Control messages
{"type": "new_fight"} // new opponent: clears the model's memory of the last one
{"type": "ping", "t": 123} // answered with {"type": "pong", "t": 123}
{"type": "bye"} // end the session
The server may send {"type": "balance", "credits": 41.5} about once a
minute, and always sends {"type": "error", "code": …, "message": …}
before it closes a session.
4. Errors
unauthorized,rate_limited: bad key, or too many attempts from one address.plan_required,concurrency,daily_cap,premium_cap,insufficient_credit: limits of your plan.bad_frame: wrong size, a value out of range, or a tick that did not increase.not_driving: your turns do not follow the model's. Apply the deltas verbatim.synthetic_state: frames are not continuous;prevPosmust equal the last frame'spos.gpu_unavailable,gpu_lost,unavailable: ask for a new session after a short wait.ticket_expired: the ticket is older than 60 seconds or was already used; ask for a new session.region_changed: the key’s region changed; ask for a new session.session_limit: sessions last two hours; reconnect to continue.no_frames: no frame within 15 seconds ofready. Start sending the tick after ready; the server never speaks first.idle_timeout: no frame for 30 seconds mid-session; reconnect when you send again.low_rate: fewer than 5 frames a second over a minute. Send one every game tick while connected (control messages do not count).keepalive(HTTP 429): in the last 3 hours your sessions held a GPU for over an hour with nobody else streaming on it while using almost no credits (short or empty sessions). New sessions pause until the time in the message. Sessions that stream normally for 20 seconds or more never trigger this.idle_sessions(HTTP 429): your last few sessions sent no frames, and each one kept a GPU running. New sessions pause for 5 minutes, doubling up to an hour; the message gives the time. One session that really streams clears it.cold_start_limit(HTTP 429): starting a GPU costs us money before any credit is spent, so an account's last two GPU starts must be followed by at least 5 credits of play before it can start another. You can always join a GPU that is already running; the message says when you may start one again.
A session that never connects ends as ticket_unused. Your account page says why under it: the GPU reports whether your client rejected its certificate (pin cert_sha256 as above instead of checking it against a CA), spoke plain HTTP or ws://, used TLS older than 1.3, sent no hello, or never reached it at all (the url is an IPv4 address and port; check firewalls and VPNs).
5. Limits
- At most 20 frames a second per session, with a small burst allowance.
- Starter: one session at a time, two hours a day. Pro: two sessions, three hours a day, ten hours of V29 a month.
- Credits are charged per frame actually answered. Waiting for a GPU is free.
6. Example
import time
from mca_client import Client, Frame
with Client("mca_live_…", model="reforge") as bot: # session + pinned TLS + ticket
next_tick = time.monotonic()
while in_fight():
state = read_game_state() # your code
bot.send(Frame(pos=state.pos, prev_pos=state.prev_pos, …, tick=state.tick))
next_tick += 0.05
for action in bot.poll(next_tick): # replies that arrived this tick
if not isinstance(action, dict):
turn(action.yaw_delta, action.pitch_delta) # your code
press(action.keys) # your code
7. Crystal models
crystal (Crystal R1, 1.5 credits a minute, any paid account) plays crystal
PvP: end crystals, respawn anchors, totems, pearls, the elytra and the mace. It
takes a bigger frame, 2592 bytes, because the model needs the
blocks around you; the session's frame_bytes says which a model takes.
Everything else (session, ticket, pinning, control messages, errors) is the same.
The model has memory: send {"type": "new_fight"} whenever the
opponent changes, so it does not carry the last fight into the next.
Terrain. Map every block to an id: 0 air (and anything you can walk
through), 1 bedrock, 2 stone and every other full solid block, 3 dirt or grass, 4
obsidian or crying obsidian, 5–9 a respawn anchor with charge 0–4, 10 fire. The
cube covers every block the crosshair and the placement checks can
reach. A column top is the highest solid block (not air, not fire) at or
below floor(your Y) + 4, looking at most 40 blocks below your feet; if
none is found it is the first block below that range. Both grids scan from
your feet, including the five columns around the opponent. The reference
client's CrystalFrame.fill_terrain(block_at) does all of this from a
single block_at(x, y, z) callback.
| Offset | Field | Type | Meaning |
|---|---|---|---|
| 0 | magic | u32 | 0x3158434D (the bytes MCX1) |
| 4 | tick | i32 | Game tick, strictly increasing |
| 8 | pingMs | i32 | Your ping to the game server |
| 12 | sensitivity | f32 | Mouse sensitivity option, 0–1 |
| 16 | pos x, y, z | 3 × f64 | Your position, world coordinates |
| 40 | prevPos x, y, z | 3 × f64 | Your position last tick; must equal the previous frame's pos |
| 64 | motion x, y, z | 3 × f64 | getDeltaMovement() |
| 88 | fallDistance | f64 | Blocks fallen since last on ground |
| 96 | yaw, pitch | 2 × f32 | Your view angles in degrees |
| 104 | eyeHeight | f32 | getEyeHeight() for your current pose (1.62 standing, 1.27 crouching) |
| 108 | health, absorption | 2 × f32 | Health 0–20 and absorption hearts |
| 116 | attackStrength | f32 | getAttackStrengthScale(0.5f), 0–1 |
| 120 | fireTicks | i16 | getRemainingFireTicks() |
| 122 | useTicks | u16 | Ticks you have been using an item (0 when not) |
| 124 | sinceTotemPop, sinceElytraDrop | 2 × u16 | Ticks since your totem popped / since you stopped wearing or flying an elytra; saturate at 1000 |
| 128 | hurtTime, foodLevel, rightClickDelay, invLock | 4 × u8 | Hurt ticks; hunger 0–20; vanilla rightClickDelay; ticks your inventory screen still owns the client (0 normally) |
| 132 | usingItem | u8 | Item id being used, 0 when not |
| 133 | flags | u8 | Bits: 0 onGround, 1 fallFlying, 2 sneaking (isCrouching()), 3 sprinting, 4 the use click you actually applied last tick |
| 134 | effects | u8 | Bits: 0 slow falling, 1 weakness |
| 135 | selected | u8 | Selected hotbar slot, 0–8 |
| 136 | chestWorn, chestStowed | 2 × u8 | Item in your chest slot; the other chest piece you carry (chestplate if any, else elytra, else 0) |
| 138 | offhandItem, offhandCount | 2 × u8 | Offhand item id and count |
| 140 | hotbarItem[9], hotbarCount[9] | 18 × u8 | Hotbar slots 0–8 |
| 158 | backpackItem[27], backpackCount[27] | 54 × u8 | Inventory slots 9–35 |
| 212 | oPos x, y, z | 3 × f64 | Opponent position as rendered |
| 236 | oPrevPos x, y, z | 3 × f64 | Opponent position last tick |
| 260 | oMotion x, y, z | 3 × f64 | Opponent getDeltaMovement() |
| 284 | oYaw, oPitch, oHealth | 3 × f32 | Opponent view angles and visible health |
| 296 | oHurtTime | u8 | Opponent hurt ticks |
| 297 | oFlags | u8 | Bits: 0 onGround, 1 sprinting, 2 sneaking, 3 swinging, 4 fallFlying, 5 elytra in chest slot, 6 shield raised (using a shield ≥ 5 ticks) |
| 298 | oEffects | u8 | Bits: 0 slow falling, 1 weakness (visible particles) |
| 299 | oMainItem, oOffhandItem | 2 × u8 | What the opponent holds in each hand |
| 301 | crystalCount, blastCount, projectileCount | 3 × u8 | How many entries below are used (≤ 12, 4, 4) |
| 304 | crystals[12] | 12 × (3 × f64, u8 own, 3 pad) | End crystals you can see, nearest first; own = 1 if you placed it |
| 640 | blasts[4] | 4 × (3 × f64, f32 radius, f32 damage, u16 age, 2 pad) | Last explosions, newest first: centre, radius (6 crystal, 5 anchor), health + absorption it took from you, ticks ago |
| 784 | projectiles[4] | 4 × (3 × f64, u8 type, 3 pad) | Pearls (1) and arrows (2) someone else threw |
| 896 | cubeX, cubeY, cubeZ | 3 × i32 | World position of the cube's first cell: floor(eye) − 6 on each axis |
| 908 | cube | 1099 bytes | 13 × 13 × 13 block ids around your eye, 4 bits each, low nibble first; cell (x, y, z) is index (y·13 + z)·13 + x |
| 2007 | colTop[169] | 169 × i16 | Column tops on the 13 × 13 columns around floor(pos), index (dz+6)·13 + (dx+6); value = top Y − floor(your Y) |
| 2345 | colId[169] | 169 × u8 | Block id of each of those top blocks |
| 2514 | foeTop[25] | 25 × i16 | Column tops on the 5 × 5 columns around floor(oPos), index (dz+2)·5 + (dx+2); value = top Y − floor(your Y) |
| 2564 | foeId[25] | 25 × u8 | Block id of each of those top blocks |
| 2589 | padding | 3 × u8 | Zero |
| Offset | Field | Type | Meaning |
|---|---|---|---|
| 0 | tick | i32 | The frame this answers |
| 4 | yawDelta, pitchDelta | 2 × f32 | Degrees to turn this tick. Apply verbatim |
| 12 | keys | u8 | As for sword: 0 forward, 1 back, 2 left, 3 right, 4 jump, 5 sprint, 6 sneak, 7 attack (swing at whatever the crosshair is on: a crystal or the opponent) |
| 13 | use | u8 | Bit 0: right-click once this tick (place, charge, detonate, throw, fire). Bit 1: hold the use key (eating, shield, crossbow) |
| 14 | slot | u8 | Hotbar slot to select before acting, 0–8; 255 leaves it as it is |
| 15 | inventory | u8 | 0 nothing; 1 the F key (swap main hand and offhand; sent when the held item is a totem and the offhand is not); 2 swap elytra and chestplate; 3 refill: offhand totem first, then each empty hotbar slot with what it held before, else totem, crystal, obsidian, golden apple, anchor, glowstone, pearl. 2 and 3 open your inventory for 5 ticks: report that countdown in invLock; replies are neutral until it ends |
| Item id | Items |
|---|---|
| 0 | empty |
| 1 | sword (any) |
| 2 | mace |
| 3 | obsidian (incl. crying) |
| 4 | end crystal |
| 5 | respawn anchor |
| 6 | glowstone |
| 7 | totem of undying |
| 8 | golden apple (incl. enchanted) |
| 9 | firework rocket |
| 10 | elytra |
| 11 | chestplate (any) |
| 12 | ender pearl |
| 13 | axe (any) |
| 14 | shield |
| 15 | wind charge |
| 16 | crossbow |
| 17 | arrow (incl. tipped, spectral) |
| 18 | pickaxe / shovel / hoe |
| 19 | experience bottle |
| 20 | potion (any) |
| 21 | helmet (any) |
| 22 | leggings (any) |
| 23 | boots (any) |
| 24 | building block (stone, cobblestone, dirt, netherrack, end stone, deepslate, gravel) |
| 25 | container (chests, shulker boxes, barrel) |
| 26 | glowstone dust |
| 27 | spear |
| 28 | bow |
| 29 | cobweb |
| 30 | utility (bucket, water bucket, book, player head, nether star, chorus fruit, bed…) |
| 31 | anything else |
from mca_client import Client, CrystalFrame, Crystal, item_id
with Client("mca_live_…", model="crystal") as bot:
f = CrystalFrame(pos=…, prev_pos=…, motion=…, yaw=…, pitch=…, tick=…,
hotbar=[(item_id(s.id), s.count) for s in hotbar], …,
crystals=[Crystal(c.pos, own=c.id in my_placements) for c in near])
f.fill_terrain(lambda x, y, z: block_id(world.get(x, y, z))) # your mapping
a = bot.step(f)
turn(a.yaw_delta, a.pitch_delta); press(a.keys)
if a.slot is not None: select(a.slot)
if a.use: right_click()
if a.inventory_op: inventory(a.inventory_op)
8. UHC models
uhc_v7 (UHC GRU v7) and uhc_gru (UHC GRU v1), 1.5 credits a minute
each on any paid account, play UHC with the full kit: rod, bow, crossbow, shield, lava and
water buckets, webs, blocks, golden heads and apples. v7 is the newer and stronger of the
two; both take exactly the same frames and send the same replies, so switching is only the
model id. Neither is the UHC BETA that comes with R1 RIVET and MONARCH, which is our first
UHC model. Session, ticket, pinning, control messages, errors and the reply are the same as
for crystal (section 7). The models have memory, and the frame below starts them fresh:
there is no need for new_fight.
Frames vary in size. A UHC frame carries the arena once, at the start of
each fight, and after that only what changed. The catalog lists frame_bytes: 0
for it. The ready message gives frame_limits (the smallest and largest frame
accepted) and uhc, a set of numbers you build frames with: sim_center,
stand_y, grid_y0, grid_h, the id table sizes, and
parity and flags (flags bit 0: the model was trained with
vanilla's player pushing on).
Arena coordinates. Every position is in a 64 × 64 arena frame. Choose an
offset for the fight so that the fight area falls inside x and z 0–64 (the middle is
sim_center) and the floor you stand on is at y = stand_y − 1.
Then subtract that offset from every position you send. The arena grid covers
grid_h (20) layers from y = grid_y0 up; above it is open sky.
| Part | Field | Type | Meaning |
|---|---|---|---|
| header | type | i32 | 1 = arena frame: the first frame of a fight. It carries the whole grid and starts the model's memory over; its tick may start again. 2 = a tick |
seq, tick, pingMs | 3 × i32 | Your frame counter (not checked); the game tick, strictly increasing within a fight; your ping | |
| type 1 only | grid | 81920 × u8 | Block ids of the 64 × 64 × 20 arena; cell (x, y, z) is index (y·64 + z)·64 + x, at world y = grid_y0 + y |
| changes | count, then entries | i32, count × (3 × i16, u8 id, u8 0) | Blocks that changed since the last frame, in arena coordinates (at most 1024) |
| you | self[42] | 42 × f64 | See the next table |
| inventory | kit[37] | 37 × (i16 item, i16 count) | Hotbar slots 0–8, the offhand at 9, inventory slots 9–35 at 10–36 |
| opponent | opp[15] | 15 × f64 | Position x, y, z; health; absorption; fire ticks; in water, in lava, in a cobweb (0/1); the item they are using; its use ticks (a bow's draw); crossbow loaded; shield cooldown; main-hand item; offhand item |
| opponent, as rendered | remote[15] | 15 × f64 | Position x, y, z; position last tick x, y, z; yaw; pitch; onGround; sprinting; sneaking; hurtTime; visible health (on servers that hide it, the name-tag health); swinging; swing time |
| counters | tally[2][12] | 24 × i32 | Yours, then the opponent's: bow shots, crossbow shots, bow hits, crossbow hits, golden apples eaten, heads eaten, food eaten, lava placed, water placed, webs placed, blocks placed, melee hits |
| arrows | count, then entries | i32, count × (6 × f64, i32 owner, i32 inGround) | Arrows in the arena (at most 32): position, motion, owner (0 you, 1 the opponent), stuck in the ground (0/1) |
| Index | Field | Meaning |
|---|---|---|
| 0–2 | pos x, y, z | Your position, arena coordinates |
| 3–5 | prevPos x, y, z | Your position last tick; must equal the previous frame's pos |
| 6–8 | motion x, y, z | getDeltaMovement() |
| 9, 10 | yaw, pitch | Your view angles in degrees |
| 11 | onGround | 0 or 1 |
| 12 | health | Health as your client shows it |
| 13, 14 | foodLevel, saturation | Hunger 0–20 and saturation |
| 15 | fallDistance | Blocks fallen since last on ground |
| 16, 17 | sprinting, sneaking | 0 or 1 (the keys) |
| 18 | attackStrengthTicker | Ticks since your last swing (vanilla's counter) |
| 19 | missTime | Vanilla's missTime |
| 20, 21 | hurtTime, invulnerableTime | Hurt ticks and damage-immunity ticks |
| 22, 23 | waterHeight, lavaHeight | Fluid height at your feet (0 when out of it) |
| 24, 25 | eyeInWater, inCobweb | 0 or 1 |
| 26 | fireTicks | getRemainingFireTicks() |
| 27 | absorption | Absorption hearts, as your client shows them |
| 28, 29 | regenAmplifier, regenTicks | Regeneration effect (amplifier −1 when none) and ticks left |
| 30 | absorptionTicks | Ticks left on the absorption effect |
| 31 | usingItem | Item id being used, 0 when not |
| 32 | useTicks | getTicksUsingItem() after this tick (1 on the tick a use starts) |
| 33 | crossbowLoaded | 0 or 1 |
| 34 | shieldCooldown | Ticks your shield stays disabled after an axe hit |
| 35 | selected | Selected hotbar slot, 0–8 |
| 36 | crouching | 1 while the crouching pose is on (it lags the sneak key) |
| 37 | serverHealth | Health the server reports (your real health) |
| 38 | inLava | 0 or 1 |
| 39 | invLock | Ticks your inventory screen still owns the client (0 normally) |
| 40 | rightClickDelay | Vanilla's rightClickDelay |
| 41 | serverAbsorption | Absorption the server reports |
The reply uses the crystal layout: keys, use (bit 0 click, bit 1 hold),
a hotbar slot (255 = leave it), and an inventory op. The ops are 1 = the F key (swap main
hand and offhand); 2 = restock, where each empty hotbar slot gets back what it started with
and used buckets are swapped for full ones; 3 = cycle tool, where the selected slot swaps
with the next inventory item the hotbar doesn't hold (bow, pickaxe, crossbow, axe, shovel,
cobblestone, planks, food, rod, …). Ops 2 and 3 open your inventory for 5 ticks: report it
in invLock, as for crystal. Auto-hold (eating, drawing the bow) and bucket
flicks come back as plain use, slot and turn values. Apply them verbatim.
| Item id | Items |
|---|---|
| 0 | empty |
| 1 | sword |
| 2 | mace |
| 3 | obsidian |
| 4 | end crystal |
| 5 | respawn anchor |
| 6 | glowstone |
| 7 | totem |
| 8 | golden apple |
| 9 | firework |
| 10 | elytra |
| 11 | chestplate |
| 12 | ender pearl |
| 13 | axe |
| 14 | shield |
| 15 | wind charge |
| 16 | crossbow |
| 17 | arrow |
| 18 | pickaxe |
| 19 | experience bottle |
| 20 | potion |
| 21 | helmet |
| 22 | leggings |
| 23 | boots |
| 24 | oak planks (and other building blocks) |
| 25 | container |
| 26 | glowstone dust |
| 27 | spear |
| 28 | bow |
| 29 | cobweb |
| 30 | other utility |
| 31 | anything else |
| 32 | water bucket |
| 33 | lava bucket |
| 34 | empty bucket |
| 35 | golden head |
| 36 | food (steak) |
| 37 | shovel |
| 38 | cobblestone |
| 39 | fishing rod |
| Block id | Blocks |
|---|---|
| 0 | air |
| 1 | bedrock |
| 2 | stone (and every other full solid block) |
| 3 | dirt |
| 4 | obsidian |
| 5 | respawn anchor 0 |
| 6 | respawn anchor 1 |
| 7 | respawn anchor 2 |
| 8 | respawn anchor 3 |
| 9 | respawn anchor 4 |
| 10 | fire |
| 11 | glowstone |
| 12 | oak planks |
| 13 | cobblestone |
| 14 | cobweb |
| 15 | grass block |
| 16–24 | water, level 0 (source) to 8 (falling) |
| 25–33 | lava, level 0 (source) to 8 (falling) |
9. Sienna
sienna (Sienna, Pro only, sharing the monthly premium minutes with V29) plays sword and pot
fights. She owns her attack timing (no charge gate), strafes, trades crits, and in a pot fight throws healing
potions, drinks buffs she lacks at quiet moments and refills her hotbar from her inventory. Session, ticket,
pinning, control messages and errors are the same as for the other models. She has memory, and a type-1
frame starts it fresh: there is no need for new_fight.
The frame is 304 bytes: two 32-bit integers, 71 floats (the fields below, in order), then 12 bytes for the hand. A fight is a pot fight once a healing splash potion is on your hotbar; it stays one until the next type-1 frame. Several fields are filled by the server itself, so every client feeds her exactly what she was trained on; send 0 (or 1 where the table says so) in those.
Continuity. Frames must follow the game: no position may jump more than 3 blocks between consecutive ticks, and your camera must turn as the replies say. Apply the turn verbatim, as for every model.
| Part | Field | Type | Meaning |
|---|---|---|---|
| header | type | i32 | 1 = the first frame of a fight (a new opponent or a new round): her memory starts over and the tick may start again. 2 = a tick |
tick | i32 | The game tick, strictly increasing within a fight | |
| state | f[71] | 71 × f32 | See the next table |
| hand | hotbar[9] | 9 × u8 | Hotbar slots 0–8: 0 empty, 1 sword, 2 axe, 3 healing splash potion, 4 a drinkable potion with a buff you lack or that ends within 5 seconds (speed, strength, regeneration, resistance, fire resistance, absorption, health boost; never one with a harmful effect), 5 any other splash potion, 6 anything else |
selected | u8 | The selected hotbar slot, 0–8 | |
flags | u8 | Bit 0: you are using an item (drinking). Bit 1: your inventory screen is open | |
backpackHeal | u8 | Healing splash potions in inventory slots 9–35 |
| Index | Field | Meaning |
|---|---|---|
| 0–2 | sx, sy, sz | Your position. Any origin fixed for the fight (where it started is fine): only differences are used |
| 3, 4 | syaw, spitch | Your view angles in degrees |
| 5–7 | sground, ssprint, ssneak | onGround, isSprinting, crouching pose (0/1) |
| 8 | shurt | Your hurtTime |
| 9 | sinv | Your damage-immunity clock as the client sees it: 19 on the tick your hurtTime rises, 9 on a tick your health rises, otherwise one less than last tick, down to 0 |
| 10 | shp | Your health |
| 11 | shp_known | 1 (the server sets it) |
| 12 | sabs | Absorption hearts |
| 13 | scharge | getAttackStrengthScale(0.5) |
| 14 | scharge_known | 1 (the server sets it) |
| 15–17 | sswing, susing, suse_prog | Swinging (0/1), using an item (0/1), use progress 0–1 |
| 18 | sheld | Send 1. In a pot round the server works it out from your hotbar |
| 19, 20 | sarmor, sweapon | The server sets them |
| 21 | sfood | Food level 0–20 |
| 22, 23 | shcol, svcol | horizontalCollision, verticalCollision (0/1) |
| 24–36 | se_*, k_* | Send 0. The server fills the pot-round fields from your hotbar |
| 37–39 | ox, oy, oz | The opponent's position as your client renders it, same origin as yours |
| 40, 41 | oyaw, opitch | Their view angles |
| 42–45 | oground, osprint, osneak, ohurt | onGround, sprinting, crouching pose (0/1), their hurtTime |
| 46 | ohp | Their health. On servers that hide entity health, send the number the server draws (the score under their name, the name tag), in health points, not hearts |
| 47 | ohp_known | 1 when ohp is a real number, 0 when you have none. A number that is plainly fake (it never moves through three of her hits, or rises as she hits) is set aside for the rest of the fight |
| 48, 49 | oswing, ousing | Swinging, using an item (0/1) |
| 50 | oheld | What they hold: 3 a splash potion, 0 nothing, 1 anything else |
| 51–54 | oarmor, oe_* | Send 0. The server sets them |
| 55 | pot_air | 1 when a thrown splash potion is within 32 blocks of you |
| 56–59 | pot_dx, pot_dy, pot_dz, pot_vy | The nearest one: its offset from you, and its vertical motion |
| 60–62 | ping_s, ping_o, ping_known | Your ping and theirs in ms (the tab list), and 1 if you have them |
| 63–68 | pa_fwd, pa_strafe, pa_jump, pa_sprint, pa_sneak, pa_attack | The keys you played last tick: forward minus back (−1/0/1), right minus left, then jump, sprint, sneak, attack (0/1) |
| 69, 70 | pa_use, pa_slot | Send 0. The server sets them |
The reply uses the crystal layout: keys, the turn, use (bit 0 click, bit 1 hold), a hotbar
slot (255 = leave it) and an inventory op. A throw comes as three replies: the slot of a healing potion, a use
click, then the slot back to your sword, with no attack on those ticks. A buff drink comes as the slot of the
potion, use held until the drink ends (keep flags bit 0 up to date), then the slot back.
Op 3 = refill: open your inventory, move healing splash potions from inventory slots 9–35 into empty hotbar
slots, close it, and report flags bit 1 while the screen is open; the replies meanwhile press
nothing. Apply everything verbatim.
10. Demo mod
A small Fabric mod (Minecraft 26.1.2, Fabric API, Java 25) that runs a sword model on your player, or measures how far behind the game the model's replies land from your connection. It is a complete, working example of this page: the session request, the pinned TLS connection, the WebSocket, the frame encoder and applying the replies are plain Java you can copy (MIT licence).
- mca-smoketest-1.1.1.jar
(SHA-256
7e732ebd9d7a3a38…) and its source. Put the jar and Fabric API inmods/. - On first launch it asks for your API key on the title screen. The key stays in
config/mca-smoketest.propertieson your computer, readable only by you. - In a world: F9 starts the AI: the model turns, moves, sprints, jumps and attacks for you; F9 again gives you back control. F10 runs a 30-second latency test that never moves you. F7 opens the control panel (model, API key, every keybind), F8 hides the HUD. All keys can be rebound in Controls.
- The AI fights the nearest player within 32 blocks, or, when nobody is near, the nearest hostile mob within 16 (switch that off in the panel), so singleplayer works. While it plays the AI owns the camera: the mouse is released until you press F9, because turns that are not the model's end the session.
- The HUD shows what it is doing, who it is fighting, frame-to-action latency (p50, p95), how many ticks a reply takes, lost replies and the cost per minute. Both the AI and the test are charged at the model's rate while they stream (V32: 1 credit a minute). The region is the one set on your key.