#How to flip a block upside down?

1 messages · Page 1 of 1 (latest)

eager bear
#

I want my block to be flipped upside down like how stairs gets flipped. Or just the model itself.

surreal yarrow
#

you can use the minecraft:vertical_half state to check where the player has placed the block
then, use the minecraft:transformation component to flip it

"minecraft:block": {
  "description": {
    ...
    "traits": {
      "minecraft:placement_position": {
        "enabled_states": ["minecraft:vertical_half"]
      }
    }
  },
  "permutations": [
    {
      "condition": "q.block_state('minecraft:vertical_half') == 'top'",
      "components": {
        "minecraft:transformation": {
          "rotation": [0, 0, 180]
        }
      }
    }
  ]
}