Just started playing Minecraft Windows 10 edition, and I'm having a lot of fun playing around with command blocks. I'm trying to build a store in which you trade 64 Rotten Flesh for 1 diamond. I've got most of it set up, however, whether I have 1 or 63 blocks, they all get removed and I still get the diamond.

How to I set it up so that ONLY if I have a stack or a total of 64 I would receive the item?

My commands are as follow :

First CB:

/clear @p emerald 0 1

followed by chains

/testforblock 65 63 65 powered_comparator > /give @p diamond 1 > /msg @p "Message" > /title @p actionbar purchase successful

Second row if player doesn't have an item or enough of it:

/testforblock 65 63 65 unpowered_comparator > /msg @p "Message" > /title @p actionbar Purchase Failed.
  • You're testing for a powered/unpowered comparator? Why? Why not just use conditional command blocks? – Fabian Röling Aug 30 '17 at 6:30
  • What container are you using? How do you remove the items from that container? – Starcaz Aug 30 '17 at 8:34
  • So, let's say I wanted to make it so that you trade 64 Rotten_Flesh for 1 diamond, how would I go about doing that? I've been doing a lot of research and watching videos, but nothing seems to do exactly what I want it to. PS: I'm on the Windows 10 Edition of Minecraft – Georgie Q Aug 30 '17 at 19:23

/summon villager ~ ~ ~ {Invulnerable:1b,NoAI:1b,CareerLevel:1,Willing:1b,Offers:{Recipes:[{rewardExp:1b,buy:{id:"minecraft:rotten_flesh",Count:64b},sell:{id:"minecraft:diamond",Count:1b}}]}}

That should solve all you problems. It summons a Villager that trades 64 rotten_flesh for 1 diamond. It has no AI so it wont move around and is invulnerable so it won't die.

  • 1
    As of now, MCBE (which windows 10 edition is a part of) does not support data tags. However, it would be possible through an addon. – Matth3w 23 Apr 23 '18 at 16:49

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.