Minecraft: How do I make a command block shop that allows players to sell items?
I am making a map that relies on currency and other custom things like a shop. But the issue is that I'd like the player to be able to sell for example 16 chorus fruits for 20 Coins. Now keep in mind I'm building the map on the latest snapshot of Minecraft 1.9 and thus I'm using the brand new command blocks. There are some limitations to what I can use. For example I'm only able to use a total of 4 command block for every item because of lack of space.
And if you have a way of making it possible I'd love you to explain the command and how it works so that I can have a better understanding of what I'm doing.
EDIT: I'm aware that I'll probably have to use /testfor and I found this online:
/testfor @p[r=10] {Inventory:[{id:"minecraft:emerald",Count:2b}]}
keep in mind I have no idea how to make it so that I can /testfor a certain amount of an item. The youtuber who posted it as dragnoz so take a look there for even more info.
Pictures about "Minecraft: How do I make a command block shop that allows players to sell items?"



How do you make a shop in Minecraft using command blocks?
In order to set up a shop, you must first start by placing a chest, trapped chest, shulker box or barrel somewhere. This chest should contain the item(s) you would like to sell (or it will store any items you may be buying). Then, you need to place a sign near the chest - the shop sign.Minecraft Simple Buy and Sell Shops Command Block Tutorial | Xbox One, PS4, Windows 10, MCPE
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Quang Nguyen Vinh, Ksenia Chernaya, Jens Mahnke, Piotr Arnoldes
