I’m making a puzzle map with similar structure to Portal, where you get a cube and you put it on a button, etc. But for some puzzles, I want the block to be summoned by pushing a button, but I don’t want the command to work every time I push the button, only the first time so they get ONE block. Plus, if they lose the block, I’d like them to be able to get it again. How can I set this up to where your allowed to get only ONE block from this button?


There are a bunch of fancy ways to do this, but I would recommend the simplest one: Using /setblock to remove the button and later place it back whenever you want. That way the player immediately sees that they can't request another cube and won't try to push the button more often (because it's gone). And when the button is back again, they immediately see that they can request another cube. That's good user interface design. :)

  • In this case, you'd probably also want a mechanism to determine if the item still exists (in their inventory or in the world) (I'm not sure how to do this now that I remembered that just in the inventory is not enough) – Unionhawk Feb 21 '20 at 22:05
  • 1
    ... and remember that it could be in an unloaded chunk. – pppery Feb 21 '20 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.