Hello,
This Is just another small tutorial, which teaches you on how to code your own Minecraft Plugin.
In this tutorial, we'll use IntelliJ IDEA Community 2017.2.x
1. Get the Server Files!
To develop anything with the Spigot API, you'll need to grab some files from the Internet!
What u have to do now?! Get the JAR File for bukkit 1.8.8. I'll recommend https://getbukkit.org for newcomers.
2. Setting up IDEA
So, the first thing what u gonna do now is, opening IntelliJ IDEA!
Create a new Java Project with the 1.8 SDK!
3. Creating the packages
Now, you'll have to create a package.
for the sake of this tutorial, we'll use org.pjd.ts!
4. Making somethin' useful!
Let's create a new file inside the package.
Name it "Base"!
Go to project Structure & add the spigot JAR!
CODING PART:
Now, extend from the JavaPluin class, which is provided in the spigot API!
THIS:
package org.pjd.ts;
public class Base {
}
INTO:
package org.pjd.ts;
import org.bukkit.java.plugin.JavaPlugin;
public class Base extends JavaPlugin{
}
Now, let's create a onEnable function, which GETS CALLED EVERYTIME THE PLUGIN GETS ENABLED BY THE PLUGINLOADER!
package org.pjd.ts;
import org.bukkit.plugin.java.JavaPlugin;
public class Base extends JavaPlugin{
@Override
public void onEnable()
{
}
}
that's it! u can paste some logging methods like this.getLogger().info("ur gay, this is mah pluugin!"); into the onEnable function, and it will be display'd everytime the plugin gets loaded!
GL!
EDIT: don't forget to create the plugin.yml btw!
~ Bux
