Advertisement
BlackGRizzly

ItemCustomTools.java

Jun 2nd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.17 KB | None | 0 0
  1. package grizzly.mod.items;
  2.  
  3.  
  4.  
  5. import java.util.List;
  6.  
  7. import net.minecraft.client.util.ITooltipFlag;
  8. import net.minecraft.item.IItemTier;
  9. import net.minecraft.item.Item;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraft.util.text.ITextComponent;
  12. import net.minecraft.util.text.TextComponentString;
  13. import net.minecraft.world.World;
  14.  
  15. public class ItemCustomTools extends Item
  16. {
  17.        
  18.     public ItemCustomTools(IItemTier tier, float f, float attackSpeedIn, Properties builder)
  19.     {
  20.         super(builder);
  21.     }
  22.  
  23.     @Override
  24.     public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
  25.          tooltip.add(new TextComponentString("Instantly Broken!"));
  26.     }
  27.        
  28.     @Override
  29.     public boolean hasContainerItem() {
  30.         return true;
  31.     }
  32.    
  33.     @Override
  34.     public boolean hasContainerItem(ItemStack stack) {
  35.         return this.hasContainerItem();
  36.     }
  37.    
  38.     @Override
  39.     public ItemStack getContainerItem(ItemStack itemStack) {
  40.         ItemStack stack = itemStack.copy();
  41.         stack.attemptDamageItem(1, random, null);
  42.         return stack.getDamage() > 0 ? stack:ItemStack.EMPTY;
  43.     }
  44.        
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement