#How do make it so that a block can only be placed on a solid block?

1 messages · Page 1 of 1 (latest)

uneven osprey
#

I want it to be like a snow layer, where it can't be placed on any surface that doesn't have a 16 by 16 collision on the top side of it. Ex. Place a snow layer on a trapdoor and open it.
I am using minecraft:placement_filter.
Although i am considering using a command that deletes the block and a molang that will do the job as well.

versed rain
uneven osprey
#

I am unaware of scripting api but my other idea is using an event with a condition that will delete the block below

#

someone said to use above_top_solid but i don't think that returns a float and is probably rounded up or down.

uneven osprey
#

yeah

versed rain
#

Which is useful for world generation

uneven osprey
#

but i think it would be useful for returning the height of a block

#

if it returns something like y=-60.9 or something

#

then i can do something if it returns a decimal

#

in other words if above_top_solid(0, 0) mod 1 returns something other than zero

uneven osprey
versed rain
uneven osprey
versed rain
#

Not sure why you would need to even use this query, it doesn't help

uneven osprey
uneven osprey
#

Sorry i don't know where to begin using scrpting api for this

versed rain
uneven osprey
versed rain
#

Then your other choice is to list every block in the placement filter

uneven osprey
#

Yeah.

uneven osprey
#

Update: that feeling when u can just add an exclamation point to negate everything :0

#

Damn

#

:(