Constructors

Properties

buyShop: boolean

Whether or not players can buy items in this shop.

id: `playerShop:${number}:${string}`

The id of the player shop.

mainBuyPageBodyText?: string

The body text that is displayed on the main buy page of the server shop.

mainPageBodyText?: string

The body text that is displayed on the main page of the player shop.

mainSellPageBodyText?: string

The body text that is displayed on the main sell page of the server shop.

name?: string

The display name of the player shop. This is displayed on the button for the player shop in the manage player shops menu.

playerID: `${number}`

The ID of the player who owns this player shop.

playerName?: string

The name of the player who owns this player shop.

publicShop: boolean

Whether or not this shop can be accessed by any player through the use of the \viewplayershops command.

sellShop: boolean

Whether or not players can sell items in this shop.

title?: string

The title of the player shop. This is the title displayed at the top of the UI for the player shop.

Accessors

Methods

  • Parameters

    Returns Promise<0 | 1>

  • Parameters

    Returns Promise<void>

  • Parameters

    • player: Player
    • mode: "both" | "none" | "buy" | "sell" = ...
    • showBackButton: boolean = true

    Returns Promise<0 | 1>

  • Returns void

  • Parameters

    • shopID: string

    Returns PlayerShop

  • Parameters

    • playerID: `${number}`

    Returns PlayerShop[]

  • Returns string[]

  • Parameters

    • playerID: `${number}`

    Returns string[]

  • Opens the public shops selector interface for the player.

    Parameters

    • sourceEntity: loosePlayerType

      The player viewing the menu, can be an Entity, executeCommandPlayerW, or Player.

    • OptionalshowBackButton: boolean = false

      Optional boolean to indicate if a back button should be displayed.

    Returns Promise<0 | 1>

    A promise that resolves to 0 or 1 depending on the user's interaction:

    • 0: Indicates that the previous menu should be closed.
    • 1: Indicates that the previous menu should be re-opened.

    The function performs the following actions:

    1. Retrieves the player entity from the source entity.
    2. Asserts that the source entity is defined.
    3. Creates and configures an ActionFormData form with options for public player shops.
    4. Displays the form to the player and handles their selection:
      • manageMyShops: Opens the manage player shops interface.
      • manageAllShops: Opens the manage all shops interface (admin only).
      • playerShopSystemSettings: Opens the player shop system settings interface (admin only).
      • back: Returns 1.
      • close: Returns 0.
      • refresh: Refreshes the public shops selector interface.
      • shop: Opens the selected shop interface.
    5. Handles errors by logging and showing a message to the player.