Global Variable Event Help

Started by berberborscing on

Topic category: Help with MCreator software

Last seen on 04:55, 23. Dec 2019
Joined May 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Global Variable Event Help

Where would I put code to set variables for a global event, such as in older versions of MCreator where you could set variables when your player sleeps in a bed.

Last seen on 21:06, 23. Nov 2021
Joined Sep 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
maybe you can set a variable…
Thu, 06/07/2018 - 16:33

maybe you can set a variable when a player is right clicking a bed when it's night

Last seen on 04:55, 23. Dec 2019
Joined May 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I solved this; sorry, it was…
Thu, 06/07/2018 - 18:19

I solved this; sorry, it was really simple. The new Procedure mode element combines all event calls and global functions, evidently~
So, create three NUMBER variables:
1. SpawnX (Default value of 0)
2. SpawnY (Default value of 63 [sea level] )
3. SpawnZ (Default value of 0)
Then, create a Procedure (which I call GetSpawn) that sets these three global variables every time you right click on a bed;
-Set SpawnX to the player's X coordinate
-Set SpawnY to the player's Y coordinate
-Set SpawnZ to the player's Z coordinate

Now if only I could get SpawnX, SpawnY, and SpawnZ to be assigned immediately upon world creation..