Player state and survival
Death and respawn, dimension changes, experience, abilities, the spawn point, and the survival interactions beds, fishing and books. Observed on BDS 1.26.51.1 (protocol 2193) with bedrock-protocol 3.60.1.
Respawn handshake
- Affects:
bot.respawn(), therespawnoption,isAlive,death/respawn/spawnevents. - Java: death =
update_health≤ 0;client_command(perform respawn) → serverrespawnpacket →update_health→spawn. - Bedrock: death = the player's own
entity_event death_animation+minecraft:healthattribute 0 (noset_health0), thenrespawnstate 0 (searching) at the death position. Respawning is a 3-step handshake: clientrespawnstate 2 (client_ready; ignored by BDS when sent before the server's state 0) → serverrespawnstate 0 + state 1 (ready, eye-level spawn position) → clientplayer_action respawn→ serverentity_event respawn+set_health 20. A respawn into another dimension (death in the nether, spawn in the overworld) puts achange_dimensionwithout loading_screen_id between the client state 2 and the server state 1; answering it withserverbound_loading_screengets the client disconnected (unexpected_packet). - bedboo: same API and event order as upstream (
health→death;respawnat the server's state 1, the analog of Java's respawn packet;spawnonce the server's health update says the player is alive, from the lifecycle).bot.respawn()sends state 2 once per death (waiting for the server's state 0 if needed); therespawn: falseoption keeps the bot on the death screen. The lifecycle sends no loading screen ack for achange_dimensionwithout loading_screen_id and completes a dimension change during a respawn withoutspawn: onerespawnand onespawnper death, also across dimensions. The join's and the End exit's respawn packets are not deaths. For the position atspawnafter a respawn into another dimension see spawn search height.
Creative players cannot die
- Affects:
/kill(or any damage) on a bot in creative mode; setting the game mode of a dead bot. - Java:
/killkills a creative player. - Bedrock: "Players cannot be killed while they are in Creative mode" (not even by
/damageor the void), and a game mode cannot be set on a dead player ("No targets matched selector"). - bedboo: nothing to change in the library. Switch the bot to survival or adventure before killing it; a non-default game mode (e.g. adventure) survives the respawn.
Dimension change, End credits
- Affects:
bot.game.dimension,respawn/game/spawnevents on a dimension change, the End exit portal. - Java: a
respawnpacket with another dimension (+game_state_change win_gamefor the credits, skipped withclient_command). - Bedrock:
change_dimension(the feet position for/execute in … tp; a junk position followed by amove_playerreset for portals) → clientplayer_action dimension_change_ack→ serverdimension_change_ack→ clientserverbound_loading_screen1 / 2 with the loading_screen_id. Leaving the End through the exit portal: BDS first sendsshow_credits {status: 0}(only the first time a player leaves the End) and waits, forever, for the client'sshow_credits {status: 1}before thechange_dimension(respawn: true) to the overworld. - bedboo: like upstream:
gamethenrespawn(isAlive false) at the change,spawn(isAlive true) when the new dimension is loaded; the credits are skipped at once (show_creditsstatus 1), like upstream'sclient_command. Portal travel works by standing inportal(nether portal, Bedrock's name; a survival player needs ~4 s, a creative one ~1.5 s) andend_portalblocks. How the world is reset and which heights apply: dimensions.
Waiting for a tick across a dimension change
- Affects: code that walks into a portal with
await bot.waitForTicks(1)in its loop. - Java: physics ticks go on through a respawn into another dimension.
- Bedrock: bedboo pauses physics while the player changes dimension (
change_dimension→ dimension change ack →player_spawn; the End exit also shows the credits). - bedboo:
bot.waitForTicks(1)waits through the change and rejects after 5 s ("Timeout waiting for 1 ticks"), although the bot arrived. A portal walk should wait for the next tick or for thegame(the dimension switched),spawn,respawnordeathevent, whichever comes first, and await the arrival onspawnin the new dimension (the bedboo agent'sutil.tick(bot)does this and never rejects).
Experience points
- Affects:
bot.experience.points. - Java: the server sends the total experience.
- Bedrock:
update_attributesminecraft:player.levelandminecraft:player.experience(bar progress) only. - bedboo: points = the XP needed for the level + progress × the XP of the next level (the curve Bedrock shares
with Java;
/xp 10→ level 1 + 3/9 → 10 points). Points spent on enchanting are not distinguishable.
Abilities
- Affects:
bot.abilities,abilitiesevent. - Java: an
abilitiespacket with flag bits on join and on every game mode change. - Bedrock:
update_abilitieswith ability layers (base, spectator, commands, editor, loading screen: allowed / enabled sets, fly / walk speeds) at join and on permission changes. On/gamemodethe client derives the game mode's abilities itself; BDS sendsupdate_abilitiesonly when the flight changes. BDS sends it twice in answer to arequest_ability, and after a game mode change that changes the flight (flying → survival, into / out of spectator), repeating values the bot already has (measured on BDS 1.26.51.1). In spectator BDS's layers clearmayFlywhileflyingstays on. - bedboo: the layers are merged (a layer decides the flags it allows; later layers override). On a game mode
change the abilities follow the Java server's
GameType.updatePlayerAbilities(creative: mayFly, instantBuild, invulnerable; spectator: + flying, no instantBuild; survival / adventure: none) andabilitiesis emitted once, like Java. Anupdate_abilitiesthat changes nothing emits noabilitiesand keeps thebot.abilitiesobject (the join's first one is always reported).bot.abilitiesis the only flight state source: the physics engine follows it without sendingrequest_abilityback (flight).
Spawn point
- Affects:
bot.spawnPoint. - Java:
spawn_position= the world spawn (compass target), with its real height. - Bedrock:
start_game.spawn_position(the world spawn; y = 32767 while the height is not fixed: the server searches the highest safe block when someone spawns there) andset_spawn_positionwithspawn_typeworld(/setworldspawn) orplayer(bed, respawn anchor,/spawnpoint; never sent by Java). - bedboo:
bot.spawnPoint= the world spawn (start_game, thenworldupdates +game); the player's own respawn point does not change it. A 32767 height is resolved once the spawn column is loaded: spawn search height.
Beds, sleeping and spawnReset
- Affects:
bot.sleep,bot.wake,sleep/wakeevents,bot.isABed,bot.parseBedMetadata,spawnReset. - Java: 16 coloured bed blocks with facing / part / occupied states; sleep = use the bed;
entity_action leave_bedwakes; the sleeping state is the player's pose metadata;game_state_change no_respawn_block_available. - Bedrock:
- One
bedblock (the colour is in the block entity; plusstraw_bed) withdirection(0 south, 1 west, 2 north, 3 east),head_piece_bit,occupied_bit. The first item whose name ends in "bed" isstraw_bed, not the bed. - Sleep = item use
click_blockon the bed. The server answers withset_entity_dataplayer_flagsbit 1 +player_bed_position(the head), moves the player into the bed with acorrect_player_move_prediction(feet ~0.7 below the bed top, in the head block's centre) and marks the headoccupied_bit; a creative player can sleep too.player_action stop_sleepingwakes the player (animate wake_up+player_flags0, a correction next to the bed). With nobody waking the player, BDS ends the sleep itself after 100 ticks (the night is skipped whendoDaylightCycleis on; the clock jumps to the morning). /setblockof a bed always places the whole bed: the given position becomes the head and the foot goes behind it (head_piece_bitis ignored; e.g./setblock <head> bed ["direction"=0]); removing one half breaks the other.- A respawn whose bed / anchor is gone is announced with the
tile.bed.notValid/tile.respawn_anchor.notValidmessage, and not at all when the fallback is the bed spawn's own position.
- One
- bedboo:
isABedmatchesbedand*_bed;parseBedMetadatareturns upstream's shape from the Bedrock states;spawnResetis emitted on those messages.sleep()runs upstream's checks in upstream's order and with its messages (time / thunderstorm, already sleeping, not a bed, occupied, half a bed,canDigBlockreach, click range, hostile mobs);activateBlockis awaited (Bedrock's is asynchronous); 'bot is not sleeping' after 3 s.wake()sendsplayer_action stop_sleepingand resolves at once, like upstream.
A bed placed a moment ago is "half a bed"
- Affects:
bot.sleep(bed)right afterbot.placeBlockplaced the bed. - Java: the server places both halves with one block change each; a client sees both before it can click.
- Bedrock: the foot and the head arrive as two separate
update_blocks (observed on BDS 1.26.51.1). - bedboo: a
bot.sleep()issued as soon as the clicked cell holds a bed is refused with upstream's "there's only half bed" (bot.isABedof the other half is still false), and works a tick later. Wait (≤ 20 ticks) until both cells are beds, and trysleepagain after such a refusal. Sleeping then behaves as in beds.
Fishing
- Affects:
bot.fish(). - Java: cast / reel in with use_item; the bobber is a
fishing_bobberspawn_entity; a bite shows as 6fishing/bubbleparticles next to the bobber (world_particles), which upstream detects. - Bedrock: cast / reel in = item use
click_airwith the rod. The bobber isadd_entity minecraft:fishing_hookwhoseowner_eidmetadata is the caster's unique id. While waiting, the hook sendsentity_event fish_hook_tease(fish nearby) and thenfish_hook_positionwithfish_x/fish_zmetadata (a fish swimming in, ~1–3 s); the bite isentity_event fish_hook_hookon the hook. Reeling in then drops the catch as anadd_item_entityflying to the player (collected withtake_item_entity) plus XP orbs, and removes the hook (remove_entity).- Measured waits (cast →
fish_hook_hook, open water,/enchantlevels): Lure 0 clear 6.3–32.3 s (mean 20.7, n=10); Lure 0 rain 6.0–20.9 s (12.1, n=8); Lure III clear 2.5–12.7 s (5.9, n=8); Lure III rain 1.9–12.2 s (5.7, n=14). The base window matches Java's 100–600 ticks (+ the fish swimming in), sofishingBiteDelayMaxTicks: 600(feature table) holds; Lure lowers it by ~5 s per level like Java. - Bedrock's
/givecannot carry enchantments and/enchantcaps Lure at III (/give @s fishing_rod+/enchant @s lure 3); BDS tells a creative player nothing about an/enchant.
- Measured waits (cast →
- bedboo: upstream's task logic and messages are unchanged; the bobber is the first
fishing_hookthe bot owns afterfish()(another player's bobber is ignored; upstream takes any bobber), and the bite isfish_hook_hookon it. Like upstream,fish()has no time limit of its own.
Books
- Affects:
bot.writeBook,bot.signBook. - Java:
edit_book { slot, pages[], title? }with the whole book, up to 100 pages; pages are NBT strings (nbt.value.pages.value.value= the page texts); the server echoes the edited slot. - Bedrock:
- The book must be opened first: an item use (
click_air) of the heldwritable_book(a new book then comes back with an emptypageslist); edits that reach the server in the same tick as the use are dropped. - Edits go page by page:
book_edit { inventory_slot: hotbar slot, type: replace_page | add_page | delete_page | swap_pages, page_number, text, photo_name }; signing isbook_edit { type: sign, title, author, xuid }. BDS sends nothing back for an edit; closing the book (item_release) makes it resend the book (new stack id). - Item NBT:
pages: [{ text, photoname }](read the texts aspages.value.value.map(p => p.text.value), not as a list of strings); a written book addsauthor,title,xuid('' offline) andgeneration0. An 18-character title is accepted. - BDS keeps at most 50 pages and drops the rest.
- The book must be opened first: an item use (
- bedboo: upstream's checks, messages and slot handling (the book is moved to hotbar slot 0 and held, then the
held slot / book slot are restored). The edit is one session: open →
book_edits (only the pages that change, extra pages deleted from the end) → (sign) → release, acknowledged by the resent book holding the requested pages (or the written book); an unacknowledged session is retried once with a longer open delay (20 s in total, like upstream's acknowledgement timeout).writeBookwith the book's own pages sends nothing. More than 50 pages are refused at once (too many pages: a Bedrock book holds at most 50 pages), before anything is moved; a failed edit still restores the held slot and puts the book back.