extension.jsonat the root of the resources folder (
src/main/resourcesfor instance) and fill it up:
entrypoint: Fully qualified name of your extension class
name: Name to use to represent the extension to users. Must match regex
version: Version of your extension
codeModifiers (optional): List of code modifier fully qualified-named classes to modify Minestom classes at launch time
mixinConfig (optional): Name of a JSON file for support of Mixin injection
dependencies (optional): List of extension names required for this extension to work.
externalDependencies (optional): List of external libraries used for this extension (see Dependencies)
extensionsfolder (resolved from the current working folder) for jar files. For each file found, it then checks if there is an
extension.jsonfile and attempts to parse it. If the file exists, and parsing succeeds, the extension is considered discovered.
ExtensionManager#loadDynamicExtension(File)but works the same.
extension.json(including the Mixin config) are loaded.
repositoriesis the list of repositories to contact to get the artifacts
name: Name of the repository, used to recognize the repository inside logs
url: URL of the repository to contact
artifactsis the list of Maven coordinates from the dependencies you want to use
extensions/.libs/, so that it does not require to redownload them at each launch.
MinecraftServer#start, Minestom calls
preInitializeon all extensions, then
initializeon all extensions, and finally
postInitializeon all extensions. Minestom does NOT guarantee the loading order of extensions, but it should be deterministic.
mainClassfully qualified name of your main class
Bootstrapwill then setup extensions, modifiable classloader and mixin support, then call your
-Dminestom.extension.indevfolder.classes=<folder to compiled classes of your extension>Specifies the folder in which compiled classes of your extension are. With a default Gradle setup,
-Dminestom.extension.indevfolder.resources=<folder to resources of your extension>Specifies the folder in which resources of your extension are. With a default Gradle setup,
terminatemethod of your extensions, and unregister everything there.
postInitializecallbacks called immediatly upon load.