pyCraft icon indicating copy to clipboard operation
pyCraft copied to clipboard

Unable to dig block

Open SquirrelOn0IQ opened this issue 2 years ago • 3 comments

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)

SquirrelOn0IQ avatar Jul 09 '22 05:07 SquirrelOn0IQ

What version are you trying to get on?

MisterSoandSo avatar Jul 10 '22 03:07 MisterSoandSo

1.18.1

SquirrelOn0IQ avatar Jul 11 '22 07:07 SquirrelOn0IQ

see how minecraft do it first(yarn or mcp)

Cassy-Lee avatar Apr 22 '23 07:04 Cassy-Lee