I'm mad at this problem. Let's start. I want to add some modifiers to various minecraft events (for example, how much damage has been done in EntityDamageByEntityEvent) according to the level that is stored in the MySQL database.
This level system will have 99 levels (from 1 to 100), up to 50 levels by default; for example, in the case of EntityDamageByEntityEvent, I would like to change the damage like this:
a) If a player had a level of 50, the damage would not have been changed (it would have simply been multiplied by 1).
b) If a player had 1 level, the damage done would be multiplied by 1/3.
c) If a player had a level of 100, the damage would have been increased by 3.
So far, so good, but how can I do this in the case of a player with level 17 or 89? I want to know how to convert, say, a scale from 1 to 100 to 1/3 to 3, beeing 50 = 1 ... A bit of reason ... Thanks in advance, I hope you understand me!
source
share