From 33f74bbd3073e1f590aef2c03ff6df522bb1f120 Mon Sep 17 00:00:00 2001 From: CrisisSheep Date: Fri, 27 Feb 2026 11:30:44 +1300 Subject: [PATCH] fixed xp bottle throwing --- .../org/icetank/AutoAnvilRenameModule.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/icetank/AutoAnvilRenameModule.java b/src/main/java/org/icetank/AutoAnvilRenameModule.java index 9a109f1..93afa0b 100644 --- a/src/main/java/org/icetank/AutoAnvilRenameModule.java +++ b/src/main/java/org/icetank/AutoAnvilRenameModule.java @@ -11,6 +11,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.ShulkerBoxBlock; +import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket; import org.rusherhack.client.api.events.client.EventUpdate; import org.rusherhack.client.api.feature.module.ModuleCategory; import org.rusherhack.client.api.feature.module.ToggleableModule; @@ -32,6 +33,27 @@ public class AutoAnvilRenameModule extends ToggleableModule { private final BooleanSetting autoXP = new BooleanSetting("AutoXP", false); private int delay = 0; + private void throwXPBottle() { + if (mc.player == null) return; + + float yaw = mc.player.getYRot(); + + // Not quite 90degrees for better reliability + float pitch = 87.5f; + + + // serverside rotation + mc.player.connection.send( + new ServerboundMovePlayerPacket.Rot(yaw, pitch, mc.player.onGround(), mc.player.horizontalCollision) + ); + + // throw bottle at feet + mc.player.connection.send( + new ServerboundUseItemPacket( + InteractionHand.MAIN_HAND, 0, yaw, pitch) + ); + } + public AutoAnvilRenameModule() { super("AutoAnvilRename", "Renames items in an anvil automatically", ModuleCategory.CLIENT); @@ -85,7 +107,7 @@ void tick() { } if (mc.player.isHolding(Items.EXPERIENCE_BOTTLE)) { - mc.player.connection.send(new ServerboundUseItemPacket(InteractionHand.MAIN_HAND, 1, 1, 1)); + throwXPBottle(); } }