Hi everyone,
I recently wrote a Skript to display health bars next to all mobs' names. However, after implementing the script, my server crashed within a minute, causing over 10,000 entities to spawn and bringing the server offline.
I’m unsure why this is happening and would greatly appreciate any assistance in fixing it.
Below is the code I used:
- Skript 2.8.7
Thanks in advance for your help!
I recently wrote a Skript to display health bars next to all mobs' names. However, after implementing the script, my server crashed within a minute, causing over 10,000 entities to spawn and bringing the server offline.
I’m unsure why this is happening and would greatly appreciate any assistance in fixing it.
Below is the code I used:
code_language.skript:
every 5 ticks:
loop all entities:
if loop-entity is a living entity:
set {_maxHealth} to loop-entity's max health
set {_health} to loop-entity's health
set {_barLength} to 10
set {_type} to loop-entity's type
set {_typeFormatted} to {_type} in strict proper case
set {_barFilled} to rounded up ({_barLength} * ({_health} / {_maxHealth}))
set {_barEmpty} to {_barLength} - {_barFilled}
set {_hearts} to "&c{@heart}" repeated {_barFilled} times
set {_bar} to "%{_hearts}%"
set loop-entity's name to "&e%{_typeFormatted}%&r &7[&r%{_bar}%&7]&r "
- Skript 2.8.7
Thanks in advance for your help!