3

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: Is it possible to use NBT tags in commands in Minecraft: Bedrock Edition? because I want to test for a block, not setting it so you are only able to place it on specific blocks.

It is also not a duplicate of Can you tell if a specific item is dropped? What about its name? as this question was written first, therefore they have asked a duplicate of my answer!

4
  • Possible duplicate of How to tell if a certain item is in a player inventory? (revisting this after the NBT tag split)
    – pppery
    Commented May 6, 2021 at 18:02
  • @pppery Incorrect duplicate, I believe you are looking for Testing for dropped items.
    – One 2 Many
    Commented May 7, 2021 at 7:00
  • Yep, sorry, misread the question.
    – pppery
    Commented May 7, 2021 at 14:32
  • @DanHowe Sorry, we base duplicates off of answer quality. The duplicate question currently has the best answer because it is more detailed. We only resort to dates if the answers are of about equal value. Please do not attempt to edit this question or answer to make it "beat" the other one, we'd like to encourage collaboration, not competition, so if you have stuff to add, why don't you suggest an edit to that answer?
    – One 2 Many
    Commented May 10, 2021 at 22:59

1 Answer 1

3

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 will only work if the player is playing on English. It is not case-sensitive.

1
  • I mean it fails if you're trying to detect the item through its name, but the (survival) player renamed it in an anvil. then you're out of luck and have absolutely no way to detect that item anymore. And as I've said, it's also dependant on the hosts language settings, so if they aren't playing on english, the default names will be different and thus not detected.
    – Plagiatus
    Commented Jul 14, 2020 at 9:18

Not the answer you're looking for? Browse other questions tagged .