Pets need to be more identifiable by other plugins
DSH105 opened this issue ยท 2 comments
It has been brought to my attention that, at the moment, pets are not easily identifiable as EchoPet entities. The only way to achieve this is to unnecessarily traverse through OBC/NMS (as is currently done in the plugin itself):
if (((CraftEntity) entity).getHandle() instanceof IEntityPet) {
// do stuff
}
Potential solution(s):
- Label each pet entity with a specific metadata tag.
- Provide a better API (
EchoPet.isPet(entity)
?). - Other solutions.
Option 2 has the disadvantage of requiring plugins wishing to detect if an entity is a pet to explicitly (soft-)depend on EchoPet.
I'd vote for #1, like Citizens does :)
A simple "pet" boolean would be great. I currently look for unknown entity types, but we also use MythicMobs and they are using custom entities in the latest version. I want to be able to target mobs but not pets, so it's a bit of an issue.