Advertisement
Creepinson

yaay

Mar 19th, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public ActionResult<ItemStack> onItemRightClick(ItemStack item, World world, EntityPlayer user, EnumHand hand)
  2.  
  3. {
  4. if(!world.isRemote){
  5. RayTraceResult pos = user.rayTrace(100, 20);
  6. double x = pos.getBlockPos().getX();
  7. double y = pos.getBlockPos().getY();
  8. double z = pos.getBlockPos().getZ();
  9.  
  10. world.addWeatherEffect(new EntityLightningBolt(world, x, y, z, bFull3D));
  11. user.setHealth(13);
  12. return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, item);
  13. }
  14.  
  15. else{
  16. return new ActionResult(EnumActionResult.FAIL, new ItemStack(this));
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement