I am learning coding for spigot and I have been following a tutorial to setup if a basic plugin works for me and I am having problems with it. It won't show up in the plugins and I have it in the plugins folder and the code seems to be right for me but I hope one of you can find my error.
Here is the code:
Here is the code:
Code:
package com.etterman.mrheal;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import net.md_5.bungee.api.ChatColor;
public class MrHeal extends JavaPlugin {
public void onEnable(){
System.out.println("Enabled");
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(!(sender instanceof Player)){
sender.sendMessage("Players only");
return true;
}
Player p = (Player) sender;
if(command.getName().equalsIgnoreCase("heal")){
if(args.length == 0){
p.setHealth(20D);
p.sendMessage(ChatColor.GREEN + "You have been revived!");
return true;
}
if(args.length == 1){
Player t = Bukkit.getServer().getPlayer(args[0]);
t.setHealth(20D);
t.sendMessage(ChatColor.GREEN + "You were healed by " + p.getName());
p.sendMessage(ChatColor.GREEN + "You have healed " + t.getName());
return true;
}
}
return true;
}
}