HyperScript
Docs

← All of the Docs HyperBedrock

Forms HyperBedrock

expressionshow form <id> to <who> titled <text> with buttons <text>, <text>HyperBedrock

A list of buttons under a title. Add with text <text> before with buttons for a line above them

show form "kits" to player titled "&lKits" with text "Pick a kit" with buttons "Warrior", "Archer", "Miner"
expressionshow question form <id> to <who> titled <text> with text <text> with buttons <text>, <text>HyperBedrock

A question with exactly two buttons

show question form "reset" to player titled "Reset" with text "Really delete your home?" with buttons "Yes, delete it", "No"
expressionshow input form <id> to <who> titled <text> with <part>, <part>HyperBedrock

A form to fill in; the parts are listed below

show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5
structureon form "<id>":HyperBedrock

Runs when a player answers the form of that id. player is who answered

on form "reset":
    if {_index} is 1:
        delete {%player%.home}
        send "&aYour home was deleted."
structureon form closed "<id>":HyperBedrock

Runs when they close it without answering

on form closed "kits":
    send "&7Maybe later."
expressioninput <label>HyperBedrock

A box to type in. Add hint <text> for the grey text shown while it is empty

send "&7Device: &f%device of arg.1% &7Input: &f%input of arg.1%"
expressiontoggle <label>HyperBedrock

A switch, off to begin with; toggle <label> on starts it on

show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5
expressiondropdown <label> of <list>HyperBedrock

One of several choices: dropdown "Kit" of ["Warrior", "Archer"] or a list in a variable

show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5
expressionslider <label> from <n> to <n>HyperBedrock

A number between two ends, in whole steps; step <n> after it for other steps

show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5
expressionlabel <text>HyperBedrock

A line of text, nothing to fill in

show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5
Guide and examples
command /kits:
    players only: true
    trigger:
        show form "kits" to player titled "&lKits" with text "Pick a kit" with buttons "Warrior", "Archer", "Miner"

on form "kits":
    if {_button} is "Warrior":
        give 1 iron sword to player
    else if {_button} is "Archer":
        give 1 bow to player
    else:
        give 1 iron pickaxe to player
    send "&aYou took the %{_button}% kit."

on form closed "kits":
    send "&7Maybe later."

command /resetme:
    players only: true
    trigger:
        show question form "reset" to player titled "Reset" with text "Really delete your home?" with buttons "Yes, delete it", "No"

on form "reset":
    if {_index} is 1:
        delete {%player%.home}
        send "&aYour home was deleted."

command /report:
    players only: true
    trigger:
        show input form "report" to player titled "Report a player" with label "Staff read every report.", input "Who?" hint "Their name", dropdown "Why?" of ["Cheating", "Chat", "Other"], toggle "Urgent", slider "How bad?" from 1 to 5

on form "report":
    set {_who} to item 1 of {_answers}
    set {_why} to item 2 of {_answers}
    log "%player.name% reported %{_who}% for %{_why}% (urgent: %item 3 of {_answers}%, %item 4 of {_answers}% of 5)"
    send "&aThank you. Staff have been told."
SyntaxEffect
show form <id> to <who> titled <text> with buttons <text>, <text>A list of buttons under a title. Add with text <text> before with buttons for a line above them
show question form <id> to <who> titled <text> with text <text> with buttons <text>, <text>A question with exactly two buttons
show input form <id> to <who> titled <text> with <part>, <part>A form to fill in; the parts are listed below
on form "<id>":Runs when a player answers the form of that id. player is who answered
on form closed "<id>":Runs when they close it without answering

What an input form is made of:

PartIt is
input <label>A box to type in. Add hint <text> for the grey text shown while it is empty
toggle <label>A switch, off to begin with; toggle <label> on starts it on
dropdown <label> of <list>One of several choices: dropdown "Kit" of ["Warrior", "Archer"] or a list in a variable
slider <label> from <n> to <n>A number between two ends, in whole steps; step <n> after it for other steps
label <text>A line of text, nothing to fill in
  • The <id> ties a form to its blocks: show form "kits" is answered in on form "kits":. It is never shown to the player.
  • In on form, for a button or question form {_button} is what the pressed button says and {_index} its number, counting from 1. For an input form {_answers} is a list of what was filled in, in the order of the parts: text for an input and a dropdown, true or false for a toggle, a number for a slider. Labels are not counted.
  • A form shown to a Java player does nothing: they have no forms. Ask platform of player first, as in the example at the top.
  • The buttons may also be given as one list: with buttons {kit.names}.
  • Colour codes work in titles, text and buttons.