Started by
RipleysLuminous
on
Topic category: Help with Minecraft modding (Java Edition)
So I had seen a bunch of forums regarding this topic, but half of them had no answer and the other half linked to NorthWestTrees torch placement video. I wanted to simplify it and provide my own answer, because I solved it.
first off, make sure that your block is set to Y axis rotation (FROM BLOCK FACE) this is important so that you don't end up placing the leaves on, for example, the wrong side of the block when looking at a block from an odd direction.
Next, here is the procedure I used. It goes under the "block valid placement condition" section. This procedure is ONLY for the sides of the block, and not top and bottom. I hope this helps anyone struggling with this!
Edited by RipleysLuminous on Mon, 06/03/2024 - 21:59
is there a way to detect the "pitch rotation"? like the is on celling or floor
nvm i got it to work
TYSM
Thank you
ShadowMaskX could you provide an example? everything i try with pitch rotation isnt working
JustaKiwi use 'get enum propery' to get ceiling or floor data, otherwise just follow what's here. (be sure to use capitals for enum properties)
https://mcreator.net/forum/101363/get-enum-property-procedure-block-not…
could you add a download, i don't want to have to recreate the entire thing lol.
ehh nevermind ill just do it
I managed after some hours of serching, testing & working with AI to create code for Valid Placement that enables placing to walls, floors & ceilings; you only must in settings of block set "Y-axis rotation (S/W/N/E)" (as in original post) & enable "Has pitch rotation"

And then in Valid Placement procedure do this code:
I needed to do this for a block I'm making and I found it can be done even easier by writing:
if: is block at [[x] - [x offset direction [get direction of [provided blockstate]]]], y, [[z] - [z offset direction [get direction of [provided blockstate]]]] solid?
do: Return logic: true,
Return logic: false
or the actual Java code version:
And you can add the -y offset direction if you want it to be able to be placed up or down. It's a lot easier than using NBT tags or checking every direction.