Hi guys, I'm learning to make plugins at the moment. This is what i'm working on right now. It's a simple healing plugin. When I put it on the server and try a command absolutely nothing happens. It doesn't even say internal error or unknown command, just nothing happens. Help please? Here is the pastebin link: http://pastebin.com/HaBvwEsS And here it is in a Bukkit thing: Code:java package me.Antonio.Test; import java.util.logging.Logger; import org.bukkit.command.Command;import org.bukkit.entity.Player;import org.bukkit.plugin.PluginDescriptionFile;import org.bukkit.plugin.java.JavaPlugin; public class Test extends JavaPlugin{public static Test plugin;public Logger logger = Logger.getLogger("Minecraft"); @Overridepublic void onDisable(){PluginDescriptionFile pdfFile = this.getDescription();this.logger.info(pdfFile.getName() + " has been disabled"); } @Overridepublic void onEnable(){PluginDescriptionFile pdfFile = this.getDescription();this.logger.info(pdfFile.getName() + " has been enabled!");} public boolean onCommand(Command sender, Command cmd, String commandLabel, String [] args){Player player = (Player) sender;if(commandLabel.equalsIgnoreCase("heal") || commandLabel.equalsIgnoreCase("h")){if (args.length == 0){player.setHealth(20.0);player.sendMessage("You healed yourself!");}else if (args.length == 1){if(player.getServer().getPlayer(args [0]) != null){Player targetPlayer = player.getServer().getPlayer(args [0]);targetPlayer.setHealth(20.0);targetPlayer.sendMessage("You were healed!");}else{player.sendMessage("Player is offline.");}}}return false;} } Thanks so much. Antonio
Here is the error: Code: public boolean onCommand(Command sender, Command cmd, String commandLabel, String [] args){ And here the fixed line: Code: public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String [] args){ Next time add @Override to the command method, it's not necessary, but the IDE will show a error, if the class JavaPlugin has no method with that parameters to override. And don't forget to add the command in the plugin.yml, if you haven't.
Caprei & Seadragon91 He could implement CommandExecutor after extending JavaPlugin. Then his IDE would make him enter it correctly.