Json block behaviors NWOrientable

From Vintage Story Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

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.