Entity entity = EntityList.createEntityByName(id, world);
Handler handler = getHandler(id);
if ((entity != null) && (handler != null) &&
(entity instanceof EntityLiving)) {
EntityLiving slime = (EntityLiving)entity;
float rotation = MathHelper.wrapAngleTo180_float(world.rand.nextFloat() * 360.0F);
slime.setLocationAndAngles(x + 0.5, y, z + 0.5, rotation, 0.0F);
slime.rotationYawHead = slime.renderYawOffset = rotation;
if (name != null) slime.setCustomNameTag(name);
handler.setSize(slime, 1);
NBTTagList effectList = (NBTTagList)StackUtils.getTag(stack, "Effects");
if (effectList != null)
for (int i = 0; i < effectList.tagCount(); i++)
slime.addPotionEffect(PotionEffect.readCustomPotionEffectFromNBT(
effectList.getCompoundTagAt(i)));
world.spawnEntityInWorld(slime);
slime.playSound("mob.slime.big", 1.2F, 0.6F);
player.setCurrentItemOrArmor(EquipmentSlot.HELD, new ItemStack(Items.bucket));
}
return true;