Started by
Cdztw
on
Topic category: Advanced modding
I recently created a custom slab with rotatable textures.
I want to make the placement of this slab similar to vanilla Minecraft.
When a player is holding a slab and looks at the upper part of a block, then right-clicks, it will place the slab with the enum property "type" set to "top."
On the other hand, if the player looks at the lower part of a block and right-clicks, it will place the slab with the enum property "type" set to "bottom".
How can I implement this function?
*UPDATE
I tried using "Look Y position of [Event/target entity] with raytrace distance [1] fluid mode [NONE▾] block mode [OUTLINE▾] " block, but it only return integer value,
I can't get the double value to make the detection works.
Edited by Cdztw on Mon, 11/06/2023 - 16:04
Okay, I found a solution.
Instead of making a rotatable block behaves like vanilla slabs, I modified the vanilla slabs to have facing enum property and use my custom models to acheive this goal.
Now I don't need to worry about how to solve placement problem.