mffs/src/main/java/mffs/item/module/interdiction/ItemModuleAntiHostile.java

23 lines
739 B
Java
Raw Normal View History

2022-10-28 16:20:12 +02:00
package mffs.item.module.interdiction;
import mffs.ModularForceFieldSystem;
import net.minecraft.entity.INpc;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.EntityLivingBase;
import mffs.api.security.IInterdictionMatrix;
public class ItemModuleAntiHostile extends ItemModuleInterdictionMatrix
{
public ItemModuleAntiHostile() {
super("moduleAntiHostile");
}
@Override
public boolean onDefend(final IInterdictionMatrix interdictionMatrix, final EntityLivingBase entityLiving) {
if (entityLiving instanceof IMob && !(entityLiving instanceof INpc)) {
entityLiving.attackEntityFrom(ModularForceFieldSystem.damagefieldShock, 20);
}
return false;
}
}