final Class<?> finalCustomNPCsIEntity = customNPCsIEntity;
customNPCsEventBus.addListener(EventPriority.LOWEST, true, (event) -> {
- if (finalCustomNPCsPlayerHurtEvent.isInstance(event)) {
+ if (finalCustomNPCsPlayerHurtEvent.isInstance(event)
+ && TurnBasedMinecraftMod.proxy.getAttackingEntity() != null) {
Field damageSourceField;
try {
damageSourceField = finalCustomNPCsPlayerHurtEvent.getField("damageSource");
}
}
});
+ TurnBasedMinecraftMod.logger.info("Enabled NpcAPI handling of Player damaged event");
}
}
}