1

I'm playing in the new snapshot, 18w01a.

I'm trying to detect if a hopper has a specific renamed item in it using this command:

/execute if block "x" "y" "z" minecraft:hopper{Items:[{id:"minecraft:paper",tag:{display:{Name:"12345"}}}]} run say hi

I have a piece of paper renamed 12345 in the hopper and the command fails when I try to run it. If I remove the tag/display/Name argument, the command runs fine, but that's no help to me. I'm sure I don't have the syntax wrong, so what gives? Is this a bug? If it's not a bug, I won't report it on the bug tracker, but right now I'm a little iffy.

3
  • 1
    What do you mean by the command fails? What error is given, or does it simply give no response?
    – 54D
    Jan 10, 2018 at 4:31
  • Try an easier command/a part of the command first. Many things changed in 1.13, so it could be the execute part, the NBT structure of the hopper, the item part, the name part, ... Jan 10, 2018 at 8:12
  • I think you need to specify a slot somewhere. Jan 10, 2018 at 8:12

1 Answer 1

2

In 1.13, the syntax for display names changed to text components. In my case, we'd have to write it as:

/execute if block "x" "y" "z" minecraft:hopper{Items:[{id:"minecraft:paper",tag:{display:{Name:"{\"text:\":\"12345\"}"}}}]} run say hi

You must log in to answer this question.

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