CMI Flight Charge
This feature is disabled by default as we have to perform couple extra checks on player move and if you are not interested in using it, then better avoid doing those checks at all.
Players can buy fly charges by using exp or money (possible item thingy in future updates).
By default player can buy 1000 charges. Which will allow for player to fly 1000 blocks.
In case player hovers in one place, then 1 charge every second will be taken to discourage that behavior.
To prevent no damage on falling down from huge heights, as vanilla behavior prevents any fall damage if you can toggle fly mode, players can suffer one of two or both feedbacks:
Player will loose flight charge depending on fallen height x 2. In example if fallen down from 7 blocks height, then (7 - 3) * 2, as you can only suffer damage if you fall from higher than 3 blocks, so result will be 8 lost charges. Configurable.There is build in GUI for recharging, so type in /recharge and you are good to go.
Second result can be actual player damage. Simulates same damage as if you would not have fly mode. By default this only applies when jumping from cliff, but will not apply when toggling off fly mode while flying. Configurable. By default, even if you would jump from 200 height, you will not die, but you will have 1 heart left. Again, configurable.
By default, by spending one exp point you will get one charge point and same goes with money. This can be adjusted in config file.
As we have Bossbar engine, so players will see nice boss bar indicating how much of charge they have left
This includes your current left charge, how much you lost/gain in last check and maximum possible amount.
Graded bar which will update with amount and will change color depending how much of charge you have left. >50% green, >30% yellow, <30% red.
/cmi flightcharge (add/take/set/show/expcharge/moneycharge/recharge) (playerName) (amount) can be used if needed, but for basic recharge you can simply use /recharge command.
To check left charge, alias command can be used for simplicity /fcharge
Players with cmi.command.flightcharge.admin permission node can add/take/set
Currently if player uses all charges and he is in mid air, then he will get teleported back to ground, to avoid "accidents"