Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
Entity Health Display

Entity Health Display

Fabric server-side library mod for displaying entities' health.

830
1
Library

Compatibility

Minecraft: Java Edition

1.21.x
1.20.2–1.20.4

Platforms

Fabric
Quilt

Supported environments

Server-side

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Links

Report issues View source Join Discord server

Creators

Tyap-Lyap Modding
Tyap-Lyap ModdingOrganization

Details

Licensed MIT
Published last year
Updated 6 months ago
DescriptionGalleryChangelogVersions

About

Entity Health Display is a fabric server-side library for displaying entities' health.

Installing

To use Entity Health Display in your project add the Modrinth repository to your build file and a mod dependency. Replace the VERSION_TAG with the latest version, for example 0.3.1+1.20.2

repositories {
    maven {
        url "https://api.modrinth.com/maven"
        content { includeGroup "maven.modrinth" }
    }
    maven { url "https://maven.nucleoid.xyz" }
}

dependencies {
    modImplementation include("maven.modrinth:entity-health-display:VERSION_TAG")
    modImplementation include("eu.pb4:placeholder-api:${project.placeholder_api}")
    modImplementation include("eu.pb4:polymer-virtual-entity:${project.polymer_version}")
}

Example

HealthDisplayEvents.FORMAT_HEALTH_DISPLAY.register((entity, world) -> {
   String color = (entity.getMaxHealth() / 2) >= entity.getHealth() ? "<yellow>" : "<green>";
   var text = TextParserUtils.formatText("<red>" + entity.getName().getString() + " " + color + String.format("%.1f", entity.getHealth()) + "<white>/<green>" + (int)entity.getMaxHealth() + "<red>❤");
   return text;
});

HealthDisplayEvents.SHOULD_DISPLAY_HEALTH.register((entity, world) -> {
   return true;
});

Modrinth is open source.

main@396f737

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.