#minecraft:vertical_half problems

1 messages · Page 1 of 1 (latest)

distant spoke
#

So i wanna replicate a trapdoor in bedrock using a custom pack, and as soon as i transitioned my block from the old style, using cardinal_player_facing with the up/down (0, 1) to figure out if i should rotate the block to be on the top side of the block, to the new style of minecraft:vertical half, the trapdoor just shows me the "update" block.

Both versions of the code are provided below, im not sure why it wont work.

analog fern
#

to rotate your block, use minecraft:transformation. minecraft:rotation was removed:

"minecraft:transformation": {
  "rotation": [0, 180, 0]
}
distant spoke
#

but if i use all of the old code it still works

#

also, does vertical_half even work for format 1.19.50

#

if not, what version minimum should i use

analog fern
#

i think block traits are only enabled in format versions 1.20.10 and higher

distant spoke
#

makes sense

distant spoke
#

update:


            {
                "condition": "query.block_property('placement:rotation') == 2 && query.block_property('minecraft:vertical_half') == 'bottom'",
                "components": {
                    "minecraft:transformation": {
                        "rotation": [
                            0,
                            180,
                            0
                        ]
                    }
                }
            }
``` format for all of them and the block still doesnt show
nova swift
#

Line 124, it's still minecraft:rotation

#

Also, you can use minecraft:cardinal_direction traits rather than using a query.

#

Also, you can define in permutation of every different direction of your block once, then the vertical_half.

You don't have to combine every combination states in permutation. Both components from different permutation can be combine if those two states are met.

distant spoke
#

Hm interesting

distant spoke
#

So like a condition if it's facing west, another condition if it's the top half, and if I do both by placing on the top half facing west, it'll do both?

#

also based off this

#

they have one for every permutation lol

#

update: i LITERALLY copied and pasted their code and made sure to change any modifiers like the geometry and texture and identifier, and it STILL doesnt work

nova swift
#

First, I wrote permutations for direction.

           {
                "condition": "q.block_property('minecraft:cardinal_direction') == 'north'",
                "components": {
                    "minecraft:transformation": { "rotation": [0, 0, 0] }
                }
            },
            {
                "condition": "q.block_property('minecraft:cardinal_direction') == 'west'",
                "components": {
                    "minecraft:transformation": { "rotation": [0, 90, 0] }
                }
            },
            {
                "condition": "q.block_property('minecraft:cardinal_direction') == 'south'",
                "components": {
                    "minecraft:transformation": { "rotation": [0, 180, 0] }
                }
            },
            {
                "condition": "q.block_property('minecraft:cardinal_direction') == 'east'",
                "components": {
                    "minecraft:transformation": { "rotation": [0, -90, 0] }
                }
            }
#

Then for vertical half

{
                "condition": "q.block_property('minecraft:vertical_half') == 'bottom'",
                "components": {
                    "minecraft:geometry": "geometry.lower_trapdoor",
                    "minecraft:selection_box": {
                        "origin": [ -8, 0, -8 ],
                        "size": [ 16, 3, 16 ]
                    },
                    "minecraft:collision_box": {
                        "origin": [ -8, 0, -8 ],
                        "size": [ 16, 3, 16 ]
                    }
                }
            },
            {
                "condition": "q.block_property('minecraft:vertical_half') == 'top'",
                "components": {
                    "minecraft:geometry": "geometry.upper_trapdoor",
                    "minecraft:selection_box": {
                        "origin": [ -8, 13, -8 ],
                        "size": [ 16, 3, 16 ]
                    },
                    "minecraft:collision_box": {
                        "origin": [ -8, 13, -8 ],
                        "size": [ 16, 3, 16 ]
                    }
                }
            }
#

For example the block's state is cardinal_direction is east, and vertical_half is top. The components from both permutation will combine, thus you don't need to write every possible combination of permutation in your code. This will help you write less code.

#

Idk why the wiki wrote a permutation like that, you can simply just write less and achieve the same behavior because as I said earlier, the components from different permutation that are met will be combined. One components will only be overridden when there are same components from different permutation.

Take a look at my custom trapdoors.

#

Here in my code, you can see I only wrote all directions once, same for vertical_half, then I only wrote an open states once as well. I no longer need to write a permutation for close because that's my default states, so writing it will be unnecessary.

distant spoke
#

That makes sense, also does it make any difference to have the cardinal direction as a property instead of a placement position state?

nova swift
#

Nope, that's technically same. The only difference is that cardinal direction will use an event, which I heard will be deprecated in the future. That's why I'm using placement position traits, instead.

distant spoke
#

Oh boy, alright

dapper quarry
#

@distant spoke , yow I had this template

distant spoke
dapper quarry
#

That work because I try when I done these template

thin lark
#

aint it supposed to be block_state and not block_property