OPEN Plugin Developing Tutorial (Send me links of your projects!)

Death_Dev

Developer | Cracker
MC Models
SpigotVIP
Supporter
Member
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

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.
 

Driq

Freelance Dev that works at ExcleGames LLC
Trusted
SpigotVIP
Supporter
Benefactor
Member
What... This is not really code at all..

Any person can do this ..

I'm not being rude, but when I first started I just typed off my mind and I just started learning myself on my own.
 

mcm is after me

Active Member
MC Models
SpigotVIP
Supporter
Member
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
player.setBanned(true);
player.kick();
}
 
BlackSpigot General Chat
Rules Help Users
    A @ amirmohamad as: man raftam discord rank vip نداد
    Top