Hello! I was recently messing around with command blocks and found that I could do "/testfor @r[type=<type>] {}" but not "/testfor @r[name=<name>] {}". I don't know if this is a bug or not, but either way you should be able to do it, making for some easy randomizers. The output from "/testfor @r[name=<name>] {}" is "The entity UUID provided is an invalid format".
Linked issues
Comments 3
Duplicate of MC-93023.
WAI, I made the same mistake also. The @r selector only works on players by default.