Diamond's Form Builder
By TheDiamondBlue1
Release: 6/7/25
Updated: 6/7/25
Version: 1.0.0
About It
What Is It?
Welcome to Diamond's Form Builder! Our powerful script allows you to effortlessly create various forms in Minecraft, including Action Forms, custom Modal Forms, and Message Forms. With the ability to assign actions for button clicks and form events, you have complete control over your creations. Dive in and enhance your Minecraft experience with user-friendly forms tailored to your needs! This was inspired by AxisCube's Form Builder.
How It Works
Welcome to our addon! Inside, you'll find a well-organized structure with six folders under scripts: class, def, engine, forms, utils, and vanilla, each serving a specific purpose. The Class folder contains entityClass.js for item spawns, while the Def folder holds a TypeScript Definition for autocompletion and form building. The Engine folder is where the magic happens, featuring Form Builders and action functions. In the Forms folder, you can manage your forms and drop-down items, while the Utils folder ensures everything runs smoothly. Lastly, the Vanilla folder is in progress, aimed at simplifying forms with dimension names, game modes, text color and style names, and categorized mobs.
What's Next?
Below, you will find the Form Types, Action Types, and more to help you build your own custom forms!
Form Types
There are 3 different types of forms in Minecraft: Action, Modal, Message.
Action Forms are forms with buttons that can have tons of buttons with different actions.
Modal Forms are forms that can have different elements, allowing more customisability, but more time to set up.
Message Forms are forms that have 2 buttons only, not more, not less. This is usually for Yes/Confirm and No/Deny functions.
Below will tell you what you can do and have for each forms
Action Forms
This is how you set up the basics.
title - Sets the title text for the form.
body - Sets the body text for the form [Is Optional].
type - Sets the type between "action", "modal", & "message".
elements [] - Sets the elements for the form.
Action Elements
There are 4 different element types: "button", "divider", "header", "label". We will show you how to use each one and what it does.
Buttons
type - The element type. Button adds a button to the form.
buttonName - Set the name for the button.
icon - Set the icon using a texture path. [Is Optional]
onClick - Holds the action for when the button is clicked. [Don't use if you want the button to just close].
Dividers
type - The element type. Divider adds a divider line; it can be placed in between buttons.
Headers
type - The element type. Header adds a header to the top of the form, no matter how it is ordered.
headerText - Sets the text for the header.
Labels
type - The element type. Labels adds labels in the form; it can be placed in between buttons.
labelText - Sets the text for the label
Action Types
Actions can be used in onOpen, onClose, and onClick in Action Forms. There are 12 Action Types: "add_tag", "cmds", "eval", "form", "gamemode", "give", "remove_tag", "say", "sound", "summon", "tp" or "teleport", and "tellraw".
Add Tags
This action will add a tag to the player that clicked it.
type - The action type. Add Tag will add a tag.
value - The action value. The tag that will be added.
Cmds/Commands
This action lets you run an Array of commands. This should be used if no other actions can preform what you wanted it to do.
type - The action type. Runs commands in an array.
value [] - The action value. The Array of commands.
Eval
This action lets you run a java script code. Takes the value string and turns it into code.
type - The action type. Runs eval code.
value - The action value. The string that will run as code.
Form
This action lets you open another form. Can go from form to form.
type - The action type. Opens another form.
value - The action value. Uses the form name to open.
Gamemode
This action lets you change gamemodes. Go from Creative to Survival.
type - The action type. Change gamemodes.
value - The action value. The new gamemode. Can be an object and select a specific player.
Give
This action lets you give items to self.
type - The action type. Give items.
value - The action value. Item ID for the item and amount for the amount of item.
Remove Tags
This action will remove the tag to the player that clicked it.
type - The action type. Remove Tag will remove the tag.
value - The action value. The tag that will be removed.
Says
The action will send a message in that chat. The sender is the person who pushed the button.
type - The action type. Talks in the chat.
value - The action value. The value is what will be sent through the chat.
Sound
This action will play a sound at the player's location that pushed it.
type - The action type. Plays a sound.
value - The action value. As a string, it is just the sound name. In the object, you use soundId. Volume and pitch are optional and default to 1. Target is also optional and defaults to self, but if all is put in, it will play in all player's locations.
Summon
This action will summon a mob at your location or another specified location.
type - The action type. Summons a mob.
value - The action value. As a string, it is just the entity's identifier. As an object, it is both the entity's identifier and the location.
TP/Teleport
This action lets you teleport yourself to another location and in a different dimension.
type - The action type. Teleports self. "tp" and "teleport" are both valid.
value - The action value. Define the location and the dimension. If dimension is undefined, then it will default to "overworld".
Tellraw
This action will work just like how the tellraw commands work.
type: The action type. The tellraw function.
value: The action value. The value is the same as if you did the command.
Modal Forms
So, Modal forms were tricky to set up but we got it to work. It was a few more things with the elements then normal.
This is how you set up the basics.
title - Sets the title text for the form.
type - Sets the type between "action", "modal", & "message".
elements [] - Sets the elements for the form.
Modal Elements
Modal has the most elements out of all the forms. There are 8 elements, but we have 9: "divider", "dropdown", "header", "label", "player", "slider", "submitButton", "textField", and "toggle". We will show how to use them and what they do
Dividers
type - The element type. Divider adds a divider line; it can be placed in between other elements.
Dropdowns
type - The element type. Adds a dropdown menu in the forms.
label - The element label.
items [] - The values for the dropdown.
default - The default value it goes to. [Is Optional].
tooltip - Adds a tooltip for the element. [Is Optional].
value - Connects what this is for to the action.
Headers
type - The element type. Header adds a header to the top of the form, no matter how it is ordered.
label - Sets the text for the header.
Labels
type - The element type. Labels adds labels in the form; it can be placed in between elements.
label - Sets the text for the label
Player
type - The element type. Adds a dropdown menu with player name in the forms.
label - The element label.
tooltip - Adds a tooltip for the element. [Is Optional].
value - Connects what this is for to the action. Player should be the "selector" which is the effect player/
Sliders
type - The element type. Adds a slider in the form
label - The element label.
range - Holds the values of the slider.
min - The lowest value for the slider.
max - The highest value for the slider.
step - The amount that it goes by. Defaults to 1 [Is Optional].
default - The default value it goes to. [Is Optional].
tooltip - Adds a tooltip for the element. [Is Optional].
value - Connects what this is for to the action.
Submit Buttons
type - The element type. Adds the submit button. Every Modal Forms need one to work
label - The element label.
onSubmit [] - The action that the values will effect.
Text Fields
type - The element type. Adds a text field to the form
label - The element label.
placeholder - A placeholder value like an example of what the field wants.
default - The default value it goes to. Text Fields need a string for default [Is Optional].
tooltip - Adds a tooltip for the element. [Is Optional].
value - Connects what this is for to the action.
Toggles
type - The element type. Adds a toggle to the form. Toggle is a Boolean element, only true or false.
label - The element label.
default - The default value it goes to. Toggle is a Boolean element, only true or false [Is Optional].
tooltip - Adds a tooltip for the element. [Is Optional].
value - Connects what this is for to the action.
Modal Types
Actions can be used in onOpen, onClose, and onSubmit in Modal Forms. There are 10 Action Types: "add_tag", "confirm", "effect", "gamemode", "give", "message", "remove_tag", "scoreboard", "summon", and "tp" or "teleport".
Add Tags
This adds a tag to the selected player.
type - The action type. Adds a tag to player.
value - Holds the values needed for the action type.
selector - The selector player. Please only use "selector", "self", "all".
tag - The value can be from another element by using the same value name or a set value.
Confirm
This action is for making a confirmation screen. This can use text placeholder, {#KEY}, doesn't have to be all capitalised but I like how it looks, but you can capitalise it any way you like.
type - The action type. Confirms the selection.
value - The action value. The values will be whatever action you were doing.
body - The body for the confirmation form.
cancelText - The cancel text on the button. Defaults to "Cancel" if undefined.
confirmText - The confirm text on the button. Defaults to "Confirm" if undefined.
cancelAction [] - The action performed if the form was exited or if cancel was selected.
confirmAction [] - The action if confirm was selected.
The values for these actions can be set like the cancelAction example above or be dynamic with placeholders like the confirmAction example above.
Effects
This action let you apply effects to the selected player.
type - The action type. Apply effects.
selector - The selected player. Please only use "selector", "self", "all".
effects - The name of the effect. Can be slowness, Slow Falling, Weakness, it no matter how it is inputted it will change to be slowness, slow_falling, weakness.
amplifier - The power of the effect. ONLY INTEGER VALUES!
duration - The length of the time it is applied for. The value will convert from seconds to ticks. ONLY INTEGER VALUES!
particles - Is show particles on or off. ONLY BOOLEAN VALUES!
Gamemode
This action lets you sets the selected player's gamemode.
type - The action type. Change gamemode.
selector - The selected player. Please only use "selector", "self", "all".
gamemode - The gamemode it is changing to.
Give
This action lets you give items to the selected player.
type - The action type. Give item.
selector - The selected player. Please only use "selector", "self", "all".
itemId - The item that is being give. If no identifier is defined, then 'minecraft:' is assumed.
amount - The amount of that item that is being given.
Message
This action lets you send messages to the selected player like if it was with tellraw.
type - The action type. Send message
selector - The selected player. Please only use "selector", "self", "all".
message - The message that is being sent.
colour - The colour the message will be. Defaults to white if undefined.
format - The style of the message like Bold or Italic. Defaults to nothing or standard style if undefined.
Remove Tags
This removes the tag from the selected player.
type - The action type. Removes the tag from player.
selector - The selector player. Please only use "selector", "self", "all".
tag - The tag that is being removed.
Scoreboard
This modifies the scoreboard for the specified objective.
type - The action type. Modify scoreboard.
selector - The selector player. Please only use "selector", "self", "all".
objective - The objective that is being modified.
amount - The amount that is being changed by.
Summon
This action will summon an entity at the selected location. Can be a player or coordinates.
type - The action type. Summon entity.
selector - The selector player. Please only use "selector", "self", "all". DON'T USE LOCATION WITH THIS
location - The coordinates which the entity will spawn. DON'T USE SELECTOR WITH THIS
entity - The entity that will spawn.
TP/Teleport
This action will teleport selected player to another location.
type - The action type. Teleport player.
selector - The selector player. Please only use "selector", "self", "all".
destination - This is the destination that the selected player will teleport to. Can either be another player or coordinates.
Message Form
A Message Form is like an action form but is only allow for 2 buttons.
This is how you set up the basics.
title - Sets the title text for the form.
body - Sets the body text for the form [Is Optional].
type - Sets the type between "action", "modal", & "message".
elements [] - Sets the elements for the form.
Message Elements
There are only 2 elements that is usable in the Message Form: "button1" and "button2". IMPORTANT! NEED BOTH FOR MESSAGE & CAN'T HAVE MORE THAN ONE OF EACH!
Button 1
type - The element type. Button1 is usually for cancelling or saying no.
label - The name of the button
onClick [] - The array of actions when the button is clicked.
Button 2
type - The element type. Button2 is usually for confirming or saying yes.
label - The name of the button
onClick [] - The array of actions when the button is clicked.
Message Types
I am too tired to make this list again. The types are the same as the Action Types. Click to go there.
Comments
Leave Suggestions For Other Actions You Want Me To Add!
