Modding:Collectible Behaviors

From Vintage Story Wiki
Revision as of 05:34, 27 July 2024 by Bluelightning32 (talk | contribs) (→‎All Behaviors: list AnimationAuthoritative properties)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Using Collectible Behaviors

Collectible behaviors can be added to items and blocks through the behaviors array in the block json file at the top level (same level as code). Note that for blocks, this array also lists block behaviors. The properties dictionary is optional if the behavior does not have any properties. Example:

{
  code: "wrench",
  ...
  behaviors: [{
      name: "GroundStorable",
      properties: {
        layout: 'WallHalves',
        wallOffY: 1,
        sprintKey: true,
        selectionBox: { x1: 0, y1: 0, z1: 0, x2: 1, y2: 0.1, z2: 1 },
        collisionBox: { x1: 0, y1: 0, z1: 0, x2: 0, y2: 0, z2: 0 },
      }
  }],
  ...
}

All Behaviors

Here is a table containing all the collectible behaviors of the base game as of 1.19.8. Block behaviors are listed separately, even though they are technically collectible behaviors too.

Behavior Name Properties Used by Blocks & Items
GroundStorable
  • Layout
  • WallOffY
  • PlaceRemoveSound
  • RandomizeSoundPitch
  • StackingModel
  • TessQuantityElements
  • ModelItemsToStackSizeRatio
  • StackingTextures
  • MaxStackingHeight
  • StackingCapacity
  • TransferQuantity
  • BulkTransferQuantity
  • SprintKey
  • UpSolid
  • CollisionBox
  • SelectionBox
  • CbScaleYByLayer
  • MaxFireable
Most tools and ingots
ArtPigment
  • paintableOnBlockMaterials
  • decorBlockCodes
  • charcoal
  • limonite nugget
  • hematite nugget
  • chalk
AnimationAuthoritative
  • strikeSound
  • onlyOnEntity
  • axe
  • blade
  • cleaver
  • club
  • hammer
  • knife
  • spear
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