I'm trying to make a custom crafting system in minecraft with command blocks, and for this when someone puts in a correct recipe, it should give them the result and take one item out of each of the slots. There seems to be now way to easily remove just one item from a slot in a chest, and the only way I can think of is to detect if it is a certain stack size and put in that stack size minus one, but I would have to do that for every item because there seems to be no way to replaceitem to just modify the stack size and not the item

What I need: Something similar to

/replaceitem block x y z slot <keep item the same> ammount <keep data the same> <keep datatag the same>

or even to just be able to decrease the ammount of an item in slot x of a chest

Is there a way to replaceitem without changing the item or otherwise decrease the stack size of an item in a chest?


Unfortunately, you are correct. There is currently not a way to do this in the Vanilla game without having a command for each possible item and stack size. I wish I had a better suggestion, but you may have to consider alternatives such as only accepting crafting items one at a time, or waiting until the addition of custom crafting recipes (currently said to be coming in PC edition 1.13)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.