In the Windows 10 edition, I'm trying to create a capture the flag (banner) map which detects if the flag has been dropped and replaces it back at that team's base but I can't manage to set up the command. So far I have tried:

/testfor @e[type=Item] {Item:{id:minecraft:banner}}

to receive:

Syntax Error: unexpected "{" at "ype=Item] >>{<<Item{in:m"

I know some commands are slightly different between Bedrock and Java, so I could have the wrong syntax. Also, it would be great if it could detect the colour as well. Please, could someone enlighten me?

Note: It is not the same as the question: How do you add NBT tags to commands in Minecraft Pocket/Bedrock Edition? because I want to test for a block, not setting it so you are only able to place it on specific blocks.

  • 1
    The answer to your question can be found in the question linked by pppery. It doesn't directly answer how you can add the Item NBT tag. Instead it explicitly states that it is impossible to add NBT tags except can_place_on and can_destroy. – 54D Aug 26 '19 at 15:09
  • 2
    @pppery I vote to reopen this question, because this question doesn't ask about NBT tags, it shows a command that has been tried, which happens to try to use NBT tags. This question is not about NBT tags, it is about how to test for a certain item entity that in this case is a blue banner. The answer to this question is not "you can't do it", the question to the answer is "you can do it, but the solution isn't perfect. This is how you do it and this is what you have to pay attention to." – user232393 Aug 26 '19 at 19:58
  • @54D whats an NBT?? – Dan Howe Aug 27 '19 at 17:13
  • 3
  • 2
    @FabianRöling Assuming the OP's answer is right (which is logical, otherwise he wouldn't have posted it), there is in fact a way of doing this without using NBT tags, meaning it is not a duplicate. – pppery Jan 26 '20 at 1:39

i resolved this issue by downloading somebody elses map and looking at the code they had set up

for anyone who might need this

/testfor @e[type=item,name="blue banner"]
  • 1
    this probably only works if they are playing in english though? – Plagiatus Aug 27 '19 at 14:14
  • @Plagiatus depends as they could have renamed the items – Dan Howe Aug 27 '19 at 17:11
  • so even more ways to break this system? – Plagiatus Aug 29 '19 at 14:58
  • It would be far better to use an actual minecraft: id instead of the name. – MasterOfTheTiger Dec 16 '19 at 11:23
  • @MasterOfTheTiger this only works in java edition! – Dan Howe May 5 '20 at 13:00

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.