FormCreator

FormCreator 1.2.0

Compatible API Versions
1.0.0
Sourcecode
https://github.com/MEFRREEX/FormCreator
FormCreator
Tool for easy creation of forms in Json file for Nukkit

Dependencies
FormConstructor
GitHub: https://github.com/ContentForge/FormConstructor/releases/tag/1.1.3

How to use
Example form:

example.json
JSON:
{
    "command": {
        "enable": true,
        "name": "example",
        "description": "Example command",
        "aliases": [
            "example1"
        ],
        "permission": "formcreator.example"
    },
    "title": "Example Form",
    "content": [
        "Content line"
    ],
    "buttons": [
        {
            "name": "Button",
            "image": "textures/blocks/diamond",
            "imageType": "path",
            "actions": [
                {
                    "type": "OPEN",
                    "value": "example"
                }
            ]
        },
        {
            "name": "Button 2",
            "actions": [
                {
                    "type": "PLAYER_COMMAND",
                    "value": "say Test"
                }
            ]
        }
    ],
    "openActions": [
        {
            "type": "CONSOLE_COMMAND",
            "value": "say {player} Form opened!"
        }
    ],
    "closeActions": [
        {
            "type": "CONSOLE_COMMAND",
            "value": "say {player} Form closed!"
        }
    ]
}
form.png


Registration of the form:
forms.yml
YAML:
# Registration of the form
forms:
  # form name: "form path in the 'forms' folder"
  example: "example.json"
Commands
NameSub CommandUsageDescriptionPermission
/formcreatoropen/formcreator open <form> <player>Open player formformcreator.open
/formcreatorinfo/formcreator infoPlugin infoformcreator.info
/formcreatorhelp/formcreator helpHelp
API





FormManager

Get a folder with forms:
Java:
File folder = FormManager.getFormsFolder();
Getting a form by name:
Java:
Form form = FormManager.get("form_name");
Check the existence of the form:
Java:
FormManager.exists("form_name");
Load form from file:
Java:
FormManager.load("form_name", file);
Creating a custom action executor
Your executor:
Java:
public class YourExecutor implements Executor {

    /**
     * @param player Player
     * @param value  Value of action
     */
    @Override
    public void execute(Player player, String value) {
        // Handling action
    }
}
Executor registration:
Java:
// name - Executor name. For example: YOUR_EXECUTOR
ExecutorManager.register("name", new YourExecutor());
Getting a executor:
Java:
ExecutorManager.getExecutor("YOUR_EXECUTOR");
Events
NameCancellableDescription
FormLoadEventtrueCalled when the form is loaded
FormSendEventtrueCalled when a form is opened

RuNukkitBanner.png
Author
MEFRREEX
Downloads
715
Views
1,339
First release
Last update
Rating
4.50 star(s) 2 ratings

More resources from MEFRREEX

Latest updates

  1. FormConstructor adapters

    Added adapters for different versions of FormConstructor This plugin now supports the latest...
  2. Java 8 and bStats Metrics

    The plugin is compiled in Java 8, added bStats metrics

Latest reviews

Excellent Plugin! but if u support java 8 or 11 i will change my rating to 5 star
M
MEFRREEX
Download the latest version of the plugin, it supports Java 8
I'm interested but you can make it run in java 8 or 11
M
MEFRREEX
You can download the latest version of the plugin, it supports Java 8
Top