Null argument error

Discussion in 'Bukkit Help' started by Suprem20, Mar 23, 2012.

Thread Status:
Not open for further replies.
  1. Offline



    I'm quite new to making plugins, and I need help fixing a simple error. When I try to use a command (/lar), I get an internal because I require arguments. I tried fixing it using this

        public boolean onCommand(CommandSender sender, Command cmd, String string, String[] args) {
            if (!(sender instanceof Player)) {
                sender.sendMessage("This command can only be used in-game.");
                return true;
            if (args == null) {
                sender.sendMessage(ChatColor.RED + "Not enough arguments");
            final Player player = (Player) sender;
            String playername = player.getDisplayName();
            String command = cmd.getName();
            //activate tp arrow
            if (command.equalsIgnoreCase("tparrow") && args[0].equalsIgnoreCase("on") && !powers.containsKey(playername)) {
                powers.put(playername, command);
                player.sendMessage(ChatColor.GREEN + "Teleportation arrows enabled!");
                return true;
    Please help me!
Thread Status:
Not open for further replies.

Share This Page