@minecraft/server-editor
    Preparing search index...

    Class TransactionManagerBeta

    The Transaction Manager is responsible for tracking and managing all of the registered transaction operations which represent creator changes in the world. Transaction Manager is the basis of the UNDO and REDO operations, and allows a creator to store the changes made to the world and the state of the world BEFORE those changes were applied, making it possible to UNDO those changes and restore the world state. The transactions are stored as a stack, and can be undone in stack order to restore the world to it's original state

    Index

    Methods

    • Beta

      Parameters

      • name: string

      Returns PendingTransaction

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

      This function can throw errors.

    • Beta

      Parameters

      • undoClosure: (arg0: string) => void
      • redoClosure: (arg0: string) => void

      Returns UserDefinedTransactionHandlerId

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

      This function can throw errors.

    • Beta

      Returns void

      Perform an redo operation. This will take the last transaction record on the redo stack and store the current world state and then apply the changes in the record. This will reduce the redo record stack by one.

      The transaction record affected by this operation will be transferred to the undo stack in case the creator decides to undo it

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

      This function can throw errors.

    • Beta

      Returns number

      Return the number of transaction records on the redo stack.

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

      This function can throw errors.

    • Beta

      Returns void

      Perform an undo operation. This will take the last transaction record on the stack and apply the stored world state from before the changes were made. This will reduce the record stack by one.

      The transaction record affected by this operation will be transferred to the redo stack in case the creator decides to reapply it

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

      This function can throw errors.

    • Beta

      Returns number

      Return how many transactions records currently exist on the stack

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

      This function can throw errors.