Json block behaviors NWOrientable: Difference between revisions
(→Purpose: describe the drops) |
(→Usage) |
||
Line 18: | Line 18: | ||
== Usage == | == 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 | 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: | ||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
variantgroups: [ | variantgroups: [ |
Revision as of 07:33, 12 October 2023
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 | 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 |