so, im working on this mod called "about dragons"
i have some future plans for it, but for now, im working on an end game enchantment that you get after you beat the ender dragon
the enchantment has 3 levels and is called Flapping (Flapping I, Flapping II, Flapping III)
it basicaly flap the elytra when you press V and gives you a little boost, nothing too op
i already figured a way to give the player, when flying, a boost but i don't know how to link this to my enchantment, and "nerf" it to the levels.
i want one flap per level, so when you have flapping III you can flap your wings 3 times in a flight before landing (then it resets and you are able to fly/flap again)
how can i create this "charges" and how pressing "v" consume one "charge" after flapping?
how can i set one "charge" per level? so the lvl 3 enchant have 3 charges?
The Meaning of Life, the Universe, and Everything.
I would look at the elytra source code and see how it handles firework rockets. Then I would take code from there and use a key-pressed function to trigger the boost with a counter equal to the level of the flapping enchantment's level I would look at the bows source code and see how it determines if an enchantment is in use.