Middle Click Pearl
Minecraft Gameplay Impact
In high-pace PvP situations, throwing an Ender Pearl requires manually selecting the item in the hotbar, right-clicking to throw, and switching back to weapons. AutoPearl / FastPearl exploits automate this sequence upon pressing a hotkey (such as the middle mouse button): the module searches the player's hotbar for an Ender Pearl, swaps the active slot, calls interactItem to throw the projectile immediately, and restores the previously equipped slot within 1 tick.
Functions & APIs Analyzed
Items.ENDER_PEARL
Ender pearl item identifier constant (class_1802.field_8634 / field_151079_bi).
ClientPlayerInteractionManager.interactItem
Client method (method_2919) to interact with an item in hand and dispatch use packets.
Mod Implementation (Dev Source / Mapped)
// Developer Source (Fabric / Yarn mappings)
public class AutoPearl {
public static void throwPearl(MinecraftClient client) {
if (client.player == null || client.interactionManager == null) return;
int prevSlot = client.player.getInventory().selectedSlot;
int pearlSlot = findPearlSlot(client.player.getInventory());
if (pearlSlot != -1) {
client.player.getInventory().selectedSlot = pearlSlot;
client.interactionManager.interactItem(client.player, Hand.MAIN_HAND);
client.player.swingHand(Hand.MAIN_HAND);
client.player.getInventory().selectedSlot = prevSlot;
}
}
}
Decompiled Representation (Vineflower View)
// Decompiled with Vineflower 1.12 (Intermediary mappings)
public class AutoPearl {
public static void throwPearl(class_310 client) {
if (client.field_1724 != null && client.field_1761 != null) {
int prevSlot = client.field_1724.method_31548().field_7545;
int pearlSlot = findPearl(client.field_1724, class_1802.field_8634);
if (pearlSlot != -1) {
client.field_1724.method_31548().field_7545 = pearlSlot;
client.field_1761.method_2919(client.field_1724, class_1268.field_5808);
client.field_1724.method_6104(class_1268.field_5808);
client.field_1724.method_31548().field_7545 = prevSlot;
}
}
}
}
Bytecode Signature & Static Detection
Matches item reference to Items.ENDER_PEARL (class_1802.field_8634 / field_151079_bi) co-occurring with ClientPlayerInteractionManager.interactItem (method_2919 / func_217292_a).