Does your add-on have a toggle you’d like to change right in the game, or a custom menu that should open with a button? Plinth connects add-ons to menus and settings like these through scriptevent. 🛠️

What you can connect
Plinth accepts add-on configurations and menus created for them. Settings can include toggles, a slider, a text field, and a dropdown list. For example, the demo pack includes a toggle with a default value of true, a slider from 0 to 100 with a step of 5, a text field, and a list with two options. A title and divider are also available.
You can set labels and tooltips for items. A configuration can have a description and metadata parameters, including enabled, access , and intended; in the example, their values are true, "hidden" , and "hidden". The pack supports a permissions system and global or personal settings. 🎮
How to connect a menu or configuration
- Download the pack, extract the archive, and open the file
entry.js. - Follow the instructions in the file: copy the class
Entrywith all of its contents and paste it into your add-on’s file. - For a menu, set an ID, name, icon, and type
"menu". The example usesEntry.menu("example", "example", "textures/.."), then callsexample.send(). If you use the importimport { Entry } from "./entry.js";, that call is enough; without the import, you need to rewrite the message sending code. - For a custom menu, use the event
click:menuid. If you need a fallback for a separate system that automatically connects to Plinth when it detects it, useplinth:present. - Open the menu with the command
/p:mainmenu. Another option is to uncomment the block/* */inmain.jsto enable the item feature, and replace"minecraft:release"with the item you need, for exampleminecraft:stick.
Press the menu button to open it. The label enabled/disabled means you’re looking at a configuration; without that label, it’s a menu, unless you’ve added a custom subtitle yourself.
How settings are passed
For a menu, the add-on sends data through load:, Plinth receives and parses it, then displays a button. After you press it, Plinth sends click:menuid, the add-on receives the event and opens the menu.
For a configuration, Plinth receives data through load:, parses it, displays the settings, and saves them as dynamic properties. It then sends sync:, so the add-on can apply the values. When you change and save a setting, it sends sync:again, and the add-on applies the updated values. The event plinth:present lets other add-ons detect that Plinth is available. ✨