Search in sources :

Example 1 with AmbientEntity

use of net.minecraft.entity.mob.AmbientEntity in project Wurst7 by Wurst-Imperium.

the class RadarHack method onUpdate.

@Override
public void onUpdate() {
    ClientPlayerEntity player = MC.player;
    ClientWorld world = MC.world;
    entities.clear();
    Stream<Entity> stream = StreamSupport.stream(world.getEntities().spliterator(), true).filter(e -> !e.isRemoved() && e != player).filter(e -> !(e instanceof FakePlayerEntity)).filter(e -> e instanceof LivingEntity).filter(e -> ((LivingEntity) e).getHealth() > 0);
    if (filterPlayers.isChecked())
        stream = stream.filter(e -> !(e instanceof PlayerEntity));
    if (filterSleeping.isChecked())
        stream = stream.filter(e -> !(e instanceof PlayerEntity && ((PlayerEntity) e).isSleeping()));
    if (filterMonsters.isChecked())
        stream = stream.filter(e -> !(e instanceof Monster));
    if (filterAnimals.isChecked())
        stream = stream.filter(e -> !(e instanceof AnimalEntity || e instanceof AmbientEntity || e instanceof WaterCreatureEntity));
    if (filterInvisible.isChecked())
        stream = stream.filter(e -> !e.isInvisible());
    entities.addAll(stream.collect(Collectors.toList()));
}
Also used : Category(net.wurstclient.Category) Entity(net.minecraft.entity.Entity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) LivingEntity(net.minecraft.entity.LivingEntity) Hack(net.wurstclient.hack.Hack) SearchTags(net.wurstclient.SearchTags) Collectors(java.util.stream.Collectors) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) ArrayList(java.util.ArrayList) ValueDisplay(net.wurstclient.settings.SliderSetting.ValueDisplay) SliderSetting(net.wurstclient.settings.SliderSetting) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) Stream(java.util.stream.Stream) Window(net.wurstclient.clickgui.Window) CheckboxSetting(net.wurstclient.settings.CheckboxSetting) Monster(net.minecraft.entity.mob.Monster) UpdateListener(net.wurstclient.events.UpdateListener) RadarComponent(net.wurstclient.clickgui.components.RadarComponent) StreamSupport(java.util.stream.StreamSupport) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Collections(java.util.Collections) ClientWorld(net.minecraft.client.world.ClientWorld) LivingEntity(net.minecraft.entity.LivingEntity) Entity(net.minecraft.entity.Entity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) LivingEntity(net.minecraft.entity.LivingEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) Monster(net.minecraft.entity.mob.Monster) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) ClientWorld(net.minecraft.client.world.ClientWorld) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity)

Example 2 with AmbientEntity

use of net.minecraft.entity.mob.AmbientEntity in project Wurst7 by Wurst-Imperium.

the class FollowHack method onEnable.

@Override
public void onEnable() {
    WURST.getHax().fightBotHack.setEnabled(false);
    WURST.getHax().protectHack.setEnabled(false);
    WURST.getHax().tunnellerHack.setEnabled(false);
    if (entity == null) {
        Stream<Entity> stream = StreamSupport.stream(MC.world.getEntities().spliterator(), true).filter(e -> !e.isRemoved()).filter(e -> e instanceof LivingEntity && ((LivingEntity) e).getHealth() > 0 || e instanceof AbstractMinecartEntity).filter(e -> e != MC.player).filter(e -> !(e instanceof FakePlayerEntity));
        if (filterPlayers.isChecked())
            stream = stream.filter(e -> !(e instanceof PlayerEntity));
        if (filterSleeping.isChecked())
            stream = stream.filter(e -> !(e instanceof PlayerEntity && ((PlayerEntity) e).isSleeping()));
        if (filterFlying.getValue() > 0)
            stream = stream.filter(e -> {
                if (!(e instanceof PlayerEntity))
                    return true;
                Box box = e.getBoundingBox();
                box = box.union(box.offset(0, -filterFlying.getValue(), 0));
                return !MC.world.isSpaceEmpty(box);
            });
        if (filterMonsters.isChecked())
            stream = stream.filter(e -> !(e instanceof Monster));
        if (filterPigmen.isChecked())
            stream = stream.filter(e -> !(e instanceof ZombifiedPiglinEntity));
        if (filterEndermen.isChecked())
            stream = stream.filter(e -> !(e instanceof EndermanEntity));
        if (filterAnimals.isChecked())
            stream = stream.filter(e -> !(e instanceof AnimalEntity || e instanceof AmbientEntity || e instanceof WaterCreatureEntity));
        if (filterBabies.isChecked())
            stream = stream.filter(e -> !(e instanceof PassiveEntity && ((PassiveEntity) e).isBaby()));
        if (filterPets.isChecked())
            stream = stream.filter(e -> !(e instanceof TameableEntity && ((TameableEntity) e).isTamed())).filter(e -> !(e instanceof HorseBaseEntity && ((HorseBaseEntity) e).isTame()));
        if (filterTraders.isChecked())
            stream = stream.filter(e -> !(e instanceof MerchantEntity));
        if (filterGolems.isChecked())
            stream = stream.filter(e -> !(e instanceof GolemEntity));
        if (filterInvisible.isChecked())
            stream = stream.filter(e -> !e.isInvisible());
        if (filterStands.isChecked())
            stream = stream.filter(e -> !(e instanceof ArmorStandEntity));
        if (filterCarts.isChecked())
            stream = stream.filter(e -> !(e instanceof AbstractMinecartEntity));
        entity = stream.min(Comparator.comparingDouble(e -> MC.player.squaredDistanceTo(e))).orElse(null);
        if (entity == null) {
            ChatUtils.error("Could not find a valid entity.");
            setEnabled(false);
            return;
        }
    }
    pathFinder = new EntityPathFinder();
    EVENTS.add(UpdateListener.class, this);
    EVENTS.add(RenderListener.class, this);
    ChatUtils.message("Now following " + entity.getName().getString());
}
Also used : Category(net.wurstclient.Category) GolemEntity(net.minecraft.entity.passive.GolemEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) ChatUtils(net.wurstclient.util.ChatUtils) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) ArrayList(java.util.ArrayList) ValueDisplay(net.wurstclient.settings.SliderSetting.ValueDisplay) Vec3d(net.minecraft.util.math.Vec3d) AbstractMinecartEntity(net.minecraft.entity.vehicle.AbstractMinecartEntity) StreamSupport(java.util.stream.StreamSupport) RenderListener(net.wurstclient.events.RenderListener) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Entity(net.minecraft.entity.Entity) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) PathFinder(net.wurstclient.ai.PathFinder) LivingEntity(net.minecraft.entity.LivingEntity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity) Box(net.minecraft.util.math.Box) GameRenderer(net.minecraft.client.render.GameRenderer) MatrixStack(net.minecraft.client.util.math.MatrixStack) BlockPos(net.minecraft.util.math.BlockPos) Hack(net.wurstclient.hack.Hack) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) PathCmd(net.wurstclient.commands.PathCmd) SliderSetting(net.wurstclient.settings.SliderSetting) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) PathPos(net.wurstclient.ai.PathPos) Stream(java.util.stream.Stream) CheckboxSetting(net.wurstclient.settings.CheckboxSetting) Monster(net.minecraft.entity.mob.Monster) RenderSystem(com.mojang.blaze3d.systems.RenderSystem) PathProcessor(net.wurstclient.ai.PathProcessor) UpdateListener(net.wurstclient.events.UpdateListener) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) DontSaveState(net.wurstclient.hack.DontSaveState) Comparator(java.util.Comparator) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) GolemEntity(net.minecraft.entity.passive.GolemEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) AbstractMinecartEntity(net.minecraft.entity.vehicle.AbstractMinecartEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Entity(net.minecraft.entity.Entity) 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) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Box(net.minecraft.util.math.Box) GolemEntity(net.minecraft.entity.passive.GolemEntity) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) Monster(net.minecraft.entity.mob.Monster) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity) AbstractMinecartEntity(net.minecraft.entity.vehicle.AbstractMinecartEntity)

Example 3 with AmbientEntity

use of net.minecraft.entity.mob.AmbientEntity in project Wurst7 by Wurst-Imperium.

the class TriggerBotHack method isCorrectEntity.

private boolean isCorrectEntity(Entity entity) {
    ClientPlayerEntity player = MC.player;
    ClientWorld world = MC.world;
    double rangeSq = Math.pow(range.getValue(), 2);
    Stream<Entity> stream = Stream.of(entity).filter(e -> !e.isRemoved()).filter(e -> e instanceof LivingEntity && ((LivingEntity) e).getHealth() > 0 || e instanceof EndCrystalEntity).filter(e -> player.squaredDistanceTo(e) <= rangeSq).filter(e -> e != player).filter(e -> !(e instanceof FakePlayerEntity)).filter(e -> !WURST.getFriends().contains(e.getEntityName()));
    if (filterPlayers.isChecked())
        stream = stream.filter(e -> !(e instanceof PlayerEntity));
    if (filterSleeping.isChecked())
        stream = stream.filter(e -> !(e instanceof PlayerEntity && ((PlayerEntity) e).isSleeping()));
    if (filterFlying.getValue() > 0)
        stream = stream.filter(e -> {
            if (!(e instanceof PlayerEntity))
                return true;
            Box box = e.getBoundingBox();
            box = box.union(box.offset(0, -filterFlying.getValue(), 0));
            return !world.isSpaceEmpty(box);
        });
    if (filterMonsters.isChecked())
        stream = stream.filter(e -> !(e instanceof Monster));
    if (filterPigmen.isChecked())
        stream = stream.filter(e -> !(e instanceof ZombifiedPiglinEntity));
    if (filterEndermen.isChecked())
        stream = stream.filter(e -> !(e instanceof EndermanEntity));
    if (filterAnimals.isChecked())
        stream = stream.filter(e -> !(e instanceof AnimalEntity || e instanceof AmbientEntity || e instanceof WaterCreatureEntity));
    if (filterBabies.isChecked())
        stream = stream.filter(e -> !(e instanceof PassiveEntity && ((PassiveEntity) e).isBaby()));
    if (filterPets.isChecked())
        stream = stream.filter(e -> !(e instanceof TameableEntity && ((TameableEntity) e).isTamed())).filter(e -> !(e instanceof HorseBaseEntity && ((HorseBaseEntity) e).isTame()));
    if (filterTraders.isChecked())
        stream = stream.filter(e -> !(e instanceof MerchantEntity));
    if (filterGolems.isChecked())
        stream = stream.filter(e -> !(e instanceof GolemEntity));
    if (filterInvisible.isChecked())
        stream = stream.filter(e -> !e.isInvisible());
    if (filterNamed.isChecked())
        stream = stream.filter(e -> !e.hasCustomName());
    if (filterStands.isChecked())
        stream = stream.filter(e -> !(e instanceof ArmorStandEntity));
    if (filterCrystals.isChecked())
        stream = stream.filter(e -> !(e instanceof EndCrystalEntity));
    return stream.findFirst().isPresent();
}
Also used : Category(net.wurstclient.Category) GolemEntity(net.minecraft.entity.passive.GolemEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) SearchTags(net.wurstclient.SearchTags) ValueDisplay(net.wurstclient.settings.SliderSetting.ValueDisplay) Hand(net.minecraft.util.Hand) 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) Box(net.minecraft.util.math.Box) Hack(net.wurstclient.hack.Hack) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) SliderSetting(net.wurstclient.settings.SliderSetting) EntityHitResult(net.minecraft.util.hit.EntityHitResult) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) Stream(java.util.stream.Stream) CheckboxSetting(net.wurstclient.settings.CheckboxSetting) Monster(net.minecraft.entity.mob.Monster) UpdateListener(net.wurstclient.events.UpdateListener) 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) ClientWorld(net.minecraft.client.world.ClientWorld) 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) TameableEntity(net.minecraft.entity.passive.TameableEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Box(net.minecraft.util.math.Box) GolemEntity(net.minecraft.entity.passive.GolemEntity) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) Monster(net.minecraft.entity.mob.Monster) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) ClientWorld(net.minecraft.client.world.ClientWorld) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity)

Example 4 with AmbientEntity

