|
| 1 | +package com.dark.zewo2.modules; |
| 2 | + |
| 3 | +import com.dark.zewo2.Addon; |
| 4 | +import meteordevelopment.meteorclient.events.world.TickEvent; |
| 5 | +import meteordevelopment.meteorclient.systems.modules.Category; |
| 6 | +import meteordevelopment.meteorclient.systems.modules.Module; |
| 7 | +import meteordevelopment.orbit.EventHandler; |
| 8 | +import net.minecraft.entity.Entity; |
| 9 | +import net.minecraft.entity.player.PlayerEntity; |
| 10 | +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; |
| 11 | +import net.minecraft.util.hit.EntityHitResult; |
| 12 | +import net.minecraft.util.hit.HitResult; |
| 13 | + |
| 14 | +public class SitModule extends Module { |
| 15 | + private Entity target = null; |
| 16 | + int kickdelay = 25; |
| 17 | + public SitModule() { |
| 18 | + super(Addon.CATEGORY, "SitModule", "Sit on other players"); |
| 19 | + } |
| 20 | + |
| 21 | + @Override |
| 22 | + public void onActivate() { |
| 23 | + target = null; |
| 24 | + } |
| 25 | + |
| 26 | + @EventHandler |
| 27 | + private void ontick(TickEvent.Pre event){ |
| 28 | + if (target != null) { |
| 29 | + mc.player.setPosition(target.getPos().x, target.getPos().y + target.getHeight(), target.getPos().z); |
| 30 | + mc.player.setVelocity(0,0,0); |
| 31 | + |
| 32 | + if (kickdelay <= 0) { |
| 33 | + mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - 0.04, mc.player.getZ(), mc.player.isOnGround())); |
| 34 | + kickdelay = 25; |
| 35 | + } else { |
| 36 | + kickdelay--; |
| 37 | + } |
| 38 | + } |
| 39 | + |
| 40 | + if (mc.options.useKey.isPressed()){ |
| 41 | + if (!mc.crosshairTarget.getType().equals(HitResult.Type.ENTITY)) return; |
| 42 | + EntityHitResult etr = (EntityHitResult) mc.crosshairTarget; |
| 43 | + target = etr.getEntity(); |
| 44 | + } |
| 45 | + |
| 46 | + if (mc.options.sneakKey.isPressed()){ |
| 47 | + target = null; |
| 48 | + } |
| 49 | + } |
| 50 | +} |
0 commit comments