Confirmedusers
261
edits
Lazy Warlock (talk | contribs) |
(→All Block Behaviors: Update HorizontalOrientable link) |
||
(19 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
== Adding behaviors to your block == | == Adding behaviors to your block == | ||
Block behaviors are an array of objects with properties attached to your block. | Block behaviors are an array of objects with properties attached to your block. They are added through the <code>behaviors</code> field at the top level (same level as the <code>code</code> field) of a block json file. | ||
Below is an example of two behaviors, one with properties and one without properties. | Below is an example of two behaviors, one with properties and one without properties. | ||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
{ | |||
... | |||
code: "exampleblock", | |||
... | |||
behaviors: [{name: "behavior1", properties: {myProperty1: "myValue1", myProperty2: "myValue2"}},{name: "behavior2"}], | behaviors: [{name: "behavior1", properties: {myProperty1: "myValue1", myProperty2: "myValue2"}},{name: "behavior2"}], | ||
... | |||
} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== All Block Behaviors == | == All Block Behaviors == | ||
Here is a table containing all properties of the base game as of 1. | Here is a table containing all properties of the base game as of 1.18.14. | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Behavior Name ! | ! Behavior Name | ||
! style="width: 25em" | Properties | |||
! Used by Blocks | |||
|- | |- | ||
| | | [[Json_block_behaviors_BlockEntityInteract|BlockEntityInteract]] || - || door | ||
|- | |- | ||
| | | [[Json_block_behaviors_BreakIfFloating|BreakIfFloating]] || - || termitemound, crackedrock, meteorite, ore, ore, ore, rock, rottenlog | ||
|- | |- | ||
| | | [[Json_block_behaviors_BreakSnowFirst|BreakSnowFirst]] || - || tallgrass, stonepath | ||
|- | |- | ||
| [[Json_block_behaviors_CanAttach|CanAttach]] | |||
| | |||
* sides | |||
| drystonefence, woodenfence, roughhewnfence | |||
|- | |- | ||
| | | [[Json_block_behaviors_CanIgnite|CanIgnite]] || - || torch | ||
|- | |- | ||
| | | [[Json_block_behaviors_CollectFromThis|CollectFrom]] || - || henbox | ||
|- | |- | ||
| | | [[Json_block_behaviors_Container|Container]] || - || storagevessel, stove, hopper, quern, crate, labeledchest, trunk, chest, firepit, stationarybasket | ||
|- | |- | ||
| [[Json_block_behaviors_Decor|Decor]] | |||
| | |||
* sides | |||
* sidedVariants | |||
* nwOrientable | |||
* drawIfCulled | |||
* alternateZOffset | |||
* notFullFace | |||
* removable | |||
* thickness | |||
| linen, mediumcarpet, rushmat, smallcarpet, wallpaper, wool, hotspringbacteriasmooth, hotspringbacteria, attachingplant, overlay, overlay, oxidation, transition, fallenleaves, caveart | |||
|- | |- | ||
| | | [[Json_block_behaviors_Door|Door]] || - || door | ||
|- | |- | ||
| | | [[Json_block_behaviors_DropNotSnowCovered|DropNotSnowCovered]] || - || fern, flower | ||
|- | |- | ||
| [[Json_block_behaviors_ExchangeOnInteract|ExchangeOnInteract]] | |||
| | |||
* exchangeStates (string array of block states) | |||
* sounds (path from sounds folder) | |||
* actionLangCode (language key from the lang file) | |||
| trapdoor | |||
|- | |- | ||
| | | [[Json_block_behaviors_FiniteSpreadingLiquid|FiniteSpreadingLiquid]] | ||
| | |||
* liquidCollisionSound (path from sounds folder) | |||
* sourceReplacementCode (block code) | |||
* flowingReplacementCode (block code) | |||
* collidesWith (other liquid) | |||
* spreadDelay (int, default: 0) | |||
| boilingwater, water, lava, saltwater | |||
|- | |- | ||
| [[Json_block_behaviors_Harvestable|Harvestable]] | |||
| | |||
* harvestTime (float, seconds, default: 0) | |||
* harvestedStack (BlockDropItemStack) | |||
* harvestingSound (path from sounds folder) | |||
* harvestedBlockCode (block code) | |||
| bigberrybush, saguarocactus, smallberrybush, log-resin | |||
|- | |- | ||
| [[Json_block_behaviors_HeatSource|HeatSource]] | |||
| | |||
* heatStrength (float) | |||
| boilingwater, lava, forge, firepit, pitkiln, coalpile, ember, fire | |||
|- | |- | ||
| | | [[Json_block_behaviors_horizontalattachable|HorizontalAttachable]] | ||
| | |||
* handleDrops (bool, default: true) | |||
* dropBlockFace (Compass Direction, default: "north") | |||
* dropBlock (block name) | |||
* attachmentAreas (side -> RotatableCube) | |||
* attachmentArea (cuboid) | |||
| tapestry, torchholder, mushroom, canvas, moldrack, painting, shelf, toolrack | |||
|- | |- | ||
| | | [[Modding:HorizontalOrientable_behavior|HorizontalOrientable]] | ||
| | |||
* dropBlockFace (Compass Direction, default: "North") | |||
* drop (block name) | |||
| agedwallpaperplanks, altar, bellows, bloomerybase, brake, cage, churn, clayoven, clutch, cokeovendoor, condenser, crank, creativerotor, helvehammerbase, jonas, labeledchest, metalpartpile, palisadestakes, palisadewall, pulverizerframe, resonator, skep, slantedroofing, slantedroofingcornerinner, slantedroofingcornerouter, statictranslocator, stationarybasket, stonecoffinsection, stove, trunk, verticalboiler, wagonwheels, windmillrotor, workbench | |||
|- | |- | ||
| | | [[Json_block_behaviors_HorizontalUpDownOrientable|HorizontalUpDownOrientable]] || - || - | ||
|- | |- | ||
| | | [[Json_block_behaviors_ignitable|Ignitable]] || - || charcoalpit, clayoven, firepit | ||
|- | |- | ||
| | | [[Json_block_behaviors_JonasBoilerDoor|JonasBoilerDoor]] || - || jonas | ||
|- | |- | ||
| | | [[Json_block_behaviors_JonasGasifier|JonasGasifier]] || - || jonas | ||
|- | |- | ||
| | | [[Json_block_behaviors_JonasHydraulicPump|JonasHydraulicPump]] || - || jonas | ||
|- | |- | ||
| [[Json_block_behaviors_Ladder|Ladder]] | |||
| | |||
* dropBlockFace (face direction, Default: north) | |||
* isFlexible (bool, default: false) | |||
| ladder | |||
|- | |- | ||
| | | [[Json_block_behaviors_Lockable|Lockable]] || - || archimedesscrew, chest, chute, cokeovendoor, crate, door, hopper, irondoor, labeledchest, roughhewnfencegate, stationarybasket, storagevessel, trapdoor, trunk, woodenfencegate | ||
|- | |- | ||
| UnstableFalling || | | [[Json_block_behaviors_MilkingContainer|MilkingContainer]] || - || woodbucket | ||
|- | |||
| [[Json_block_behaviors_Multiblock|Multiblock]] | |||
| | |||
* sizex | |||
* sizey | |||
* sizez | |||
* type | |||
* cposition | |||
| jonas, riftward, verticalboiler, banner, trunk, painting | |||
|- | |||
| [[Json_block_behaviors_MyceliumHost|MyceliumHost]] || - || creativegrass, forestfloor, log, soil | |||
|- | |||
| [[Json_block_behaviors_NoParticles|NoParticles]] || - || claybrickchimney | |||
|- | |||
| [[Json_block_behaviors_NWOrientable|NWOrientable]] || - || bookshelves (legacy), claybrickchimney, fruitpress, fruitpresstop, mannequin, slantedroofingridge, transmission, trough, woodenpath, woodentoggle | |||
|- | |||
| [[Json_block_behaviors_OmniAttachable|OmniAttachable]] | |||
| | |||
* facingCode (string, default: orientation) | |||
* attachmentAreas (side -> RotatableCube) | |||
| crystal, lantern | |||
|- | |||
| [[Json_block_behaviors_OmniRotatable|OmniRotatable]] | |||
| | |||
* rotateH (bool, default: false) | |||
* rotateV (bool, default: false) | |||
* rotateV4 (bool, default: false) | |||
* rotateSides (bool, default: false) | |||
* facing (string, "block" or "player", default: "player") | |||
* dropChance(float, default: 1) | |||
| brickslabs, clayshinglelabs, cobblestoneslab, glassslab, mudbrickslab, plankslab, polishedrockslab, quartzslab, stonebrickslab, trapdoor | |||
|- | |||
| [[Json_block_behaviors_pillar|Pillar]] | |||
| | |||
* invertedPlacement (bool, default: false) | |||
| carvedlog, debarkedlog, hay, log, lognarrow, planks, plaster, quartzpillar, stackedbamboo, woodenaxle | |||
|- | |||
| [[Json_block_behaviors_Pumpkin|Pumpkin]] | |||
| | |||
* vineGrowthStage(int) | |||
* vineGrowthQuantity(NatFloat) | |||
| crop | |||
|- | |||
| [[Json_block_behaviors_PushEventOnBlockBroken|PushEventOnBlockBroken]] | |||
| | |||
* eventName (string) | |||
| bamboo, bambooleaves, leaves, leavesbranchy, leavesnarrow, log, lognarrow, logsection | |||
|- | |||
| [[Json_block_behaviors_RainDrip|RainDrip]] || - || - | |||
|- | |||
| [[Json_block_behaviors_Reinforcable|Reinforcable]] || - || - | |||
|- | |||
| [[Json_block_behaviors_RightClickPickup|RightClickPickup]] | |||
| | |||
* dropsPickupMode (bool, default: false) | |||
* sound (path from sounds folder) | |||
* placeSound (path from sounds folder) | |||
| basereturnteleporter, bowl, bowl-meal, clayplanter, claypot, crock, crucible, egg, flowerpot, ingotmold, jug, lantern, looseflints, looseores, loosestick, loosestones, metal, oillamp, pan, pie, pineapple, pumpkin, seashell, storagevessel, toolmold, wateringcan, woodbucket | |||
|- | |||
| [[Json_block_behaviors_RopeTieable|RopeTieable]] || - || roughhewnfence, woodenfence | |||
|- | |||
| [[Json_block_behaviors_slab|Slab]] || - || - | |||
|- | |||
| [[Json_block_behaviors_Steaming|Steaming]] || - || boilingwater | |||
|- | |||
| [[Json_block_behaviors_SneakPlacing|SneakPlacing]] || - || pan, pie, wateringcan | |||
|- | |||
| [[Json_block_behaviors_Unplaceable|Unplaceable]] || - || bloomerychimney, bowl, bowl-meal, clayplanter, claypot, crock, crucible, flowerpot, ingotmold, jug, metal, pineapple, pumpkin, storagevessel, toolmold, wateringcan | |||
|- | |||
| [[Json_block_behaviors_Unstable|Unstable]] | |||
| | |||
* attachedToFaces (default: down) | |||
* attachmentAreas (side -> RotatableCube) | |||
| bunchocandles, crop, deadcrop, firepit, oreblastingbomb, silvertorchcactus, verticalboiler, wildbeehive, woodenpath, woodenrails | |||
|- | |||
| [[Json_block_behaviors_UnstableFalling|UnstableFalling]] | |||
| | |||
* attachableFaces (string array) | |||
* attachmentArea (cuboid) | |||
* attachmentAreas (side -> RotatableCube) | |||
* ignorePlaceTest (bool, default: false) | |||
* exceptions (block code array) | |||
* fallSideways (bool, default: false) | |||
* dustIntensity (float, default: 0) | |||
* fallSidewaysChance (float, default: 0.3) | |||
* fallSound (path from sounds folder) | |||
* impactDamageMul (float, default 1) | |||
| anvil, anvilpart, barrel, barrelcactus, bloomerychimney, bonyremains, bonysoil, carcass, chair, chandelier, cheese, churn, clayplanter, coalpile, dirtygravel, displaycase, drycarcass, egg, flowerpot, gravel, groundstorage, ingotmold, knappingsurface, lightningrod, looseboulders, looseflints, loosegears, looseores, loosestick, loosestones, lootvessel, metal, metalpartpile, muddygravel, oillamp, omoktabletop, pan, pie, quern, sand, seashell, sieve, sludgygravel, snowlayer, stonecoffinlid, storagevessel, table, talldisplaycase, toolmold, wateringcan, woodbucket | |||
|- | |||
| [[Json_block_behaviors_WrenchOrientable|WrenchOrientable]] | |||
| | |||
* hideInteractionHelpInSurvival (bool, default: false) | |||
* baseCode (string) | |||
| banner, brickslabs, brickstairs, carvedlog, chute, clayshinglelabs, clayshinglestairs, clutter, cobblestoneslab, cobblestonestairs, debarkedlog, glassslab, jonas, log, mudbrickslab, planks, plankslab, plankstairs, plaster, polishedrockslab, quartzpillar, quartzslab, quartzstairs, stonebrickslab, stonebrickstairs, stonepathstairs | |||
|- | |||
| [[Json_block_behaviors_WorldEditFixGhostBlockPlace|WorldEditFixGhostBlockPlace]] || - || - | |||
|} | |} | ||
{{Navbox/modding|Vintage Story}} | {{Navbox/modding|Vintage Story}} |