Add combat job with safe target filtering

This commit is contained in:
Tanner committed 2026-11-17 22:37:12 +00:00
1 parent 2ecaa9a30a
commit 1b9f973db3
12 files changed
+486 -7

No files matched your search

+7 -2
View File
@@ -26,8 +26,8 @@ from mosfet.protocol.packets import (
from mosfet.protocol.types import Slot
from mosfet.protocol.modern import (
ClientCommandPacket, PlayerCommandPacket, PlayerInputPacket,
UpdateTimePacket, UseItemPacket,
AttackEntityPacket, ClientCommandPacket, PlayerCommandPacket,
PlayerInputPacket, UpdateTimePacket, UseItemPacket,
)
from mosfet import utils
@@ -1008,6 +1008,11 @@ class Game(LegacyGame):
"""Ask the 26.3 server to broadcast a main-hand punch animation."""
self._send_action(PunchPacket())
def attack_entity(self, entity_id):
"""Attack an entity with the main-hand item, then swing visibly."""
self._send_action(AttackEntityPacket(entity_id=int(entity_id)))
self.animate()
def break_block(self, location):
location = tuple(int(value) for value in location)
block_id = self.g.chunks.get_block_at(*location)