My commands in spigot plugin doesn't work

My spigot plugin doesn't work. On the console, it says the plugin is enabled but i can't run the command in the plugin. Pls help.

This is the main code

package lol.quacnooblol.mypvpplugin;

import org.bukkit.Bukkit;

import org.bukkit.command.Command;

import org.bukkit.command.CommandSender;

import org.bukkit.entity.Player;


public class Plugin extends JavaPlugin{


public void onEnable() {

Bukkit.getServer().getLogger().info("Plugin Enabled");



public void onDisable() {

Bukkit.getServer().getLogger().info("Plugin Disabled");


public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {

if(!(sender instanceof Player)) {

sender.sendMessage("You ran this command on the console");


Player player = (Player) sender;

if(cmd.getName().equalsIgnoreCase("test")) {

player.sendMessage("You ran the test command in game.");

return true;


return true;



This is the plugin.yml

name: Plugin

version: 0.1

main: lol.quacnooblol.mypvpplugin.Plugin

author: QuacNoobLoL

description: A pvp plugin




Read More »

By: StackOverFlow - Wednesday, 14 March

Related Posts