I want to be sure that the procedure will be completed on a certain day of the game

Started by Zuha on

Topic category: Help with modding (Java Edition)

Last seen on 22:15, 27. Jan 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I want to be sure that the procedure will be completed on a certain day of the game
Fri, 01/26/2024 - 20:26 (edited)
I want to make sure that on a certain day of the game a procedure is carried out. But I can’t figure out how to do this, please help me.
Edited by Zuha on Fri, 01/26/2024 - 20:26
Last seen on 16:12, 15. Oct 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can get the 'world time'…
Sat, 01/27/2024 - 12:59

You can get the 'world time' as a number, which is the current number of ticks the world has been running. (One day is 24000 ticks.) Dividing by 24000 and rounding down should give you the current in-game day. If you want the current real-world day, you can also reference the system clock instead. (The calendar stuff can be found in the 'date and time' tab, the world time is found in the 'world data' tab.)

You would probably need to use the 'on player update tick' trigger for this, just to get a sense of where the player is, but you could also just use the 'on world tick update' trigger, (though this is less helpful since it doesn't give you much to work with.) 

Also, you don't need to use a text box for your posts, those are just for code inserts. =)