Posted February 22, 20232 yr occureHi in my mod I have a method wich tells me if it is day or night: Spoiler public static Boolean isDay(){ Level world = Minecraft.getInstance().level; if (world == null) return null; return world.getDayTime() < 12400 || world.getDayTime() > 23950; } My Problem is that it does not always recognize the right time, I can fix this by manualy setting the time to night or day. Also this doesn't always occur. Does enyone know why? The default Minecraft Method also doesn't work. Thanks for helping Edited February 22, 20232 yr by Cron3x
February 22, 20232 yr You could look at how DaylightSensorBlock.java (or whatever it may be called) does it. I'm not good at modding, but at least I can read a crash report (well enough). That's something, right?
February 22, 20232 yr Author 1 hour ago, Hipposgrumm said: You could look at how DaylightSensorBlock.java (or whatever it may be called) does it. Thanks, I really didn't think of that. I feel stupid now
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.