How do I make my custom block only placeable on certain blocks? [SOLVED]

Started by Alex Khang on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make my custom block only placeable on certain blocks? [SOLVED]
Wed, 07/30/2025 - 08:52 (edited)

I'm creating a custom sapling for my mod, which requires a custom model. As a result, I'm unable to use the plants feature and must rely on procedures.

I attempted to create a procedure to check if the targeted block is tagged as "minecraft:dirt", which includes my custom blocks, but it didn't work. I have seen a lot of people say that you can use the "Block valid placement condition", but it's currently bugged or something, because I cannot scroll down to choose my procedures, and can only access the first five procedures I've made.

I've seen and followed this forum topic, but it didn't work for me. Procedure: https://postimg.cc/yWPQcZ5N

PS: I want my sapling to be unplacable on blocks that don't allow vegetation to grow on, not that it becomes destroyed after a while through tick updates.

Any help is appreciated. Thank you!

Edited by Alex Khang on Wed, 07/30/2025 - 08:52
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Please help
Tue, 07/15/2025 - 08:18

Please help

Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
pretty simple: advanced…
Wed, 07/16/2025 - 10:50

pretty simple: advanced properties

block valid placement condition
 

if your block needs the support below, "if: [block at (x) (y-1) (z)] = [select block]"

if it's above, just put + instead

if it's on the side, put the equasion depending on the axis

if there's multiple blocks, just put a XOR gate in front

Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you, I do know how to…
Wed, 07/30/2025 - 06:04

Thank you, I do know how to check if the block at y - 1 is the block I wanted. However, I'm not sure how to return a statement so that the procedure is complete and inserted in the block valid placement condition.

Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
UPDATE: I have figured out a…
Wed, 07/30/2025 - 08:52

UPDATE: I have figured out a way to do it after some tinkering. Thanks pal.
Code for anyone who is interested:
If Get block at {x   y + 1   z} tagged in block tags as [your block tag] / is the same block as [your block]
      Return logic: True
Return logic: False

For support, just check if there is not a solid block at y - 1.
If that's the case, destroy block at x y z and drop block at x y+1 z to avoid item getting stuck.