-1

This question already has an answer here:

I'm making an enchanting shop, where you click a button, it takes away your sword, gives you an enchanted one. But currently, I am using /clear to take away the sword, so if someone has more swords, it takes away all of them. How do I do this? Do you have to add a number somewhere? I am not trying to take away items with custom names, just a normal diamond sword.

marked as duplicate by GodEmperorDune, Ave, nine, Adam Lobo, Studoku Feb 19 '16 at 15:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

The syntax of /clear is:

/clear [player] [item] [data] [maxCount] [dataTag]

To make it only take away one sword, put maxCount as 1.

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