Guest User

ItemC4.class

a guest
May 23rd, 2012
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. public class ItemC4 extends Item
  4. {
  5.  
  6.     public static int grenadeID;
  7.    
  8.     public ItemC4(int par1)
  9.     {
  10.         super(par1);
  11.         maxStackSize = 16;
  12.     }
  13.     /**
  14.      * Called whenever this item is equipped and the right mouse button is pressed.
  15.      */
  16.     public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
  17.     {
  18.         if (!par3EntityPlayer.capabilities.isCreativeMode)
  19.         {
  20.             par1ItemStack.stackSize--;
  21.         }
  22.  
  23.         par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
  24.  
  25.         par2World.entityJoinedWorld(new EntityC4(par2World, par3EntityPlayer));
  26.  
  27.         return par1ItemStack;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment