Procedure that triggers upon it becoming nighttime

Started by TheCabbage on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedure that triggers upon it becoming nighttime

So, I have a procedure that I want to activate when it becomes night time.  Specifically, it is supposed to say something in chat on New Moons and Full Moons.  But I can't figure out a trigger to use other than "on world tick update", which causes the message to be spammed ever tick.  Is there any other way I can have this procedure get naturally triggered with no input from the player? (image attached)Procedure to say  "TEST" on new and full moons, with the 'on world tick update' trigger.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could use a global logic…
Thu, 12/04/2025 - 12:38

You could use a global logic variable, set it to false when the condition is not met, and require it to be false to send the message (using a separate if condition inside the first one). Then, when it sends the message, set it to true. That way it will act as a switch that toggles on and off, while still using the same global trigger and similar procedure setup to what you currently have.

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could do on world tick…
Thu, 12/04/2025 - 17:05

You could do on world tick update, if get world time = [whenever night comes, I am not sure] AND if get moon phase = 1 OR 5, do procedure. 

Joined Dec 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Are you able to create…
Thu, 12/04/2025 - 19:04

Are you able to create global logic variables?  I thought they were restricted to just the default ones?  If so, how do you do that?

Joined Dec 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I figured out how to do the…
Thu, 12/04/2025 - 19:29

I figured out how to do the global variable, and I have this once created as a Global_World logic variable.  This is the new procedure I worked out, but it is still resulting in the message being spammed in chat.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Turn is_super_night to true…
Thu, 12/04/2025 - 19:55

Turn is_super_night to true when it is day in provided world, and re-add the check that it is not day in provided world to the lower if condition.

That way is_super_night will only be true during the day, and when it turns to night, it will trigger the second procedure one time, then turn is_super_night to false, and it won't turn back to true until the next day.