I've deciphered this logic from a bukkit plugin source - I was wondering if anyone else can confirm if it is correct?
I am running it right now - but because the actual appearance of the moon varies depending on resource packs and shaders etc - it is hard to tell if it is accurate or not.
It has produced the desired effects on a few occasions - Just wana make sure it was no fluke.
I am trying to build temples and dungeons in my server where redstone doors will only open on the night of a Full Moon.
Does this logic look ok?
The original I got this from was doing
(getFullTime() / 24000)%8
I am assuming that 24000 was to get the current day number.
I am running it right now - but because the actual appearance of the moon varies depending on resource packs and shaders etc - it is hard to tell if it is accurate or not.
It has produced the desired effects on a few occasions - Just wana make sure it was no fluke.
Code:
local day, phase
day = os.day();
phase = day%8
if phase == 0 then
print("We have a full moon?")
end
I am trying to build temples and dungeons in my server where redstone doors will only open on the night of a Full Moon.
Does this logic look ok?
The original I got this from was doing
(getFullTime() / 24000)%8
I am assuming that 24000 was to get the current day number.