@minecraft/server
    Preparing search index...

    Class WorldClockBeta

    A class that represents a particular clock within a world.

    Index

    Properties

    isPaused: boolean

    Retrieves or sets whether the world clock is currently paused.

    restricted-execution-read-only - This property can't be edited in restricted-execution mode.

    name: string

    The identifier that represents this world clock.

    time: number

    Retrieves or sets the current time (in ticks) of the world clock.

    restricted-execution-read-only - This property can't be edited in restricted-execution mode.

    Minimum Value: 0

    timeMarkers: TimeMarker[]

    Retrieves the current time markers of the world clock.

    Methods

    • Beta

      Parameters

      Returns void

      Adds a new time marker to the world clock.

      no-restricted-execution - This function can't be called in restricted-execution mode.

      This function can throw errors.

      WorldClockAddTimeMarkerError

    • Beta

      Parameters

      • timeMarker: string | TimeMarker

        The time marker or time marker name to remove.

      Returns void

      Removes an existing time marker from the world clock.

      no-restricted-execution - This function can't be called in restricted-execution mode.

      WorldClockTimeMarkerNotFoundError: If the time marker does not exist on the world clock. WorldClockRemoveMinecraftTimeMarkerError: If the time marker uses the 'minecraft' namespace.

      WorldClockRemoveMinecraftTimeMarkerError

      WorldClockTimeMarkerNotFoundError

    • Beta

      Parameters

      • timeMarker: string | TimeMarker

        The time marker or time marker name to rewind the world clock's time to.

      Returns void

      Rewinds the world clock's time to the previous occurrence of the specified time marker.

      no-restricted-execution - This function can't be called in restricted-execution mode.

      WorldClockTimeMarkerNotFoundError: If the time marker does not exist on the world clock. WorldClockRewindError: If the world clock's current time is before the time marker's first occurrence.

      WorldClockRewindError

      WorldClockTimeMarkerNotFoundError

    • Beta

      Parameters

      • timeMarker: string | TimeMarker

        The time marker or time marker name to set the world clock's time to.

      Returns void

      Sets the world clock's time to the specified time marker.

      no-restricted-execution - This function can't be called in restricted-execution mode.

      WorldClockTimeMarkerNotFoundError: If the time marker does not exist on the world clock.

      WorldClockTimeMarkerNotFoundError

    • Beta

      Parameters

      • timeMarker: string | TimeMarker

        The time marker or time marker name to skip the world clock's time to.

      Returns void

      Skips the world clock's time to the next occurrence of the specified time marker. If the next occurrence overflows the world clock's time, the time is reset to the first occurrence.

      no-restricted-execution - This function can't be called in restricted-execution mode.

      WorldClockTimeMarkerNotFoundError: If the time marker does not exist on the world clock.

      WorldClockTimeMarkerNotFoundError