How do I make an item place a block with its rotation based on which half of a face of a block the player is looking at?

Started by MCAlexisYT on

Topic category: Help with modding (Java Edition)

Last seen on 20:02, 22. Dec 2023
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make an item place a block with its rotation based on which half of a face of a block the player is looking at?
Sat, 07/29/2023 - 18:11 (edited)

I'm currently making a mod which has slabs, vertical slabs, stairs and what I call "corner posts" (8x16x8 blocks with its model aligned to a corner of the 16x16x16 pixel area it occupies) made with Concrete and all of its coloured variants, and I want the placement of those "corner posts" to mimic vanilla slab placement, but its flipped horizontally and also works on corners of blocks. I would LOVE for the "Look [cardinal direction] position of [event/target entity] with raytrace distance [number]" procedure blocks to have an option for using floating point numbers instead of integers, but for now, I need help. Here's the model in question:

A post on the corner of a 16x16x16 grid

Now, before you say "HaVe YoU tRiEd ThE "[cardinal direction] value of look angle vector of [event/target entity]" pRoCeDuRe BlOcK???", I did. And it passes straight through blocks.

Edited by MCAlexisYT on Sat, 07/29/2023 - 18:11
Last seen on 01:37, 20. Apr 2024
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make a while command to test…
Thu, 09/14/2023 - 01:12

Make a while command to test all blocks in that direction to see if they are valid for placing, and then use the thing you said you tried