Skip to content

Fix activateItem always having the same rotation#3840

Merged
rom1504 merged 3 commits intoPrismarineJS:masterfrom
SuperGamerTron:activateitem-rotation
Apr 2, 2026
Merged

Fix activateItem always having the same rotation#3840
rom1504 merged 3 commits intoPrismarineJS:masterfrom
SuperGamerTron:activateitem-rotation

Conversation

@SuperGamerTron
Copy link
Copy Markdown
Contributor

Correctly uses the bot's rotation in the activateItem function instead of having a (0, 0) rotation.
Fixes:
#3537
#3621
#3833

@osyra42
Copy link
Copy Markdown

osyra42 commented Mar 16, 2026

Could this be related to why my bot always faced south when trying to go fishing? The bot will look at the right water block and then turn south quickly, cast, and then look back at the block.

@DatArnoGuy
Copy link
Copy Markdown
Contributor

Could this be related to why my bot always faced south when trying to go fishing? The bot will look at the right water block and then turn south quickly, cast, and then look back at the block.

Yes

@osyra42
Copy link
Copy Markdown

osyra42 commented Mar 30, 2026

has this been pulled to main?

SuperGamerTron and others added 2 commits April 1, 2026 15:02
Verifies that bot.activateItem() sends the bot's current yaw and pitch
(converted via toNotchianYaw/toNotchianPitch) in the use_item packet's
rotation field. Skips on protocol versions before 1.21.1 where the
rotation field does not exist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rom1504 rom1504 force-pushed the activateitem-rotation branch from 1ab8146 to 7a4af38 Compare April 1, 2026 15:37
Verifies that activateItem sends the bot's actual yaw/pitch in the
use_item packet by intercepting the outgoing packet and checking the
rotation values match expected Notchian angles for two different
look directions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rom1504
Copy link
Copy Markdown
Member

rom1504 commented Apr 2, 2026

Added tests

@rom1504 rom1504 merged commit 47a41c6 into PrismarineJS:master Apr 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants