diff --git a/main/src/main/java/net/citizensnpcs/commands/EditorCommands.java b/main/src/main/java/net/citizensnpcs/commands/EditorCommands.java index dcfa53a4a..9a714aa8d 100644 --- a/main/src/main/java/net/citizensnpcs/commands/EditorCommands.java +++ b/main/src/main/java/net/citizensnpcs/commands/EditorCommands.java @@ -6,6 +6,7 @@ import org.bukkit.entity.Player; import net.citizensnpcs.api.command.Command; import net.citizensnpcs.api.command.CommandContext; import net.citizensnpcs.api.command.Requirements; +import net.citizensnpcs.api.command.exception.CommandException; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.editor.CopierEditor; import net.citizensnpcs.editor.Editor; @@ -35,7 +36,9 @@ public class EditorCommands { min = 1, max = 1, permission = "citizens.npc.edit.equip") - public void equip(CommandContext args, Player player, NPC npc) { + public void equip(CommandContext args, Player player, NPC npc) throws CommandException { + if (!npc.isSpawned()) + throw new CommandException("NPC must be spawned"); Editor.enterOrLeave(player, new EquipmentEditor(player, npc)); }