LOOHP / HoloMobHealth

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

[Suggestion] Add Support for LevelledMobs #15

Closed Chris6ix closed 2 years ago

Chris6ix commented 2 years ago

Could you please add Support for LevelledMobs so that HoloMobHealth doesn't show the Health Display for Mobs from LevelledMobs?

I just added LM to my Server and saw that HoloMobhealth overwrites their Health display, and so doesn't show their level anymore :/

I really love your plugin and would want to continue using it for the normal mobs...

Cheers, Chris6ix

LOOHP commented 2 years ago

You can kinda have the mob levels displayed through HoloMobHealth with javascript placeholders in holomobhealth. Using these from LevelledMobs

Chris6ix commented 2 years ago

Mhm...not a very ideal solution, but I have tried it to see how that would look, and it doesn't work... What do I need to do for it to work? I downloaded "javascript" from papi and reloaded the plugin Then I tried to add %levelledmobs_level% or {%levelledmobs_level%} to the Display Text in HoloMobHealth And it just looks like this: 2022-04-12_23 20 30 Or like this... 2022-04-12_23 23 25

Here are all my placeholder hooks installed: 2022-04-12_23 24 17 Here is also the part in my HoloMobHealth config: image

Chris6ix commented 2 years ago

The problem is also that now all the mobs show this LevelledMobs health...even the ones that are not from LevelledMobs (Like normal animals) :/

The best thing would just be proper compatibility of LevelledMobs in HoloMobhealth...

LOOHP commented 2 years ago

I mean the javascript placeholders in holomobhealth, not papi. Take a look at the placeholder_scripts folder in the HoloMobHealth plugin folder

Chris6ix commented 2 years ago

Oh...okay, and how do these work? (What do i need to do now?)

LOOHP commented 2 years ago

Look at one of the examples in the placeholder_scripts folder, basically, you can create your own placeholders to be used in the HoloMobHealth config. It works similar to javascript placeholders in papi.

Chris6ix commented 2 years ago

Do I need to know javascript to make this placeholder? Because I don't understand much in these files :/

LOOHP commented 2 years ago

Here's an example of how you would get the level of the mob in levelledmobs LevelledMobsLevel.js This file goes into the plugins/HoloMobHealth/placeholder_scripts/scripts folder. Then you'll have to add these lines into the scripts.yml in plugins/HoloMobHealth/placeholder_scripts

LevelledMobsLevel:
  file: LevelledMobsLevel.js

Now you will be able to use {LevelledMobsLevel} in the config.yml

Chris6ix commented 2 years ago

That is perfect! Thank you. This fixes the problem completely :) Now all mobs that come from LevelledMobs have a level displayed and normal mobs stay normal!

You should add this file as default to HoloMobHealth, and then you could also add LevelledMobs as partly compatible here, just like MythicMobs: image

Just one more question: What exactly is meant by compatibilty with Worldguard? Can you choose to not show the Health Bar in a specific WorldGuard Region? Because i cannot find any "WorldGuard" setting in the config...

LOOHP commented 2 years ago

A few state flags are added to worldguard. Btw this is a bit off-topic to this ticket. I think opening a new one or asking on my discord server would be better. Closing this for now.