extension.json
at the root of the resources folder (src/main/resources
for instance) and fill it up:entrypoint
: Fully qualified name of your extension classname
: Name to use to represent the extension to users. Must match regex [A-Za-z][_A-Za-z0-9]+
version
: Version of your extensiondependencies (optional)
: List of extension names required for this extension to work.externalDependencies (optional)
: List of external libraries used for this extension (see Dependencies)extensions
folder (resolved from the current working folder) for jar files. For each file found, it then checks if there is an extension.json
file and attempts to parse it. If the file exists, and parsing succeeds, the extension is considered discovered.ExtensionManager#loadDynamicExtension(File)
but works the same.entrypoint
, and the preInitialize
, initialize
and postInitialize
callbacks are called. (see Callback order for more information)dependencies
array inside extension.json
.externalDependencies
object inside extension.json
:repositories
is the list of repositories to contact to get the artifactsname
: Name of the repository, used to recognize the repository inside logsurl
: URL of the repository to contactartifacts
is the list of Maven coordinates from the dependencies you want to useextensions/.libs/
, so that it does not require to redownload them at each launch.MinecraftServer#start
, Minestom calls preInitialize
on all extensions, then initialize
on all extensions, and finally postInitialize
on 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, build/classes/java/main/
should work.-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, build/resources/main/
should work.