Topic category: Help with Minecraft modding (Java Edition)
So I wanted to make a block that will "infect" nearby solid blocks and replace them with itself. It's supposed to have a 1 in 10000 chance of doing that and it should replace anything that isn't air(or at least anything that's solid). This is where the problem comes - I tried to make a procedure that first checks if a block in a certain coordinate is solid, then replaces it if it is. However the game instead checks if a chosen location has a solid block, and if it does, it simply replaces a totally different block rather than the one it chose during the check. I can't figure out how to fix this. Here's my current setup.
If anyone could help me out, it would be much appreciated.
Also, unrelated, but I don't know how to add loot to chests that appear in existing structures in the game. Would like to figure that out since I want some of my modded items to appear in the vanilla structures. Thanks in advance.
Apparently the image is broken so here's a link https://imgur.com/4YOz3fe
I solved problem 1 by using variables. But now I have another issue - https://imgur.com/a/CGcdagl
I set this up so the infectious block can't infect any solid blocks with a hardness value lower than 25. This is supposed to prevent the block from spreading to indestructible blocks. However, when I check in-game, everything other than air seems to get infected.
Too bad there's no edit button, but I managed to fix the issue. Apparently blocks with infinite hardness actually have -1 hardness.
Anyways, would still appreciate some help with adding loot tables to chests inside of vanilla structures.
huh?
Ignore this topic. I've solved everything myself.