FormAPI

FormAPI 2.1-SNAPSHOT

Compatible API Versions
1.0.9
Sourcecode
https://github.com/qPexLegendary/FormAPI
Contributors
qPexLegendary
# FormAPI | NukkitX

Simple API for creating forms (MCBE Nukkit)

Usage example:

SimpleForm:

Code:
    SimpleForm form = new SimpleForm("Test form")
    .setContent("Some kind of test text should be written here.")
    .addButton("Button")
    .addButton("Button with a picture", ImageType.PATH, "textures/items/diamond");

form.send(player, (targetPlayer, targetForm, data) -> {
    if(data == -1) return; //If the form is closed forcibly, then data will have a value of -1

    targetPlayer.sendMessage(data.toString());
});
33333.png


CustomForm:
Code:
CustomForm form = new CustomForm()
    .addLabel("Here some random text should be written, but it is written.")
    .addDropDown("Drop-down list", Arrays.asList("Var 1", "Var 2", "Var 3"))
    .addInput("Text field")
    .addSlider("Slider", 1, 100)
    .addStepSlider("Step slider", Arrays.asList("Var 1", "Var 2", "Var 3"))
    .addToggle("Toggle", false);

form.send(player, (targetPlayer, targetForm, data) -> {
    if(data == null) return; //If the form is closed forcibly, then data will have a value of null

    targetPlayer.sendMessage(data.toString());
});
22222.png


ModalForm:
Code:
ModalForm form = new ModalForm("HEADER", "TEXT", "BUTTON 1", "BUTTON 2");

form.send(player, (targetPlayer, targetForm, data) -> {
    if(data == -1) return; //If the form is closed forcibly, then data will have a value of -1

    targetPlayer.sendMessage(data.toString());
});
11111.png
Author
C1oky
Downloads
3,798
Views
8,686
First release
Last update
Rating
4.75 star(s) 4 ratings

More resources from C1oky

Latest updates

  1. 2.1-SNAPSHOT

    A small change in the form responses for ease of use
  2. Refactoring code

    SimpleForm and ModalForm will return -1 when closed

Latest reviews

Hey i have a problem i'll give them 5 stars too! How can I take the button now? Because this is not possible with me. (picture: https://ibb.co/2cy7WY0)
This is the way to make forms, thank you for making this!
not bad :3⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
C1oky
C1oky
thanks :D
good
Nice )
Top