Started by
S33R_OF_PYR3
on
Topic category: Help with MCreator software
I have a procedure that runs when the player right clicks a block, and I want the code to run only when the block is on the floor (as opposed to the ceiling or wall). I have this if statement encapsulating the code at the start, but something seems to be wrong with it as the code won't run even if the block is on the floor.
if (((world.getBlockState(new BlockPos(x, y, z))).getBlock().getStateDefinition().getProperty("face") instanceof EnumProperty _getep1
? (world.getBlockState(new BlockPos(x, y, z))).getValue(_getep1).toString()
: "").equals("floor")) {
I'm using the visual editor to write the procedures so I'm not sure if the raw code is correct. According to the visual editor, the if statement reads:
if ([get enum property "face" of {block x y z}] = "floor")
I've checked and assigned integer blockstates successfully but haven't messed with enum properties much, so I'm in the dark here. Would appreciate the help~