Example Addon

The source code for the example addon can be found here

Creating the project

Create a new project and add Dimensions.jar to your build path

Creating the main class

package me.xxastaspastaxx.dimensions.addons.exampleaddon;

import org.bukkit.event.Listener;

import me.xxastaspastaxx.dimensions.addons.DimensionsAddon;
import me.xxastaspastaxx.dimensions.addons.DimensionsAddonPriority;

public class DimensionsExampleAddonMain extends DimensionsAddon implements Listener {

	public DimensionsExampleAddonMain() {
		super(addonName, addonVersion, addonDescription, addonPriority); //Replace with whatever you want
	}
	
}

Registering listener

Now we want to register our addon as a listener when the addon is being enabled so we add onEnable

CustomPortalIgniteEvent

And finally we want to listen to the CustomPortalIgniteEvent so we can summon the explosion particles. We use the EventHandler like we would in any other case.

Finishing up

Now that we are done with coding, we have to let Dimensions know about our addon otherwise its not going to load it.

You need to create a few folders and files inside our src folder.

Inside the services folder we need to create a new file named:

Finally, inside the file, enter the path to your main class as you would with plugin.yml

for example in this case it would be

This last part is required by ServiceLoader in order to load the addons properly

Done

Now you can put the addon you made inside ./plugins/Dimensions/Addons/ and restart your server.

Last updated