Advertisement
Guest User

miningPotion.java

a guest
Jul 8th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. package com.gmail.loustak347.common;
  2.  
  3. import net.minecraft.entity.player.EntityPlayer;
  4. import net.minecraft.item.EnumAction;
  5. import net.minecraft.item.ItemStack;
  6. import net.minecraft.potion.PotionEffect;
  7. import net.minecraft.world.World;
  8. import net.minecraft.item.Item;
  9.  
  10.  
  11. public class miningPotion extends Item {
  12.    
  13.     @Override
  14.     public int getMaxItemUseDuration(ItemStack stack) {
  15.         return 72000;
  16.     }
  17.     public EnumAction getItemUseAction(ItemStack par1ItemStack)
  18.     {
  19.         return EnumAction.drink;
  20.     }
  21.     public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
  22.     {
  23.     player.setItemInUse(stack, this.getMaxItemUsageDuration(stack));
  24.     player.addPotionEffect(new PotionEffect(3, 1200, 2));
  25.     if (!player.capabilities.isCreativeMode)
  26.         {
  27.           --stack.stackSize;
  28.         }
  29.     return stack;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement