Started by
Zuha
on
Topic category: Help with modding (Java Edition)
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
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. =)