Guest User

Untitled

a guest
Nov 24th, 2018
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. package com.theishiopian.usefulpotionarrows;
  2.  
  3.  
  4.  
  5. import net.minecraft.entity.projectile.EntityArrow;
  6. import net.minecraft.entity.projectile.EntityTippedArrow;
  7.  
  8. import net.minecraft.nbt.NBTTagCompound;
  9.  
  10. import net.minecraft.world.World;
  11. import net.minecraftforge.event.entity.ProjectileImpactEvent;
  12. import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
  13.  
  14. public class DamageNullifier
  15. {
  16.     @SubscribeEvent
  17.     public void Nullifier(ProjectileImpactEvent.Arrow event)
  18.     {
  19.         EntityArrow arrow = event.getArrow();
  20.         World world = arrow.getEntityWorld();
  21.        
  22.         if(!world.isRemote && arrow instanceof EntityTippedArrow)
  23.         {
  24.             NBTTagCompound arrowTag = new NBTTagCompound();
  25.            
  26.             arrow.readEntityFromNBT(arrowTag);
  27.            
  28.             System.out.println(arrowTag);
  29.         }
  30.     }
  31.    
  32. }
Advertisement
Add Comment
Please, Sign In to add comment