diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/commands/CommandGiveXP.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/commands/CommandGiveXP.kt index 30c6fc1..89e740b 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/commands/CommandGiveXP.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecopets/commands/CommandGiveXP.kt @@ -23,10 +23,11 @@ class CommandGiveXP(plugin: EcoPlugin) : Subcommand(plugin, "givexp", "ecopets.c sender.sendMessage(plugin.langYml.getMessage("needs-amount")) return } - var player: Player = sender as Player + var player = sender if (args.size == 3){ player = Bukkit.getPlayer(args[2])!! } + if (!(player is Player)) return; val pet = Pets.getByID(args[0]) if (pet == null) {