illusivesoulworks / consecration

Minecraft Mod: Makes the undead more resilent except against fire and holy damage, and adds new features to help you slay them
https://www.curseforge.com/minecraft/mc-mods/consecration
Other
4 stars 6 forks source link

Possible way of picking up on undead mobs #1

Closed Sunconure11 closed 6 years ago

Sunconure11 commented 6 years ago

A lot of undead mobs are classified under a creature attribute enum named EnumCreatureAttribute.UNDEAD. Why not use this to pick up on modded undead, or at least, try and pick up on them a bit easier?

TheIllusiveC4 commented 6 years ago

Don't I do that already?

This is where I check for the applicable creatures to cancel death: https://github.com/TheIllusiveC4/Consecration/blob/163c6bb8ec57908feba3e66512250aa8eba20c63/src/main/java/c4/consecration/common/EventHandlerCommon.java#L109

Which leads to this method in the EntityLivingBase class: public boolean isEntityUndead() { return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; }

TheIllusiveC4 commented 6 years ago

It's been a little over a week so if there's nothing to be corrected, I'll go ahead and close this issue. Please let me know if I've misunderstood anything.