Can I make an advancement near an entity ?

I wanted to create an advancement which would be that a player is close to the entity for example armor_stand which has for nbt {CustomName:'[{\"text\":\"end_game:cursed_altar\"}]'}

I do this but nothing, I dont really understand.

Continue to help post