What am I doing wrong?

Started by Boi3 on

Topic category: Help with modding (Java Edition)

Last seen on 03:33, 3. Apr 2021
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What am I doing wrong?

https://cdn.discordapp.com/attachments/791088632659181588/818648488950497280/Code.png

I'm trying to make it so it spawns a torch when the player enters my new dimension, but it keeps spawning the torches after it places one and I can't fix it

Last seen on 00:30, 24. Aug 2023
Joined May 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You are using local…
Tue, 03/09/2021 - 01:30

You are using local variables, meaning they reset each time the procedure is called. If you want a variable to be permanent for the world, you should use global variables instead. You can make a global variable in the Variables menu on the left of the workspace window.