flag = DenizenAPI.getCurrentInstance().flagManager().getNPCFlag(((dNPC) flag_target).getId(), name.asString());
else throw new CommandExecutionException("Could not fetch a flag for this entity: " + flag_target.debug());
// Do the action!
flag.doAction(action, value, index);
// Set flag duration
if (flag.StillValid() && duration != null && duration.getSeconds() > 0)
flag.setExpiration(System.currentTimeMillis()
+ Double.valueOf(duration.getSeconds() * 1000).longValue());