mojira.dev
MC-91095

Furnace burning enchanted fuel breaks /testforblock on that furnace

Working on a custom map, I decided to give the player enchanted coal. I wanted to use /testforblock to detect furnaces with that enchanted coal and lower its CookTimeTotal. It worked at first. However, once the furnace consumed one of the enchanted coal items, it broke. Specifically, the furnace was no longer detected by /testforblock, giving the strange error message, "The block at <x,y,z> is Furnace (expected: Furnace)." If it's expecting furnace and it found a furnace, why is it failing?

A bit of inspection shows that after the furnace consumes one of the enchanted fuels, the "ench" tag on the fuel slot gets flattened--in other words, rather than an array of enchantment objects, it becomes a 1D array of values. So if the original tag was "ench:[{id:32,lvl:1}]" it gets converted into "ench:[0:32,1:1]" after consuming the first piece. That's strange, but it still doesn't explain the failing /testforblock behavior.

To reproduce:

1) /give yourself a few pieces of enchanted coal using the "ench" tag.
2) Put that stack into the fuel slot of a furnace and start smelting something, allowing it to use at least one of the coal.
3) Try a /testforblock x y z minecraft:furnace command and watch it fail with an odd message.

I realize enchanted fuel isn't something that's natively supported, but surely it shouldn't break all future /testforblock commands until the furnace is broken and replaced, right?

Attachments

Comments 4

You need to /testforblock lit_furnace. They both have the same name so it's a bit confusing. Cannot reproduce the broken enchantment tag.

Facepalm Yeah, that makes sense, thanks. Might I suggest that the /testforblock error message correctly identifies variants like lit_furnace and furnace to avoid confusion?

As for the enchantment tag... here are the full steps I performed to achieve this consistently:

1) Execute the following command: /give @p minecraft:coal 2 0 {ench:[{id:32,lvl:2}]}

2) Put both enchanted coal into a furnace and cook one item, allowing one coal to be used.

3) Stand on the furnace and execute the following command: /blockdata ~ ~-1 ~ {}

If you look at the tag, you'll see the ench tag has become simply "ench:[0:32,1:2]" instead of the array of objects with key names.

I've highlighted it in a blue box in this screenshot: https://dl.dropboxusercontent.com/u/11662651/Minecraft/FurnaceTestForBlockBug.png

Because of the flattened tag, the coal no longer says "Efficiency II" in an inventory; it instead just says that it has 1 NBT tag.

Update: I just tried it again, and this time, the tag wasn't flattened. I'm not sure what I did differently this time; you can see from the screenshot that it did happen. I'll keep testing and let you know if I figure out the conditions that lead to it.

Might I suggest that the /testforblock error message correctly identifies variants like lit_furnace and furnace to avoid confusion?

http://minecraftsuggestions.reddit.com

Still cannot reproduce the broken enchantment tag. I recommend creating a new ticket with detailed steps to reproduce for that.

Daniel Burnett

(Unassigned)

Unconfirmed

Minecraft 15w43a

Retrieved