Best way to have an item that converts blocks into a variant of said block?

Started by wheatttt on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Best way to have an item that converts blocks into a variant of said block?

Currently, I have a tool that changes some specific blocks into their variants when you right click them. As of now, this works in a way that feels just a little bad, which is a long chain of if statements checking that the blockstate is a specific one, then playing the break effect, and replacing the block, like so:

 

 

This is annoying and time consuming to set up, but I can't think of any other way to do this. any ideas?

Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thats as good as the code…
Mon, 11/24/2025 - 20:03

thats as good as the code will get sadly

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I was able to figure out a…
Fri, 11/28/2025 - 00:39

I was able to figure out a solution, actually! It requires the plugin File Manager (Nerdy Edition), in order to parse json files.

I can then put json files in data/[ModName]/recipe/transforms and they will automatically be detected by this code block.

One of those json files looks something like this:

{
 "input": "minecraft:oak_planks",
 "output": "minecraft:spruce_planks"
}

Which would then make it so that using this item on Oak Planks would convert it into Spruce Planks.