Skip to content

use_item packet / activateItem not working on Minecraft 1.21.8 #3742

@wupengabc

Description

@wupengabc

Hello,

It seems that in Minecraft 1.21, the activateItem function no longer works. After debugging, the issue appears to be that the use_item packet definition in the current protodef/minecraft-data has not been updated to match the 1.21 protocol.

Specifically:

Older versions used rotation: vec2f (x, y),

1.21 officially requires yaw: float and pitch: float as separate fields.

As a result, sending yaw/pitch causes serialization errors like SizeOf error for undefined.
The old rotation field no longer works correctly on 1.21 servers.

Steps to reproduce:

Use bot.activateItem() or send use_item packet on a 1.21 server.

Observe that the action does not trigger server-side interactions.

Check console for serialization errors.

Expected behavior:
activateItem should correctly send a use_item packet compatible with 1.21 servers.
Image

Image

Metadata

Metadata

Assignees

Labels

Stage1just created by someone new to the project, we don't know yet if it deserves an implementation / a fpossible bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions