I am making a trade system in my Minecraft map where I give players a diamond sword if they give me 2 golden swords.
For that I put 2 command blocks. On first one:
/give @p[hasitem={item=golden_sword, quantity=2.. }] diamond_sword
and on second one:
/clear @p[hasitem={item=golden_sword, quantity=2.. }] golden_sword 0 2
Here's the problem: the system will only clear the golden swords with data value 0, which means full health, but I want that the system clears the sword even if it is about to break. I can't skip data value as after data value I have to specify the amount that is 2.