Modding:Json Block Behaviors: Difference between revisions
From Vintage Story Wiki
(→All Block Behaviors: Update the survival behaviors up to HorizontalAttachable) |
(→All Block Behaviors: Finish updating from the survival mod to 1.18.8.) |
||
Line 6: | Line 6: | ||
</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.8. | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 40: | Line 40: | ||
| HeatSource || heatStrength (float) || boilingwater, lava, forge, firepit, pitkiln, coalpile, ember, fire || [[Json_block_behaviors_HeatSource|Heat Source]] | | HeatSource || heatStrength (float) || boilingwater, lava, forge, firepit, pitkiln, coalpile, ember, fire || [[Json_block_behaviors_HeatSource|Heat Source]] | ||
|- | |- | ||
| HorizontalAttachable || handleDrops (bool, default: true) || tapestry, torchholder, mushroom, canvas, moldrack, painting, shelf, toolrack || [[Json_block_behaviors_horizontalattachable|Horizontal Attachable]] | | HorizontalAttachable || handleDrops (bool, default: true) <br> dropBlockFace (Compass Direction, default: "north") <br> dropBlock (block name) <br> attachmentAreas (side -> cuboid) <br> attachmentArea (cuboid) || tapestry, torchholder, mushroom, canvas, moldrack, painting, shelf, toolrack || [[Json_block_behaviors_horizontalattachable|Horizontal Attachable]] | ||
|- | |- | ||
| HorizontalOrientable || dropBlockFace (Compass Direction, default: "North") <br> | | HorizontalOrientable || dropBlockFace (Compass Direction, default: "North") <br> 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_horizontalorientable|Horizontal Orientable]] | ||
|- | |- | ||
| HorizontalUpDownOrientable || none || - || [[Json_block_behaviors_HorizontalUpDownOrientable| Horizontal Up/Down Orientable]] | | HorizontalUpDownOrientable || none || - || [[Json_block_behaviors_HorizontalUpDownOrientable| Horizontal Up/Down Orientable]] | ||
|- | |- | ||
| Ignitable || none || charcoalpit || [[Json_block_behaviors_ignitable|Ignitable]] | | Ignitable || none || charcoalpit, clayoven, firepit || [[Json_block_behaviors_ignitable|Ignitable]] | ||
|- | |- | ||
| | | JonasBoilerDoor || none || jonas || [[Json_block_behaviors_JonasBoilerDoor|Jonas Boiler Door]] | ||
|- | |- | ||
| Lockable|| none || chest, | | Ladder || dropBlockFace (face direction, Default: north) <br> isFlexible (bool, default: false) || ladder || [[Json_block_behaviors_Ladder|Ladder]] | ||
|- | |||
| Lockable|| none || archimedesscrew, chest, chute, cokeovendoor, crate, door, hopper, irondoor, labeledchest, roughhewnfencegate, stationarybasket, storagevessel, trapdoor, trunk, woodenfencegate || [[Json_block_behaviors_Lockable|Lockable]] | |||
|- | |||
| MilkingContainer || none || woodbucket || [[Json_block_behaviors_MilkingContainer|Milking Container]] | |||
|- | |- | ||
| Multiblock|| sizex, sizey, sizez, type, cposition || jonas, riftward, verticalboiler, banner, trunk, painting | | Multiblock|| sizex, sizey, sizez, type, cposition || jonas, riftward, verticalboiler, banner, trunk, painting | ||
|| [[Json_block_behaviors_Multiblock|Multiblock]] | || [[Json_block_behaviors_Multiblock|Multiblock]] | ||
|- | |- | ||
| NoParticles || none || | | MyceliumHost || none || creativegrass, forestfloor, log, soil || [[Json_block_behaviors_MyceliumHost|Mycelium Host]] | ||
|- | |||
| NoParticles || none || claybrickchimney || [[Json_block_behaviors_NoParticles|No Particles]] | |||
|- | |- | ||
| NWOrientable || none || | | NWOrientable || none || bookshelves, claybrickchimney, fruitpress, fruitpresstop, mannequin, slantedroofingridge, transmission, trough, woodenpath, woodentoggle || [[Json_block_behaviors_NWOrientable|North/West Orientable]] | ||
|- | |- | ||
| OmniAttachable || | | OmniAttachable || facingCode (string, default: orientation) <br> attachmentAreas (side -> cuboid) || crystal, lantern || [[Json_block_behaviors_OmniAttachable|Omni-Attachable]] | ||
|- | |- | ||
| OmniRotatable || rotateSides (bool, default: false) <br> facing (string) || | | OmniRotatable || rotateH (bool, default: false) <br> rotateV (bool, default: false) <br> rotateV4 (bool, default: false) <br> rotateSides (bool, default: false) <br> facing (string, "block" or "player" default: "player") <br> dropChance(float, default: 1) || brickslabs, clayshinglelabs, cobblestoneslab, glassslab, mudbrickslab, plankslab, polishedrockslab, quartzslab, stonebrickslab, trapdoor || [[Json_block_behaviors_OmniRotatable|Omni-Rotatable]] | ||
|- | |- | ||
| Pillar || | | Pillar || invertedPlacement (bool, default: false) || carvedlog, debarkedlog, hay, log, lognarrow, planks, plaster, quartzpillar, stackedbamboo, woodenaxle || [[Json_block_behaviors_pillar|Pillar]] | ||
|- | |- | ||
| | | Pumpkin || vineGrowthStage(int), vineGrowthQuantity(NatFloat) || crop || [[Json_block_behaviors_Pumpkin|Pumpkin]] | ||
|- | |- | ||
| RightClickPickup || | | PushEventOnBlockBroken || eventName (string) || bamboo, bambooleaves, leaves, leavesbranchy, leavesnarrow, log, lognarrow, logsection ||[[Json_block_behaviors_PushEventOnBlockBroken|Push Event on Block Broken]] | ||
|- | |||
| Reinforcable || none || - || [[Json_block_behaviors_Reinforcable|Reinforcable]] | |||
|- | |||
| RightClickPickup || dropsPickupMode (bool, default: false) <br> sound (path from sounds folder) <br> 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_RightClickPickup|Right Click Pickup]] | |||
|- | |- | ||
| RopeTieable || none || roughhewnfence, woodenfence || [[Json_block_behaviors_RopeTieable|Rope Tieable]] | | RopeTieable || none || roughhewnfence, woodenfence || [[Json_block_behaviors_RopeTieable|Rope Tieable]] | ||
|- | |- | ||
| Slab || none || | | Slab || none || - || [[Json_block_behaviors_slab|Slab]] | ||
|- | |||
| Steaming || none || boilingwater || [[Json_block_behaviors_Steaming|Steaming]] | |||
|- | |||
| SneakPlacing || none || pan, pie, wateringcan ||[[Json_block_behaviors_SneakPlacing|Sneak Placing]] | |||
|- | |- | ||
| | | Unplaceable || none || bloomerychimney, bowl, bowl-meal, clayplanter, claypot, crock, crucible, flowerpot, ingotmold, jug, metal, pineapple, pumpkin, storagevessel, toolmold, wateringcan || [[Json_block_behaviors_Unplaceable|Unplaceable]] | ||
|- | |- | ||
| | | Unstable || attachedToFaces (default: down) <br> attachmentAreas (side -> cuboid) || bunchocandles, crop, deadcrop, firepit, oreblastingbomb, silvertorchcactus, verticalboiler, wildbeehive, woodenpath, woodenrails || [[Json_block_behaviors_Unstable|Unstable]] | ||
|- | |- | ||
| | | UnstableFalling || attachableFaces (string array) <br> attachmentAreas (side -> cuboid) <br> ignorePlaceTest (bool, default: false) <br> exceptions (block code array) <br> fallSideways (bool, default: false) <br> dustIntensity (float, default: 0) <br> fallSidewaysChance (float, default: 0.3) <br> fallSound (path from sounds folder) <br> 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_UnstableFalling| Unstable Falling]] | ||
|- | |- | ||
| | | WrenchOrientable || hideInteractionHelpInSurvival (bool, default: false), baseCode (block code) || 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_WrenchOrientable|Wrench Orientable]] | ||
|} | |} | ||
{{Navbox/modding|Vintage Story}} | {{Navbox/modding|Vintage Story}} |
Revision as of 22:28, 10 October 2023
Adding behaviors to your block
Block behaviors are an array of objects with properties attached to your block. Below is an example of two behaviors, one with properties and one without properties.
behaviors: [{name: "behavior1", properties: {myProperty1: "myValue1", myProperty2: "myValue2"}},{name: "behavior2"}],
All Block Behaviors
Here is a table containing all properties of the base game as of 1.18.8.
Behavior Name | Additional Properties | Used by Blocks | Detail link |
---|---|---|---|
BlockEntityInteract | none | door | Block Entity Interact |
BreakIfFloating | none | termitemound, crackedrock, meteorite, ore, ore, ore, rock, rottenlog | Break if Floating |
BreakSnowFirst | none | tallgrass, stonepath | Break Snow First |
CanAttach | sides | drystonefence, woodenfence, roughhewnfence | Can Attach |
CanIgnite | none | torch | Can Ignite |
CollectFrom | none | henbox | Collect From |
Container | none | storagevessel, stove, hopper, quern, crate, labeledchest, trunk, chest, firepit, stationarybasket | Container |
Decor | sides, sidedVariants, nwOrientable, drawIfCulled, alternateZOffset, notFullFace, removable, thickness | linen, mediumcarpet, rushmat, smallcarpet, wallpaper, wool, hotspringbacteriasmooth, hotspringbacteria, attachingplant, overlay, overlay, oxidation, transition, fallenleaves, caveart | Decor |
Door | none | door | Door |
DropNotSnowCovered | none | fern, flower | Drop not Snow Covered |
ExchangeOnInteract | exchangeStates (string array of block states) sounds (path from sounds folder) actionLangCode (language key from the lang file) |
trapdoor | Exchange On Interact |
FiniteSpreadingLiquid | liquidCollisionSound (path from sounds folder) sourceReplacementCode (block code) flowingReplacementCode (block code) collidesWith (other liquid) spreadDelay (int, default: 150) |
boilingwater, water, lava, saltwater | Finite Spreading Liquid |
Harvestable | harvestTime (float, seconds) harvestedStack (BlockDropItemStack) harvestingSound (path from sounds folder) harvestedBlockCode (block code) |
bigberrybush, saguarocactus, smallberrybush, log-resin | Harvestable |
HeatSource | heatStrength (float) | boilingwater, lava, forge, firepit, pitkiln, coalpile, ember, fire | Heat Source |
HorizontalAttachable | handleDrops (bool, default: true) dropBlockFace (Compass Direction, default: "north") dropBlock (block name) attachmentAreas (side -> cuboid) attachmentArea (cuboid) |
tapestry, torchholder, mushroom, canvas, moldrack, painting, shelf, toolrack | Horizontal Attachable |
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 | Horizontal Orientable |
HorizontalUpDownOrientable | none | - | Horizontal Up/Down Orientable |
Ignitable | none | charcoalpit, clayoven, firepit | Ignitable |
JonasBoilerDoor | none | jonas | Jonas Boiler Door |
Ladder | dropBlockFace (face direction, Default: north) isFlexible (bool, default: false) |
ladder | Ladder |
Lockable | none | archimedesscrew, chest, chute, cokeovendoor, crate, door, hopper, irondoor, labeledchest, roughhewnfencegate, stationarybasket, storagevessel, trapdoor, trunk, woodenfencegate | Lockable |
MilkingContainer | none | woodbucket | Milking Container |
Multiblock | sizex, sizey, sizez, type, cposition | jonas, riftward, verticalboiler, banner, trunk, painting | Multiblock |
MyceliumHost | none | creativegrass, forestfloor, log, soil | Mycelium Host |
NoParticles | none | claybrickchimney | No Particles |
NWOrientable | none | bookshelves, claybrickchimney, fruitpress, fruitpresstop, mannequin, slantedroofingridge, transmission, trough, woodenpath, woodentoggle | North/West Orientable |
OmniAttachable | facingCode (string, default: orientation) attachmentAreas (side -> cuboid) |
crystal, lantern | Omni-Attachable |
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 | Omni-Rotatable |
Pillar | invertedPlacement (bool, default: false) | carvedlog, debarkedlog, hay, log, lognarrow, planks, plaster, quartzpillar, stackedbamboo, woodenaxle | Pillar |
Pumpkin | vineGrowthStage(int), vineGrowthQuantity(NatFloat) | crop | Pumpkin |
PushEventOnBlockBroken | eventName (string) | bamboo, bambooleaves, leaves, leavesbranchy, leavesnarrow, log, lognarrow, logsection | Push Event on Block Broken |
Reinforcable | none | - | Reinforcable |
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 | Right Click Pickup |
RopeTieable | none | roughhewnfence, woodenfence | Rope Tieable |
Slab | none | - | Slab |
Steaming | none | boilingwater | Steaming |
SneakPlacing | none | pan, pie, wateringcan | Sneak Placing |
Unplaceable | none | bloomerychimney, bowl, bowl-meal, clayplanter, claypot, crock, crucible, flowerpot, ingotmold, jug, metal, pineapple, pumpkin, storagevessel, toolmold, wateringcan | Unplaceable |
Unstable | attachedToFaces (default: down) attachmentAreas (side -> cuboid) |
bunchocandles, crop, deadcrop, firepit, oreblastingbomb, silvertorchcactus, verticalboiler, wildbeehive, woodenpath, woodenrails | Unstable |
UnstableFalling | attachableFaces (string array) attachmentAreas (side -> cuboid) 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 | Unstable Falling |
WrenchOrientable | hideInteractionHelpInSurvival (bool, default: false), baseCode (block code) | 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 | Wrench Orientable |
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 |