Need help making a mana bar

Started by nilek20 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Need help making a mana bar

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.

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I suggest making a Player…
Mon, 09/07/2020 - 19:45

I suggest making a Player_Lifetime variable named mana, and then a procedure that increases its value by a little every few update ticks.

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i do this though do…
Wed, 09/23/2020 - 14:23

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…
Wed, 09/23/2020 - 15:21

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.

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
could you send the procedure…
Wed, 09/23/2020 - 15:47

could you send the procedure please please please

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
please send the procedures…
Wed, 09/23/2020 - 15:52

please send the procedures please

There really aren't any…
Wed, 09/23/2020 - 16:58

There really aren't any large procedures, just ones in each overlay to detect if the variable has the corresponding mana amount.

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
it would make my life much…
Wed, 09/23/2020 - 17:31

it would make my life much easier please

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i make variables???
Tue, 02/16/2021 - 04:45

how do i make variables???

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
sorry, i know now, but how…
Tue, 02/16/2021 - 04:52

sorry, i know now, but how do i make global variables? there is no button anywhere to make or delete one

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
nvm i figured out before
Tue, 02/16/2021 - 23:45

nvm i figured out before