DavideBlade / HealthBar-Reloaded

Cool health bars above mobs' and players' heads, a must-have for RPG and PvP servers!
https://www.spigotmc.org/resources/healthbar-reloaded.104616/
GNU General Public License v3.0
6 stars 2 forks source link

Suggestion: {custom_name} in custom-text #19

Closed KhrysAK47 closed 1 month ago

KhrysAK47 commented 1 month ago

Could you please add support for {custom_name} in the custom-text? That way it displays the custom name of the mob and just adds the health display to it at the end. Thank you!

DavideBlade commented 1 month ago

If I have not misunderstood, this is exactly what {name} does. With the following configuration, you get the result below.

config.yml:

mob-bars:
  enable: true
  text-mode: true
  custom-text-enable: true
  custom-text: '{name} - &a{health}/{max}'

locale.yml:

CREEPER: CustomName:)

Result: Creeper with custom name

DavideBlade commented 1 month ago

I will add a clarification in the configuration file and documentation.

This will be the new config.yml from the next version:

  # The custom text. You can use these placeholder:
  # {name} = the name of the mob hit, which will correspond to the first value found from the following:
  #   1. Custom name of the mob (e.g. the one set with a name tag)
  #   2. The custom name set in the locale.yml file
  #   3. The real (vanilla) name
  # {health} = the current health
  # {max} = the maximum health
  # <3 = a hearth symbol (❤)
  # &4 / &n / &k ... = all the formatting codes
  #
  # For example this will be displayed as 'Creeper - 16/20'
  custom-text: '{name} - &a{health}/{max}'
DavideBlade commented 1 month ago

@KhrysAK47 let me know if you have any other concerns.