is Daylight Time

Check to see if current time is within the daytime value given.

gameplay.isDaylightTime(DAY)

Parameters

  • query: the time of day to query:
    • day
    • dawn
    • midday
    • dusk
    • night
    • midnight

Returns

  • a boolean value that is true if the current time is within the daytime value given, false otherwise.

Example

Give a chat message saying whether the current time is during the day or not.

if (gameplay.isDaylightTime(DAY)) {
    player.say("It's day.")
} else {
    player.say("It's not day.")
}

See Also

||gameplay:time query||