Json block behaviors NWOrientable

From Vintage Story Wiki

Purpose

The behavior selects a horizontal orientation variant of a block when the block is placed. The orientation variant is selected based on the orientation of the player. The assumption is that the block would look the same if it were horizontally rotated 180 degrees. So only 2 orientation variants are used: "we" (pointing in the west or east direction) and "ns" (pointing in the north or south direction).

When the block is broken, the "ns" variant is dropped.

Used by blocks

  • bookshelves (legacy)
  • claybrickchimney
  • fruitpress
  • fruitpresstop
  • mannequin
  • slantedroofingridge
  • transmission
  • trough
  • woodenpath
  • woodentoggle

Usage

The block must have a variant code of "orientation" or "side". It is a mistake to add both variant codes to the block, but in this situation, the behavior will use the "orientation" code. The variant group must contain the "ns" and "we" states:

	variantgroups: [
		{ code:"orientation", states: ["ns", "we"] },
	],

Properties

none

 

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