public class Command extends JavaPlugin implements Listener {
public boolean onCommand(Command command, CommandSender sender, String s, String[] args) {
if (s.equalsIgnoreCase("ce")) {
if (args.length < 1) {
sender.sendMessage("Usage: /ce add|remove [EnchantName] [EnchantID] [MaxLevel]");
return true;
switch (args[0].toLowerCase()) {
case "add":
if (args.length < 3) {
sender.sendMessage("Usage: /ce add [EnchantName] [EnchantID] [MaxLevel]");
return true;
}
sender.sendMessage("Added Enchantment: " + args[1] + " " + args[2] + " " + args[3]);
return true;
case "remove":
if (args.length < 3) {
sender.sendMessage("Usage: /ce remove [EnchantName] [EnchantID] [MaxLevel]");
return true;
}
default:
sender.sendMessage("Usage: /ce add|remove [EnchantName] [EnchantID] [MaxLevel]");
return true;
}
}
}
return false;
}
}```
불러오는 중...