Class ServerTickEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.tick.ServerTickEvent
- Direct Known Subclasses:
ServerTickEvent.Post
,ServerTickEvent.Pre
public abstract class ServerTickEvent
extends net.neoforged.bus.api.Event
Base class of the two server tick events.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ServerTickEvent.Post
is fired once per server tick, after the server performs work for the current tick.static class
ServerTickEvent.Pre
is fired once per server tick, before the server performs work for the current tick. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
ServerTickEvent
(BooleanSupplier hasTime, MinecraftServer server) -
Method Summary
Modifier and TypeMethodDescriptionReturns the server instance.boolean
hasTime()
Returns true if the server has enough time to perform any additional tasks (usually IO related) during the current tick, otherwise false.
-
Field Details
-
hasTime
-
server
-
-
Constructor Details
-
ServerTickEvent
-
-
Method Details
-
hasTime
public boolean hasTime()Returns true if the server has enough time to perform any additional tasks (usually IO related) during the current tick, otherwise false.- Returns:
- true if the server has enough time to perform any additional tasks (usually IO related) during the current tick, otherwise false
-
getServer
Returns the server instance.- Returns:
- the server instance
-