Manages the tick loop for a world.
Signature:
export default class WorldLoop extends EventRouter Extends: EventRouter
The world loop automatically handles ticking physics, entities, and other world logic.
The internal order of tick operations is as follows:
-
Update chunks and meshing
-
Tick entity logic
-
Step physics
-
Check and emit entity updates
-
Synchronize network packets with player clients
This class is an EventRouter, and instances of it emit events with payloads listed under WorldLoopEventPayloads
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the WorldLoop class.
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
number |
The current tick of the world loop. | |
|
|
number |
The next tick time in milliseconds. | |
|
|
number |
The fixed timestep of the world loop in seconds. | |
|
|
The world that the loop manages. |