Advertisement
Guest User

Untitled

a guest
Jul 13th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. public class BaseEggItem extends BaseParasiteItem {
  2.  
  3.  
  4. public BaseEggItem(String name, int index) {
  5. super(name, index);
  6. }
  7.  
  8.  
  9. public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
  10. EntityItem egg = new EntityItem(world);
  11.  
  12. if (!player.capabilities.isCreativeMode) {
  13. --stack.stackSize;
  14. }
  15.  
  16. world.playSoundAtEntity(player, "random.pop", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
  17.  
  18.  
  19. if (!world.isRemote) {
  20.  
  21. world.spawnEntityInWorld(new EntityParasiteEgg(world, player.posX, player.posY, player.posZ, new ItemStack(ItemRegistry.baseParasite, 1, stack.getItemDamage())));
  22.  
  23. }
  24.  
  25.  
  26. return stack;
  27. }
  28.  
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement