#hello, im new to plugin development

1 messages · Page 1 of 1 (latest)

swift trench
#

hello im new to plugin development and in fact this is my very first plugin that i make but it does not work can someone help me


import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

public class Untitled3 extends JavaPlugin {

    @Override
    public void onEnable() {
        getLogger().info("Untitled3 has been enabled!");
    }

    @Override
    public void onDisable() {
        getLogger().info("Untitled3 has been disabled!");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (cmd.getName().equalsIgnoreCase("ping")) {
            sender.sendMessage("Pong!");
            return true;
        }
        return false;
    }
}```
#

also pls dont bully me

near cairn
# swift trench also pls dont bully me

add the command to onEnable
getServer().getPluginCommand("ping").setExecutor(this, this) //(I'm not sure if this is true, I'm writing on phone)
and in plugin.yml

author: example
api-version: 1-19…
commands:
ping:

near cairn
#

working?