Need help with replacing non-air blocks

Started by Orandza on Sat, 07/09/2022 - 21:10

Topic category: Help with modding (Java Edition)

Last seen on 16:36, 21. Sep 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Need help with replacing non-air blocks
Sat, 07/09/2022 - 21:10

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.

Last seen on 16:36, 21. Sep 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Apparently the image is…
Sat, 07/09/2022 - 21:12

Apparently the image is broken so here's a link https://imgur.com/4YOz3fe

Last seen on 16:36, 21. Sep 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I solved problem 1 by using…
Sun, 07/10/2022 - 21:45

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.

Last seen on 16:36, 21. Sep 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Too bad there's no edit…
Sun, 07/10/2022 - 22:08

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.

Last seen on 12:11, 2. Oct 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
huh?
Fri, 07/15/2022 - 14:27

huh?

Last seen on 16:36, 21. Sep 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Ignore this topic. I've…
Wed, 07/20/2022 - 21:15

Ignore this topic. I've solved everything myself.