Back to mods
PlantAnythingAPI project artwork

Vintage Story Mod DB · Vintage Story mod

PlantAnythingAPI

Simple API to allow planting any item as any specified block on any specified block with a simple rightclick interaction. Only requires a simple json behavior on the item to funciton. Vanilla semi-hardcodes what block a seed item gets planted as. This mod allo

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which PlantAnythingAPI release should I use?

Updated 2 months ago
Latest stable file 1.2.0
Game version 1.22.0-pre.1, 1.22.0-pre.2, 1.22.0-pre.3
Loader Built-in Vintage Story mod system

PlantAnythingAPI 1.2.0 targets 1.22.0-pre.1, 1.22.0-pre.2, 1.22.0-pre.3. It must be installed on the client. Installation on the dedicated server is optional. No extra mods listed for this file.

Where it goes

Is PlantAnythingAPI required on the client, server, or both?

It must be installed on the client. Installation on the dedicated server is optional.

Client Required
Dedicated server Optional
Loader for this release Built-in Vintage Story mod system
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

This release supports both sides, but the source does not require it on the server.

What else does PlantAnythingAPI 1.2.0 need?

1.2.0. Change the file and its required mods may change too.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add PlantAnythingAPI without breaking your instance.

Built for PlantAnythingAPI 1.2.0. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use 1.2.0. It targets 1.22.0-pre.1, 1.22.0-pre.2, 1.22.0-pre.3; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    It must be installed on the client. Installation on the dedicated server is optional.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside 1.2.0. It opens that exact file at the source.

About this project

What does PlantAnythingAPI add?

Simple API to allow planting any item as any specified block on any specified block with a simple rightclick interaction. Only requires a simple json behavior on the item to funciton.
Vanilla semi-hardcodes what block a seed item gets planted as. This mod allows working around this limitation without having to rely on the vanilla item class "ItemPlantableSeed", or having to write custom code for every item type with slight variations.

Note: This will override any other rightclick behavior if a valid planting is found. other rightclick behaviors will function if no valid planting is found. Sneaking/Crouching will bypass this function to allow other mod's functions to be possible.
Does NOT require the vanilla item class "ItemPlantableSeed", but leaving the class will cancel attempts to plant onto farmland using this mod. Other blocktypes work fine.
No AI/LLM was used.

 

To add the mechanic to an item, simple add the behavior "Behavior_Plantable" to the .json file of the item.

Json Code Example

"behaviors": [ {
       "name": "Behavior_Plantable",
       "properties": {
              "plantOn": ["game:soil-medium-none", "game:farmland-*"],
              "plantAs": "game:crop-turnip-1",
       },
} ],

Json Patch Example

[
       {
              "op": "addmerge",
              "file": "PATHTOJSONFILE",
              "path": "/behaviors",
              "value": [ {
                     "name": "Behavior_Plantable",
                     "properties": {
                            "plantOn": [ //can be omitted
                                   "game:soil-medium-none",
                                   "game:farmland-*",
                            ],
                            "plantAs": "game:crop-turnip-1"
                     }
              } ],
       }
]

 

To specify what block to plant and what blocks can be planted on change plantOn and plantAs to the desired blocks.

Specifics of Each Propery (properties)
  • plantOn: Is an array of blocks that the item can be planted onto.
    • Is an array, meaning any number of blocks can be included.
    • Can be ommited - will default to farmland.
    • Domain is not required but is also accepted.
      • If ommited the domain of the block being matched to will be used, effectly ignoring the domain match.
      • Ex: "game:farmland-*" or "farmland-*" are both valid. However, not including the domain means ANY mod that adds a block that would match "farmland-*" will also match.
    • Can use wildcards in the block code path.
      • Ex: "game:farmland-*" to match all farmland.
  • plantAs: Is the resulting block of the planting action.
    •  Requires a single block code path.
    • Only allows a single block.
    • Can use varientgroups. Plantable item must contain the varientgroup to function, and varientgroup type is determined by the plantable item's varient.
      • Ex: "plantAs": "game:crop-{type}-1"

 

Planned Additions
  • Plant on block face. Allows specifying only planting on the specific face of the targeted block.
  • Item tooltip to show plantable behavior requirements and output.

Project description from Vintage Story Mod DB.

Pick your setup

PlantAnythingAPI releases for each Vintage Story version.

Choose the version and loader you play, then open the matching release.

23 available setups

Showing the newest 12 of 23 game versions. Older files are in the list below.

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

PlantAnythingAPI versions and loaders

3 of 3 releases match

Looking for an older file? The official Vintage Story Mod DB project page is in Resources.