FLOODGATE

This module allows you to interact with the Floodgate plugin.

The Floodgate plugin is required for this module to work

Check if a player has logged in through Bedrock Edition

%player% [(is|does)](n't| not) from floodgate

Get the localization of the player

[the] be[[drock] [edition]] (locale|language) of [the] [floodgate] %player%
%player%'s be[[drock] [edition]] (locale|language) [of [the] floodgate]

Get the name of the player’s device

[the] [be[[drock] [edition]]] (platform|device) of [the] [floodgate] %player%
%player%'s [be[[drock] [edition]]] (platform|device) [of [the] floodgate]

Get the Bedrock version of the client

[the] be[[drock] [edition]] version of [the] [floodgate] %player%
%player%'s be[[drock] [edition]] version [of [the] floodgate]

Subsections of Floodgate

FORM TYPES

Creating a new form

It is the simplest form, which has only two buttons and a description block. The buttons are a conditional choice of ‘yes’ or ’no’.
The created form will be placed in the expression last created form

create [a] [new] modal form (with (name|title)|named) %string%
command /modalform:
    trigger:
      create modal form named "Modal form":
        set form content to "Please select one option"
        run on form close:
            broadcast "closed"
        run on form open:
            broadcast "opened"
        form button named "I like skript!":
            broadcast "Thank you!!!"
        form button named "I didnt like skript!":
            broadcast "USE DENIZEN INSTEAD!!!"
            broadcast "Just kidding, skript is the best"
            broadcast "If you use denizen, you are just wasting your time"
      open last created form to player

modal form
modal form

Simple form

It is a form with buttons. There can be an unlimited number of buttons, in addition, the buttons can have images from the Internet.
The created form will be placed in the expression last created form

create [a] [new] simple form (with (name|title)|named) %string%
command /simpleform:
    trigger:
        create simple form named "Simple form":
            form button named "button 1" with image "https://pics.clipartpng.com/Carrots_PNG_Clipart-465.png":
                broadcast "button 1 pressed"
            form button named "button 2":
                broadcast "button 2 pressed"
            form button named "button 3":
                broadcast "button 3 pressed"
        open last created form to player

simple form
simple form

Custom form

It is a form with any elements except buttons. This type of forms allows you to use sliders, switches, input fields, selection fields, etc.
The processing of the form elements is carried out in the section on form result
The created form will be placed in the expression last created form

create [a] [new] custom form (with (name|title)|named) %string%
command /customform:
  trigger:
    create custom form named "Custom form":
      form dropdown named "Select one value from list" with elements "one", "two", "three"
      form input named "Your password?" with placeholder "write your password"
      form label named "sample text"
      form slider named "music volume????" with minimum value 0 and maximum value 10
      form textslider named "select shit" with elements "value 1","value 2","value 3"
      form toggle named "yes or no?"
      run on form result:
        broadcast "%form toggle 1 value%"
        broadcast "%form dropdown 1 value%"
        broadcast "%form input 1 value%"
        broadcast "%form label 1 value%"
        broadcast "%form slider 1 value%"
        broadcast "%form textslider 1 value%"

    open last created form to player

custom form
custom form

Last created form

[the] (last[ly] [(created|edited)]|(created|edited)) form

Open the form to the player

open %form% (for|to) %players%

FORM ELEMENTS

Buttons

The button is a section, the code inside of which will be executed when you click on it.
After clicking on the button, the form will be automatically closed (a feature of Bedrock forms).

Can only be used in Modal form and Simple form because these forms support button interactions.
Using buttons in other forms may result in unexpected behavior or errors.
The button with the image can only be used in Simple form

form(-| )button ((with (name|title))|named) %string% [with image %string%]
command /modalform:
  trigger:
    create modal form named "Modal form":
      form button named "My button":
        broadcast "Pressed button"

    open last created form to player

Description of Modal form.

The Modal form allows you to specify or retrieve a text description that provides context or instructions to the user.
This description can be set during the creation of the form or modified later in an already created form.
It is particularly useful for guiding users through the form’s purpose or actions they need to take.
For more details, refer to the creation section Modal form .

form['s] content
content of form
%form%['s] content
content of %form%
command /modalform:
  trigger:
    create modal form named "Modal form":
      set content of form to "Sample text"
    open last created form to player

Custom form Elements

The values of Custom form Elements can only be retrieved in the run on form result section after the form is closed.

User Input element

Creates an element in which the user can enter any text.
Allows you to specify the initial text inside the field, and the placeholder text.

form(-| )input (with name|named) [%string% (with|and) [placeholder] %string%[(, | (with|and) ) [def[ault] [value]] %string%]]
Choosing from the list

Creates an element in which the user can select one of the suggested values. Allows you to specify the initial value by index.

form(-| )drop[(-| )]down (with name|named) %string% (with|and) [elements] %strings%[(, | (with|and) ) [def[ault] [(element [index]|index)]] %number%]
Label, note, text

Creates an element with text.

form(-| )label [(with (name|title)|named)] %string%
A slider with a numeric value selection

Creates an element in the form of a strip with a control in which the user can specify a value. Allows you to specify the minimum and maximum threshold of numbers, the initial value and the slider step.

form(-| )slider (with name|named) %string% [[(with|and) [min[imum] [value]] %number%[(, | (with|and) ) [max[imum] [value]] %number%[(, | (with|and) ) [def[ault] [value]] %number%[(, | (with|and) ) [[step] [value]] %number%]]]]
A slider with a selection of values

Creates an element similar to the numeric slider, but with text values. Allows you to specify the initial value by index.

form(-| )(text|step)[(-| )]slider (with name|named) %string% (with|and) [elements] %strings%[(, | (with|and) ) [def[ault] [(element [index]|index)]] %number%]
command /textsliderform:
    trigger:
        create custom form named "Text Slider Form":
          form textslider named "Choose an option" with elements "Option 1", "Option 2", "Option 3", "Option 4" with default element index 2

        open last created form to player
The switch element.

It has only two states, on or off.
You can specify the initial state.

form(-| )toggle (with name|named) %string% [(with|and) [def[ault]] [value] %boolean%]

Processing the results

Get the player inside the form

Use this expression to get the player interacting with the form. For example, instead of using a variable like %player% to refer to the player, you can directly use this expression to ensure it references the player inside the form.

form(-| )player

Getting the type of the created form

form[(-| )]type of %form%
%form%'s form[(-| )]type

Available types of forms for comparison:

  • custom form
  • modal form
  • simple form

Execute the code when opening/closing the form

run (when|while) (open[ing]|clos(e|ing)) [[the] form]
run (when|while) [the] form (opens|closes)
run on form (open[ing]|clos(e|ing))
create modal form named "Modal form":
  run on form close:
    broadcast "%formplayer%" #will show the name of the player who closed the form
open last created form to player

Disable or allow closing of the form

By default, closing the form is allowed. If closing is disabled, the form will reopen after a selection is made.

cancel [the] form clos(e|ing)
uncancel [the] form clos(e|ing)

Get the reason for closing the form

This expression can only be used in the section on executing code when closing the form

[form(-| )]close reason

Available reasons for closing for comparison:

  • close
  • (submit|success)
  • invalid[ response]

Execute the code on form submit

run on form (result|submit)
create custom form named "Custom form":
  form toggle named "toggle value"
  run on form result:
    broadcast "%form toggle 1 value%"
open last created form to player

Custom form elements

This expression can only be used in the section on executing code on form submission

[form[(-| )]](drop[(-| )]down|input|slider|step[(-| )]slider|toggle) %number% [value]
value of [form[(-| )]](drop[(-| )]down|input|slider|step[(-| )]slider|toggle) %number%

For button processing Modal form and Simple form use the section on creating buttons