Skip to main content

Testing for structures near players

I want to have a redstone timer that has a signal into a command block, with /execute @a ~ ~ ~ testforblocks <Coordinate 1> <Coordinate 2> <Relative Position> and then a compartor, testing if a structure 1 X away from the player (I may make it 2) is the same as a structure I built somewhere else. (A chest with a sign on top of it reading “[Case]” and then having 2 iron blocks next to the chest) Then, the chest will fill with random loot, and the iron and sign disappear. I know how to do the random loot, and how to make the blocks disappear, but using /execute will only test if A player is next to the structure. How do I tell the players that are near the structure from the players that aren't?