I am creating a Minecraft game that is similar to the game polytopia, but I am having trouble with the "exploring" feature. The exploring feature basically allows the player to walk around their 1 chunk spawning area, and there is a glass 1 thick floor around the floating chunk, the player can step on the glass, on either side of the chunk. Basically I want to run something like this: execute if entity @a[chunk=[62,-2]. I was thinking about this way because when you forceload a chunk, it forceloads as a 2 number area, like [62, -2], so I want a way to see if the player is inside that chunk. For testing, you can just run say test I created something similar to this but it is very inefficient, I just did, if a player is standing on a certain color glass, it will run the command. I would prefer in game commands inside command blocks rather than datapacks.
Here is the inefficient way I did it: (video)
I did notice something in MCStacker with a "SpawnForced" Option, and I'm thinking that could be helpful