# Configuration > Configuration reference for ML Planting Category: PLANTING · Source: https://miciomods.it/docs/ml-planting-configuration · Last updated: 2026-09-26 ## Overview Configuration is split across multiple files: - `shared/config.lua`: General settings, growth mechanics, rendering, ground materials - `shared/zones.lua`: Growth zones with multipliers and blips - `server/config_server.lua`: Discord webhooks Plant types, categories, and items are managed through the **admin panel** and stored in the database. ## General **shared/config.lua** ```lua Config.Language = 'en' Config.Debug = false Config.Theme = 'default' Config.MinimizeKey = 'F9' Config.GlobalGrowTime = 30 Config.SeedDefaultPlants = true Config.PlayerPlantLimit = 10 Config.PlantDistance = 1.5 Config.DefaultSharedInteraction = true ``` - `GlobalGrowTime`: Base growth time in minutes - `PlayerPlantLimit`: Max plants a single player can have active - `PlantDistance`: Minimum distance between plants - DefaultSharedInteraction: When a plant type or category does not set its own rule: true lets any nearby player water and harvest, false limits it to the owner and admins. - `SeedDefaultPlants`: On the very first start, fills the panel with two ready-made plant types so it is not empty. Once any plant type exists they are never re-created; false starts empty - `MinimizeKey`: Key that minimises and restores the admin panel ## Per-Plant Limits Override the global limit for specific plant types: **shared/config.lua** ```lua Config.PlantLimitOverrides = { ['weed_seed'] = 4, ['coca_seed'] = 10, } ``` ## Growth Mechanics **shared/config.lua** ```lua Config.HealthBaseDecay = { 7, 10 } Config.WaterDecay = 1.0 Config.FertilizerDecay = 0.7 Config.WaterThreshold = 10 Config.FireTime = 5000 Config.DeadPlantTimeout = 10 ``` - `HealthBaseDecay`: Health lost per minute while water sits at or below WaterThreshold (random between the two values) - `WaterDecay`: Water lost per minute. Real elapsed time is used, so plants keep drying while the server is down - `FertilizerDecay`: Fertilizer lost per minute. Only the part above 50 speeds growth up - `WaterThreshold`: Water level at or below which the plant starts losing health. At 0 the damage doubles and growth stops - `FireTime`: Duration of fire effect when a plant is destroyed by burning - `DeadPlantTimeout`: Minutes before dead plants auto-destroy (0 = instant) ## Ground Restrictions Control which ground surfaces plants can be placed on. **shared/config.lua** ```lua Config.OnlyAllowedGrounds = false Config.AllowedGrounds = { 1333033863, -- Grass -1885547121, -- Dirt Track -700658213, -- Soil -- default list covers grass, sand, dirt, gravel, mud, clay, leaves, marsh } ``` - `OnlyAllowedGrounds = false`: Plants can go anywhere - `OnlyAllowedGrounds = true`: Only surfaces listed in `AllowedGrounds` are valid Available ground materials are documented in `Config.GroundMaterials`. Plant types can also carry their own allowed-surface list (set per type or per category in the admin panel), which overrides the global setting. ## Rendering Plants use a chunk-based rendering system for performance. **shared/config.lua** ```lua Config.ChunkSize = 100.0 Config.StreamRadius = 150.0 Config.StreamOutRadius = 200.0 Config.MaxPropsPerFrame = 3 Config.PlantInteractionRadius = 1.0 Config.RayCastDistance = 7.0 ``` - `ChunkSize`: Size of each spatial chunk for prop loading - `StreamRadius`: Distance within which plants are loaded around each player - `StreamOutRadius`: Distance beyond which loaded props are despawned (kept larger than StreamRadius so plants do not repeatedly load and unload at the edge) - `MaxPropsPerFrame`: Max plant props spawned per frame while streaming in - `PlantInteractionRadius`: Sphere zone radius around each plant for interaction - `RayCastDistance`: How far ahead of the camera the placement ray looks for a spot to plant on ## In-World Plant Panel An optional panel drawn in the world on the plants themselves: a small status badge on the plants around the player, and a full readout with keys on the one being looked at. It is off by default and plants keep the target eye. Turning it on replaces the target with the panel keys. **shared/config.lua** ```lua Config.PlantPanel = { Enabled = false, Style = 'minimal', MiniDistance = 25.0, FullDistance = 3.0, MaxMiniSurfaces = 6, OcclusionCheck = true, RefreshMs = 3000, MiniScale = 0.045, FullScale = 0.14, HeightOffset = 0.7, DestroyHoldMs = 1500, Keys = { Water = { control = 38, label = 'E', also = { 51 } }, Fertilize = { control = 47, label = 'G' }, Harvest = { control = 74, label = 'H' }, CycleItem = { control = 73, label = 'X' }, Destroy = { control = 45, label = 'R', also = { 140, 263 } }, }, } ``` - `Enabled`: false keeps the target eye on plants, true replaces it with the panel and its keys - `Style`: 'minimal' is white and transparent, 'themed' tints the panel with your Config.Theme - `MiniDistance`: distance in meters at which the small status badge appears - `FullDistance`: distance at which the plant being looked at swaps its badge for the full panel - `MaxMiniSurfaces`: how many plants can show a badge at once, the nearest plants take priority - `OcclusionCheck`: hides the panel of plants standing behind walls or terrain - `RefreshMs`: how often the visible plants ask the server for fresh water and growth values - `MiniScale` and `FullScale`: width of the badge and of the panel as a share of the screen. Raising them past the values above stretches the texture and softens the text - `HeightOffset`: height in meters above the base of the plant. It is fixed rather than measured on the prop, so the panel never jumps when a plant grows into a new stage - `DestroyHoldMs`: how long the destroy key must be held down before the plant burns - `Keys`: control is the FiveM control id, label is what the panel prints next to the action. A single physical key can drive more than one control id, so also lists the others on that key: they are switched off together while the panel is up, otherwise the game still reacts to the keypress. Update it if you rebind an action ## Growth Zones Define areas where plants grow faster and yield more. Seed zones in `shared/zones.lua` or draw them in-game from the admin panel. Zones from `shared/zones.lua` are synced into the database on every start and overwrite entries with the same id; zones created from the panel are preserved. **shared/zones.lua** ```lua Config.Zones = { ['weed_zone_one'] = { points = { vec3(2031.0, 4853.0, 43.0), vec3(2007.0, 4877.0, 43.0), -- ... }, thickness = 4.0, growMultiplier = 2.0, yieldMultiplier = 1.0, allowlist = {}, blocklist = {}, plantLimitOverride = nil, blip = { display = true, sprite = 469, color = 2, text = 'Cannabis Zone', }, }, } ``` - `growMultiplier`: Multiplies the growth speed inside this zone (2.0 = twice as fast) - `yieldMultiplier`: Multiplies harvested item counts for plants inside the zone - `allowlist` / `blocklist` - Restrict which seeds may be planted in the zone - `plantLimitOverride`: Max total plants allowed inside the zone - `blip`: Optional map blip. Set `display = false` to hide it. ## Skill Progression Skill requirements and XP rewards are optional and read from `ml_skills`. The config holds the global switches; every plant type then sets its own. **shared/config.lua** ```lua Config.ExternalSkills = { Enabled = true, Resource = 'ml_skills', XpMultiplier = 1.0, MaxXpPerHarvest = 500, } ``` - `Enabled`: false ignores every requirement and grants no XP, whatever the plant types define - `Resource`: Name of the progression resource that provides the skill trees - `XpMultiplier`: Global multiplier applied to every XP award - `MaxXpPerHarvest`: Ceiling applied after the multipliers. 0 removes the ceiling Requirements and rewards live in the plant editor, under **Skill Integration**. Four actions are configured independently, each on its own tab: - `Plant`: Checked when the seed item is used, before placement mode opens - `Water`: Checked before the watering animation starts - `Fertilize`: Checked before the fertilizing animation starts - `Harvest`: Checked before the harvest animation starts Each tab holds the same two groups: - **Requirement**: A skill the player must have unlocked, and a minimum level in that skill's category. Leave both empty to require nothing - **XP Reward**: The skill that receives the XP (its category is bound automatically) or a plain category, plus the amount. Leave the amount at 0 to grant nothing Harvest XP scales with the plant health and the zone yield multiplier. The other three actions grant their flat amount. > **INFO:** Progression is optional > > With the progression resource stopped, or `Enabled = false`, every requirement passes and no XP is granted. Plants never become unplantable because progression is down. > **TIP:** Set it once per category > > Categories carry the same Skill Integration block. A plant type inherits its category unless the `OVERRIDE` toggle on that section is on. ## Admin Panel **shared/config.lua** ```lua Config.AdminCommand = 'plantadmin' ``` The admin panel allows creating and editing plant types, categories, seed items, and growth configurations - all stored in the database. Access requires admin permission from your framework, resolved through `ml_bridge` (the `admin`/`god` group on QBCore, Qbox and ESX, or ACE admin on standalone). ## Item Usage The plant editor decides what happens to an item when a player uses it, in two separate places. **Required Items**: the tools a player needs to plant the seed. Each entry has its own usage mode. - **Check Only**: the player must carry the item. Nothing is taken. - **Consume**: the item is taken from the inventory when the seed goes in the ground. - **Degrade**: the item loses durability instead. Set how much per use, and whether it is removed once it reaches zero. **Water and fertilizer items**: each item row has its own Consume item on use switch. - On: the item is taken when the plant is watered or fertilized. If you set a Return item, the player gets that one back. - Off: the item is only checked and stays in the inventory. > **TIP:** Reusable tools > > Leave the switch off for a watering can or any tool players should keep. Turn it on for a water bottle or a bag of fertilizer the player uses up. ## Logging Every webhook event can be toggled individually: **shared/config.lua** ```lua Config.Log = { Plant = true, -- Player planted a seed Water = true, -- Player watered a plant Fertilize = true, -- Player fertilized a plant Harvest = true, -- Player harvested a plant (logs full reward list) Destroy = true, -- Player destroyed their own plant AdminDestroy = true, -- Admin destroyed another player's plant Death = true, -- Plant died from decay (water=0 / health=0) AdminPanel = true, -- Admin opened the panel AdminConfig = true, -- Admin saved/deleted a plant type, category or zone } ``` ## Discord Webhooks **server/config_server.lua** ```lua ServerConfig.DiscordWebhook = { Default = '', Plant = '', Water = '', Fertilize = '', Harvest = '', Destroy = '', Death = '', AdminDestroy = '', AdminPanel = '', AdminConfig = '', AntiExploit = '', } ``` - Each key is one action, matching the toggles in Config.Log. That action is logged to its own channel. - Default is the fallback channel: any action whose own webhook is empty is sent there instead. - Leave an action and Default both empty to skip that log.