Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean hitEntity(ItemStack stack, EntityLivingBase attackedLiving, EntityLivingBase attackerLiving)
- {
- if(!stack.hasTagCompound())
- {
- stack.setTagCompound(new NBTTagCompound());
- }
- IEntitySelector filter;
- if(stack.getTagCompound().getByte("Mode") == 0)
- {
- return super.hitEntity(stack, attackedLiving, attackerLiving);
- }
- else
- {
- filter = new IEntitySelector()
- {
- @Override
- public boolean isEntityApplicable(Entity entity)
- {
- if(entity instanceof EntityLivingBase)
- {
- return true;
- }
- return false;
- }
- };
- }
- List entityTargetList = attackedLiving.worldObj.selectEntitiesWithinAABB(EntityLivingBase.class, attackedLiving.boundingBox.expand(1.0D, 1.0D, 1.0D), filter);
- for(Object entity : entityTargetList)
- {
- EntityLivingBase living = (EntityLivingBase)entity;
- living.setFire(4);
- }
- return super.hitEntity(stack, attackedLiving, attackerLiving);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement