How to detect a block facing a certain way then place another block facing the same way.

Started by Char1ie on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to detect a block facing a certain way then place another block facing the same way.
Sat, 03/30/2024 - 12:19 (edited)

ive got this block where when you right click it it changes texture but the problem is this block has a S/W/N/E rotation. ive tried to do it but it doesnt work (the procedure that doesnt work is in the image attached) I just need to know how to do this and/or where I went wrong

 

if the image isnt working its at https://imgur.com/a/wCbfcx6

Edited by Char1ie on Sat, 03/30/2024 - 12:19
Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm an idiot and I only just…
Sat, 03/30/2024 - 12:26

I'm an idiot and I only just found this out, if anyone wants to know how its really simple. Here's an image of how you do it but if the image doesnt work anymore then I'll try explain in text form, sorry if I'm bad at explaining it though.

[Place ___ at x y z]

the ___ is:

 [__ with direction set to ____]

the first __ is:

[Block]

the second ____ is:

[Get block direction at x y z]

Hope this helps!

 

Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you so much! This also…
Sun, 01/12/2025 - 15:01

Thank you so much! This also works with cake-like blocks that you eat on right-click and want the block models to update, was wracking my brain trying to make those keep the same orientation!