LOOHP / HoloMobHealth

Display Mob Health above head through packets!
https://www.spigotmc.org/resources/75975/
GNU General Public License v3.0
14 stars 7 forks source link

Add EliteMobs support #16

Closed apatuka closed 2 years ago

apatuka commented 2 years ago

Hello !

It's possible to add the same logic as ShowMythicMobsHealth but for EliteMobs ? Whenever i spawn a EliteMobs, it replaces it's nameplate with the HoloMobHealth nameplate

Also if it's possible to add dynamic placeholders for EliteMobs like Mob Name and Level.

Thank you !

LOOHP commented 2 years ago

Currently, there are no plans to hook into more mob plugins. So a "ShowMythicMobsHealth" for EliteMobs might not be available. However. through the use of the Custom JavaScript placeholders built into HoloMobHealth, you can hook into EliteMobs and retrieve mob names and levels. There are a few examples but with MythicMobs in the plugin folder.

apatuka commented 2 years ago

By seeing the sample you told about, i fixed it with a Javascript function:

function parse() {
        if(LivingEntity.isDead())
            return null;

        if (EntityTracker.static.isEliteMob(LivingEntity)) {
            var eliteName = "";
            if(EntityTracker.static.getEliteMobEntity(LivingEntity).getName() != null)
                eliteName = EntityTracker.static.getEliteMobEntity(LivingEntity).getName()+" ";

            return eliteName;
        }

        return null;
    }

    parse();

Thanks !

apatuka commented 2 years ago

https://imgur.com/a/S62fp47