pyCraft
pyCraft copied to clipboard
Unable to dig block
I'm trying to dig a block using a custom packet, but i'm getting this error Traceback (most recent call last): File "thing.py", line 50, in <module> loc = Position(x=plk.x, y=plk.y - 1, z=plk.z) AttributeError: x
I don't understand the problem, here's my code for digging: class DigPacket(Packet): id = 0x1C packet_name = "Player Digging" definition = [{'status': VarInt}, {'location': Position}, {'face': Byte}] plk = PlayerPositionAndLookPacket.PositionAndLook() packet = DigPacket() packet.status = 0 loc = Position(x=plk.x, y=plk.y - 1, z=plk.z) packet.location = loc packet.face = 1 connection.write_packet(packet) time.sleep(2) packet.status = 2 connection.write_packet(packet)
(Sorry not sure how to get code on seperate lines on GitHub)
What version are you trying to get on?
1.18.1
see how minecraft do it first(yarn or mcp)