Hey! I am currently making a single-player RPG plugin. I'm planning to add something like a damage indicator where colors differ depending on the severity of the damage recieved. I had an idea to do something like LastDamage (math thingy) with MaxHealth Which I can't recall doing because my brain is too small to remember things from the past and I need your help to do math things!!!!!
PHP: $severity = $player->getHealth() - $player->getLastDamageCause()->getFinalDamage();if ($serverity < 3); // Do stuff if health lower than 3switch ($serverity) { case 3: // Do stuff if health equals 3 break; default: // Else... break;}