What plugins can extend
Explore JavaScript plugins for BDEngine: custom interfaces, objects, import and export actions, HeadPaint, and environment controls.
You only need basic JavaScript knowledge and an open BDEngine editor to get started. Your first tool can be a small button that performs a useful action in the editor.
What a plugin extends
A BDEngine plugin is a regular JavaScript file with metadata. The user installs it in the editor, then restarts BDEngine. The editor loads the saved code on the next startup. A simple plugin does not need a separate build tool.
The plugin runs in the editor page. It can add an interface, access selected objects, create content, and use BDEngine features. It does not become part of an exported model or run in Minecraft. For external server integrations, use Server API.
Common tasks
| Task | Capabilities |
|---|---|
| Custom tools | A Dock menu button, a regular or modal window, and DOM elements inside it. |
| Model processing | Reading the selection, adding built-in objects, deleting objects, and updating the display. |
| Generators | Creating displays and collections programmatically from user parameters. |
| Data exchange | Loading project content, exporting JSON, and adding custom import and export menu actions. |
| Painting | Working with colors, the canvas, and tools through editorAPI.headPaint. |
| Environment | Controlling the sky, time of day, moon phase, and other settings through editorAPI.sky. |
| Multilingual interfaces | Registering plugin translations and retrieving localized strings. |
Each task has a guide in Practical guides. You do not need to learn every editor feature first.
Supported API and internals
The main entry point is window.editorAPI, the stable, officially supported
extension interface. The main examples in this manual use it.
window.editor is also available to developers. You can use it to explore the
editor and access internal features that do not yet have an editorAPI method.
However, the structure and methods of editor can change between versions.
Account for those dependencies when maintaining your plugin.
Public API and internal objects explains the differences and how to choose an approach. This manual targets Release. A feature available only in Beta is not necessarily available in the main version.
Your first result or a specific task
If you have not created a plugin before, start with
First plugin: a button and a window. It includes a complete .js file,
installation through the interface, and a check that the window opens again after closing.
If you already know what you want to add, choose a practical task. Exact parameters and return values are in the editorAPI reference.