Posted May 15, 201312 yr I made an item that when you right click on an animal it drops the egg for that animal. For some reason when this happens it drops the actual egg that the player can pick up, but it also drops another egg that the player can't do anything to. Here's the main interaction code I have. public boolean itemInteractionForEntity(ItemStack itemstack, EntityLiving entity) { if(entity instanceof EntityAnimal || entity instanceof EntityWaterMob) { int spawnID = 0; if(entity instanceof EntityBat) spawnID = 65; else if(entity instanceof EntityChicken) spawnID = 93; else if(entity instanceof EntityCow) spawnID = 92; else if(entity instanceof EntityMooshroom) spawnID = 96; else if(entity instanceof EntityOcelot) spawnID = 98; else if(entity instanceof EntityPig) spawnID = 90; else if(entity instanceof EntitySheep) spawnID = 91; else if(entity instanceof EntitySquid) spawnID = 94; else if(entity instanceof EntityWolf) spawnID = 95; else return false; entity.setDead(); entity.entityDropItem(new ItemStack(383, 1, spawnID), 0.0F); return true; } return false; }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.