Mineuniverse
Block offset

Block offset

Certain non-solid blocks, such as short grass, pointed dripstone, and some flowers do not have their textures or interaction boxes centered on blocks they…

4 min read Updated
Gameplay Research required
Advertisement Remove ads with Premium →
Contents (8)
  1. List of blocks subject to offset
  2. Effects of block offset on textures and hitboxes
  3. Calculation of block offset
  4. X and Z offset
  5. Y offset
  6. Calculator
  7. Notes
  8. References
This topic is named from the game code.
While a name exists in the game code, it has not been otherwise used officially by Mojang.
A completely filled in 5 by 5 grid of poppies, where each flower is subject to a block offset

Certain non-solid blocks, such as short grass, pointed dripstone, and some flowers do not have their textures or interaction boxes centered on blocks they are placed on, and are instead staggered in a pseudorandom manner. The offset of a block depends solely on its X and Z coordinates, and not the world seed. This means that, for example, a row of flowers at the same coordinates will always be staggered the same way between worlds, and this will not be changed by a player breaking or replacing them.

All blocks with an offset have their interaction box and/or texture translated in the X and Z axis. Some blocks such as short grass or the fern additionally have an offset in the Y axis for their textures only. The base X, Y, and Z offsets of a block are consistent between all blocks at a certain coordinate. However, some blocks (such as bamboo‌[Bedrock Edition only] or pointed dripstone‌[Java Edition only]) may use the base offset slightly differently than most blocks for block placement.

List of blocks subject to offset

The following is a list of blocks subject to an offset in game. Most blocks have their interaction box offset to match their texture being offset, but some do not.

Blocks subject to offset
Block Interaction box XZ offset Texture XZ offset Interaction box Y offset Texture Y offset
Short Grass
Fern
Short Dry Grass
Tall Dry Grass
Yes Yes Bedrock Edition only Yes
Mangrove Propagule
Dandelion
Golden Dandelion
Torchflower
Poppy
Blue Orchid
Allium
Azure Bluet
Tulips
Oxeye Daisy
Cornflower
Wither Rose
Lily of the Valley
Bamboo Sapling
Bamboo
Pointed Dripstone
Sulfur Spike
Yes Yes No No
Sunflower
Lilac
Rose Bush
Peony
Tall Grass
Large Fern
Pitcher Plant
Warped Roots
Nether Sprouts
Crimson Roots
Hanging Roots
Bedrock Edition only Yes No No
Coral Fans
Dead Coral Fans
Bedrock Edition only Bedrock Edition only No No
Coral
Dead Coral
Bedrock Edition only No[note 1] No No
Tall Seagrass No Java Edition only No No
Small Dripleaf No Java Edition only No Java Edition only

Effects of block offset on textures and hitboxes

In Java Edition, X and Z offsets are added to the coordinates of the center of the block to determine the new center of the texture or hitbox. In Bedrock Edition, X and Z offsets are used differently depending on the block. On both versions, the Y offset is directly added to the Y coordinate of the block to determine what Y level a texture will start. A Y offset will always be negative or zero, meaning a block's texture or interaction box may be translated downwards but never upwards.

Calculation of block offset

These calculations are exclusively for Java Edition. The algorithm used in Bedrock Edition is unknown.

X and Z offset

The following algorithm is used to calculate X and Z offsets of blocks in Java Edition (except for pointed dripstone and sulfur spikes), given a block's X and Z coordinates.[1] Note that two's compliment arithmetic while treating all integers as signed 64 bit numbers must be used for correct results.[note 2]

temp1 = (0x2FC20F * x) XOR (0x6EBFFF5 * z)
temp2 = (0x285B825 * temp1 * temp1) + (0x000B * temp1)
x_offset = (((temp2 >> 16) AND 0xF) / 15.0 - 0.5) * 0.5
z_offset = (((temp2 >> 24) AND 0xF) / 15.0 - 0.5) * 0.5

The X and Z offsets of pointed dripstone and sulfur spikes are given by calculating the x_offset and z_offset above, and clamping the values between -0.125 and 0.125. All other blocks have their X and Z offsets clamped between -0.25 and 0.25.[note 3]

Y offset

The Y offset in Java Edition depends solely on the X and Z coordinates of a block and the block type. For all blocks with a Y offset besides small dripleaf, the Y offset is given by (using the variable temp2 from above):[1]

y_offset = (((temp2 >> 20) AND 0xF) / 15.0 - 1.0) * 0.2

The Y offset for small dripleaf is half as much as the Y offset for other blocks at the same coordinates.

Calculator

Notes

  1. ↑ MCPE-228149 – Unlike the Coral fans, all Corals only have their hitbox randomly offcentered but not their block
  2. ↑ This corresponds to standard arithmetic operations involving the long datatype in Java.
  3. ↑ The y_offset however is not clamped

References

  1. ↑ a b From BlockBehaviour#offsetType(OffsetType)
Advertisement Remove ads with Premium →

More in Gameplay

View all 133 →
AttributeAttributes control certain numeric properties of players, mobs, and armor stands. Every entity has a base value for each of its attributes, and modifiers…BarteringBarteringBartering is a gameplay mechanic that allows players to exchange gold ingots for various items with piglins.Black entitiesWhen an entity's origin point goes inside an opaque block and can be seen easily, they become black entities. This applies to mobs and some block…Block conversionBlock conversion is a mechanic where certain blocks can convert into other blocks.BlockingBlockingBlocking is a gameplay mechanic that allows players to block several forms of damage using a shield.BossbarA bossbar is a bar at the top of the screen that can track health of a boss mob or the total health of raid mobs. The bossbar disappears when the ender…BreakingBreakingBreaking, digging, punching, or mining is a common activity in Minecraft, performed (by default) by holding Left Mouse Button or right trigger while the…BreedingBreedingBreeding is a game mechanic that allows certain mobs, including villagers and many animals, to produce offspring. Some mobs have similar mechanics that…
Advertisement Remove ads with Premium →

Related mods

No Potion Offset (Fabric/Forge) No Potion Offset (Fabric/Forge) Mod · 1.7M downloads No Random Drop Offset No Random Drop Offset Mod · 12.2K downloads TFC Offset Smoker TFC Offset Smoker Mod · 2.2K downloads Dynamic FOV Offset Dynamic FOV Offset Mod · 1.2K downloads
Explore the Minecraft Wiki
Blocks, items, mobs, biomes and game mechanics — all in one place.
Wiki home