Json block behaviors HorizontalUpDownOrientable

From Vintage Story Wiki

Purpose

The behavior selects an orientation variant of a block when the block is placed. The orientation variant is selected based on the orientation of the player. The orientation type includes all 4 horizontal directions. In addition to having variants for all 4 horizontal directions with the block right side up, the orientation type includes an additional 4 horizontal directions with the blocks upside down. So the orientation type has a total of 8 states.

When the block is broken, the "up" "north" variant is dropped.

Used by blocks

This behavior is not used by any of the vanilla blocks.

Usage

The second to last variant group of the block must include the "up" and "down" states. The last variant group of the block must include the 4 cardinal directions. The variant groups must be the last 2 in the block, but the codes of the variant groups do not matter for this behavior.

The variant states can be specified directly via the states field, is cleaner to load them from the abstract/verticalorientation and abstract/horizontalorientation world properties:

	variantgroups: [
		{ code:"v", loadFromProperties: "abstract/verticalorientation" }
		{ code:"side", loadFromProperties: "abstract/horizontalorientation" }
	],

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.

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