I'd like to create a quest where a user can activate a command block that will spawn one ocelot, but limit it so that each player can activate said command only once.
I've got the command to spawn one ocelot, which is:
/summon ocelot ~ ~1 ~ {PersistenceRequired:1}
but I don't know how to limit it so that each player can only do it only once. I found the solution to something similar, but I don't know how to integrate that into spawning animals rather than giving items.
TL;DR: How would I use a command block to allow each player to summon an ocelot only once?
Best Answer
Scoreboards!
You can track a user with scoreboards. The main gist is:
Where
hasOcelot
is a score of type 'dummy' that you use to keep tabs on who has spawned an Ocelot and who hasn't.You can use the
/testfor
command with the radius and score selectors to see if the player fits into the criteria.tl;dr