It largely depends on why the person isn’t paying attention during mass. Most times, what we should pay attention to is what is willful and what isn’t. Someone can be distracted because they’re tired, in pains or worried about real problems they’re having. When their minds wander involuntarily, it isn’t necessarily sinful. However, if one willfully entertains thoughts or is in dispositions that are incompatible with the concentration needed at Mass, then it could at least be a venial sin.