Code (Text): import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.Listener; import falconseeker.main.Main; public class Econ implements CommandExecutor, Listener { private Main main = (Main)Main.getPlugin(Main.class); public void setGold(Player p, int amount){ UUID uuid = p.getUniqueId(); main.getConfig().set(uuid + ".gold", getGold(p) + amount); } public int getGold(Player p){ UUID uuid = p.getUniqueId(); return main.getConfig().getInt(uuid + ".gold"); } public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { Player p = (Player) sender; if (commandLabel.equalsIgnoreCase("gold")) { if (args.length == 0) { p.sendMessage(ChatColor.RED + "Not enough args"); } else { Player target = Bukkit.getPlayerExact(args[0]); if (target == null) { p.sendMessage(ChatColor.RED + "Your target " + args[0] + " is not online!"); } else { if (args.length == 1){ int amount = Integer.valueOf(args[1]); p.sendMessage(ChatColor.GREEN + "Given " + amount + " to " + args[0]); setGold(target, amount); } } } } return true; } } doesnt do anything. howeever, when i type /gold i get the message.
yes, but its not sending the message Code (Text): p.sendMessage(ChatColor.GREEN + "Given " + amount + " to " + args[0]);