How do I check for items in a block and then change the block depending on what is in it

Started by stabbyfork on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I check for items in a block and then change the block depending on what is in it
Sat, 02/25/2023 - 12:43 (edited)

I'm trying to make a furnace block that checks what's in its inventory, then changes the block depending on what's inside of it. My current version doesn't work tho

Current code looks like this:
Event trigger (furnace block update tick every 20 ticks)
if item in slot 3 = bowl and item in slot 0 = iron powder
do replace block at xyz with furnace with bowl with iron keep state keep nbt/inventory
else if item in slot 3 = bowl
do replace block at xyz with furnace with bowl keep state keep nbt/inventory
else if item in slot 3 is not bowl
do replace block at xyz with furnace without bowl keep state keep nbt/inventory

The main point of this is to change the model of the furnace depending on what's inside of it, so if there's an easier way tell me

Edited by stabbyfork on Sat, 02/25/2023 - 12:43