{"id":19509079,"url":"https://github.com/contentforge/formconstructor","last_synced_at":"2025-07-29T06:09:00.278Z","repository":{"id":46832462,"uuid":"388993217","full_name":"ContentForge/FormConstructor","owner":"ContentForge","description":"Library for easy creating and handling of forms","archived":false,"fork":false,"pushed_at":"2025-06-09T17:11:05.000Z","size":9247,"stargazers_count":10,"open_issues_count":0,"forks_count":7,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-09T18:24:38.550Z","etag":null,"topics":["formapi","nukkit","nukkit-api","nukkit-plugin","pnx","pnx-plugin","powernukkitx"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ContentForge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-24T03:53:48.000Z","updated_at":"2025-06-09T17:11:09.000Z","dependencies_parsed_at":"2024-11-10T23:11:36.524Z","dependency_job_id":"9a599b8b-51cf-40a7-b3f3-404cf5596e59","html_url":"https://github.com/ContentForge/FormConstructor","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ContentForge/FormConstructor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContentForge%2FFormConstructor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContentForge%2FFormConstructor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContentForge%2FFormConstructor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContentForge%2FFormConstructor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ContentForge","download_url":"https://codeload.github.com/ContentForge/FormConstructor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContentForge%2FFormConstructor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267639016,"owners_count":24119766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formapi","nukkit","nukkit-api","nukkit-plugin","pnx","pnx-plugin","powernukkitx"],"created_at":"2024-11-10T23:10:58.494Z","updated_at":"2025-07-29T06:09:00.266Z","avatar_url":"https://github.com/ContentForge.png","language":"Java","readme":"![logo by @tolimag](.github/logo.png)\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Version](https://img.shields.io/badge/version-2.0.0-brightgreen)](https://github.com/ContentForge/FormConstructor/releases/tag/2.0.0)\n\n:warning:  Discontinued :warning: \n======\nI stopped writing plugins for Nukkit and I don't see any point in supporting this project. \nUse a good fork that my friend made: https://github.com/MEFRREEX/FormConstructor\n\n\n\nIntroduction\n------------- \n\nLibrary is designed to simplify the creation and handling of forms.\nIt has a few key advantages over other  form libraries:\n\n- Forms are processed using a lambda, which is passed when the form itself is created, and not by catching events.\n- For each button we can set a lambda function in SimpleForm.\n- In SimpleForm we get a button object as a response, where we can get its text and index.\n- In CustomForm we can mark elements with an identifier to conveniently get this element in its handler. We can get element by id and its index.\n- Easy async handling.\n\nExamples\n-------------\n\n### SimpleForm\n```java\nSimpleForm form = new SimpleForm(\"Sample title\");\n\nSimpleFormHandler handler = (p, button) -\u003e {\n    p.sendMessage(\"Your selected button is \" + button.getName());\n    p.sendMessage(\"Its index - \" + button.index);\n};\n\nform.setContent(\"This is a text\")\n    .addContent(\"\\nThis is addition :3\")\n    .add(new Button(\"Test button\", handler))\n    .add(new Button(\"Same button but with image\", Button.Icon.texture(\"textures/items/diamond\"), handler));\n\n//We can set handler for null result\nform.setOnCloseHandler(p -\u003e {\n    p.sendMessage(\"Why you closed this form? :c\");\n});\n\nform.send(player);\n```\n\n### ModalForm\n```java\nModalForm form = new ModalForm(\"Test modal form\");\n\nform.setContent(\"Is OneKN gay?\") //local meme in RuNukkitDev\n    .setPositiveButton(\"Yes\")\n    .setNegativeButton(\"Sure\");\n\nform.setResponse((p, result) -\u003e {\n    p.sendMessage(result? \"I knew it!\" : \"Quite right :D\");\n});\n\nform.send(player);\n```\n\n### CustomForm\n```java\nCustomForm form = new CustomForm(\"Sample custom form\");\n\nList\u003cSelectableElement\u003e elements = Arrays.asList(\n    new SelectableElement(\"Option 1\"),\n    new SelectableElement(\"Option 2 but with value\", 42),\n    new SelectableElement(\"Option 3\")\n);\n\nform.add(new Label(\"This is a test\"))\n    .add(\"Easy way to add a label\")\n    .add(\"my-text\", new Input(\"A sample input\"))\n    .add(\"my-toggle\", new Toggle(\"Toggle?\", true))\n    .add(\"my-dd\", new Dropdown(\"Dropdown\",  elements))\n    .add(new Dropdown(\"Dropdown with default value\", elements, 1))\n    .add(\"my-ss\", new StepSlider(\"Step slider\", elements, 2));\n\nform.setHandler((p, response) -\u003e {\n    //We can get by id and index\n    p.sendMessage(response.getInput(\"my-text\").getValue());\n    p.sendMessage(response.getInput(1).getValue()); //It's bad practice. Do not use indexes\n    p.sendMessage(response.getToggle(\"my-toggle\").getValue());\n    \n    SelectableElement el = response.getDropdown(\"my-dd\").getValue();\n    p.sendMessage(el.getText());\n    if(el.getValue() != null) p.sendMessage(el.getValue(Integer.class));\n    \n    el = response.getStepSlider(\"my-ss\").getValue();\n    p.sendMessage(el.getText());\n});\n\nform.send(player);\n```\n\n### Async handling\nAlso you can use method `form.sendAsync(player)` for using async form handling.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentforge%2Fformconstructor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontentforge%2Fformconstructor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentforge%2Fformconstructor/lists"}