A class that provides system-level events and functions.

Hierarchy

  • System

Constructors

  • Returns System

Properties

currentTick: number

Represents the current world tick of the server.

events: SystemEvents

Contains a set of events that are applicable for the lifecycle of items in the Minecraft system.

Methods

  • Parameters

    • runId: number

    Returns void

    Remarks

    Cancels the execution of a function run that was previously scheduled via the run function.

  • Parameters

    • runScheduleId: number

    Returns void

    Remarks

    Cancels the execution of a scheduled function run that was previously scheduled via the runSchedule function.

  • Parameters

    • callback: (() => void)

      Function callback to run when the tickDelay time criteria is met.

        • (): void
        • Returns void

    • Optional tickDelay: number

      Number of ticks to wait before running this function. 1 means this function will run on the next tick. A value of 20 means that this function will run in 20 ticks (or approximately one second). When the value of '0' is used within an event handler, this funtion will run later within the tick frame. Using the value of '0' within a System.run function is not supported.

    Returns number

    An opaque identifier that can be used with the clearRun function to cancel the execution of this run.

    Remarks

    Runs a specified function at a future time. This is frequently used to implement delayed behaviors and game loops.

  • Parameters

    • callback: (() => void)

      Function callback to run on the specified schedule.

        • (): void
        • Returns void

    • Optional tickInterval: number

      The number of ticks to run this function within - run this function every tickInterval ticks.

    Returns number

    An opaque identifier that can be used with the clearRunSchedule function to cancel the execution of this scheduled run.

    Remarks

    Runs a specified function at a scheduled interval. This is frequently used to implement delayed behaviors and game loops.