Skip to content

Network Protocol Error near hitboxes: armor-stand metadata applied to ItemDisplay (26.1.2) #445

Closed

Description

@janvitos

Summary

Players near a custom crocodile model repeatedly receive Network Protocol Error. The client receives metadata consistent with BetterModel's hidden armor-stand hitbox for an entity advertised as an ItemDisplay. Reproduced with different entity IDs, two launchers, and two client versions; unrelated to /shop.

Environment

  • BetterModel 3.5.1-SNAPSHOT-525, Paper 26.1.2 build 74, Java 25, NMS V26_R1
  • MythicMobs 5.13.0: model applied to a ZOMBIE on ~onSpawn and ~onLoad
  • ProtocolLib 5.5.0-SNAPSHOT, ViaVersion/ViaBackwards installed
  • Model has a hitbox bone with a 44×16×39 cube and an h_head bone

Client error

ClientboundSetEntityDataPacket[id=288512, packedItems=[
  DataValue[id=0, value=32], DataValue[id=4, value=true], DataValue[id=9, value=20.0]]]
IllegalStateException: Invalid entity data item type for field 9 on entity ItemDisplay:
old=0(Integer), new=20.0(Float)

Findings

From inspecting the installed plugin/Paper bytecode and V26_R1 source—not runtime instrumentation:

  • HitBoxImpl extends ArmorStand through AbstractHitBox and implements HitBox. The NMS HitBoxInteraction does not implement HitBox (only its Bukkit wrapper does). The spawn rewrite therefore targets the armor stand.
  • 9=20.0 matches LivingEntity health; 0=32 and 4=true match invisible/silent flags. My initial interpretation as Interaction height was incorrect.
  • The channel handler advertises a hitbox as ITEM_DISPLAY, but metadata replacement with hitBoxData depends on registry/live entity lookup. If both lookups return null, the original packet passes through unchanged.
  • The live lookup uses the player's current world. Removal/despawn, chunk unloading, or world changes before queued packets are processed could therefore break the rewrite. The exact runtime trigger is not yet confirmed.
  • Ordinary bundles are recursively handled; there is no evidence that disabling bundling fixes this.

Workaround

Renamed hitbox to hitbox_disabled and deleted its cube (renaming alone rendered a missing-texture cube), then ran bettermodel reload. The model looks normal and hits still register using the smaller vanilla mob hitbox. No further kick during a short test; long-term validation is pending.

Suggested fix (unverified)

Track IDs advertised as fake ItemDisplays per connection, rather than relying on live entity lookup for subsequent metadata rewriting. Use the same state for hitbox attribute/equipment suppression; clear IDs on outgoing removal in packet order and release state on disconnect.

Regression tests should cover despawn/removal with queued metadata, chunk unload/reload, world changes, and remove/re-spawn ordering, including bundles. Raw armor-stand metadata must never reach an entity advertised as an ItemDisplay.

Activity

  1. changed the title [-]Clients kicked with "Network Protocol Error": Interaction entity data sent for hitbox faked as ItemDisplay (26.1.2)[/-] [+]Clients kicked with "Network Protocol Error": armor-stand metadata sent for hitbox faked as ItemDisplay (26.1.2)[/+] on Sep 30, 2026
  2. changed the title [-]Clients kicked with "Network Protocol Error": armor-stand metadata sent for hitbox faked as ItemDisplay (26.1.2)[/-] [+]Network Protocol Error near hitboxes: armor-stand metadata applied to ItemDisplay (26.1.2)[/+] on Sep 30, 2026
  3. Rabusek commented on Nov 1, 2026

    @Rabusek

    Same crash on 26.2 (V26_R2) with BetterModel 3.5.0 and MythicMobs 5.13.0 on a Purpur-based server. A packet capture on the backend shows the runtime trigger: the modeled mob despawns right after it spawns, and the hitbox's first metadata update is sent in the same burst as its removal.

    Trigger

    • A MythicMobs random spawn (Action: ADD, mob with Despawn: true and a model with a hitbox bone) can place the mob more than 128 blocks away (3D, the hard despawn range) from every player. The server then removes it almost immediately, and BetterModel removes the hitbox with it.
    • The hitbox's first metadata update (0=32, 4=true, 9=20.0) goes out just before the remove packet. As described above, the live lookup misses, so the raw armor-stand metadata reaches a client that knows the entity as an ITEM_DISPLAY.
    • For us it mostly hits players flying or standing on peaks around y ≥ 190 above oceans. Sea-level spawns at y = 62.5 are then always more than 128 blocks away.

    Capture. Decoded backend traffic. Times are ms before the client closed the connection.

    -122  add_entity       2601770            base mob (shark model on a dolphin), y=62.5
    -122  add_entity       2601771..2601777   item_display bones; set_passengers 2601770 -> bones
    -121  add_entity       2601778            item_display = rewritten hitbox, y=62.5
    -121  set_entity_data  2601778 [10=3]     hitBoxData, the rewrite worked here
    -121  add_entity       2601779            hitbox interaction
    -118  set_entity_data  2601778 [0=32, 4=true, 9=20.0F]    <- raw armor-stand data
    -118  remove_entities  2601770, bones, 2601779, 2601778   mob and model removed
       0  client closes the connection
    

    A second capture shows the same sequence 79 ms before the close (entities 2602310–2602319, again spawned at y = 62.5). A client report from a third occurrence has the error from this issue: Invalid entity data item type for field 9 on entity <Item Display> ... at y=62.50: old=0(Integer), new=20.0(Float).

    Workaround without editing models: add - playerwithin{d=100} true to the conditions of every random spawn whose mob uses a model. Mobs then never spawn where they would despawn at once. MythicMobs' PlayerWithin uses 3D distance. We applied it today, so it isn't validated long-term yet.

    #468, which tracks the fake hitbox ids per connection until the removal is sent, covers this exact ordering: the entity is removed before its queued metadata is processed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions