use of net.minecraft.entity.decoration.ArmorStandEntity 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();
}
use of net.minecraft.entity.decoration.ArmorStandEntity 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);
}
use of net.minecraft.entity.decoration.ArmorStandEntity 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);
}
use of net.minecraft.entity.decoration.ArmorStandEntity in project More-Weaponry by DakotaPride.
the class WatcherArmorItem method predicate.
// Predicate runs every frame
private <P extends IAnimatable> PlayState predicate(AnimationEvent<P> event) {
// This is all the extradata this event carries. The livingentity is the entity
// that's wearing the armor. The itemstack and equipmentslottype are self
// explanatory.
LivingEntity livingEntity = event.getExtraDataOfType(LivingEntity.class).get(0);
// Always loop the animation but later on in this method we'll decide whether or
// not to actually play it
event.getController().setAnimation(new AnimationBuilder().addAnimation("idle", true));
// If the living entity is an armorstand just play the animation nonstop
if (livingEntity instanceof ArmorStandEntity) {
return PlayState.CONTINUE;
} else // full set of armor
if (livingEntity instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity) livingEntity;
// Get all the equipment, aka the armor, currently held item, and offhand item
List<Item> equipmentList = new ArrayList<>();
player.getItemsEquipped().forEach((x) -> equipmentList.add(x.getItem()));
// elements 2 to 6 are the armor so we take the sublist. Armorlist now only
// contains the 4 armor slots
List<Item> armorList = equipmentList.subList(2, 6);
// Make sure the player is wearing all the armor. If they are, continue playing
// the animation, otherwise stop
boolean isWearingAll = armorList.containsAll(Arrays.asList(MoreWeaponryItems.WATCHER_HELMET, MoreWeaponryItems.WATCHER_CHESTPLATE));
return isWearingAll ? PlayState.CONTINUE : PlayState.STOP;
}
return PlayState.STOP;
}
use of net.minecraft.entity.decoration.ArmorStandEntity in project More-Weaponry by DakotaPride.
the class CracklerArmorItem method predicate.
private <P extends IAnimatable> PlayState predicate(AnimationEvent<P> event) {
// This is all the extradata this event carries. The livingentity is the entity
// that's wearing the armor. The itemstack and equipmentslottype are self
// explanatory.
LivingEntity livingEntity = event.getExtraDataOfType(LivingEntity.class).get(0);
// Always loop the animation but later on in this method we'll decide whether or
// not to actually play it
event.getController().setAnimation(new AnimationBuilder().addAnimation("idle", true));
// If the living entity is an armorstand just play the animation nonstop
if (livingEntity instanceof ArmorStandEntity) {
return PlayState.CONTINUE;
} else // full set of armor
if (livingEntity instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity) livingEntity;
// Get all the equipment, aka the armor, currently held item, and offhand item
List<Item> equipmentList = new ArrayList<>();
player.getItemsEquipped().forEach((x) -> equipmentList.add(x.getItem()));
// elements 2 to 6 are the armor so we take the sublist. Armorlist now only
// contains the 4 armor slots
List<Item> armorList = equipmentList.subList(2, 6);
// Make sure the player is wearing all the armor. If they are, continue playing
// the animation, otherwise stop
boolean isWearingAll = armorList.containsAll(Arrays.asList(MoreWeaponryItems.CRACKLER_HELMET, MoreWeaponryItems.CRACKLER_CHESTPLATE));
return isWearingAll ? PlayState.CONTINUE : PlayState.STOP;
}
return PlayState.STOP;
}
Aggregations