Example Addon

circle-info

The source code for the example addon can be found herearrow-up-right

Creating the project

Create a new project and add Dimensions.jararrow-up-right 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 onEnablearrow-up-right

CustomPortalIgniteEvent

And finally we want to listen to the CustomPortalIgniteEventarrow-up-right 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

circle-info

This last part is required by ServiceLoaderarrow-up-right 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