Add 26.3 punch and swing animation packets

This commit is contained in:
Tanner committed 2026-11-05 15:26:55 +00:00
1 parent 0e3b556628
commit ce1a35b896
1 file changed
+25
+25
View File
@@ -188,6 +188,23 @@ class PlayerLoaded(Packet):
definition = []
class EntityAnimationPacket(Packet):
"""Legacy clientbound entity animation event."""
id = 0x02
packet_name = "entity animation"
definition = [{'entity_id': VarInt}, {'animation': UnsignedByte}]
class EntitySwingAnimationPacket(Packet):
"""26.3 item-aware swing animation sent to tracking clients."""
id = 0x7B
packet_name = "entity swing animation"
definition = [
{'entity_id': VarInt}, {'hand': VarInt},
{'animation_type': VarInt}, {'duration': VarInt},
]
class PaletteSection:
"""Decoded paletted container for a 26.3 chunk section."""
def __init__(self, bits, palette, words, size):
@@ -825,6 +842,13 @@ class PlayerActionPacket(Packet):
]
class PunchPacket(Packet):
"""Serverbound punch/arm-swing event (protocol 777)."""
id = 0x2E
packet_name = "punch"
definition = []
class SetCarriedItemPacket(Packet):
id = 0x36
packet_name = "set carried item"
@@ -1135,6 +1159,7 @@ class ModernPlayingReactor(PacketReactor):
ChunkCacheCenterPacket, ChunkCacheRadiusPacket,
PlayGameEventPacket,
ClientboundChunkBatchFinished, ClientboundPlayerChatPacket,
EntityAnimationPacket, EntitySwingAnimationPacket,
BlockChangedAckPacket, AddEntityPacket, RemoveEntitiesPacket,
MoveEntityPositionPacket,
MoveEntityPositionRotationPacket, MoveEntityRotationPacket,