added msg on invalid player

This commit is contained in:
Sedri05
2022-06-18 12:33:18 +02:00
parent c362ad0d18
commit 5d4eedfef6

View File

@@ -27,7 +27,10 @@ class CommandGiveXP(plugin: EcoPlugin) : Subcommand(plugin, "givexp", "ecopets.c
if (args.size == 3){
player = Bukkit.getPlayer(args[2])!!
}
if (!(player is Player)) return;
if (!(player is Player)) {
sender.sendMessage(plugin.langYml.getMessage("invalid-player"))
return
}
val pet = Pets.getByID(args[0])
if (pet == null) {