use of net.minecraft.entity.mob.AmbientEntity in project Wurst7 by Wurst-Imperium.

the class BowAimbotHack method filterEntities.

private Entity filterEntities(Stream<Entity> s) {
    Stream<Entity> stream = s.filter(e -> e != null && !e.isRemoved()).filter(e -> e instanceof LivingEntity && ((LivingEntity) e).getHealth() > 0 || e instanceof EndCrystalEntity).filter(e -> e != MC.player).filter(e -> !(e instanceof FakePlayerEntity)).filter(e -> !WURST.getFriends().contains(e.getEntityName()));
    if (filterPlayers.isChecked())
        stream = stream.filter(e -> !(e instanceof PlayerEntity));
    if (filterSleeping.isChecked())
        stream = stream.filter(e -> !(e instanceof PlayerEntity && ((PlayerEntity) e).isSleeping()));
    if (filterFlying.getValue() > 0)
        stream = stream.filter(e -> {
            if (!(e instanceof PlayerEntity))
                return true;
            Box box = e.getBoundingBox();
            box = box.union(box.offset(0, -filterFlying.getValue(), 0));
            return !MC.world.isSpaceEmpty(box);
        });
    if (filterMonsters.isChecked())
        stream = stream.filter(e -> !(e instanceof Monster));
    if (filterPigmen.isChecked())
        stream = stream.filter(e -> !(e instanceof ZombifiedPiglinEntity));
    if (filterEndermen.isChecked())
        stream = stream.filter(e -> !(e instanceof EndermanEntity));
    if (filterAnimals.isChecked())
        stream = stream.filter(e -> !(e instanceof AnimalEntity || e instanceof AmbientEntity || e instanceof WaterCreatureEntity));
    if (filterBabies.isChecked())
        stream = stream.filter(e -> !(e instanceof PassiveEntity && ((PassiveEntity) e).isBaby()));
    if (filterPets.isChecked())
        stream = stream.filter(e -> !(e instanceof TameableEntity && ((TameableEntity) e).isTamed())).filter(e -> !(e instanceof HorseBaseEntity && ((HorseBaseEntity) e).isTame()));
    if (filterTraders.isChecked())
        stream = stream.filter(e -> !(e instanceof MerchantEntity));
    if (filterGolems.isChecked())
        stream = stream.filter(e -> !(e instanceof GolemEntity));
    if (filterInvisible.isChecked())
        stream = stream.filter(e -> !e.isInvisible());
    if (filterNamed.isChecked())
        stream = stream.filter(e -> !e.hasCustomName());
    if (filterStands.isChecked())
        stream = stream.filter(e -> !(e instanceof ArmorStandEntity));
    if (filterCrystals.isChecked())
        stream = stream.filter(e -> !(e instanceof EndCrystalEntity));
    return stream.min(priority.getSelected().comparator).orElse(null);
}
Also used : Color(java.awt.Color) Category(net.wurstclient.Category) GolemEntity(net.minecraft.entity.passive.GolemEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) Item(net.minecraft.item.Item) GUIRenderListener(net.wurstclient.events.GUIRenderListener) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) SearchTags(net.wurstclient.SearchTags) VertexFormat(net.minecraft.client.render.VertexFormat) BufferRenderer(net.minecraft.client.render.BufferRenderer) GL11(org.lwjgl.opengl.GL11) RenderListener(net.wurstclient.events.RenderListener) VertexFormats(net.minecraft.client.render.VertexFormats) Tessellator(net.minecraft.client.render.Tessellator) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) Matrix4f(net.minecraft.util.math.Matrix4f) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) CrossbowItem(net.minecraft.item.CrossbowItem) LivingEntity(net.minecraft.entity.LivingEntity) GameRenderer(net.minecraft.client.render.GameRenderer) MatrixStack(net.minecraft.client.util.math.MatrixStack) Hack(net.wurstclient.hack.Hack) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) Window(net.minecraft.client.util.Window) Stream(java.util.stream.Stream) Monster(net.minecraft.entity.mob.Monster) ToDoubleFunction(java.util.function.ToDoubleFunction) BufferBuilder(net.minecraft.client.render.BufferBuilder) UpdateListener(net.wurstclient.events.UpdateListener) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) ColorSetting(net.wurstclient.settings.ColorSetting) ValueDisplay(net.wurstclient.settings.SliderSetting.ValueDisplay) ItemStack(net.minecraft.item.ItemStack) RotationUtils(net.wurstclient.util.RotationUtils) EnumSetting(net.wurstclient.settings.EnumSetting) StreamSupport(java.util.stream.StreamSupport) BowItem(net.minecraft.item.BowItem) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Entity(net.minecraft.entity.Entity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity) Box(net.minecraft.util.math.Box) SliderSetting(net.wurstclient.settings.SliderSetting) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) CheckboxSetting(net.wurstclient.settings.CheckboxSetting) RenderSystem(com.mojang.blaze3d.systems.RenderSystem) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) Comparator(java.util.Comparator) RenderUtils(net.wurstclient.util.RenderUtils) GolemEntity(net.minecraft.entity.passive.GolemEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Entity(net.minecraft.entity.Entity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Box(net.minecraft.util.math.Box) GolemEntity(net.minecraft.entity.passive.GolemEntity) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) Monster(net.minecraft.entity.mob.Monster) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity)

