DimensionsAddon base class, optionally listen for events, and tell Dimensions where to find your class through a ServiceLoader registration file. The steps below walk you through the full process from an empty project to a deployable JAR.
Create your project and add Dimensions to the build path
Create a new Java project in your IDE of choice. Download
Dimensions.jar from the SpigotMC resource page and add it to your build path as a compile-only dependency — do not bundle it into your addon JAR.You will also need the Bukkit/Spigot API on your build path, since Dimensions itself depends on it.Create your main class
Your main class must extend The
DimensionsAddon. If you want to listen to Dimensions events, also implement Listener.super(...) call accepts four arguments:- name — a unique display name for your addon.
- version — the version string for your addon.
- description — a short description shown in logs.
- priority — controls load order relative to other addons (
LOW,NORMAL, orHIGH).
Override onEnable to register your listener
Override You can also override
onEnable to run setup logic when Dimensions activates your addon. If your class implements Listener, register it here so Bukkit routes events to your handlers.onLoad to check for optional dependencies, onDisable to clean up, and registerPortal to receive each portal’s config at load time.Create the ServiceLoader registration file
Dimensions uses Java’s Inside the Open that file and enter the fully-qualified class name of your main class on a single line:
ServiceLoader to discover addons. You must create a specific file at the exact path below inside your src directory:services folder, create a file named exactly:The file name must match the service interface exactly —
me.xxastaspastaxx.dimensions.addons.DimensionsAddon — or Dimensions will not find your addon. This is a requirement of the Java ServiceLoader specification, not a Dimensions convention.