Modding:Block Orientation

From Vintage Story Wiki

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
  • ns
  • we
woodenpath
Pillar
  • ud
  • ns
  • we
log
Horizontals
  • north
  • east
  • south
  • west
cokeovendoor
All faces
  • north
  • east
  • south
  • west
  • up
  • down
slab
Verticals
  • up
  • down
none
Horizontal Up Down
  • up-north
  • up-east
  • up-south
  • up-west
  • down-north
  • down-east
  • down-south
  • down-west
none
2 Axis
  • up-north
  • up-east
  • up-south
  • up-west
  • left-north
  • left-east
  • left-south
  • left-west
  • down-north
  • down-east
  • down-south
  • down-west
  • right-north
  • right-east
  • right-south
  • right-west
trapdoor
Icon Sign.png

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 ItemEntityBlockBlock BehaviorsBlock ClassesBlock EntitiesBlock Entity BehaviorsWorld properties
Workflows & Infrastructure Modding Efficiency TipsMod-engine compatibilityMod ExtensibilityVS Engine
Additional Resources Community Resources Modding API Updates Programming Languages List of server commandsList of client commandsClient startup parametersServer startup parameters
Example ModsAPI DocsGitHub Repository