Example 5 with AmbientEntity

use of net.minecraft.entity.mob.AmbientEntity in project Wurst7 by Wurst-Imperium.

the class ClickAuraHack method attack.

private void attack() {
    // set entity
    ClientPlayerEntity player = MC.player;
    ClientWorld world = MC.world;
    if (player.getAttackCooldownProgress(0) < 1)
        return;
    double rangeSq = Math.pow(range.getValue(), 2);
    Stream<Entity> stream = StreamSupport.stream(MC.world.getEntities().spliterator(), true).filter(e -> !e.isRemoved()).filter(e -> e instanceof LivingEntity && ((LivingEntity) e).getHealth() > 0 || e instanceof EndCrystalEntity).filter(e -> player.squaredDistanceTo(e) <= rangeSq).filter(e -> e != player).filter(e -> !(e instanceof FakePlayerEntity)).filter(e -> !WURST.getFriends().contains(e.getEntityName()));
    if (fov.getValue() < 360.0)
        stream = stream.filter(e -> RotationUtils.getAngleToLookVec(e.getBoundingBox().getCenter()) <= fov.getValue() / 2.0);
    if (filterPlayers.isChecked())
        stream = stream.filter(e -> !(e instanceof PlayerEntity));
    if (filterSleeping.isChecked())
        stream = stream.filter(e -> !(e instanceof PlayerEntity && ((PlayerEntity) e).isSleeping()));
    if (filterFlying.getValue() > 0)
        stream = stream.filter(e -> {
            if (!(e instanceof PlayerEntity))
                return true;
            Box box = e.getBoundingBox();
            box = box.union(box.offset(0, -filterFlying.getValue(), 0));
            return !world.isSpaceEmpty(box);
        });
    if (filterMonsters.isChecked())
        stream = stream.filter(e -> !(e instanceof Monster));
    if (filterPigmen.isChecked())
        stream = stream.filter(e -> !(e instanceof ZombifiedPiglinEntity));
    if (filterEndermen.isChecked())
        stream = stream.filter(e -> !(e instanceof EndermanEntity));
    if (filterAnimals.isChecked())
        stream = stream.filter(e -> !(e instanceof AnimalEntity || e instanceof AmbientEntity || e instanceof WaterCreatureEntity));
    if (filterBabies.isChecked())
        stream = stream.filter(e -> !(e instanceof PassiveEntity && ((PassiveEntity) e).isBaby()));
    if (filterPets.isChecked())
        stream = stream.filter(e -> !(e instanceof TameableEntity && ((TameableEntity) e).isTamed())).filter(e -> !(e instanceof HorseBaseEntity && ((HorseBaseEntity) e).isTame()));
    if (filterTraders.isChecked())
        stream = stream.filter(e -> !(e instanceof MerchantEntity));
    if (filterGolems.isChecked())
        stream = stream.filter(e -> !(e instanceof GolemEntity));
    if (filterInvisible.isChecked())
        stream = stream.filter(e -> !e.isInvisible());
    if (filterNamed.isChecked())
        stream = stream.filter(e -> !e.hasCustomName());
    if (filterStands.isChecked())
        stream = stream.filter(e -> !(e instanceof ArmorStandEntity));
    if (filterCrystals.isChecked())
        stream = stream.filter(e -> !(e instanceof EndCrystalEntity));
    Entity target = stream.min(priority.getSelected().comparator).orElse(null);
    if (target == null)
        return;
    WURST.getHax().autoSwordHack.setSlot();
    // face entity
    Rotation rotation = RotationUtils.getNeededRotations(target.getBoundingBox().getCenter());
    PlayerMoveC2SPacket.LookAndOnGround packet = new PlayerMoveC2SPacket.LookAndOnGround(rotation.getYaw(), rotation.getPitch(), MC.player.isOnGround());
    MC.player.networkHandler.sendPacket(packet);
    // attack entity
    WURST.getHax().criticalsHack.doCritical();
    MC.interactionManager.attackEntity(player, target);
    player.swingHand(Hand.MAIN_HAND);
}
Also used : Category(net.wurstclient.Category) GolemEntity(net.minecraft.entity.passive.GolemEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) SearchTags(net.wurstclient.SearchTags) ValueDisplay(net.wurstclient.settings.SliderSetting.ValueDisplay) RotationUtils(net.wurstclient.util.RotationUtils) EnumSetting(net.wurstclient.settings.EnumSetting) StreamSupport(java.util.stream.StreamSupport) Hand(net.minecraft.util.Hand) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) LeftClickListener(net.wurstclient.events.LeftClickListener) 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) Box(net.minecraft.util.math.Box) Hack(net.wurstclient.hack.Hack) Rotation(net.wurstclient.util.RotationUtils.Rotation) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) SliderSetting(net.wurstclient.settings.SliderSetting) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) Stream(java.util.stream.Stream) CheckboxSetting(net.wurstclient.settings.CheckboxSetting) Monster(net.minecraft.entity.mob.Monster) ToDoubleFunction(java.util.function.ToDoubleFunction) UpdateListener(net.wurstclient.events.UpdateListener) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) PlayerMoveC2SPacket(net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) Comparator(java.util.Comparator) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) ClientWorld(net.minecraft.client.world.ClientWorld) 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) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) PlayerMoveC2SPacket(net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket) GolemEntity(net.minecraft.entity.passive.GolemEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) EndCrystalEntity(net.minecraft.entity.decoration.EndCrystalEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) Monster(net.minecraft.entity.mob.Monster) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) Box(net.minecraft.util.math.Box) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) Rotation(net.wurstclient.util.RotationUtils.Rotation) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) ClientWorld(net.minecraft.client.world.ClientWorld)

Aggregations

Entity (net.minecraft.entity.Entity)11 AmbientEntity (net.minecraft.entity.mob.AmbientEntity)11 Monster (net.minecraft.entity.mob.Monster)11 WaterCreatureEntity (net.minecraft.entity.mob.WaterCreatureEntity)11 AnimalEntity (net.minecraft.entity.passive.AnimalEntity)11 PlayerEntity (net.minecraft.entity.player.PlayerEntity)11 Stream (java.util.stream.Stream)10 LivingEntity (net.minecraft.entity.LivingEntity)10 Category (net.wurstclient.Category)10 UpdateListener (net.wurstclient.events.UpdateListener)10 Hack (net.wurstclient.hack.Hack)10 CheckboxSetting (net.wurstclient.settings.CheckboxSetting)10 SliderSetting (net.wurstclient.settings.SliderSetting)10 ValueDisplay (net.wurstclient.settings.SliderSetting.ValueDisplay)10 FakePlayerEntity (net.wurstclient.util.FakePlayerEntity)10 StreamSupport (java.util.stream.StreamSupport)9 ArmorStandEntity (net.minecraft.entity.decoration.ArmorStandEntity)9 EndermanEntity (net.minecraft.entity.mob.EndermanEntity)9 ZombifiedPiglinEntity (net.minecraft.entity.mob.ZombifiedPiglinEntity)9 GolemEntity (net.minecraft.entity.passive.GolemEntity)9