net.minecraft.entity.mob.AmbientEntity Java Examples

The following examples show how to use net.minecraft.entity.mob.AmbientEntity. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RadarHack.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@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.removed && 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()));
}
 
Example #2
Source File: FollowHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onEnable()
{
	if(entity == null)
	{
		Stream<Entity> stream = StreamSupport
			.stream(MC.world.getEntities().spliterator(), true)
			.filter(e -> e instanceof LivingEntity)
			.filter(e -> !e.removed && ((LivingEntity)e).getHealth() > 0)
			.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.doesNotCollide(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(filterVillagers.isChecked())
			stream = stream.filter(e -> !(e instanceof VillagerEntity));
		
		if(filterGolems.isChecked())
			stream = stream.filter(e -> !(e instanceof GolemEntity));
		
		if(filterInvisible.isChecked())
			stream = stream.filter(e -> !e.isInvisible());
		
		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());
}
 
Example #3
Source File: TriggerBotHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
private boolean isCorrectEntity(Entity entity)
{
	ClientPlayerEntity player = MC.player;
	ClientWorld world = MC.world;
	
	double rangeSq = Math.pow(range.getValue(), 2);
	Stream<LivingEntity> stream = Stream.of(entity)
		.filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e)
		.filter(e -> !e.removed && e.getHealth() > 0)
		.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.doesNotCollide(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(filterVillagers.isChecked())
		stream = stream.filter(e -> !(e instanceof VillagerEntity));
	
	if(filterGolems.isChecked())
		stream = stream.filter(e -> !(e instanceof GolemEntity));
	
	if(filterInvisible.isChecked())
		stream = stream.filter(e -> !e.isInvisible());
	
	return stream.findFirst().isPresent();
}
 
Example #4
Source File: RemoteViewHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onEnable()
{
	// find entity if not already set
	if(entity == null)
	{
		Stream<Entity> stream = StreamSupport
			.stream(MC.world.getEntities().spliterator(), true)
			.filter(e -> e instanceof LivingEntity)
			.filter(e -> !e.removed && ((LivingEntity)e).getHealth() > 0)
			.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.doesNotCollide(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(filterVillagers.isChecked())
			stream = stream.filter(e -> !(e instanceof VillagerEntity));
		
		if(filterGolems.isChecked())
			stream = stream.filter(e -> !(e instanceof GolemEntity));
		
		if(filterInvisible.isChecked())
			stream = stream.filter(e -> !e.isInvisible());
		
		entity = stream
			.min(Comparator
				.comparingDouble(e -> MC.player.squaredDistanceTo(e)))
			.orElse(null);
		
		// check if entity was found
		if(entity == null)
		{
			ChatUtils.error("Could not find a valid entity.");
			setEnabled(false);
			return;
		}
	}
	
	// save old data
	wasInvisible = entity.isInvisibleTo(MC.player);
	
	// enable NoClip
	MC.player.noClip = true;
	
	// spawn fake player
	fakePlayer = new FakePlayerEntity();
	
	// success message
	ChatUtils.message("Now viewing " + entity.getName().getString() + ".");
	
	// add listener
	EVENTS.add(UpdateListener.class, this);
	EVENTS.add(PacketOutputListener.class, this);
}
 
Example #5
Source File: KillauraLegitHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onUpdate()
{
	ClientPlayerEntity player = MC.player;
	ClientWorld world = MC.world;
	
	if(player.getAttackCooldownProgress(0) < 1)
		return;
	
	double rangeSq = Math.pow(range.getValue(), 2);
	Stream<LivingEntity> stream = StreamSupport
		.stream(MC.world.getEntities().spliterator(), true)
		.filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e)
		.filter(e -> !e.removed && e.getHealth() > 0)
		.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.doesNotCollide(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(filterVillagers.isChecked())
		stream = stream.filter(e -> !(e instanceof VillagerEntity));
	
	if(filterGolems.isChecked())
		stream = stream.filter(e -> !(e instanceof GolemEntity));
	
	if(filterInvisible.isChecked())
		stream = stream.filter(e -> !e.isInvisible());
	
	target = stream.min(priority.getSelected().comparator).orElse(null);
	if(target == null)
		return;
	
	WURST.getHax().autoSwordHack.setSlot();
	
	// face entity
	if(!faceEntityClient(target))
		return;
	
	// attack entity
	MC.interactionManager.attackEntity(player, target);
	player.swingHand(Hand.MAIN_HAND);
}
 
Example #6
Source File: KillauraHack.java    From Wurst7 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onUpdate()
{
	ClientPlayerEntity player = MC.player;
	ClientWorld world = MC.world;
	
	if(player.getAttackCooldownProgress(0) < 1)
		return;
	
	double rangeSq = Math.pow(range.getValue(), 2);
	Stream<LivingEntity> stream = StreamSupport
		.stream(MC.world.getEntities().spliterator(), true)
		.filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e)
		.filter(e -> !e.removed && e.getHealth() > 0)
		.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.doesNotCollide(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(filterVillagers.isChecked())
		stream = stream.filter(e -> !(e instanceof VillagerEntity));
	
	if(filterGolems.isChecked())
		stream = stream.filter(e -> !(e instanceof GolemEntity));
	
	if(filterInvisible.isChecked())
		stream = stream.filter(e -> !e.isInvisible());
	
	target = stream.min(priority.getSelected().comparator).orElse(null);
	renderTarget = target;
	if(target == null)
		return;
	
	WURST.getHax().autoSwordHack.setSlot();
	
	WURST.getRotationFaker()
		.faceVectorPacket(target.getBoundingBox().getCenter());
}
 
Example #7
Source File: EntityUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
public static boolean isAnimal(Entity e) {
	return e instanceof AnimalEntity || e instanceof AmbientEntity || e instanceof WaterCreatureEntity ||
			e instanceof GolemEntity || e instanceof VillagerEntity;
}
 
Example #8
Source File: EntityUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
public static boolean isAnimal(Entity e) {
	return e instanceof AnimalEntity || e instanceof AmbientEntity || e instanceof WaterCreatureEntity ||
			e instanceof GolemEntity || e instanceof VillagerEntity;
}
 
Example #9
Source File: EntityUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 4 votes vote down vote up
public static boolean isAnimal(Entity e) {
	return e instanceof AnimalEntity || e instanceof AmbientEntity || e instanceof WaterCreatureEntity ||
			e instanceof GolemEntity || e instanceof VillagerEntity;
}
 
Example #10
Source File: ClickAuraHack.java    From Wurst7 with GNU General Public License v3.0 votes vote down vote up
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<LivingEntity> stream = StreamSupport
		.stream(MC.world.getEntities().spliterator(), true)
		.filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e)
		.filter(e -> !e.removed && e.getHealth() > 0)
		.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.doesNotCollide(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(filterVillagers.isChecked())
		stream = stream.filter(e -> !(e instanceof VillagerEntity));
	
	if(filterGolems.isChecked())
		stream = stream.filter(e -> !(e instanceof GolemEntity));
	
	if(filterInvisible.isChecked())
		stream = stream.filter(e -> !e.isInvisible());
	
	LivingEntity 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.LookOnly packet = new PlayerMoveC2SPacket.LookOnly(
		rotation.getYaw(), rotation.getPitch(), MC.player.isOnGround());
	MC.player.networkHandler.sendPacket(packet);
	
	// attack entity
	MC.interactionManager.attackEntity(player, target);
	player.swingHand(Hand.MAIN_HAND);
}
 
Example #11
Source File: TpAuraHack.java    From Wurst7 with GNU General Public License v3.0 votes vote down vote up
@Override
public void onUpdate()
{
	ClientPlayerEntity player = MC.player;
	
	// set entity
	double rangeSq = Math.pow(range.getValue(), 2);
	Stream<LivingEntity> stream = StreamSupport
		.stream(MC.world.getEntities().spliterator(), true)
		.filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e)
		.filter(e -> !e.removed && e.getHealth() > 0)
		.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 MC.world.doesNotCollide(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(filterVillagers.isChecked())
		stream = stream.filter(e -> !(e instanceof VillagerEntity));
	
	if(filterGolems.isChecked())
		stream = stream.filter(e -> !(e instanceof GolemEntity));
	
	if(filterInvisible.isChecked())
		stream = stream.filter(e -> !e.isInvisible());
	
	Entity entity =
		stream.min(priority.getSelected().comparator).orElse(null);
	if(entity == null)
		return;
	
	WURST.getHax().autoSwordHack.setSlot();
	
	// teleport
	player.updatePosition(entity.getX() + random.nextInt(3) * 2 - 2,
		entity.getY(), entity.getZ() + random.nextInt(3) * 2 - 2);
	
	// check cooldown
	if(player.getAttackCooldownProgress(0) < 1)
		return;
	
	// attack entity
	RotationUtils.Rotation rotations = RotationUtils
		.getNeededRotations(entity.getBoundingBox().getCenter());
	WurstClient.MC.player.networkHandler
		.sendPacket(new PlayerMoveC2SPacket.LookOnly(rotations.getYaw(),
			rotations.getPitch(), MC.player.isOnGround()));
	
	MC.interactionManager.attackEntity(player, entity);
	player.swingHand(Hand.MAIN_HAND);
}