MrDj200

Untitled

Sep 3rd, 2017
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.05 KB | None | 0 0
  1. @SubscribeEvent
  2.     public void onBlockRightClick(RightClickBlock e)
  3.     {
  4.        
  5.         ItemStack itemInHand = e.getItemStack();
  6.         String itemInHandName = itemInHand.getItem().getUnlocalizedName();
  7.         String tmpMsg = "";
  8.        
  9.         if( itemInHandName.equals("tile.air") || e.getHand() == EnumHand.OFF_HAND)
  10.             return;
  11.        
  12.         if( e.getHand() == EnumHand.MAIN_HAND )
  13.         {
  14.             tmpMsg = "MAIN";
  15.         }else{
  16.             tmpMsg = "OFF";
  17.         }        
  18.         //e.getEntityPlayer().sendMessage(new TextComponentString(itemInHandName));
  19.         e.getEntityPlayer().sendMessage(new TextComponentString("------------------"));
  20.         if( itemInHandName.equals("item.appliedenergistics2.nether_quartz_wrench") || itemInHandName.equals("item.appliedenergistics2.certus_quartz_wrench") )
  21.         {
  22.             e.getEntityPlayer().sendMessage(new TextComponentString("Yep! " + tmpMsg));
  23.         }else{
  24.             e.getEntityPlayer().sendMessage(new TextComponentString("Nope! " + tmpMsg));
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment