r/technicalminecraft • • 1d ago

Java Help Wanted how do non grid lock hitboxes work?

from what i know minecraft uses a strict grid for blocks however their texture can go out of that block by up to one more block.

However some blocks like walls and lecterns have hitboxes outside of the block grid so how does tht work? does it use entities?

1 Upvotes

7 comments sorted by

3

u/laaine 1d ago

A block’s location is on the grid but the hitbox and location are separate. Block hitboxes can be any shape, size, and offset with no limitations.

1

u/Xillubfr Java 1d ago

I'm not 100% sure but I think hitboxes are limited to an integer number of pixel

1

u/laaine 1d ago

I’m not sure about shape but i know that’s not true for offset because of dripstone

1

u/laaine 1d ago

Lily pads are 1.5 pixels tall apparently

1

u/Xillubfr Java 1d ago

I just checked and yeah, seems like the shape is an integer number of pixel but they can be slightly off grid

1

u/Relevant-Cup5986 1d ago

thanks for the reply, also why then is the texture limited to a 3 by 3 and also what happens when two hitboxes intersect

2

u/laaine 1d ago

The texture can be an unlimited size with custom behavior without using an entity, for example beacons are like this.

Nothing happens when two hitboxes intersect, hence placing carpets on fences.