Why doesn't this work, it does nothing when I type the command Code: package plugin; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class Factions { public void onEnable() { System.out.print("Faction class also loaded"); } public void onDisable() { System.out.print("Faction class disabled"); } public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (sender instanceof Player) { } if (cmd.getLabel().equalsIgnoreCase("guild")) { if (args.length == 2) { if (args[0].equalsIgnoreCase("create")) { if (args[1].equalsIgnoreCase("sample")) { sender.sendMessage("Guild created i guess"); return true; } } } } return false; } }
Did you register the command in plugin.yml? Your class doesn't extend JavaPlugin And I suggest you learning more Java (basics) before starting to make Bukkit plugins
@FisheyLP this is my plugin.yml and I know that my class does not extend JavaPlugin because I have another class doing that. Code: name: Server plugin version: 1.2.1 main: plugin.Pluginx author: CraterHater description: jeay, meh commands: tokens: usage: /<command> description: Shows the tokens guild: usage: /<command> description: basic guild command
Then you need to implement CommandExecutor in the current class and register the executor in the main class in onEnable with getCommand("command name").setExecutor(executor instance);