Skip to content

Mob Display Health #338

Open
Open
@IceWolf23

Description

@IceWolf23

Mob Display Health - Script

When a player hits any entity, the Mob Type is displayed with the remaining life (in HP) in the actionbar

__on_player_deals_damage(player, amount, entity) -> (
    
    entity_hp = format('r '+round(query(entity, 'Health')));
    _entityHealth = (number(entity_hp)-number(floor(amount)));
    if (
        _entityHealth < 0, (
            _entityHealth = 0
        )
    );
    text_string = (format('w '+entity)+format('g  » ')+format('r '+_entityHealth+' ❤'));
    display_title(player, 'actionbar', text_string);

    return()
);

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions