SerenityJS
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    identifier: "minecraft:custom_form"

    The identifier of the screen.

    layout: LayoutElement = ...
    name: string

    The name of the property, used for identification and referencing purposes.

    parent: null | ObjectProperty<unknown> = null

    The path of the property within the object hierarchy.

    property: "custom_form_data"

    The data store property name associated with the screen.

    triggerCount: bigint = 0n

    A counter that keeps track of the number of times the listeners have been triggered, which can be used for various purposes such as debugging, analytics, or controlling the flow of events within the user interface based on the number of interactions that have occurred.

    type: Type = DataStorePropertyValueType.Type

    The type of the property, used for serialization and deserialization purposes.

    The value of the property, which can be of various types depending on the specific implementation and use case. This value is used for storing and retrieving data associated with the property.

    Methods

    • Add a listener function to the set of listeners associated with the observable element, allowing it to respond to specific events or interactions within the user interface.

      Parameters

      • listener: (player: Player, data: unknown) => void

        The listener function to be added, which defines the behavior and response of the observable element when certain events occur, enabling dynamic and interactive user interfaces.

      Returns void

    • Add a button to the custom form with the given label, listener, and options.

      Parameters

      • label: string | Observable<string>

        The label to be displayed on the button, which is a string value that represents the text shown on the button, allowing users to understand its purpose and function within the user interface.

      • listener: (player: Player) => void

        The listener function to be added to the button, which defines the behavior and response of the button when it is interacted with by users, enabling dynamic and interactive user interfaces.

      • options: ButtonOptions = {}

        The options for configuring the button, including the label to be displayed on the button and whether the button is visible or hidden in the user interface.

      Returns this

      The current instance of the CustomForm class.

    • Add a close button to the custom form with the given options.

      Parameters

      • options: CloseButtonOptions = {}

        The options for configuring the close button, including the label to be displayed on the button and whether the button is visible or hidden in the user interface.

      Returns this

      The current instance of the CustomForm class.

    • Add a divider element to the custom form with the given options.

      Parameters

      • options: DividerElementOptions = {}

        The options for configuring the divider element, including whether the divider is visible or hidden in the user interface of the custom form. The visibility option allows for dynamic control over whether the divider is displayed to users, enabling more flexible and customizable form layouts based on specific conditions or user interactions. By providing options for configuring the divider element, developers can create more dynamic and interactive user interfaces within their custom forms, enhancing the overall user experience.

      Returns this

      The current instance of the CustomForm class to allow for method chaining.

    • Get the path of the property within the object hierarchy, which can be used for proper referencing and access when serialized and deserialized.

      Returns string

      The path of the property within the object hierarchy, which is constructed based on the parent path and the name of the property.

    • Get the data store information for the property, which includes the identifier of the root screen and the path of the property within the object hierarchy, allowing for proper referencing and access when serialized and deserialized.

      Returns DataDrivenScreen

      A tuple containing the identifier of the root screen and the path of the property within the object hierarchy, which can be used for proper referencing and access when serialized and deserialized.

    • Add a label element to the custom form with the given text and options.

      Parameters

      • text: string | Observable<string>

        The text to be displayed on the label element.

      • options: LabelElementOptions = {}

        The options for configuring the label element, including whether the label is visible or hidden in the user interface of the custom form.

      Returns this

      The current instance of the CustomForm class to allow for method chaining.

    • Remove a listener function from the set of listeners associated with the observable element, allowing it to stop responding to specific events or interactions within the user interface.

      Parameters

      • listener: (player: Player, data: unknown) => void

        The listener function to be removed, which will no longer define the behavior and response of the observable element when certain events occur, allowing for dynamic control over the interactivity of the user interface.

      Returns void

    • Add a slider element to the custom form with the given label, value observable, minimum value, maximum value, and options.

      Parameters

      • label: string | Observable<string>

        The label to be displayed on the slider element, which is a string value that represents the text shown on the slider, allowing users to understand its purpose and function within the user interface of the custom form.

      • value: Observable<number>

        The observable that holds the value of the slider element, which is a number that represents the current position of the slider within its defined range. The value can be updated dynamically based on user interactions with the slider, allowing for real-time feedback and adjustments to other elements or data in the form based on the selected slider value. The observable nature of the value allows for seamless integration with other reactive components in the form, enabling dynamic and interactive user interfaces.

      • minValue: number

        The minimum value of the slider element, which is a number that represents the lower limit of the slider's range. The minimum value determines the lowest value that the slider can be set to when users interact with it in the user interface of the custom form. It is typically used in conjunction with the maximum value to define the range of values that the slider can represent, allowing users to select a specific value within that range by moving the slider handle. The minimum value can be updated dynamically based on specific conditions or user interactions, providing flexibility in how the slider behaves and interacts with other elements or data in the form.

      • maxValue: number

        The maximum value of the slider element, which is a number that represents the upper limit of the slider's range. The maximum value determines the highest value that the slider can be set to when users interact with it in the user interface of the custom form. It is typically used in conjunction with the minimum value to define the range of values that the slider can represent, allowing users to select a specific value within that range by moving the slider handle. The maximum value can be updated dynamically based on specific conditions or user interactions, providing flexibility in how the slider behaves and interacts with other elements or data in the form.

      • options: SliderElementOptions = {}

        The options for configuring the slider element, including the description of the slider element, whether the slider is disabled or not, whether the slider is visible or hidden in the user interface, and the amount by which the slider value changes when the user interacts with it.

      Returns this

      The current instance of the CustomForm class to allow for method chaining.

    • Add a spacer element to the custom form with the given options.

      Parameters

      • options: SpacerElementOptions = {}

        The options for configuring the spacer element, including whether the spacer is visible or hidden in the user interface of the custom form. The visibility option allows for dynamic control over whether the spacer is displayed to users, enabling more flexible and customizable form layouts based on specific conditions or user interactions. By providing options for configuring the spacer element, developers can create more dynamic and interactive user interfaces within their custom forms, enhancing the overall user experience.

      Returns this

      The current instance of the CustomForm class to allow for method chaining.

    • Add a text field to the custom form with the given label, text observable, and options.

      Parameters

      • label: string | Observable<string>

        The label to be displayed on the text field.

      • text: Observable<string>

        The observable that holds the value of the text field.

      • options: TextFieldOptions = {}

        The options for configuring the text field.

      Returns this

      The current instance of the CustomForm class to allow for method chaining.

    • Set the title of the custom form to be displayed to users when the form is shown in the user interface.

      Parameters

      • title: string | Observable<string>

        The title of the custom form, which is a string value that represents the text shown at the top of the form.

      Returns this

      The current instance of the CustomForm class.

    • Add a toggle element to the custom form with the given label, toggled state, and options.

      Parameters

      • label: string | Observable<string>

        The label to be displayed on the toggle element.

      • toggled: Observable<boolean>

        The observable that holds the toggled state of the toggle element.

      • options: ToggleElementOptions = {}

        The options for configuring the toggle element.

      Returns this

      The current instance of the CustomForm class to allow for method chaining.

    • Trigger all listener functions associated with the observable element, allowing it to respond to specific events or interactions within the user interface by executing the defined behavior and response of each listener function.

      Parameters

      • player: Player

        The player associated with the event or interaction, which can be used to provide context and information about the user who triggered the event, enabling personalized and dynamic user interfaces based on the player's actions.

      • data: unknown

        The data to be passed to each listener function when triggered, which can be used to provide context and information about the event or interaction that occurred, enabling dynamic and responsive user interfaces based on the provided data.

      Returns void