Full module source: 1 implementation
Every implementation below is the complete module file, verbatim. Expand a client to read its code.
MelaHack (ThunderHack fork)PLAYERsrc/main/java/thunder/hack/features/modules/player/PearlBlockThrow.javaJava · 22 lines · 839 B
Allows you to throw pearl into blocks. (Sunrise)
| 1 | package thunder.hack.features.modules.player;
|
| 2 |
|
| 3 | import meteordevelopment.orbit.EventHandler;
|
| 4 | import net.minecraft.network.protocol.game.ServerboundUseItemOnPacket;
|
| 5 | import net.minecraft.world.InteractionHand;
|
| 6 | import net.minecraft.world.item.Items;
|
| 7 | import thunder.hack.events.impl.PacketEvent;
|
| 8 | import thunder.hack.injection.accesors.IPlayerInteractBlockC2SPacket;
|
| 9 | import thunder.hack.features.modules.Module;
|
| 10 |
|
| 11 | public class PearlBlockThrow extends Module {
|
| 12 | public PearlBlockThrow() {
|
| 13 | super("PearlBlockThrow", Category.PLAYER);
|
| 14 | }
|
| 15 |
|
| 16 | @EventHandler
|
| 17 | public void onPackerSend(PacketEvent.Send event) {
|
| 18 | if (event.getPacket() instanceof ServerboundUseItemOnPacket p && mc.player.getMainHandItem().getItem() == Items.ENDER_PEARL)
|
| 19 | ((IPlayerInteractBlockC2SPacket) p).setHand(InteractionHand.OFF_HAND);
|
| 20 | }
|
| 21 | }
|
| 22 |
|
Utilities (1)
IPlayerInteractBlockC2SPacket.javaJava · 15 lines · 460 B
| 1 | package thunder.hack.injection.accesors;
|
| 2 |
|
| 3 | import net.minecraft.network.protocol.game.ServerboundUseItemOnPacket;
|
| 4 | import net.minecraft.world.InteractionHand;
|
| 5 | import org.spongepowered.asm.mixin.Mixin;
|
| 6 | import org.spongepowered.asm.mixin.Mutable;
|
| 7 | import org.spongepowered.asm.mixin.gen.Accessor;
|
| 8 |
|
| 9 | @Mixin(ServerboundUseItemOnPacket.class)
|
| 10 | public interface IPlayerInteractBlockC2SPacket {
|
| 11 | @Mutable
|
| 12 | @Accessor("hand")
|
| 13 | void setHand(InteractionHand hand);
|
| 14 | }
|
| 15 |
|
Mixins (2)
IPlayerInteractBlockC2SPacket.javaJava · 15 lines · 460 B
@Mixin(ServerboundUseItemOnPacket.class)
| 1 | package thunder.hack.injection.accesors;
|
| 2 |
|
| 3 | import net.minecraft.network.protocol.game.ServerboundUseItemOnPacket;
|
| 4 | import net.minecraft.world.InteractionHand;
|
| 5 | import org.spongepowered.asm.mixin.Mixin;
|
| 6 | import org.spongepowered.asm.mixin.Mutable;
|
| 7 | import org.spongepowered.asm.mixin.gen.Accessor;
|
| 8 |
|
| 9 | @Mixin(ServerboundUseItemOnPacket.class)
|
| 10 | public interface IPlayerInteractBlockC2SPacket {
|
| 11 | @Mutable
|
| 12 | @Accessor("hand")
|
| 13 | void setHand(InteractionHand hand);
|
| 14 | }
|
| 15 |
|
MixinShulkerBoxBlock.javaJava · 25 lines · 1.0 KB
@Mixin(Item.class)
| 1 | package thunder.hack.injection;
|
| 2 |
|
| 3 | import thunder.hack.core.manager.client.ModuleManager;
|
| 4 | import thunder.hack.features.modules.render.Tooltips;
|
| 5 | import org.spongepowered.asm.mixin.Mixin;
|
| 6 | import org.spongepowered.asm.mixin.injection.At;
|
| 7 | import org.spongepowered.asm.mixin.injection.Inject;
|
| 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
| 9 |
|
| 10 | import java.util.function.Consumer;
|
| 11 | import net.minecraft.network.chat.Component;
|
| 12 | import net.minecraft.world.item.Item;
|
| 13 | import net.minecraft.world.item.ItemStack;
|
| 14 | import net.minecraft.world.item.TooltipFlag;
|
| 15 | import net.minecraft.world.item.component.TooltipDisplay;
|
| 16 |
|
| 17 | @Mixin(Item.class)
|
| 18 | public class MixinShulkerBoxBlock {
|
| 19 | @Inject(method = "appendHoverText", at = @At("HEAD"), cancellable = true)
|
| 20 | private void onAppendTooltip(ItemStack stack, Item.TooltipContext context, TooltipDisplay displayComponent, Consumer<Component> textConsumer, TooltipFlag options, CallbackInfo ci) {
|
| 21 | if (ModuleManager.tooltips == null) return;
|
| 22 | if (Tooltips.storage.getValue()) ci.cancel();
|
| 23 | }
|
| 24 | }
|
| 25 |
|