Guest User

I'm probably an idiot

a guest
Apr 2nd, 2017
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1.     @Override
  2.     public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
  3.     {
  4.         if(playerIn.inventory.hasItemStack(new ItemStack(this)))
  5.         {
  6.             int invSize = playerIn.inventory.getSizeInventory();
  7.             for(int i=0; i<invSize; i++)
  8.             {
  9.                 if(playerIn.inventory.getStackInSlot(i).getItem() == Items.IRON_INGOT)
  10.                 {
  11.                     ItemStack IronIngotFound = playerIn.inventory.getStackInSlot(i);
  12.                    
  13.                     IronIngotFound.stackSize--;
  14.                 }
  15.             }
  16.         }
  17.         return super.onItemRightClick(worldIn, playerIn, handIn);
  18.     }
Add Comment
Please, Sign In to add comment