Search in sources :

Example 26 with ClientPlayerEntity

use of net.minecraft.client.network.ClientPlayerEntity in project Wurst7 by Wurst-Imperium.

the class AutoFishHack method onReceivedPacket.

@Override
public void onReceivedPacket(PacketInputEvent event) {
    ClientPlayerEntity player = MC.player;
    if (player == null || player.fishHook == null)
        return;
    if (!(event.getPacket() instanceof PlaySoundS2CPacket))
        return;
    // check sound type
    PlaySoundS2CPacket sound = (PlaySoundS2CPacket) event.getPacket();
    if (!SoundEvents.ENTITY_FISHING_BOBBER_SPLASH.equals(sound.getSound()))
        return;
    if (debugDraw.isChecked())
        lastSoundPos = new Vec3d(sound.getX(), sound.getY(), sound.getZ());
    // check position
    FishingBobberEntity bobber = player.fishHook;
    if (Math.abs(sound.getX() - bobber.getX()) > validRange.getValue() || Math.abs(sound.getZ() - bobber.getZ()) > validRange.getValue())
        return;
    // check open water
    boolean isOpenWater = isInOpenWater(bobber);
    if (!isOpenWater && wasOpenWater) {
        ChatUtils.warning("You are currently fishing in shallow water.");
        ChatUtils.message("You can't get any treasure items while fishing like this.");
        if (!WURST.getHax().openWaterEspHack.isEnabled())
            ChatUtils.message("Use OpenWaterESP to find open water.");
    }
    // catch fish
    rightClick();
    castRodTimer = 15;
    wasOpenWater = isOpenWater;
}
Also used : IFishingBobberEntity(net.wurstclient.mixinterface.IFishingBobberEntity) FishingBobberEntity(net.minecraft.entity.projectile.FishingBobberEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) PlaySoundS2CPacket(net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket) Vec3d(net.minecraft.util.math.Vec3d)

Example 27 with ClientPlayerEntity

use of net.minecraft.client.network.ClientPlayerEntity in project Wurst7 by Wurst-Imperium.

the class BonemealAuraHack method selectBonemeal.

private void selectBonemeal() {
    ClientPlayerEntity player = MC.player;
    int maxInvSlot = automationLevel.getSelected().maxInvSlot;
    for (int slot = 0; slot < maxInvSlot; slot++) {
        if (slot == player.getInventory().selectedSlot)
            continue;
        ItemStack stack = player.getInventory().getStack(slot);
        if (stack.isEmpty() || stack.getItem() != Items.BONE_MEAL)
            continue;
        if (slot < 9)
            player.getInventory().selectedSlot = slot;
        else if (player.getInventory().getEmptySlot() < 9)
            IMC.getInteractionManager().windowClick_QUICK_MOVE(slot);
        else if (player.getInventory().getEmptySlot() != -1) {
            IMC.getInteractionManager().windowClick_QUICK_MOVE(player.getInventory().selectedSlot + 36);
            IMC.getInteractionManager().windowClick_QUICK_MOVE(slot);
        } else {
            IMC.getInteractionManager().windowClick_PICKUP(player.getInventory().selectedSlot + 36);
            IMC.getInteractionManager().windowClick_PICKUP(slot);
            IMC.getInteractionManager().windowClick_PICKUP(player.getInventory().selectedSlot + 36);
        }
        return;
    }
}
Also used : ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) ItemStack(net.minecraft.item.ItemStack)

Example 28 with ClientPlayerEntity

use of net.minecraft.client.network.ClientPlayerEntity in project Wurst7 by Wurst-Imperium.

the class TpCmd method call.

@Override
public void call(String[] args) throws CmdException {
    BlockPos pos = argsToPos(args);
    ClientPlayerEntity player = MC.player;
    player.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
}
Also used : BlockPos(net.minecraft.util.math.BlockPos) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity)

Example 29 with ClientPlayerEntity

use of net.minecraft.client.network.ClientPlayerEntity in project Wurst7 by Wurst-Imperium.

the class ViewNbtCmd method call.

@Override
public void call(String[] args) throws CmdException {
    ClientPlayerEntity player = MC.player;
    ItemStack stack = player.getInventory().getMainHandStack();
    if (stack.isEmpty())
        throw new CmdError("You must hold an item in your main hand.");
    NbtCompound tag = stack.getNbt();
    String nbt = tag == null ? "" : tag.asString();
    switch(String.join(" ", args).toLowerCase()) {
        case "":
            ChatUtils.message("NBT: " + nbt);
            break;
        case "copy":
            MC.keyboard.setClipboard(nbt);
            ChatUtils.message("NBT data copied to clipboard.");
            break;
        default:
            throw new CmdSyntaxError();
    }
}
Also used : CmdSyntaxError(net.wurstclient.command.CmdSyntaxError) CmdError(net.wurstclient.command.CmdError) NbtCompound(net.minecraft.nbt.NbtCompound) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) ItemStack(net.minecraft.item.ItemStack)

Example 30 with ClientPlayerEntity

use of net.minecraft.client.network.ClientPlayerEntity in project Wurst7 by Wurst-Imperium.

the class TriggerBotHack method onUpdate.

@Override
public void onUpdate() {
    ClientPlayerEntity player = MC.player;
    if (player.getAttackCooldownProgress(0) < 1)
        return;
    if (MC.crosshairTarget == null || !(MC.crosshairTarget instanceof EntityHitResult))
        return;
    Entity target = ((EntityHitResult) MC.crosshairTarget).getEntity();
    if (!isCorrectEntity(target))
        return;
    WURST.getHax().autoSwordHack.setSlot();
    WURST.getHax().criticalsHack.doCritical();
    MC.interactionManager.attackEntity(player, target);
    player.swingHand(Hand.MAIN_HAND);
}
Also used : GolemEntity(net.minecraft.entity.passive.GolemEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Entity(net.minecraft.entity.Entity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) EntityHitResult(net.minecraft.util.hit.EntityHitResult)

Aggregations

ClientPlayerEntity (net.minecraft.client.network.ClientPlayerEntity)105 ItemStack (net.minecraft.item.ItemStack)18 Vec3d (net.minecraft.util.math.Vec3d)17 Entity (net.minecraft.entity.Entity)12 BlockPos (net.minecraft.util.math.BlockPos)12 ClientWorld (net.minecraft.client.world.ClientWorld)11 Stream (java.util.stream.Stream)10 LivingEntity (net.minecraft.entity.LivingEntity)10 Hand (net.minecraft.util.Hand)10 Inject (org.spongepowered.asm.mixin.injection.Inject)10 MinecraftClient (net.minecraft.client.MinecraftClient)9 AnimalEntity (net.minecraft.entity.passive.AnimalEntity)9 Identifier (net.minecraft.util.Identifier)9 AmbientEntity (net.minecraft.entity.mob.AmbientEntity)8 WaterCreatureEntity (net.minecraft.entity.mob.WaterCreatureEntity)8 PlayerEntity (net.minecraft.entity.player.PlayerEntity)8 PlayerUtils (at.haha007.edenclient.utils.PlayerUtils)7 ConfigSubscriber (at.haha007.edenclient.utils.config.ConfigSubscriber)7 PerWorldConfig (at.haha007.edenclient.utils.config.PerWorldConfig)7 LiteralArgumentBuilder (com.mojang.brigadier.builder.LiteralArgumentBuilder)7