use of net.minecraft.world.entity.ai.navigation.GroundPathNavigation in project Totemic by TeamTotemic.
the class InfusedFluteItem method temptEntities.
private void temptEntities(Level world, double x, double y, double z) {
TotemicEntityUtil.getEntitiesInRange(Mob.class, world, new BlockPos(x, y, z), 2, 2, entity -> ((entity instanceof Animal && entity.getNavigation() instanceof GroundPathNavigation) || entity instanceof Villager) && !temptedEntities.contains(entity)).forEach(entity -> {
double speed = (entity instanceof Animal) ? 1 : 0.5;
entity.goalSelector.addGoal(5, new TemptGoal((PathfinderMob) entity, speed, Ingredient.of(this), false));
temptedEntities.add(entity);
});
}
Aggregations