This Rust plugin adds a floating health bar ui above entities you attack, such as npcs, animals, patrol helicopter, and others. It supports multiple color themes, and you can configure how long the ui stays visible and which entities trigger it.
Permissions
enemyhealthbar.use
- Allows a player to see the health bar ui.enemyhealthbar.ignore
- Prevents a player's own health from being displayed to others when they are attacked.
Commands
/healthbar
- Toggles the health bar UI on/off for you./healthbar list
- Lists all available color palettes (from the plugin's config)./healthbar <paletteName>
- Sets your personal color palette to the specified name (if it exists in the config).
Configuration
JSON:
{
"Version": "1.3.0",
"Health Bar Display Duration Seconds": 5.0,
"Health Bar Toggle Chat Command": "healthbar",
"Whitelisted Entity Keywords (Leave empty to allow all entities)": [
"player",
"scientist",
"bear",
"polarbear",
"wolf",
"stag",
"boar",
"patrolhelicopter",
"bradleyapc",
"vehicles"
],
"Blacklisted Entity Keywords": [],
"Health Bar Hidden Below This Distance": 5.0,
"Health Bar Hidden Beyond This Distance": 50.0,
"Default Ui Color Palette": "Orange",
"Ui Color Palettes": {
"Orange": {
"Health Bar Background Color": "#3A1E03",
"Health Bar Border Color": "#190C02",
"Health Bar Fill Color": "#D27411",
"HP Value Text Color": "#FFE9C2"
},
"Green": {
"Health Bar Background Color": "#033A0D",
"Health Bar Border Color": "#051905",
"Health Bar Fill Color": "#11D238",
"HP Value Text Color": "#D7FFD2"
},
"Blue": {
"Health Bar Background Color": "#03193A",
"Health Bar Border Color": "#020E19",
"Health Bar Fill Color": "#1192D2",
"HP Value Text Color": "#D2F1FF"
},
"Red": {
"Health Bar Background Color": "#3A0D03",
"Health Bar Border Color": "#190503",
"Health Bar Fill Color": "#D23811",
"HP Value Text Color": "#ECD646"
}
}
}
Health Bar Display Duration Seconds
- How long the health bar stays visible after an attack.Health Bar Toggle Chat Command
- The chat command players can use to toggle the health bar on or off for themselves.Whitelisted Entity Keywords
- Determines which entities can display a health bar. If left empty, all entities are allowed. If specific keywords are added, only entities whose prefab name contains one of those keywords will show a health bar.Blacklisted Entity Keywords
- Prevents specific entities from ever displaying a health bar, even if they match the whitelist. This is useful if you want to allow most enemies but exclude certain ones.Health Bar Hidden Below This Distance
- Hides the health bar if the player is closer than this distance to the target (to prevent overlapping with the vanilla bar).Health Bar Hidden Beyond This Distance
- The health bar will only be shown if the target is within this distance from the player.Selected Ui Color Palette
- The name of the currently active ui color scheme.Ui Color Palettes
- A list of custom color schemesthat can be selected inSelected Ui Color Palette
.- Each palette consists of:
Health Bar Background Color
- The color behind the health bar.Health Bar Border Color
- The border color of the bar.Health Bar Fill Color
- The color representing remaining health.HP Value Text Color
- The text color for displaying exact HP values.
- Each palette consists of:
Stored Data
JSON:
{
"Health Bar Enabled": {
"76561198000000001": true,
"76561198000000002": false
},
"User Color Palettes": {
"76561198000000001": "Green",
"76561198000000002": "Red"
}
}
Health Bar Enabled
- Shows each player's Steam Id along with a true/false value indicating whether their health bar is turned on (true) or off (false).User Color Palettes
- Stores each player's Steam Id along with the name of the color palette they've chosen (like “Red” or “Blue”). Players not listed here will default to the plugin's main palette.
Localization
JSON:
{
"NoPermission": "You do not have permission to use this command.",
"HealthBarEnabled": "Enemy health bar enabled!",
"HealthBarDisabled": "Enemy health bar disabled!"
}
Developer Hooks
C#:
bool CanSeeEnemyHealthBar(BasePlayer viewer, BaseCombatEntity target)
viewer
- the player who would see the health bar.target
- the entity whose health is about to be displayed (e.g., a scientist, bear, another player).- Returning
true
forces the bar to show,false
blocks it, andnull
lets Enemy Health Bar apply its normal logic.