#Set BlockState of a newly-placed block

8 messages · Page 1 of 1 (latest)

dark summit
#

How do I dynamically set a custom BlockState property of a block that was just placed?

I have a bee_type integer block state im trying to set
...And I have a frankenstein of a line that seems to work but theres GOTTA be a better way BigEyes


event.server.runCommand(`execute in ${event.block.level.name.getString()} run setblock ${event.block.x} ${event.block.y} ${event.block.z} vulpinian_skies:configurable_bee_chrysalis[bee_type=${beeBlockState}]{data:${NBT.toTagCompound(blockEntityData)}}`);
ancient socketBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

dark summit
#

I already tried .set Doesnt work.
I dont know to use .setBlockState and cant find any examples of it + seems to be deprecated

dark summit
#

Yeah this is too scuffed and complicated. I was doing this to try and avoid registering a couple dozen different very similar blocks, but a couple dozen similar blocks will just have to do.

fresh sun
dark summit
#

even tho it shows up in f3 screen and in block entity NBT etc

#

it was too weird and never worked so im just registering a bunch of separate blocks now