if (!scriptEntry.hasObject("entity_type")
&& arg.matchesArgumentType(dEntity.class)) {
// Avoid duplication of objects
dEntity ent = arg.asType(dEntity.class);
if (!ent.isGeneric() && !ent.isNPC())
throw new InvalidArgumentsException("Entity supplied must be generic or an NPC!");
scriptEntry.addObject("entity_type", ent);
}
else if (!scriptEntry.hasObject("spawn_location")
&& arg.matchesArgumentType(dLocation.class))