switch (world.rand.nextInt(2)) { case 0: { entity = new EntityZombie(world); if(world.rand.nextInt(hardMode ? 3 : 12) == 0) { entity = new EntityWitch(world);
if(world.rand.nextInt(10) == 0) entity = new EntityHusk(world); else entity = new EntityZombie(world); break; case 1:
/** * Set the inner entity; * @param innerEntity inner entity */ public void setInnerEntity(EntityLivingBase innerEntity) { if(innerEntity instanceof EntityPlayer) { setPlayerId(((EntityPlayer) innerEntity).getGameProfile().getId().toString()); setPlayerName(((EntityPlayer) innerEntity).getGameProfile().getName()); innerEntity = new EntityZombie(world); } this.data.setInnerEntityName(innerEntity.getClass().getName()); }
@Nullable @Override public EntityLiving getExample() { EntityZombie entity = new EntityZombie(WorldDummy.INSTANCE); entity.setPositionAndRotation(12, 0, 0, 30, 73); entity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.STICK)); entity.setItemStackToSlot(EntityEquipmentSlot.CHEST, new ItemStack(Items.DIAMOND_HELMET)); return entity; }
private void setSpawn(byte id) { EntityZombie zombie; if (id == 0) { zombie = new EntityZombie(world); zombie.setLocationAndAngles(posX, posY, posZ, rotationYaw, 0.0F); zombie.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(zombie)), null); zombie.setItemStackToSlot(EntityEquipmentSlot.HEAD, new ItemStack(GaiaItems.ACCESSORY_HEADGEAR, 1, 0)); zombie.setDropChance(EntityEquipmentSlot.MAINHAND, 0); zombie.setDropChance(EntityEquipmentSlot.OFFHAND, 0); zombie.setDropChance(EntityEquipmentSlot.FEET, 0); zombie.setDropChance(EntityEquipmentSlot.LEGS, 0); zombie.setDropChance(EntityEquipmentSlot.CHEST, 0); zombie.setDropChance(EntityEquipmentSlot.HEAD, 0); world.spawnEntity(zombie); } }
@Override public boolean onActivate(IImperfectRitualStone imperfectRitualStone, EntityPlayer player) { EntityZombie zombie = new EntityZombie(imperfectRitualStone.getRitualWorld()); zombie.setPosition(imperfectRitualStone.getRitualPos().getX() + 0.5, imperfectRitualStone.getRitualPos().getY() + 2.1, imperfectRitualStone.getRitualPos().getZ() + 0.5); zombie.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 2000)); zombie.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 20000, 7)); zombie.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 20000, 3)); if (!imperfectRitualStone.getRitualWorld().isRemote) imperfectRitualStone.getRitualWorld().spawnEntity(zombie); return true; } }
private void setSpawn(byte id) { EntityZombie zombie; EntitySkeleton skeleton; if (id == 0) { zombie = new EntityZombie(world); zombie.setLocationAndAngles(posX, posY, posZ, rotationYaw, 0.0F); zombie.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(zombie)), null); zombie.setItemStackToSlot(EntityEquipmentSlot.HEAD, new ItemStack(GaiaItems.ACCESSORY_HEADGEAR, 1, 1)); zombie.setDropChance(EntityEquipmentSlot.MAINHAND, 0); zombie.setDropChance(EntityEquipmentSlot.OFFHAND, 0); zombie.setDropChance(EntityEquipmentSlot.FEET, 0); zombie.setDropChance(EntityEquipmentSlot.LEGS, 0); zombie.setDropChance(EntityEquipmentSlot.CHEST, 0); zombie.setDropChance(EntityEquipmentSlot.HEAD, 0); world.spawnEntity(zombie); } if (id == 1) { skeleton = new EntitySkeleton(world); skeleton.setLocationAndAngles(posX, posY, posZ, rotationYaw, 0.0F); skeleton.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(skeleton)), null); skeleton.setItemStackToSlot(EntityEquipmentSlot.HEAD, new ItemStack(GaiaItems.ACCESSORY_HEADGEAR, 1, 1)); skeleton.setDropChance(EntityEquipmentSlot.MAINHAND, 0); skeleton.setDropChance(EntityEquipmentSlot.OFFHAND, 0); skeleton.setDropChance(EntityEquipmentSlot.FEET, 0); skeleton.setDropChance(EntityEquipmentSlot.LEGS, 0); skeleton.setDropChance(EntityEquipmentSlot.CHEST, 0); skeleton.setDropChance(EntityEquipmentSlot.HEAD, 0); world.spawnEntity(skeleton); } }
zombie = new EntityZombie(world); zombie.setLocationAndAngles(posX, posY, posZ, rotationYaw, 0.0F); zombie.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(zombie)), null);