Time Range
Description
Matches when the hour of the world's in-game clock, 0 to 23, is inside a range.
This condition checks the world of the entity. It never matches in the Nether or the End.
It is the whole hour that <mythicseasons.hours> reports. Both ends count, so max=18 matches until the end of hour 18, and a min above max wraps past midnight: min=20;max=4 matches 20 to 23 and 0 to 4. The condition works with the calendar off.
The hour depends on the settings (Calendar):
- On the plain clock, world time 0 is hour 6 and 6000 (noon) is hour 12.
- With
modify-daynight-length: trueinconfig.yml, in a world with a season and a calendar date, the clock follows the month'sday-length-in-minandnight-length-in-minincalendar.yml. - With
sync-time-with-real-world: trueit is the real hour in the configured timezone.
Attributes
| Attribute | Aliases | Description | Default |
|---|---|---|---|
| min | from | The first hour, 0 to 23. | 0 |
| max | to | The last hour, 0 to 23. | 23 |
A value that is not a whole number, such as 6.5, is reported in the console and makes the condition always false.
Examples
NightFireflies:
Cooldown: 4
Conditions:
- timerange{from=20;to=4} true
Skills:
- message{m="Fireflies drift over the grass."} @Self
Runs at night, from hour 20 to hour 4.
EveningBell:
TargetConditions:
- timerange{from=18;to=18} true
Skills:
- message{m="The evening bell rings."}
RingForNearbyPlayers:
Skills:
- skill{s=EveningBell} @PlayersInRadius{r=60}
Equal ends match a single hour.
LateNightNotice:
Skills:
- message{m="It is past midnight."} @Self ?timerange{from=0;to=3}
Inline, it tests the caster.
Aliases
- hourrange