use of net.minecraft.entity.monster.EntitySilverfish in project EnderIO by SleepyTrousers.
the class SilverfishAttractorHandler method tick.
@Override
public void tick(TileAttractor attractor, EntityLiving entity) {
EntitySilverfish sf = (EntitySilverfish) entity;
Path pathentity = getPathEntityToEntity(entity, attractor.getTarget(), attractor.getRange() * 2);
sf.getNavigator().setPath(pathentity, sf.getAIMoveSpeed());
}
use of net.minecraft.entity.monster.EntitySilverfish in project Bewitchment by Um-Mitternacht.
the class FortuneMeetUberSilverfish method apply.
@Override
public boolean apply(EntityPlayer player) {
for (int i = 0; i < 10; i++) {
BlockPos pos = new BlockPos(player.posX + player.getRNG().nextGaussian() * 4, player.posY, player.posZ + player.getRNG().nextGaussian() * 4);
EntitySilverfish silverfish = new EntitySilverfish(player.world);
if (player.world.isAirBlock(pos) && player.world.isAirBlock(pos.up()) && player.world.getBlockState(pos.down()).canEntitySpawn(silverfish)) {
silverfish.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
silverfish.onInitialSpawn(player.world.getDifficultyForLocation(pos), null);
player.world.spawnEntity(silverfish);
if (player.getRNG().nextInt(10) < player.world.getDifficulty().ordinal())
silverfish.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 900, 1));
if (player.getRNG().nextInt(10) < player.world.getDifficulty().ordinal())
silverfish.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 900, 1));
if (player.getRNG().nextInt(10) < player.world.getDifficulty().ordinal())
silverfish.addPotionEffect(new PotionEffect(MobEffects.SPEED, 900, 1));
if (player.getRNG().nextInt(10) < player.world.getDifficulty().ordinal())
silverfish.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 900, 1));
return true;
}
}
return false;
}
use of net.minecraft.entity.monster.EntitySilverfish in project BetterWithAddons by DaedalusGame.
the class AnimalCrossbreedHandler method initialize.
public static void initialize() {
inLove = ReflectionHelper.findField(EntityAnimal.class, "field_70881_d", "inLove");
// Standard
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityCow(world)), 100));
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntitySheep(world)), 100));
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityPig(world)), 100));
// Lower chance for egg hatching animal
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityChicken(world)), 50));
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityRabbit(world)), 75));
// Parent species
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, mother.createChild(mother)), 100));
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, father.createChild(father)), 100));
// Abominations
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world, pos, new EntitySilverfish(world)), 200));
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world, pos, new EntityCaveSpider(world)), 100));
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world, pos, new EntitySlime(world)), 50));
// Enviroment dependent
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world, pos, new EntitySquid(world)), 0).setCustomWeight(AnimalCrossbreedHandler::getSquidWeight));
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityWolf(world)), 0).setCustomWeight(AnimalCrossbreedHandler::getWolfWeight));
mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityOcelot(world)), 0).setCustomWeight(AnimalCrossbreedHandler::getOcelotWeight));
}
Aggregations