I'm using Minecraft 1.10, if it helps. I'm making a mini-game where the player needs to rotate hoppers in order to direct items to the correct place (I'm summoning particles under the hoppers to indicate where items currently are). While deciding what the interface should be for the player controls, I realized that I can set the Lock tag on a hopper to prevent the UI from showing up when right-clicked, but it would still increase the stat.hopperInspected scoreboard stat when the player right-clicks it. Perfect! Just right-click a hopper to rotate it...except that there are going to be several (or many) hoppers next to each other, in a chain in fact. So once I know the player has right-click a hopper from the scoreboard, what's the best way to detect which hopper was clicked?
I already have a marker armor stand in each of the hoppers, for the particle indicators, if that helps. I just can't think of a good way. The best I've thought of is "force the player to stand directly under the hopper they're clicking", but that's not easy to enforce and would be problematic if they don't do it. (I guess I could /tp them to force them to look directly upwards, but that's also pretty terrible UI, I think...)
So what's the best way to do this?