I THINK you go to the mob trigger tab, in the "in initial spawn" section and set a procedure with the blocks "tame event/target entity by" but change the last block by "get nearest entity at xyz in a square area of 4 of type" and select player in the end there.
I THINK you go to the mob trigger tab, in the "in initial spawn" section and set a procedure with the blocks "tame event/target entity by" but change the last block by "get nearest entity at xyz in a square area of 4 of type" and select player in the end there.