@SubscribeEvent
public void onEntityAttacked(LivingAttackEvent event) {
if (!skipAttackDamageOnce && "player".equals(event.getSource().getDamageType()) && event.getSource().getEntity() instanceof EntityPlayer) {
ItemStack stack = ((EntityPlayer) event.getSource().getEntity()).getHeldItemMainhand();
if (stack != null && stack.getItem() instanceof IFactionSlayerItem) {
<BUG>IFactionSlayerItem item = (IFactionSlayerItem) stack.getItem();
IFaction faction = null;
if (event.getEntity() instanceof IFactionEntity) {
faction = ((IFactionEntity) event.getEntity()).getFaction();
} else if (event.getEntity() instanceof EntityPlayer) {
faction = FactionPlayerHandler.get((EntityPlayer) event.getEntity()).getCurrentFaction();
}</BUG>
if (faction != null && faction.equals(item.getSlayedFaction())) {

@SubscribeEvent
public void onAttachCapability(AttachCapabilitiesEvent.Entity event) {
if (event.getEntity() instanceof EntityCreature) {
event.addCapability(REFERENCE.EXTENDED_CREATURE_KEY, ExtendedCreature.createNewCapability((EntityCreature) event.getEntity()));
}
}
@SubscribeEvent
public void onEntityAttacked(LivingAttackEvent event) {
if (!skipAttackDamageOnce && "player".equals(event.getSource().getDamageType()) && event.getSource().getEntity() instanceof EntityPlayer) {
ItemStack stack = ((EntityPlayer) event.getSource().getEntity()).getHeldItemMainhand();
if (stack != null && stack.getItem() instanceof IFactionSlayerItem) {
IFactionSlayerItem item = (IFactionSlayerItem) stack.getItem();
IFaction faction = VampirismAPI.factionRegistry().getFaction(event.getEntity());
if (faction != null && faction.equals(item.getSlayedFaction())) {
