Class: World
A class that wraps the state of a world - a set of dimensions and the environment of Minecraft.
Constructors
new World()
private
new World():World
Returns
Properties
afterEvents
readonly
afterEvents:WorldAfterEvents
Remarks
Contains a set of events that are applicable to the entirety of the world. Event callbacks are called in a deferred manner. Event callbacks are executed in read-write mode.
beforeEvents
readonly
beforeEvents:WorldBeforeEvents
Remarks
Contains a set of events that are applicable to the entirety of the world. Event callbacks are called immediately. Event callbacks are executed in read-only mode.
gameRules
Beta
readonly
gameRules:GameRules
Remarks
The game rules that apply to the world.
scoreboard
readonly
scoreboard:Scoreboard
Remarks
Returns the general global scoreboard that applies to the world.
structureManager
readonly
structureManager:StructureManager
Remarks
Returns the manager for Structure related APIs.
Methods
broadcastClientMessage()
Beta
broadcastClientMessage(
id
,value
):void
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The message identifier. |
value | string | The message. |
Returns
void
Remarks
A method that is internal-only, used for broadcasting specific messages between client and server.
This function can't be called in read-only mode.
clearDynamicProperties()
clearDynamicProperties():
void
Returns
void
Remarks
Clears the set of dynamic properties declared for this behavior pack within the world.
getAbsoluteTime()
getAbsoluteTime():
number
Returns
number
Remarks
Returns the absolute time since the start of the world.
getAllPlayers()
getAllPlayers():
Player
[]
Returns
Player
[]
Remarks
Returns an array of all active players within the world.
Throws
This function can throw errors.
getDay()
getDay():
number