Can't check global variables

Started by ivanwafles67 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can't check global variables
Mon, 05/03/2021 - 00:22 (edited)

Hello, I have a procedure that is supposed to go through if a certain global variable is set to "taiga". I verified that the variable can in fact be changed to that, by having a "print" block. However, this if statement isn't returning true and so the inside blocks aren't being considered. I know the variable armyteam is in fact "taiga", but the if statement isn't passing as true. I've had this problem with other global text variables. How could I fix this?

screenshot

Edited by ivanwafles67 on Mon, 05/03/2021 - 00:22
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Are you using a player…
Mon, 05/03/2021 - 01:45

Are you using a player variable?

 
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's a global PLAYER…
Mon, 05/03/2021 - 01:57

It's a global PLAYER_PERSISTENT variable, so it should be referencing the player involved in the procedure, I think. 

Or does it only work if the Event/Target Entity is the player? Because in the screenshot, the player is the Source Entity.

Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
only if the event entity is…
Mon, 05/03/2021 - 02:04

only if the event entity is the player

I will give you a solution

Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know if it is the…
Mon, 05/03/2021 - 02:10

I don't know if it is the best but it works
On player tick update set nbt (armyteam) to global (armyteam)

And to the procedure of your picture
you would check if "source entity" has the ntb taiga

Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
sorry for my English  
Mon, 05/03/2021 - 02:11

sorry for my English