i was working on a very simple minecraft plugin for a school project and i can't seem to get this return false;
to be "reached"
im using the eclipse IDE, heres my code
package com.genuishour.me;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Events implements CommandExecutor{
private Main plugin;
public Events(Main plugin) {
this.plugin = plugin;
plugin.getCommand("hello").setExecutor(this);
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage("Only players can execute this command!");
return true;
}
Player p = (Player) sender;
String name = sender.getName();
if (p.hasPermission("hello.use")) {
p.sendMessage("Hello " + name + "!");
return true;
} else {
p.sendMessage("You do not have permission to execute this command");
return true;
}
return false; //unreachable code
}
}