Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. public class ItemSmallBackPack extends Item{
  2.     public ItemSmallBackPack(String unlocalizedName, String registryName)
  3.     {
  4.         super();
  5.         this.setUnlocalizedName(unlocalizedName);
  6.         this.setRegistryName(registryName);
  7.         this.setMaxStackSize(1);
  8.         setCreativeTab(WalkingDeadMod.WalkingDead);
  9.     }
  10.  
  11.  
  12.     @Override
  13.     public int getMaxItemUseDuration(ItemStack stack) {
  14.         return 1;
  15.     }
  16.    
  17.     @Override
  18.     public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand handIn) {
  19.         if (!worldIn.isRemote)
  20.         {
  21.             // If player not sneaking, open the inventory gui
  22.             if (!player.isSneaking()) {
  23.                 player.openGui(WalkingDeadMod.instance, WalkingDeadMod.GUI_ITEM_INV, worldIn, 0, 0, 0);
  24.             }
  25.                     }
  26.         return null;   
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement