I don't think its built in, but you could place an armor stand at every button and test for a pressed button, then look for a player who's closest (I'm assuming that you can't put a command block at every button)
What I'm basically trying to do is have one button for rolling dice, and have a system that only allows the player who's turn it is to successfully roll (they'd be flagged with a score objective or a tag when it was their turn). The problem becomes if players are crowding around the "dice" button, using an entity to detect player proximity can lead to false negatives/positives... being able to use the stat to detect who actually pressed the button would have been the best way to do it
Thanks though, I'll just have to think on this a little more.
Is there any way to create a scoreboard objective to detect the player pressing a button? I tired using stat.useItem:
But this only detects when the player places a button.
I don't think its built in, but you could place an armor stand at every button and test for a pressed button, then look for a player who's closest (I'm assuming that you can't put a command block at every button)
Youtube
Link Removed
What I'm basically trying to do is have one button for rolling dice, and have a system that only allows the player who's turn it is to successfully roll (they'd be flagged with a score objective or a tag when it was their turn). The problem becomes if players are crowding around the "dice" button, using an entity to detect player proximity can lead to false negatives/positives... being able to use the stat to detect who actually pressed the button would have been the best way to do it
Thanks though, I'll just have to think on this a little more.