Check if block is replaceable?

Started by STARRYSOCK on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Check if block is replaceable?

Is there a way to check if a block is replaceable, like air/water/grass/vines?

I have several blocks that are placed using custom procedures, but haven't found a good way to test if the space they're attempting to be placed in is occupied with a replaceable block, beyond just manually testing for each block. But that doesn't help with modded replaceable blocks

Joined Aug 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Any luck with this yet? I've…
Fri, 05/13/2022 - 10:50

Any luck with this yet? I've been trying to do something similar to this.

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hopefully this gets answered…
Fri, 05/13/2022 - 17:26

Hopefully this gets answered, because many of us don't know how to check for that.

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Not sure if this is what you…
Fri, 05/13/2022 - 22:38

Not sure if this is what you mean but If so here is a solution.

Create a Block Tag and fill it with all the blocks that you want to be replaceable and in your procedure check if the block that's trying to be replaced is tagged as your Block Tag and if it is then replace it.

Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
someone answer this pls
Sun, 03/10/2024 - 21:58

someone answer this pls

Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
minecraft:replaceable is…
Tue, 10/29/2024 - 12:13

minecraft:replaceable is already a tag so the best way i've found is:
if is [block] tagged as [minecraft:replaceable],
so all the blocks in the tag (grass, water, roots, air, etc...) will be detected
i hope that help