Entities and players
How entities, players, the player list, combat events, riding and entity-related events differ between Java and
Bedrock, and how bedboo presents them through the mineflayer API. Observed on BDS 1.26.51.1 (protocol 2193,
bedrock-protocol 3.60.1) with wire probes (two bots, /summon, /querytarget, /ride, /damage, /kill,
setblock … destroy).
Entity positions on the wire
- Affects:
entity.positionof every entity but the bot,entitySpawn,entityMoved. - Java: spawn / move / teleport packets carry the feet position (or deltas of it).
- Bedrock (measured):
add_playeris feet level (a player standing on y = -59:add_player.position.y = -59,/querytargeteye -57.38), butmove_playerof other players is eye level (feet + 1.62, also while sneaking);add_entity,add_item_entity,move_entityandmove_entity_deltaare feet level plus a per-type offset: item 0.125, primed TNT and falling blocks 0.49, boats and chest boats 0.375, minecarts (all kinds) 0.35, every mob, armor stand, XP orb, arrow, end crystal 0;move_entity_delta(1.26.40+) carries ABSOLUTE coordinates, each one optional (absent = unchanged), and byte rotations (×360/256:rot_xpitch,rot_yyaw,rot_zhead yaw;/tp … 90 30of an armor stand →rot_x21,rot_y64);move_entity.rotationis already in degrees, in the same wire order (pitch, yaw, head yaw — PocketMine / gophertunnel / dragonfly) although bedrock-protocol labels the three bytesyaw,pitch,head_yaw; BDS 1.26.51.1 itself sent onlymove_entity_deltain every probe (teleported mobs, armor stands, minecarts, boats, arrows);- Bedrock clients simulate items between sparse updates (
set_entity_motion), so an item's last reported position can lag its resting place by a few tenths of a block.
- bedboo:
entity.positionis always the feet position: the per-type offsets (POSITION_OFFSETSinlib/plugins/entities.js) and the player eye height are removed per packet. Yaw / pitch /headYaware radians (mineflayer's notchian conversions);move_entity's labelledyawbyte is read as the pitch andpitchas the yaw.
Entity ids
- Affects:
entity.id,bot.entitieskeys, every entity event. - Java: one int entity id per entity; packets for unknown ids create the entity on the fly (
fetchEntity). - Bedrock: a runtime id (varint64, most packets) and a unique id (zigzag64;
remove_entity,set_entity_link,player_list,update_player_game_type;add_player.unique_idis an li64 that protodef reads as[high, low]). - bedboo:
entity.id = Number(runtime id);entity.runtimeId/entity.uniqueIdare BigInt and the pair is tracked inbot._bedrock.ids. Packets about runtime ids that were never added are ignored instead of creating empty entities at (0, 0, 0). After a dimension change every other entity is dropped (entityGoneeach), like the Java client discarding its old world.
Entity names, types and metadata
- Affects:
entity.name,displayName,type,kind,entityType,entity.metadata,entity.uuid,entity.getCustomName(). - Java: registry names/ids, metadata indexed by number, a UUID for every entity.
- Bedrock: identifiers like
minecraft:villager_v2,minecraft:xp_orb; metadata keys are names (flags,nametag,variant, …); only players have a UUID on the wire. - bedboo:
- name / displayName / type / kind / entityType / width / height come from
registry.entitiesByName(Bedrock names from the Bedrock data; typeshostile,animal,passive,ambient,mob,living,projectile,other,playerlike modern Java; an unknown identifier → typeother, name/displayNameunknown,entityType= the identifier); entity.metadata[<Bedrock key>](named properties of the metadata array, merged per packet);entity.uuidis set for players only;getCustomName()reads thenametagkey ('' = none) — a prismarine-entity patch;- Bedrock mobs such as foxes use the same sneaking flag as players:
entityCrouch/entityUncrouchfire for them, but only players get the crouching hitbox (1.5 high, eyes at 1.27); - extras:
entity.health(current health of living entities, fromminecraft:health),entity.countof XP orbs (experience_value),entity.sleeping.
- name / displayName / type / kind / entityType / width / height come from
Metadata, attributes and effects of the bot
- Affects:
bot.entity.metadata,bot.entity.attributes,bot.entity.effects,entityUpdate,entityAttributes,entityEffect/entityEffectEnd,entityCrouch/entityUncrouch,entityElytraFlew,entitySleep/entityWake. - Java: metadata indexed by number; attribute values are base values + modifiers.
- Bedrock: metadata keys are names (
flags,flags_extended,air,nametag, …);update_attributessends the CURRENT value (modifiers already applied) with min/max/default; effects use Bedrock ids. - bedboo:
bot.entity.metadata[<name>](named properties of prismarine-entity's metadata array); flags drivecrouching,sprinting,swimming,onFire,elytraFlyingand the sleeping events;- attributes are keyed by the Java resource name (from the Bedrock data),
valueis the base value recovered fromcurrentand the modifiers (minecraft:health→minecraft:max_health= its max), pluscurrent,min,max,default; Bedrock-only attributes keep their Bedrock name; - effects:
bot.entity.effects[<Bedrock id>] = { id, amplifier, duration }; set_healthsetsbot.entity.health.
The bot's player record
- Affects:
bot.player,bot.players[bot.username]. - Java: from player_info (skin textures, ping, gamemode).
- Bedrock:
player_list(before start_game) with raw skin images and no ping. - bedboo:
{ username, uuid, displayName, gamemode, ping: 0, entity, skinData: undefined }. Every other player: see the player list.
Player list
- Affects:
bot.players,bot.player,bot.uuidToUsername,playerJoined,playerUpdated,playerLeft,player.ping,player.gamemode. - Java: player_info add / update_game_mode / update_latency / update_display_name / remove.
- Bedrock:
player_listadd / remove only — the players already online arrive BEFOREstart_game, the last record of a packet may be truncated (maybeIncompleteArray); no latency; game mode changes come asupdate_player_game_type { gamemode, player_unique_id }(BDS sends it to every player); a re-sent record (the full list after the bot's own join) is an update. - bedboo:
- records received before
start_gameare applied after its reset (upstream resets the lists on login), once that login'sloginandgameevents were handled (upstream's order: player_info follows the login packet, sobot.gameis set) —playerJoinedfires for each, the bot included; - truncated records are ignored;
pingis 0; gamemodestarts at the world default (the bot: its start_game mode) and followsupdate_player_game_type(playerUpdated);playerUpdatednever fires for latency / display names.
- records received before
Display names
- Affects:
player.displayName. - Java: player_info carries an optional display name (team prefixes,
update_display_name). - Bedrock:
player_listhas no display name; name tags are entity metadata. - bedboo:
player.displayNameis always the username (aChatMessage, like upstream's default).
Skins
- Affects:
player.skinData. - Java: a
texturesproperty (base64 JSON or mojangson) →{ url, model, capeUrl }. - Bedrock:
player_listcarries raw skin images (RGBA buffers, geometry JSON), no texture URL. - bedboo:
skinDataisundefinedfor every player; malformed or truncated skin records never throw.
Hurt and death
- Affects:
entityHurt,entityDead. - Java:
damage_event(1.20+; with the source entity) for every damage,entity_status 3for the death. - Bedrock:
entity_event hurt_animation(data = damage cause, no source entity) for non-lethal damage; the lethal hit (and/kill) sendsdeath_animationonly. - bedboo:
hurt_animation→entityHurt(entity)(nosourceargument: Bedrock does not say who hit; see who hit whom);death_animation→entityHurt(entity)for the killing blow (unless a hurt_animation for it came in the same packet batch, i.e. the same server tick — batches are counted at bedrock-protocol's batch entry points, not per event-loop turn, so batches read back to back stay apart) thenentityDead(entity), matching Java's damage_event + status order. The local player gets both too.
Who hit whom: entityHurt has no source
- Affects: combat code that wants to know whether its own hit killed a mob (e.g. the combat library of
@bedboo/agent). - Java:
damage_eventcarries the source entity (entityHurt(entity, source)in newer mineflayer). - Bedrock:
entity_event hurt_animation/death_animationcarry no attacker (see hurt and death). - bedboo: unchanged events.
@bedboo/agent's combat library attributes a kill to the bot when the target'sentityDeadcomes within 1.5 s of one of the bot's ownattack()s (3 s of one of its arrows) after at least oneentityHurt, with no other damage source around.
Combat on Bedrock
- Affects:
bot.attack,bot.activateItem/deactivateItem(bow, shield), mineflayer-pvp-style fighting. - Java: since 1.9 an attack cooldown scales the damage of fast hits; a raised shield is an item use.
- Bedrock: no attack cooldown (every hit does full damage), but a hurt mob ignores damage for 10 ticks; a shield
blocks while the player sneaks; arrows never hurt endermen (they teleport away);
/summon slime … minecraft:spawn_largeonly sets the hitbox — the split count follows the size variant (1, 2 or 4). - bedboo: the API is unchanged (
activateItemwith a shield sneaks: see item use and item use slowdown).@bedboo/agent's combat library attacks every 10 ticks and never shoots endermen.
Entity events
- Affects:
entityTaming,entityTamed,entityShakingOffWater,entityEatingGrass,entityEat,entitySwingArm,entityWake,entityCriticalEffect,entityMagicCriticalEffect. - Java:
entity_status6/7/8/10 andanimation0/2/3/4/5. - Bedrock:
entity_eventtame_fail/tame_success/shake_wet/eat_grass_animation/eating_item/arm_swing(mob attacks) andanimateswing_arm/wake_up/critical_hit/magic_critical_hit. - bedboo: mapped one to one.
entityEatcomes fromeating_item, which BDS sends for animals eating (a wolf fed a bone) — upstream'sentityEat(animation 3) never fires on modern Java either. Like Java, the bot's own swing is not echoed asentitySwingArm.entityWakefires once per wake-up (the metadata or the animation).
Hand swap
- Affects:
entityHandSwap. - Java:
entity_status 55when a player swaps main hand and off-hand. - Bedrock: there is no such event; the swap shows up as
mob_equipmentchanges. - bedboo:
entityHandSwapnever fires;entityEquipreports the new equipment.
Sleeping players
- Affects:
entitySleep,entityWake,entity.sleeping. - Java: metadata pose = sleeping; animation 2 on wake-up.
- Bedrock (measured): a sleeping player has
player_flagsbit 1 (value 2) andplayer_bed_position; theflags_extended"sleeping" bit (as named by bedrock-protocol) stays clear for players. Other entities:flags_extended. - bedboo:
entitySleep/entityWakeon the transitions ofplayer_flagsfor players and offlags_extended.sleeping for other entities (an update without the key changes nothing). The bot itself followsplayer_flagstoo once it has seen one (lib/bedrock/entity_data.js).
Swinging the arm
- Affects:
bot.swingArm(arm, showHand). - Java:
arm_animationwith the hand (main / off-hand), or no hand on 1.8. - Bedrock: a single
animate swing_arm(no off-hand swing animation, no hidden swing); 1.21.130+ adds an optional swing source. - bedboo:
swingArm()sendsanimate swing_armfor either arm;arm/showHandare accepted and ignored.attackswings with sourceattacklike the vanilla client.
Attacking and using entities
- Affects:
bot.attack,bot.useOn,bot.mount,bot.dismount. - Java:
use_entity(attack / interact) or the 1.21.2+attackpacket; dismount with the jump input. - Bedrock:
inventory_transaction item_use_on_entity(attack / interact) carrying the exact held item and the player position; the vanilla client hovers the entity first (interact mouse_over_entity); getting off isinteract leave_vehicle. - bedboo:
- like upstream the bot's view is left alone (BDS accepts attacks and interactions whatever the player faces, verified live: an attack on a zombie behind the bot, a boat mounted behind it);
- the bot hovers the target when it changed, then sends the transaction (
click_posrelative to the target's feet; held item frombot._bedrock.heldNetworkItem());attackswings first (vanilla order); - the packets go through
bot._bedrock.physics.afterControlsSent: at once, or — while a sneak / sprint change is not in a sent player_auth_input yet — right after the next one (upstream sends entity_action synchronously in setControlState; see sneak / sprint before a click); - same synchronous API and return value as upstream.
dismount()without a vehicle emitserrorlike upstream.
Vehicles
- Affects:
bot.vehicle,entity.vehicle,entity.passengers,mount,dismount,entityAttach,entityDetach,bot.moveVehicle. - Java:
attach_entity/set_passengers. - Bedrock:
set_entity_link { ridden_entity_id, rider_entity_id (unique ids), type: 0 remove, 1 rider, 2 passenger }, also insideadd_entity.links/add_player.linksfor entities spawned riding. - bedboo: links update
vehicle/passengersand emitentityAttach(passenger, vehicle)/entityDetach(passenger, vehicle); for the botbot.vehicle+mount/dismount(vehicle). A repeated link is ignored. When the vehicle is removed under the bot,dismount(vehicle)fires (upstream registers that handler on the protocol client, whereentityGonenever fires — bedboo implements the intended behaviour).moveVehicledrives the vehicle through the per-tick input (bot._bedrock.input.setVehicle) and belongs to the physics plugin: see vehicles and riding control.
Getting off a boat or minecart
- Affects:
bot.dismount(),dismount/forcedMoveevents,bot.entity.positionafter a ride. - Java: the server computes a dismount position (DismountHelper: a free spot around the vehicle, else on top of it) and teleports the rider there.
- Bedrock: BDS sends no teleport when a rider leaves a boat or a minecart (a horse rider may get a correction).
The rider sits at the vehicle's seat (
rider_seat_position, 1.02 above the vehicle's wire position, eye level), which puts its feet 0.1 into the block under a minecart on rails and 0.225 into the ground under a boat on land. BDS itself lifts its copy of the rider straight up out of that block (measured: a correction to the seat x/z on top of the block when the client reports anything else). - bedboo: like BDS: on
dismountthe rider is raised from its seat until its box is free (a seat that is free — a boat on water — stays); the move is emitted like a teleport (forcedMove) and goes out with the next input, so the server's position equals the bot's and the bot can walk away (it does not stay buried one block down).
The rider's seat across rides
- Affects:
bot.entity.positionwhile riding. - Java: the client does not move a passenger itself (mineflayer keeps the position at the mount point).
- Bedrock: the rider's position is its vehicle's seat. BDS sends
rider_seat_position(actor data) only when it changes: the join's actor data has (0, 0, 0), the first boat or minecart sets (0, 1.02, 0), and later boats and minecarts send nothing. - bedboo: the last seat is kept across rides (boat → minecart → boat: the rider follows its vehicle every time); a seat that is still unknown falls back to the boat / minecart seat or the top of the vehicle.
The rider's position
- Affects:
bot.entity.positionandmovewhilebot.vehicleis set, the position afterbot.dismount(). - Java: the client simulates the vehicle and the rider sits on it.
- Bedrock: BDS simulates the vehicle from the rider's input and keeps the rider at the vehicle's seat: vehicle
position + the
rider_seat_positionactor data (measured on BDS 1.26.51.1: boat seat (0, 1.02, 0) above the boat's wire position = feet 0.225 below the boat's feet; horse (0, 2.32, −0.2) = feet 0.7 above, 0.2 behind). It sends a vehicle correction every 6 ticks and does not always teleport a boat rider on dismount (it keeps the reported position). - bedboo: while riding, every
player_auth_inputreports that seat (the vehicle's latest position from move_entity or a vehicle correction, the seat rotated by the vehicle's yaw) andbot.entity.positionfollows it (movefires as the vehicle moves); vehicle physics is not predicted. Seat offsets along x / z are rotated by the vehicle's reported yaw: the measured single-rider seats have none; a two-rider boat's seats are not verified. The rider stays at the seat and gets off next to the boat / horse.
Equipment and armor attributes
- Affects:
entity.equipment,entity.heldItem,entityEquip,bot.getExplosionDamages(entity, …). - Java:
entity_equipmentslots 0 main hand, 1 off-hand, 2 feet … 5 head, 6 body; armor / armor toughness are synced attributes. - Bedrock:
mob_equipment(windowinventory= main hand,offhand) andmob_armor_equipment { helmet, chestplate, leggings, boots, body }; no armor attributes are sent. - bedboo: same equipment indexes as upstream (0 hand, 1 off-hand, 2 boots, 3 leggings, 4 chestplate, 5 helmet,
6 body). Living entities, players and the bot get live
generic.armor/generic.armorToughness(what upstream's explosion plugin reads) andminecraft:armor/minecraft:armor_toughnessattributes computed from the worn items (armor points and toughness per item from minecraft.wiki; enchantments not counted, as upstream). Non-living entities have none (getExplosionDamagesreturns null for them, like upstream).
Dropped items
- Affects:
entity.getDroppedItem(),itemDrop,playerCollect. - Java: the item stack is an item entity metadata entry;
itemDropfires on that metadata;collectpacket. - Bedrock:
add_item_entitycarries the item (ItemV4);take_item_entity { runtime_entity_id: the item, target: the collector }, thenremove_entity. Stacks lying close together merge:entity_event item_entity_merge { data: the new stack size }on the surviving item, thenremove_entityof the absorbed one (no metadata update). - bedboo: the wire item is kept as
entity.metadata.item; the prismarine-entity patch makesgetDroppedItem()read it on Bedrock (prismarine-itemfromNotch);itemDropfires right after the item'sentitySpawn; a merge sets the new count and firesentityUpdate+itemDroplike Java's item stack metadata update;playerCollect(collector, collected)with the item still readable.
Paintings
- Affects:
bot.blockAt(pos, true).painting, mineflayer'sPainting. - Java:
spawn_entity_painting(≤ 1.18; title / motive id, block position, direction) — 1.19+ paintings are ordinary entities. - Bedrock:
add_painting { coordinates (the painting's center), direction 0-3, title }(titlesKebab,SkullAndRoses, …). - bedboo: both: a
paintingentity inbot.entities(entitySpawn/entityGone) and aPainting(id, floored center, name, direction vector)registered in the world;nameis the modern Java variant name (kebab,skull_and_roses, …), the direction vector uses upstream's table.
Firework boosts
- Affects:
usedFirework,bot.fireworkRocketDuration. - Java: the rocket's
attached_to_targetmetadata names the boosted player. - Bedrock: a boosting rocket is
add_entity minecraft:fireworks_rocketwithowner_eid-1 and names the boosted player's unique id in metadata key 18 (minecart_has_displayin bedrock-protocol's names, a long for rockets); its item NBT is the display item (metadata key 16,Fireworks.Flight). - bedboo: a
fireworks_rocketattached to (key 18), owned or shot by the bot while the bot is gliding counts as a boost:usedFirework(rocketId)once per rocket and the upstream duration formula from the item'sFlight. The physics side of a boost: see elytra.