Minecraft 1.5.2 Command Blocks - Clear just one item [closed]

I'm playing Hexxit-Modpack, and the Minecraft version is 1.5.2. I want to build a small shop, and for this I need a clear command. I found some on the Internet, but nothing works for me.

I just want a piece of an item to be cleared and not the whole stack. Maybe you guys know too if it is possible to ask if the player has the item in the inventory.


Solution 1:

Clear Command was Introduced in 1.4.2

Syntax:

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

So for your example to clear 1 piece of stone:

/clear @p 1 0 1