Welcome to skUnity!
Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.
If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!
Now, what are you waiting for? Join the community now!
Hi skUnity, LimeGlass here.
I feel that skUnity is missing a main aspect of Skript, that being some sort of information on Skript Addons. So since the old Forums had an addon development tutorial, I feel that we should get one back. I will be explaining in my best details how to create an addon from the ground up with every secret, workaround and tip I can provide on top of the main tutorial from the Skript API.
NOTE: Please take effort and time into your addons. skUnity will not appreciate cheap quality addons made in a few hours on their site. Your addon will most likely get rejected if it's of such quality.
Scripts may take a few minutes to hours to create, but addons are suppose to be tested and well processed. So please don't release trash addons. Thank you.
Table on contents:
- Getting started (This page)
- Registering your Addon
- Creating an Expression
- Creating an Effect
- Creating a Condition
- Creating an Event
- Creating a Type/ClassInfo
- Creating Enum names (Finishing soon)
- Tips and Tricks (Finishing soon)
So to begin this tutorial, It's excepted that you have some sort of basic Java understanding. You can google "Java 101" or look at some of these links provided:
- https://www.oracle.com/java/index.html or https://docs.oracle.com/javase/tutorial/java/index.html (Valid source)
I self taught myself Java through playing around with it, trial and error and looking up documents about it. I also knew some other programing languages which did help understand more than starting from a blank canvas.
A good understanding of Skript coding is recommend aswell. If you don't know basic Skript coding, I think you're in the wrong starting location.
You may also choose to watch an updated Youtube video to help learn visually as well.
- This tutorial was written with Java 8 present. You should be using what ever version is most common at the time reading this.
- An IDE with proper Java support. You can use what ever, but one of the following are recommended:
- Basic Java understanding
- A Skript jar or Maven/Gradle setup of Skript https://github.com/SkriptLang/Skript/releases (Skript uses Jitpack for Maven/Gradle)
- A Spigot jar or Maven/Gradle setup of Spigot http://spigotmc.org/ (Use build tools) or you can get latest from https://yivesmirror.com/downloads/spigot
- A Minecraft server to test
Eclipse Oxygen 4.2 is used in this tutorial. I will be going over every detail on how to start development of an addon, so some may already know parts of this, and you may skip ahead if you want.
If someone would like to add IntelliJ support. Please insert the process in a (SPOILER="IntelliJ") pull down at each bullet point with pictures too if you can. Thanks.
First we need to create a new blank Java Project.
- In Eclipse: File -> New -> Java Project
Then a new window will appear. Here you enter the name of your addon. Then press finish (May very via IDE)
- Some addons have the wording "SK" in the name. This is just an adapted Skript terminology that over the years has developed. You may choose to follow this naming method if you wish. There has also been a new trend which is calling your addon by it's main purpose "Skript-PURPOSE" So like Skript-yaml or Skript-vectors. The name is completely up to you.
Every Spigot plugin needs to have a plugin.yml in order for the plugin to load, so let's create a plugin.yml and put it in the file location of our Java Project we just made:
Keep in mind that you can't have spaces in the name node.
The version, name and main nodes are mandatory. If you have multiple authors you name it "authors:" and as a string array.
Next we need to add Skript and Spigot/PaperSpigot as a dependency for our addon.
- In Eclipse: you right click the Java Project in the navigation panel, and go to properties.
- In Eclipse: a window like this will appear, then navigate to Java build path -> Libraries (Tab) -> Add external jars
- In Eclipse: add Skript (Latest version at the time reading this) and Spigot to the Libraries. Then once you have the files inserted click Apply and Close.
Now we're all setup and ready to start coding! Lets create our first package.
- In Eclipse: Right click the "src" file -> New -> Package
- In Eclipse: A window like this will appear. You can add the package name here.
In my case, I am calling the package "me.limeglass.addon"
Then click Finish. Now we need to add our Main class. It's recommended to name your main class the name of your addon. So if this was Skript. The main class would be Skript.class
To add a class
- In Eclipse: Right click the package that we just made and click new Class. Then name it your main class name discussed above, and click Finish.
Now we can start coding!
If you need any help feel free to PM LimeGlass on skUnity or the skUnity Discord. (Link at the bottom of the website)
This has been the Getting started section of the addon development.
To continue the tutorial go to the Registering your Addon section