Minecraft commands: how do I test when a player enters a world (single player)?

Da
- in Worlds
3

E.g. / execute as entity if Enter player world run say You entered the world

Pr

Does it have to be an execute?

Da

Nope

Sc

It would be possible if you enter the following command in a repeating command block to always be active: / execute if entity @p [name = yourplayerName]

Now put a red tone comparator on the command block, which is again a normal command block, which then outputs your desired command.

Alternatively it would be possible if you "/ execute if entity @p [name = YourPlayerName] run say You have entered the world" but that would result in it being in the chat all the time