Started by
wheatttt
on
Topic category: Help with Minecraft modding (Java Edition)
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?
thats as good as the code will get sadly
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/transformsand they will automatically be detected by this code block.One of those json files looks something like this:
Which would then make it so that using this item on Oak Planks would convert it into Spruce Planks.