Difference between revisions of "Json:block:behavior"

From Vintage Story Wiki
Jump to navigation Jump to search
m (Removed some unnecessary code.)
Line 1: Line 1:
 +
for details on all block behavior implementation, please see the table [[Json:block:behaviors|All Block Behaviors]]
 +
 
== HorizontalAttachable ==
 
== HorizontalAttachable ==
  

Revision as of 16:51, 21 March 2019

for details on all block behavior implementation, please see the table All Block Behaviors

HorizontalAttachable

Block can only be attached horizontally. Used for:

  • Painting
  • Toolrack

Requires abstract/horizontalorientation:

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

HorizontalOrientable

Block can be rotated horizontally. Used for:

  • Workbench
  • Ladder
  • Echochamber
  • Chest
  • Stove
  • Altar
  • Windmillrotor
  • Bellows

Requires abstract/horizontalorientation:

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

NWOrientable

Block can be rotated in two different directions. Used for:

  • Path
  • Bookshelves
  • Large carpet
  • Chimney

Requires "ns" and "we" states:

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

Pillar

Block can be rotated in three directions. Used for:

  • Wood log
  • Pillar
  • Axle

Requires "ud", "ns" and "we" states:

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

Slab

Block can be either placed on the top or the bottom half of a block. Used for:

  • All kinds of slabs

Requires "down" and "up" states:

	variantgroups: [
		{ code: "part", states: ["down", "up"] }
	],

HorizontalUpDownOrientable

Used for:

  • angledgearbox

Requires abstract/verticalorientation and abstract/horizontalorientation:

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

FiniteSpreadingLiquid

Make a block flow as liquid. Used for:

  • Water
  • Lava

Requires all heights as states:

	variantgroups: [
		{ code: "height", states: ["1", "2", "3", "4", "5", "6", "7"] },
	],

OmniAttachable

Can be attached on any block side. Used for:

  • Lantern

Example use:

	variantgroups: [
		{ code:"position", states: ["up", "down"], combine: "additive" },
		{ code:"wall", loadFromProperties: "abstract/horizontalorientation" }
	],

Unplaceable

Block cannot be placed. Used for:

  • Peatbrick

Unstable

Block can only be placed on a solid block and destroyed once the ground is removed. Used for:

  • Ore blasting bomb
  • Small carpet
  • Path
  • Turnip
  • Spelt
  • Soybean
  • Rye
  • Rice
  • Parsnip
  • Onion
  • Flax
  • Carrot

Harvestable

Similar to Unstable, with the only difference that it can be stacked on top of each other. Used for:

  • Small berry bush
  • Saguaro cactus
  • Big berry bush

Falling

Similar to Unstable, but instead of destorying the block, it will fall down. Used for:

  • Tool mold
  • Loot vessel
  • Ingot mold
  • Flower pot
  • Crucible
  • Sand
  • Gravel
  • Anvil

DropIfFloating

The block will break, if it is completely surrounded by air. Used for:

  • Rock