Started by
nilek20
on
Topic category: Help with Minecraft modding (Java Edition)
I am working on adding spells to my mod and i want to make a mana attribute (similar to the vanilla hunger bar) but am not really sure how to go about it. I have looked at the overlay creator and have no clue how to use it to make what i want. If this is overly complicated i don't need it to have a bar and can just add the stat. once i have the stat, how do i set the mana to regen at a certain rate.
I suggest making a Player_Lifetime variable named mana, and then a procedure that increases its value by a little every few update ticks.
how do i do this though do you know a tutorial I'm not as gifted as you are with these skills
I've done a very similar thing in a large mod I'm currently working on.
What you'll need is a global variable bound to a player, and one overlay for every segment of the mana bar (mine has 8 because I didn't feel like making 20). Set the overlay to only appear when the mana variable is at its corresponding value, e.g. set the overlay for 0 mana to only appear when the numerical value of the variable is 0. Repeat this process for every overlay, making sure to adjust the conditions properly. Then create ingame methods of gaining/losing mana.
could you send the procedure please please please
please send the procedures please
There really aren't any large procedures, just ones in each overlay to detect if the variable has the corresponding mana amount.
it would make my life much easier please
I don't seem to be able to post images.
how do i make variables???
sorry, i know now, but how do i make global variables? there is no button anywhere to make or delete one
https://mcreator.net/wiki/variables
There is a variables tab at the side of the workspace.
nvm i figured out before