Advertisement
Superloup10

Test1

Mar 27th, 2014
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1.     public boolean hitEntity(ItemStack stack, EntityLivingBase attackedLiving, EntityLivingBase attackerLiving)
  2.     {
  3.         if(!stack.hasTagCompound())
  4.         {
  5.             stack.setTagCompound(new NBTTagCompound());
  6.         }
  7.        
  8.         IEntitySelector filter;
  9.         if(stack.getTagCompound().getByte("Mode") == 0)
  10.         {
  11.             return super.hitEntity(stack, attackedLiving, attackerLiving);
  12.         }
  13.         else
  14.         {
  15.             filter = new IEntitySelector()
  16.             {
  17.                 @Override
  18.                 public boolean isEntityApplicable(Entity entity)
  19.                 {
  20.                     if(entity instanceof EntityLivingBase)
  21.                     {
  22.                         return true;
  23.                     }
  24.                     return false;
  25.                 }
  26.             };
  27.         }
  28.         List entityTargetList = attackedLiving.worldObj.selectEntitiesWithinAABB(EntityLivingBase.class, attackedLiving.boundingBox.expand(1.0D, 1.0D, 1.0D), filter);
  29.         for(Object entity : entityTargetList)
  30.         {
  31.             EntityLivingBase living = (EntityLivingBase)entity;
  32.             living.setFire(4);
  33.         }
  34.         return super.hitEntity(stack, attackedLiving, attackerLiving);
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement