Skip to content

[Bug] setName does not update the mob name #298

@RemForever0

Description

@RemForever0

✔️ Pre-check

Tested with the latest snapshot of BetterModel from Modrinth

Confirmed the issue occurs without other optional/experimental plugins affecting MythicMobs mechanics

🐞 Problem Description

setname does not update the mob name when the mob takes damage or its HP changes.

I am trying to display the mob's current HP in the name using <caster.hp>.

The name is set correctly on spawn, but when the mob takes damage the name does not update.
Even though the skill is triggered with ~OnDamaged, the HP value in the name remains the same.

It looks like any HP change does not update the displayed value.

Example skill:

  • setname{n="<caster.name> &7| &c<caster.hp{round=0}>&f%nexo_health%";delay=5} @self ~OnDamaged

Full test mob configuration:

  Template: templatemob
  Type: PIG
  Display: '&cур. 6 &7| &cДикий кабан'
  Health: 130
  Damage: 12
  Options:
    PreventRandomEquipment: true
    MovementSpeed: 0.25
    IsKillerBunny: true
    AlwaysShowName: true
    PreventOtherDrops: true
    KnockbackResistance: 0.3
    PreventSunburn: true
    Silent: true
  Skills:
  - model{mid=boar;n=name} @self ~onSpawnOrLoad
  - setname{n="<caster.name> &7| &c<caster.hp{round=0}>&f%nexo_health%";delay=5} @self ~onSpawnOrLoad
  - setname{n="<caster.name> &7| &c<caster.hp{round=0}>&f%nexo_health%";delay=5} @self ~OnDamaged```

Expected behavior:

When the mob takes damage, <caster.hp> should update and the name should change.

Actual behavior:

The name does not update and HP value remains the same.

📜 Server Log

No errors in console.

🖼️ Screenshot / Video

Can be provided if necessary.

🧪 Test Model / Code

The mob configuration above is enough to reproduce the issue.

🌍 Environment

OS: Linux

Server software & version: Paper 1.21.4

MythicMobs version: 5.11.2
BetterModel version: 2.2.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions