Jump to content

[1.7.10] Is there a calendar in forge or Vanilla code i can use?


Recommended Posts

Posted

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

Posted

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.

Posted

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.