I've always wondered when "intention" as a condition for a valid sacrament became a thing. A muslim can baptise a child and the baptism is valid and a defrocked atheist priest can consecrate a host and perform a valid confession.
The only things we can judge are matter, form and minister.
So, it's a minimal intention to do what the Church does. That's why a Muslim can baptize validly, since if he just thinks "So, I'm going to do this thing Catholics do." Obviously they don't believe in it and they don't intend what the Church intends by the Sacrament, but he's intending to DO it, perform the ritual. That's all that's necessary. This is distinct, for instance, from someone who's mocking the Sacrament or goofing around, or children playing (say playing priest), or an actor performing a baptism in a play or a movie. In those latter case they intend to mimic or portray the Catholic action, but not actually DO it.