Basically i saw a video about minecraft and i was thinking if anyone knew a command to where if someone comes to a area a mob spawns?

So basically i saw a video about minecraft and i was thinking if anyone knew a command to where if someone comes to a area a mob spawns?

Uhh okay… What's your question?

Do you mind sharing the YouTube link?

My safest bet is by using command blocks.