diff --git a/minecraft/networking/modern.py b/minecraft/networking/modern.py index 678ffcc..138325e 100644 --- a/minecraft/networking/modern.py +++ b/minecraft/networking/modern.py @@ -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,