CustomiesDevs/Customies

Allow different values ​​for minecraft:collision_box and minecraft:selection_box

Opened this issue · 1 comments

minecraft:selection_box is a Boolean or JSON Object component that defines the area of the block that is selected by the player's cursor.

minecraft:collision_box is a boolean or JSON Object that defines the area of the block that collides with entities.

I want to make the player able to pass through the block by setting the origin and size in the Model to Vector3::zero(), but I still want the player to be able to interact with the block

You can do this with permutations

->withComponent('minecraft:selection_box', CompoundTag::create()
                    ->setByte('enabled', 1)
                    ->setTag('origin', new ListTag([
                        new FloatTag(-4.0),
                        new FloatTag(0.0),
                        new FloatTag(-4.0)
                    ]))
                    ->setTag('size', new ListTag([
                        new FloatTag(8.0),
                        new FloatTag(13.0),
                        new FloatTag(8.0)
                    ]))),```