Filter entity event packets by entity id in TechHider

The processor for ClientboundEntityEventPacket used getEventId(), the
status byte (2 = hurt, 3 = death, ...), as the entity id. Events of
hidden entities therefore passed the filter, and events of visible
entities could be dropped when an unrelated hidden entity had the same
id. Use the entityId field instead.
This commit is contained in:
2026-10-27 09:24:45 +01:00
parent 0ef702da9e
commit 4943682a66
@@ -202,7 +202,7 @@ public class TechHider {
// 7.1.3 Entity Animation: entity id based signal, keep blocked until entity visibility is modeled.
processors.put(ClientboundAnimatePacket.class, this.buildEntityPacketProcessor(ClientboundAnimatePacket::getId));
// 7.1.35 Entity Event: entity id based signal.
processors.put(ClientboundEntityEventPacket.class, this.buildEntityPacketProcessor(ClientboundEntityEventPacket::getEventId));
processors.put(ClientboundEntityEventPacket.class, this.<ClientboundEntityEventPacket>buildEntityPacketProcessor(packet -> packet.entityId));
// 7.1.36 Teleport Entity: entity id and absolute position.
processors.put(ClientboundTeleportEntityPacket.class, this.buildEntityPacketProcessor(ClientboundTeleportEntityPacket::id));
// 7.1.42 Hurt Animation: entity id based signal.