Script API - v26.50.27
    Preparing search index...

    Class WorldClockBeta

    A class that represents a particular clock within a world.

    export class WorldClock {
    private constructor();
    isPaused: boolean;
    readonly name: string;
    time: number;
    readonly timeMarkers: TimeMarker[];
    addTimeMarker(timeMarkerOptions: TimeMarkerOptions): void;
    removeTimeMarker(timeMarker: string | TimeMarker): void;
    rewindTo(timeMarker: string | TimeMarker): void;
    set(timeMarker: string | TimeMarker): void;
    skipTo(timeMarker: string | TimeMarker): void;
    }
    Index

    Constructors

    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.

    This property can't be read in early-execution mode.

    name: string

    The identifier that represents this world clock.

    This property can't be read in early-execution mode.

    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

    This property can't be read in early-execution mode.

    timeMarkers: TimeMarker[]

    Retrieves the current time markers of the world clock.

    This property can't be read in early-execution mode.

    Methods

    • 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

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

    • 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

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

    • 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

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

    • 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

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

    • 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

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