NoteLand / WDForms

Minecraft Bedrock Forms Support for https://github.com/WaterdogPE/WaterdogPE
GNU General Public License v3.0
1 stars 0 forks source link

How to use the API? #1

Closed KaitoZerjoYT closed 6 months ago

KaitoZerjoYT commented 6 months ago

Hey,

I was wondering how to use the API, like how to create all those forms and query the buttons, input fields, etc. It would be nice if you could explain it to me

Crasher508 commented 6 months ago

Very simple: Example for SimpleForm, implementations for ModalForm and CustomForm are similar

SimpleForm form = new SimpleForm(((proxiedPlayer, response) -> {
            proxiedPlayer.sendMessage(response + " this is an int");
}));
form.setTitle("Title");
form.setContent("Content");
form.addButton("Button");
Forms.getInstance().sendForm(player, form);

Please do not abuse issue section for questions. Have a nice evening :)