How can I execute at a chest with a specific pattern of certain items?

Solution 1:

You should use /testforblocks. This tests if two chests are the same.

/testforblocks templateX templateY templateZ templateX templateY templateZ testforX testforY testforZ

You will need to place a template chest down with the specific item pattern.

Then if it passes, you use a conditional command block placed after that to continue the chain.

If you need to use non-relative coordinates, remove the tilde ~ from your coordinates. So instead of typing ~1 ~2 ~3, type 1 2 3 to always execute at world coordinates (1, 2, 3), instead of relative.

Otherwise, I don't quite understand what you mean by "unspecific coordinates". I assume it means that it is not relative, but a certain world coordinates each time. If not, please update it in your question to be more specific.

If you want to test for any chest, anywhere, it's going to be quite tricky, and I'm not skilled enough to solve it. Sorry.