Add required items

How to add required items

A desired feature is that items are required when an item is planted or harvested, this feature is now available with version 1.3.0 but not active by default in the Config.lua. To add the feature the following code must be added to each plant.

reqItems = { -- Items required to plant the seed
    ["planting"] = {
    },
    ["harvesting"] = {
    }
},

In each of the 2 categories you can add as many items as you want, the schema you have to use is as follows:

['item_amount'] = {amount = number, remove = true or false},

Example:

['watering_can'] = {amount = 1, remove = true},

Please remember to register all the items you list here in your inventory!


Full example

['weed_lemonhaze_seed'] = {
    label = 'Lemon Haze', -- Label for the plant
    plantType = 'plant1', -- Choose plant types from (plant1, plant2, small_plant)
    growthTime = 2, -- Cutsom growth time in minutes false if you want to use the global growth time
    onlyZone = false, -- Set to zone id if you want to plant this seed only in a specific zone 
    zones = {'weed_zone_one', 'weed_zone_two'}, -- Zones where the seed can be planted
    products = { -- Item the plant is going to produce when harvested with the max amount
        ['weed_lemonhaze'] = {min = 1, max = 4},  
        --['other_item'] = {min = 1, max = 2}
    },
    seed = {
        chance = 50, -- Percent of getting back the seed
        min = 1, -- Min amount of seeds
        max = 2 -- Max amount of seeds
    },
    time = 3000, -- Time it takes to plant/harvest in miliseconds
    reqItems = { -- Items required to plant the seed
        ["planting"] = {
            ['watering_can'] = {amount = 1, remove = true},
            ['shovel'] = {amount = 1, remove = false},
        },
        ["harvesting"] = {
            ['watering_can'] = {amount = 1, remove = true},
            ['shovel'] = {amount = 1, remove = false},
        }
    }
},

Last updated