Posted July 3, 201510 yr I want to keep track of the days-for the purpose of weather cycles and such. I cant do a tickHandler because that would be loop-holey and going to bed at night would make the mod think it's night and Minecraft know it's day. Thank you in advance
July 3, 201510 yr World#isDaytime() can tell you if it's night or day, and World#getWorldTime() gives you the current time in ticks, so divide that by 24000 and you've got the number of days spent in game. Then there is World#getCurrentDate which gives you a java.util.Calendar object - this gives you the real date (as in from real life) and is used by certain mobs to do things on Halloween and such. Finally, there is World#getMoonPhase which sort of gives you a rough idea of what time of the month it is, in game. http://i.imgur.com/NdrFdld.png[/img]
July 3, 201510 yr World#isDaytime() can tell you if it's night or day, and World#getWorldTime() gives you the current time in ticks, so divide that by 24000 and you've got the number of days spent in game. Then there is World#getCurrentDate which gives you a java.util.Calendar object - this gives you the real date (as in from real life) and is used by certain mobs to do things on Halloween and such. Finally, there is World#getMoonPhase which sort of gives you a rough idea of what time of the month it is, in game. To add to that, World#getTotalWorldTime() returns the total ticks passed in the world since the world was created Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.