class Main extends PluginBase implements Listener {
@Override
public void onEnable(){
this.getServer().getPluginManager().registerEvents(this, this);
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
switch(cmd.getName()){
case "heal":
if(args.length == 0){
if(sender.hasPermission("heal.command")){
sender.sendMessage("Please specify a player!");
} else {
sender.sendMessage("You do not have permission to run this command!");
}
}
if (sender.hasPermission("heal.command")) {
sender.sendMessage("That player is not online!");
} else {
sender.sendMessage("You do not have permission to run this command!");
}
sender.sendMessage("You healed a player!");
this.getServer().getPlayer(args[0]).setHealth(this.getServer().getPlayer(args[0]).getMaxHealth());
}
if(this.getServer().getPlayer(args[0]).getName() == sender.getName()){
if(sender.hasPermission("heal.command")){
sender.sendMessage("You healed yourself!");
this.getServer().getPlayer(args[0]).setHealth(this.getServer().getPlayer(args[0]).getMaxHealth());
} else {
sender.sendMessage("You do not have permission to run this command!");
}
}
switch(cmd.getName()){
case "healall":
if(args.length == 0){
if(sender.hasPermission("healall.command")){
for(Player p : this.getServer().getOnlinePlayers().values()){
p.setMaxHealth(p.getMaxHealth());
}
sender.sendMessage("Everyone was healed!");
} else {
sender.sendMessage("You do not have permission to run this command!");
}
}
}
return true;
}
I loaded my plugin by source to compile it and all I get is the single error of: [CRITICAL] Could not load plugin 'Heal'
`package Heal.Apple;
import cn.nukkit.event.Listener; import cn.nukkit.plugin.PluginBase; import cn.nukkit.Server; import cn.nukkit.Player; import cn.nukkit.command.CommandSender; import cn.nukkit.command.Command; import cn.nukkit.utils.TextFormat;
import java.io.File; import java.io.IOException; import java.util.LinkedHashMap;
class Main extends PluginBase implements Listener {
}
`