Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Latest commit

 

History

History
66 lines (52 loc) · 1.78 KB

README_EN.md

File metadata and controls

66 lines (52 loc) · 1.78 KB

FormAPI | NukkitX

Simple library for creating forms (MCBE Nukkit)



Examples:

SimpleForm


SimpleForm form = new SimpleForm("Test simple form")
    .setContent("Sample text")
    .addButton("Just a button")
    .addButton("Button with diamond", ImageType.PATH, "textures/items/diamond");

form.send(player, (targetPlayer, targetForm, data) -> {
    if(data == -1) return;
    
    targetPlayer.sendMessage(data.toString());
});

screenshot of sample

CustomForm


CustomForm form = new CustomForm()
    .addLabel("Sample text")
    .addDropDown("Sample dropdown", Arrays.asList("Line 1", "Line 2", "Line 3"))
    .addInput("Text area")
    .addSlider("Slider", 1, 100)
    .addStepSlider("Step slider", Arrays.asList("Step 1", "Step 2", "Step 3"))
    .addToggle("Just a toggle", false);

form.send(player, (targetPlayer, targetForm, data) -> {
    if(data == null) return;
    
    targetPlayer.sendMessage(data.toString());
});

screenshot of sample

ModalForm


ModalForm form = new ModalForm("It`s a title", "Sample text", "Positive button", "Negative button");

form.send(player, (targetPlayer, targetForm, data) -> {
    if(data == -1) return;
    
    targetPlayer.sendMessage(data.toString());
});

screenshot of sample

Download: https://github.com/qPexLegendary/FormAPI/releases
Example plugin: https://github.com/qPexLegendary/Example-for-FormAPI