1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script Health Bar 1.0

A fancy way to display entity's health to players around

  1. C
    Supported Minecraft Versions:
    • 1.8, 1.10, 1.12, 1.14
    Health Bar
    A fancy way to display entity's health to players around.​

    [​IMG]

    Dependencies:

    >>> Note for HealthBar users:

    • After the script is enabled, teleporting entity with health bar on will not work.
    • SOLUTION: To teleport entities, please use the function hpBar_safeTeleport(target[entity], location[location])
    • An Example for /tp command to work:
    • Code (Text):
      1. command /tp [<player>] [<player>] [<text>]:
      2.     trigger:
      3.         if executor doesn't have permission "server.administrator":
      4.             send "&cYou are not allowed to use this command!" to executor
      5.             stop
      6.         if arg 3 is set:
      7.             if arg 1 is set:
      8.                 set {_target} to arg 1
      9.             else:
      10.                 set {_target} to executor
      11.             set {_coords::*} to arg 3 split by " "
      12.             set {_location} to location at (("%{_coords::1}%" parsed as number), ("%{_coords::2}%" parsed as number), ("%{_coords::3}%" parsed as number)) in world("%executor's world%")
      13.             hpBar_safeTeleport({_target}, {_location})
      14.             stop
      15.         if arg 1 and arg 2 is not set:
      16.             send "&cUsage: /tp <destination player> [player] OR /tp [player] <x> <y> <z>" to executor
      17.             stop
      18.         if arg 2 is set:
      19.             hpBar_safeTeleport(arg 1, (arg 2's location))
      20.         else:
      21.             hpBar_safeTeleport(executor, (arg 1's location))

    Config:
    • Code (Text):
      1. options:
      2.  
      3.     # Select the entities that are going to have health bar enabled.
      4.     # EXAMPLE: [healthBarTargets: player or cow]
      5.     healthBarTargets: player or cow
      6.    
      7.     # Add in the argument for health bar entity's health
      8.     # EXAMPLE: [entityCurrentHealth: {_entity}'s health]
      9.     entityCurrentHealth: {_entity}'s health
      10.    
      11.     # Add in the argument for health bar entity's max health
      12.     # EXAMPLE: [entityMaxHealth: {_entity}'s max health]
      13.     entityMaxHealth: {_entity}'s max health