GenuineSounds

Create an egg from entity.

Jun 13th, 2012
202
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. @Override
  2. public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
  3.     World world = ModLoader.getMinecraftInstance().theWorld;
  4.     for (Object randent : EntityList.entityEggs.values()) {
  5.         EntityEggInfo entityInfo = (EntityEggInfo) randent;
  6.         if (entityInfo.spawnedID == EntityList.getEntityID(entity)) {
  7.             world.spawnEntityInWorld(new EntityItem(world, entity.posX, entity.posY, entity.posZ, new ItemStack(Item.monsterPlacer, 1, entityInfo.spawnedID)));
  8.             entity.setDead();
  9.             break;
  10.         }
  11.     }
  12.     return super.onLeftClickEntity(stack, player, entity);
  13. }
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment