Repository navigation
Datapack Custom Strains
Strains in Smokeleaf Industries are data. The 25 built-in strains are JSON files, and a datapack can add new ones, or change the built-in ones, without writing any code.
your_datapack/
├── pack.mcmeta
└── data/
└── <your_namespace>/
└── smokeleafindustries/
└── strain/
└── midnight_mint.json
The file name is the strain ID (midnight_mint). Only the file name counts, not the namespace, so a file named white_widow.json in any namespace replaces the built-in White Widow.
pack.mcmeta for 1.21.1:
{ "pack": { "pack_format": 48, "description": "My Smokeleaf strains" } }{
"name": "Midnight Mint",
"identified": true,
"color": -9520996,
"leaf_color": -13744573,
"thc": 22,
"cbd": 4,
"n": 12,
"p": 9,
"k": 16,
"effects": [
"smokeleafindustries:chillout",
"minecraft:night_vision"
],
"amp": 1,
"dur": 220
}| Field | Required | Meaning |
|---|---|---|
name |
yes | Display name shown on items and tooltips |
identified |
yes |
true for a named strain. false makes it show as "Unidentified" |
color |
yes | Accent colour (the bud/flower highlights) |
leaf_color |
no | Leaf colour. Defaults to a hemp green |
thc |
yes | THC level. Higher THC grants more extra effects when consumed |
cbd |
yes | CBD level. Higher CBD makes effects last longer |
n, p, k
|
yes | The nitrogen, phosphorus and potassium levels the plant wants. Players reach these with fertilizers for the best yield |
effects |
yes | List of effect IDs applied when consumed. Any mod's effects work |
amp |
yes | Effect amplifier (0 = level I, 1 = level II) |
dur |
yes | Base effect duration in ticks (20 ticks = 1 second) |
weed_color, weed_leaf_color
|
no | Override colours for ground weed |
seeds_color, seeds_leaf_color
|
no | Override colours for seeds |
extract_color, extract_leaf_color
|
no | Override colours for extract and oil |
base_strain_1, base_strain_2
|
no | Parent strain IDs, for lineage |
Colours are ARGB written as a signed integer. To convert a hex colour such as #6EB89C:
value = 0xFF6EB89C - 4294967296 = -9520996
Or in a browser console: (0xFF6EB89C | 0).
stoned, bubbled, uplifted, paranoia, relaxed, shy, aroused, breathing, sleepy, melted, dizzy, scrambled_mouth, rainbow, brain_melt, high_flyer, dry_eyes, dry_mouth, chillout, zombified, echo_location, friend_or_foe, linguists_high, sticky_icky, r_trees, vein_high
Prefix each with smokeleafindustries:.
A strain file defines the strain. Players still need a way to get it. Pick one or more:
Sequencer recipe (survival-friendly). Add data/<namespace>/recipe/midnight_mint_sequencer.json:
{
"type": "smokeleafindustries:sequencer",
"dna": { "item": "smokeleafindustries:dna_strand" },
"base_extract": { "item": "smokeleafindustries:base_extract" },
"required_reagents": [
{ "item": "minecraft:kelp" },
{ "item": "minecraft:ink_sac" },
{ "item": "minecraft:glow_berries" }
],
"result": { "id": "smokeleafindustries:extract", "count": 1 },
"strain_id": "midnight_mint"
}The three reagents are what the player loads into a DNA Strand in the Synthesizer. The Sequencer then turns it into extract of your strain, which enters the normal chain from there (Liquifier, Mixer, Mutator).
Loot tables, recipes or KubeJS trades. Anything that can produce an item with components can hand out seeds directly. The stack must carry the full smokeleafindustries:strain_data component as well as smokeleafindustries:strain_id (same shape as the command below); the ID alone is not enough.
Commands, for testing or quest rewards:
/give @s smokeleafindustries:seeds[smokeleafindustries:strain_id="midnight_mint",smokeleafindustries:strain_data={name:"Midnight Mint",identified:1b,color:-9520996,leaf_color:-13744573,thc:22,cbd:4,n:12,p:9,k:16,effects:["smokeleafindustries:chillout","minecraft:night_vision"],amp:1,dur:220}]
- Put the datapack in
world/datapacks/(or ship it with your pack through a global datapack mod or KubeJS'sdatafolder). -
Restart the world or server. Strains are a datapack registry, so
/reloaddoes not pick up new or changed strain files. - Check the log for
StrainRegistry reloaded: N strains available. N should be 25 plus the number you added.
- The creative tab lists the 25 built-in strains only. Datapack strains do not appear there, but they do appear in JEI's strain lists.
- To rebalance a built-in strain, copy its file from the mod jar (
data/smokeleafindustries/smokeleafindustries/strain/), change the numbers and keep the file name. - Player-bred strains made in the Mixer and Mutator are separate from datapack strains and are saved with the world.
- All machine recipes are ordinary datapack recipes too (
drying,grinder,extractor,liquifier,mutator,synthesizer,sequencer,gummy_machine,generator).