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