0

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.

  • @pppery how is my question similar to the one you have said it is – Dan Howe Aug 26 at 1:54
  • 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 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 at 19:58
  • @54D whats an NBT?? – Dan Howe Aug 27 at 17:13
  • NBT, short for "Named Binary Tag", is the technical term for the thing that goes in curly braces to specify specific properties of an item, block, or entity. The NBT in your question is {Item:{id:minecraft:banner}}. – pppery Aug 27 at 17:49
0

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"]
  • this probably only works if they are playing in english though? – Plagiatus Aug 27 at 14:14
  • @Plagiatus depends as they could have renamed the items – Dan Howe Aug 27 at 17:11
  • so even more ways to break this system? – Plagiatus Aug 29 at 14:58

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.