Modding:Block Orientation
For a block that does not have a block entity, all of its state is condensed down to a block type, which is then represented as an integer in the block id to block type map. Most blocks cannot be rotated. For blocks that can be rotated, they either use a block entity to attach rotation information to the block, or they use multiple variants (block types) to represent different orientations of the block.
Each orientation group represents a limited number of ways to rotate a block. After the necessary orientation variants are added to the block, some block behaviors are added to select the appropriate orientation when the block is placed. Additionally the WrenchOrientable behavior can be added to any of the orientation groups to allow the orientation to be adjusted after the block is placed.
For rendering the oriented blocks, it is more efficient to rotate the shape than to rotate the texture.
Orientation group | Variants | Example block | Placement block behaviors |
---|---|---|---|
Horizontal Pillar |
|
woodenpath | |
Pillar |
|
log | |
Horizontals |
|
cokeovendoor | |
All faces |
|
slab | |
Verticals |
|
none | |
Horizontal Up Down |
|
none | |
2 Axis |
|
trapdoor |
Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.
Modding | |
---|---|
Modding Introduction | Getting Started • Theme Pack |
Content Modding | Content Mods • Developing a Content Mod • Basic Tutorials • Intermediate Tutorials • Advanced Tutorials • Content Mod Concepts |
Code Modding | Code Mods • Setting up your Development Environment |
Property Overview | Item • Entity • Block • Block Behaviors • Block Classes • Block Entities • Block Entity Behaviors • World properties |
Workflows & Infrastructure | Modding Efficiency Tips • Mod-engine compatibility • Mod Extensibility • VS Engine |
Additional Resources | Community Resources • Modding API Updates • Programming Languages • List of server commands • List of client commands • Client startup parameters • Server startup parameters Example Mods • API Docs • GitHub Repository |