A class that wraps the state of a world - a set of dimensions and the environment of Minecraft.

Hierarchy

  • World

Constructors

  • Returns World

Properties

events: Events

Contains a set of events that are applicable to the entirety of the world.

scoreboard: Scoreboard

Returns the general global scoreboard that applies to the world.

Methods

  • Parameters

    • id: string
    • value: string

    Returns void

  • Returns number

    Remarks

    Returns the absolute time since the start of the world.

  • Returns Player[]

  • Parameters

    • dimensionId: string

    Returns Dimension

    The requested dimension

    Throws

    Throws if the given dimension name is invalid

  • Parameters

    • identifier: string

    Returns string | number | boolean

    Returns the value for the property, or undefined if the property has not been set.

    Remarks

    Returns a property value.

    Throws

    This function can throw errors.

  • Parameters

    Returns PlayerIterator

    All players currently in the world.

    Remarks

    Returns all players currently in the world.

    Throws

    This function can throw errors.

  • Returns number

    Remarks

    Sets the current game time of the day.

  • Parameters

    Returns void

    Remarks

    Plays a particular music track for all players.

  • Parameters

    Returns void

    Remarks

    Plays a sound for all players.

  • Parameters

    Returns void

    Remarks

    Queues an additional music track for players. If a track is not playing, a music track will play.

  • Parameters

    • identifier: string

    Returns boolean

    Remarks

    Removes a specified property.

    Throws

    This function can throw errors.

  • Parameters

    Returns void

    Remarks

    Broadcasts a message that is displayed on all connected clients.

    Throws

    This function can throw errors.

  • Parameters

    • identifier: string
    • value: string | number | boolean

      Data value of the property to set.

    Returns void

    Remarks

    Sets a specified property to a value.

    Throws

    This function can throw errors.

  • Parameters

    • timeOfDay: number

    Returns void

    Remarks

    Returns the current game time of the day.

  • Returns void

    Remarks

    Stops any music tracks from playing.