}
// Even if the target is a player, this command requires an NPC to get the pose from.
if (!((BukkitScriptEntryData)scriptEntry.entryData).hasNPC())
throw new InvalidArgumentsException("This command requires an NPC!");
// It also requires a pose ID
if (!scriptEntry.hasObject("pose_id"))
throw new InvalidArgumentsException("No ID specified!");
// Set default objects
scriptEntry.defaultObject("target", TargetType.NPC);
scriptEntry.defaultObject("action", Action.ASSUME);
// If the target is a player, it needs a player! However, you can't ADD/REMOVE poses
// from players, so only allow ASSUME.
if (scriptEntry.getObject("target") == TargetType.PLAYER) {
if (scriptEntry.getObject("action") != Action.ASSUME)
throw new InvalidArgumentsException("You cannot add or remove poses from a player.");
else if (!((BukkitScriptEntryData)scriptEntry.entryData).hasPlayer())
throw new InvalidArgumentsException("This command requires a linked player!");
}
}