Click text only once, not multiple times
I'm using the website minecraft.tools to help create a book, in which the user clicks the text and is given an item. I created the text that says "> Click for Reward" and added a Click Event, that gives the user an item. But I want it when the user only clicks on it once, instead of multiple times, by which they can get the item repeatedly.
The command for Click Event is /give @p economyinc:item_oneb
Minecraft Java, playing version 1.14.4
Solution 1:
Create a dummy scoreboard objective, call it something along the lines of hasClaimedReward
. When giving the item to the player, only give it to them if they have a hasClaimedReward
score of 0:
/execute as @p if @s[scores={hasClaimedReward=..0}] run give @s <item>
Afterwards, set their hasClaimedReward score to 1.
It would be best to just make the book trigger a function to handle this.