Annotation Interface Every
Runs the method periodically on the mod's own thread, as
ModThread.scheduleAtFixedRate(Runnable, Duration, Duration)
or ModThread.scheduleWithFixedDelay(Runnable, Duration, Duration) do. The schedule starts once the mod's
onServerStarted() returned (also when it threw); for an object registered later with
Events.register(Object), at once. A run that throws is logged and ends the schedule;
the schedule ends as well when the server stops or the object's subscription is cancelled.
The method has no parameters and returns void; otherwise the rules of
Events.register(Object) apply. Like any mod-thread work, it must not touch game
objects.
@Every(value = 1, unit = ChronoUnit.MINUTES)
void report() { ... }
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanfalse: the period counts from the start of each run (fixed rate);true: from the end of each run (fixed delay).longThe time before the first run, at least 0.
-
Element Details
-
value
long valueThe period, at least 1. -
unit
ChronoUnit unit- Default:
SECONDS
-
initialDelay
long initialDelayThe time before the first run, at least 0.- Default:
0L
-
fixedDelay
boolean fixedDelayfalse: the period counts from the start of each run (fixed rate);true: from the end of each run (fixed delay).- Default:
false
-