I am attempting to make a shop in which you can trade a number of items for coins (ender stars).
I'm using the /testfor
command to see if they're on the right team and /clear
to remove the items, however, when someone presses the button with only one item their one item is removed and they get the coin even though the shop requires you to pay 5 items.
How do I make it so it tests to see if they have the minimum amount of items in their inventory before it clears the item and gives them the coin?