Here we will talk about how to make a simple plugin! You can message me here or via PM for problems or help!
Here is how to make a simple plugin!
Download Eclipse (Java Developer Kit) or Intelij Idea for Java
Download JDK
Download your spigot.jar you want your plugin compatable with.
After doing this, start making your plugin!
Make a package named me.yourname.yourpluginname
Make another class named HelloCMD
After this, make a plugin.yml and add this content inside
If you made a simple plugin, feel free to send me a link! I will be happy to see what you created
Next time I will talk about booleans and player methods.
Here is how to make a simple plugin!
Download Eclipse (Java Developer Kit) or Intelij Idea for Java
Download JDK
Download your spigot.jar you want your plugin compatable with.
After doing this, start making your plugin!
Make a package named me.yourname.yourpluginname
Code:
Your Main-Class Code
public class Main extends JavaPlugin {
public void onEnable() {
System.out.println("Plugin Enabled!");
registerCommands();
}
public void registerCommands() {
getCommand("hello").setExecutor(new HelloCMD());
}
}
Make another class named HelloCMD
Code:
public class HelloCMD implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.equalsIgnoreCase("hello")) {
sender.sendMessage("Hi! Welcome to the server");
}
}
return false;
}
After this, make a plugin.yml and add this content inside
Code:
name: YourPluginName
main: me.yourname.yourplugin.Main
version: 1.0
author: you
commands:
yourcommandname:
If you made a simple plugin, feel free to send me a link! I will be happy to see what you created
Next time I will talk about booleans and player methods.