Skip to content

Dynamic Healthbar Colours and Insta-kill text#48

Open
radioactive-exe wants to merge 14 commits intoProvismet:1.21.5from
radioactive-exe:1.21.5
Open

Dynamic Healthbar Colours and Insta-kill text#48
radioactive-exe wants to merge 14 commits intoProvismet:1.21.5from
radioactive-exe:1.21.5

Conversation

@radioactive-exe
Copy link

@radioactive-exe radioactive-exe commented Jun 5, 2025

ADDED

  • Aggression-based healthbar start colours - Neutral, Aggressive/Hostile, and Passive/Default
  • Colours change based on entity state, e.g. if a neutral mob becomes angry, the healthbar colour changes
  • Instant kill and regular kill text particle
  • Logic for both specific uniquely behaving mobs and generic mobs to be compatible with most modded mobs
  • Tamed mobs will always appear as passive
  • Toggles in the config for both Aggression colours (separate for both the HUD and in-world) and Kill text (in the Particles tab)
  • If Aggression colours are turned off, all mobs will use the default/passive colour. Only the start colours are altered, the end colours (if Dynamic Colouring is enabled) stays the same.
  • If the kill/instakill text is turned off, regular number particles spawn for kills and instakills.
  • Functional Utilities class, to house functional utilities like generic LERPing, etc. Currently houses the colour deduction logic.
  • Added lang entries in en_gb and en_us.

CHANGED

  • Altered TextParticle Codec sifting to allow strings to be passed to the particles too

REMOVED

  • Unused imports removed

KNOWN ISSUES

  • Zombified Piglins' aggression behaves weirdly, so the bar colour alternates depending on action: Chasing player = isAttacking, anything else = !isAttacking and hasAngerTime - very peculiar behaviour.
  • A few mobs, like Hoglins (which are Passive in terms of class), Piglins, and Endermen have unique behaviour that has to be accounted for in manual check

Possible TODOs:

  • Fix zombie piglins
  • Add more circumstantial text particles, like for critical hits, etc
  • Allow very quick configurable LERP on aggression change for the colours.

PS: Comments throughout the code explain everything, please let me know if I missed anything

Provismet and others added 11 commits May 14, 2025 23:32
+ Added entity aggression logic to the HUD and world healthbars
+ Toggle-able config along with new colour config entries for different entity aggression healthbar colours.
+ Dynamic healthbar colour changes in case mob aggression changes (neutral to aggressive/vice versa)
+ Accounts for angerable hostile mobs, tameable mobs, and all regularly hostile mobs (default is passive)

TODO:
+ Verify Piglin unique behaviour with mod healthbar colours.
+ Fix and figure out Llama aggression behaviour to reflect in colours

Optional:
+ Make the colour changes lerp a bit smoothly

Note: I finished the content for this commit about 3 weeks ago but had to go out of town
Fix inconsistencies with upstream
FEAT:
+ Added instant kill messages
+ Added kill messages

TODO: Add toggles
@radioactive-exe
Copy link
Author

Closed to fix upstream inconsistencies, reopened once merged and fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants