Check if block is replaceable?

Started by STARRYSOCK on

Topic category: Help with Minecraft modding (Java Edition)

Active 4 months ago
Joined Sep 2021
Points:
488

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 0
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

Active 1 year ago
Joined Aug 2015
Points:
722

User statistics:

  • Modifications: 1
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
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.

Active 10 hours ago
Joined Jul 2020
Points:
1180

User statistics:

  • Modifications: 5
  • Forum topics: 84
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 229
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.

Active 2 months ago
Joined Apr 2020
Points:
768

User statistics:

  • Modifications: 4
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 101
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.

Active 9 months ago
Joined Mar 2024
Points:
165

User statistics:

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

someone answer this pls

Active 2 weeks ago
Joined Mar 2019
Points:
709

User statistics:

  • Modifications: 2
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 19
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