use of net.minecraft.entity.monster.WitherSkeletonEntity in project WarDance by Jackiecrazy.
the class GeneralUtils method dropSkull.
/**
* drops a skull of the given type. For players it will retrieve their skin
*/
public static ItemStack dropSkull(LivingEntity elb) {
ItemStack ret = null;
if (elb instanceof AbstractSkeletonEntity) {
if (elb instanceof WitherSkeletonEntity)
ret = new ItemStack(Items.WITHER_SKELETON_SKULL);
else
ret = new ItemStack(Items.SKELETON_SKULL);
} else if (elb instanceof ZombieEntity)
ret = new ItemStack(Items.ZOMBIE_HEAD);
else if (elb instanceof CreeperEntity)
ret = new ItemStack(Items.CREEPER_HEAD);
else if (elb instanceof EnderDragonEntity)
ret = new ItemStack(Items.DRAGON_HEAD);
else if (elb instanceof PlayerEntity) {
PlayerEntity p = (PlayerEntity) elb;
ret = new ItemStack(Items.PLAYER_HEAD);
ret.setTag(new CompoundNBT());
ret.getTag().putString("SkullOwner", p.getName().getString());
}
return ret;
}
Aggregations