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

    Class MessageBoxBeta

    A simple message form with two buttons and a text body. Use this class to show a basic dialog to a player and handle the player's button selection.

    Index

    Constructors

    Methods

    • Beta

      Returns void

      Closes the message box if it is currently being shown to the player. Throws a FormVisibilityError if the form is not currently open.

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

      This function can throw errors.

      minecraftcommon.EngineError

      FormVisibilityError

      minecraftserver.InvalidEntityError

    • Beta

      Returns boolean

      Returns true if the message box is currently being shown to the player, false otherwise.

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

    • Beta

      Returns Promise<MessageBoxResult>

      Shows the message box to the player. Returns a promise that resolves with a MessageBoxResult containing the close reason and the player's button selection.

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

      This function can throw errors.

      minecraftcommon.EngineError

      FormVisibilityError

      minecraftserver.InvalidEntityError