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.
-
5There is a similar post where you can find your answer.– GalabycaFeb 18, 2016 at 22:46
1 Answer
The syntax of /clear
is:
/clear [player] [item] [data] [maxCount] [dataTag]
To make it only take away one sword, put maxCount as 1.