Sometimes there is an error where an Entity might get NaN health(Not a Number) which essentially makes the Entity immortal. This kills the entity and…