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
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.
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.
extension.json, and then it will have access to the relevant classes.
-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,