Customies icon indicating copy to clipboard operation
Customies copied to clipboard

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

Open DavyCraft648 opened this issue 2 years ago • 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

DavyCraft648 avatar Sep 24 '23 01:09 DavyCraft648

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)
                    ]))),``` 

xSuperr avatar Sep 25 '23 16:09 xSuperr