Minecraft – Test for item in output slot of furnace

minecraft-commandsminecraft-java-edition

When i put this command in a command block:

/testforblock ~ ~1 ~-3 minecraft:furnace 0 {Items:[{id:"minecraft:iron",Slot:1b}]}

It gave this error:

The block at 137,85,401 is Furnace (expected: Furnace).

And when i put this in the command block:

/testforblock ~ ~1 ~-3 minecraft:furnace {Items:[{id:"minecraft:iron",Slot:1b}]}

It gave this error:

'{Items:[{id:"minecraft:iron",Slot:1b}]}' is not a valid number

I'm trying to test for an iron ingot in the output slot. Anyone know how to do this?

Best Answer

There are two types of furnaces:

  1. furnace (furnace turned off)
  2. lit_furnace (Furnace when burning something)

The data Value has to be -1 or the actual rotation of the furnace (-1 means it does not matter).

So change your command to:

/testforblock x y z minecraft:lit_furnace -1

The output slot is 2b and iron is called iron_ingot:

/testforblock x y z minecraft:furnace -1 {Items:[{Slot:2b,id:"minecraft:iron_ingot"}]}
/testforblock x y z minecraft:lit_furnace -1 {Items:[{Slot:2b,id:"minecraft:iron_ingot"}]}

You would have to test if one of these testfors was successful (basically do your redstone 2 times, one for each command).

Source.