Custom Entity Metadata Standard

Discussion in 'Plugin Development' started by Scyntrus, Jan 30, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Scyntrus

    I'm the author of the Faction Mobs plugin, as seen in my signature. From making this plugin, which involves custom entities, I have noticed that keeping plugins compatible with other plugins which introduce custom entities is as hassle.

    I propose a new standard, whereby plugins which add custom entities also give their entities a metadata tag, which other plugins can easily access without importing your plugin, recognize that the entity is not vanilla and treat it appropriately.

    For example, in my Faction Mobs plugin, I tag every entity with "Custom Entity" metadata. Using this metadata, other plugins can then call getOwningPlugin() on the metadata, and getName() on the plugin to see which plugin spawned the custom entity.

    Of course, this standard would need to be ironed out, but I think it's a good step to improving cross plugin compatibility.
     
  2. Offline

    xTrollxDudex

    Scyntrus
    I've never seen any conflicts between custom entities, but if I did, this seems like a nice idea. You have an example of a conflict?
     
  3. Offline

    Jogy34

    The only conflicts that I've seen with my own custom entities is when plugins look at the type of an entity. I have mostly seen this with my player NPC's where a plugin will go through the players in a world and do something with them. I have found ways around this though for the most part.

    Just like xTrollxDudex I haven't seen or heard of any conflicts with plugins that use custom entities because they use custom entities. Only problems with plugins that do something with normal entities treating any entity as a normal entity. I don't think there would be a way to unanimously get people to start checking for custom entities though.
     
  4. Offline

    Scyntrus

    The biggest problem I've seen is how some land protection plugins will remove custom entities just like regular entities. Also, specifically to my plugin, my mobs will attack custom entities from other plugins, since it can't tell that the other mobs aren't regular mobs.
     
Thread Status:
Not open for further replies.

Share This Page