Error with Mana Bar

Started by 2Cool4u on Mon, 11/23/2020 - 19:36

Topic category: Help with modding (Java Edition)

Last seen on 15:56, 25. Jan 2021
Joined Apr 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Error with Mana Bar
Mon, 11/23/2020 - 19:36

HI, I made a mana bar but for some reason when I use an item that is supposed to consume the mana, it consumes the nbt value of 1 mana but the overlay doesnt show - 1 mana star. I set the first mana star to display only when the nbt value is greater than 1, than second is 2, etc... any help?

Last seen on 10:06, 25. Jan 2021
Joined Jul 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
pictures of your work would…
Mon, 11/23/2020 - 22:26

pictures of your work would help allot :)

 

Last seen on 15:56, 25. Jan 2021
Joined Apr 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I think I got it but there…
Tue, 11/24/2020 - 02:09

I think I got it but there had to be a better way to do it, ill send a photo one second.

Last seen on 15:56, 25. Jan 2021
Joined Apr 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
(No subject)
Tue, 11/24/2020 - 02:13

Ok so this is it. But I have a question. I made a global variable called "manavalue" count up on player tick. The global variable is a NUMBER type and variable scope is PLAYER_LIFETIME. I works fine at the moment but I was wondering, will this work in multiplayer? Is the global variable for all players or just each person?

Last seen on 15:56, 25. Jan 2021
Joined Apr 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
(No subject)
Tue, 11/24/2020 - 02:15

Try #2

Last seen on 06:10, 25. Jan 2021
Joined Mar 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
The global variable when…
Tue, 11/24/2020 - 04:07

The global variable when specified for player only affects the player if I am correct, at least through the testing I've done. I may be wrong however.

Last seen on 10:06, 25. Jan 2021
Joined Jul 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
the variables are local to…
Tue, 11/24/2020 - 06:06

the variables are local to the event that effects the variable.

remember, there are times where you cannot use global variable of player like on entity attacked trigger.
The only way to update a global variable from a situation like this is to set the one of the triggers nbt data then have a procedure that will set your global variable to the local nbt data that you saved before.

Hope that made sense.

Last seen on 15:56, 25. Jan 2021
Joined Apr 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I understand, thank you
Tue, 11/24/2020 - 18:16

I understand, thank you