PLANTATIONS
grower@plntns:~/docs$ cat modpack-devs.md

Modpack developers

1228 words·~6 min read

Everything in Plantations is data: tags, data maps, datapack registries and recipe types. A datapack, KubeJS or CraftTweaker can change all of it. The examples on this page are in docs/examples and are tested (see Testing the examples).

Two op commands show how the mod sits in a pack; both print to chat and the log, so they also work from a server console:

  • /plantations diagnose: the mod's recipes per type, the compat recipes that loaded for each mod (with their ids), what the input tags resolve to, and which plants are on.
  • /plantations scan <chunks>: counts the ores and the Plantations plants in the chunks around the position (it generates missing chunks, so keep the radius small).

Config

config/plantations-common.toml (all options in CONFIG.md). The ones packs usually touch:

OptionWhat for
plants.<plant>.enabled / .wild / .wildRarityRemove a plant entirely (its recipes switch off through the plantations:plant_enabled condition), or only its wild patches
worldgen.saltpeter / apatite / potash / sulfurSkip our ores when another mod already provides the mineral; the c: tags keep the recipes working
balance.mineralStrength, balance.livingSoilGrowthShift the two tech trees against each other
pests.enabledTurn off the pest system
effects.dependency, effects.overdoseHow harsh repeated use is
blackMarket.enabled, .currency, .heatThe Dealer, which coins it pays in (NUMISMATICS, LIGHTMANS, CUSTOM), and raids

Screen effects are per player in config/plantations-client.toml (visuals.intensity, visuals.photosensitive, visuals.hallucinations).

Tags

Exported: other mods' recipes find Plantations items through these.

TagContents
c:seeds/cannabis, c:seeds/opium_poppy, c:seeds/coca, c:seeds/datura (in c:seeds)The seeds; coca drupes are coca's seeds
c:crops/cannabis, c:crops/coca, c:crops/khat, c:crops/salvia, c:crops/opium_poppy, c:crops/datura (in c:crops)The harvests: fresh bud, fresh coca leaves, khat bundle, fresh salvia leaf, green poppy pod, datura pod
c:dusts/saltpeter, c:dusts/potash, c:dusts/sulfur, c:dusts/wood_ash, c:gems/apatiteThe minerals
c:ores/saltpeter, c:ores/apatite, c:ores/potash, c:ores/sulfur (+ c:ores_in_ground/*)The ores, items and blocks
c:drinks, c:foodsCoca tea, mushroom tea; poppy seed cake
c:tools/knifeThe Harvest Knife (Farmer's Delight's cutting board takes it)

Consumed: recipes take conventional tags wherever one exists, for example:

  • c:crops/wheat, c:crops/sugar_cane, c:crops/cocoa_bean, c:crops/potato, c:crops/rice
  • c:eggs, c:bones, c:mushrooms, c:foods/fruit, c:foods
  • c:buckets/water, c:buckets/milk, c:buckets/empty
  • c:dyes/*, c:dusts/glowstone, c:dusts/redstone, c:ingots/*, c:tools/shear
  • the mineral tags above

Machines and mechanics read these mod tags. Add your items to them:

TagUsed by
plantations:fertilizer_inputs/nitrogen · /phosphorus · /potassiumFertilizer Mixer slots (the c: minerals plus Urea and Superphosphate)
plantations:steamableSteamed Rice for the IMO Box (c:crops/rice, wheat as the fallback)
plantations:imo_baitsWhat baits the IMO Box (Steamed Rice, Farmer's Delight's cooked rice)
plantations:young_shootsFermented Plant Juice
plantations:ohn_herbsOriental Herbal Nutrient (c:crops/garlic, c:crops/ginger, c:crops/cinnamon, beetroot)
plantations:compost_tea/bases · /sugarsCompost Tea Brewer
plantations:mulch/leaf · /strawMulch layers on garden beds
plantations:weed_repellentsLiquids that keep weeds off a bed for a day (OHN)
plantations:mycorrhizal_inoculantsItems that give a bed mycorrhiza
plantations:smokableWhat a Pipe can be packed with
plantations:manureManure for the mushroom bulk substrate (bone meal by default)
plantations:growing_media (block tag)Blocks crops stand on, unless a plant sets its own soil tag
plantations:rich_soils (block tag)Rich organic soils without tracked stats: 85 % quality cap (Farmer's Delight's rich soil)

Data maps

All are in data/<namespace>/data_maps/item/<name>.json. Entries merge across packs; set "replace": true to override an entry.

Data mapWhat it setsFormat
plantations:soil_amendmentWhat right-clicking a bed (or a watering-can use of a liquid) doesSOIL.md
plantations:dilutionMakes an item a concentrate for the Mixing BarrelPROCESSING.md
plantations:pest_controlWhich pests an item clears, for how long, at what costSOIL.md
plantations:doseWhich substance an item carries, and how muchEFFECTS.md
plantations:market_valueBlack market value (harvest, resource or derived)BLACK_MARKET.md
neoforge:compostablesThe Compost Bin uses the vanilla composter's listNeoForge

Example, tested through the KubeJS data folder (kubejs/data/plantations/data_maps/item/soil_amendment.json):

{
  "values": {
    "minecraft:rotten_flesh": { "n": 1, "organic": 2, "life": 1 }
  }
}

Datapack registries

RegistryDefinesDocs
plantations:plantPlants: climate, light, nutrients, propagation, harvestPLANTS.md
plantations:landraceRegional strains and the biomes they grow inPLANTS.md
plantations:substanceEffects, tolerance, dependency, overdoseEFFECTS.md
plantations:microbe_profileIMO profiles per biomeSOIL.md
plantations:black_market/offer · /contract_templateWhat the Dealer sells, contractsBLACK_MARKET.md

Recipe types

TypeFields (defaults)
plantations:dryingingredient, result, drying_time (2400)
plantations:curingingredient, result, cycle_ticks, gain_per_cycle (0.03), cap (1.0)
plantations:grindingingredient, result, grinds
plantations:fermentingingredients (1-4, all different), result, time (24000)
plantations:pressingingredient, count (1), result, presses (4), heated (false)
plantations:extractingingredient, count (1), result, time
plantations:fertilizer_blendparts (n, p, k), result

plantations:quality_shapeless and plantations:microbe_shapeless are shapeless crafting recipes that carry the quality or microbe profile of their inputs into the result. Plant recipes carry the plantations:plant_enabled condition, so they switch off with their plant.

KubeJS

Every recipe type works through event.custom with the JSON above. The tested example is examples/kubejs/server_scripts/plantations_examples.js. It adds one recipe of every type and removes one; an excerpt:

ServerEvents.recipes(event => {
  event.custom({
    type: 'plantations:fermenting',
    ingredients: [{ item: 'minecraft:carrot' }, { item: 'minecraft:sugar' }, { item: 'minecraft:glass_bottle' }],
    result: { id: 'plantations:fermented_plant_juice', count: 2 },
    time: 12000
  }).id('plantations:kubejs/fermenting_carrot')

  event.remove({ id: 'plantations:campfire/charred_bone' })
})

Data maps and registries go in kubejs/data/<namespace>/… like any datapack.

Black market

The market is data too (details in BLACK_MARKET.md §11). The tested examples are in examples/kubejs/data:

// data/plantations/data_maps/item/market_value.json: the Dealer buys sweet berries (merges with the mod's own file)
{ "values": { "minecraft:sweet_berries": { "value": 0.5, "tier": "t0", "capacity": 128 } } }

// data/kubejs/plantations/black_market/offer/glowstone_dust.json: the Dealer sells 8 glowstone dust from tier 1
{ "item": "minecraft:glowstone_dust", "count": 8, "value_each": 2.5, "min_tier": 1, "stock": 4 }

// data/kubejs/plantations/black_market/contract_template/berry_rush.json: a contract from tier 2
{ "item": "minecraft:sweet_berries", "count_min": 32, "count_max": 64, "days": 2, "reward_multiplier": 1.3, "min_tier": 2 }

To remove one of the mod's offers or templates, override its file (same id) in a datapack with a NeoForge neoforge:false condition ("neoforge:conditions": [{ "type": "neoforge:false" }]). For quest mods there is the plantations:reputation_tier criterion (and one advancement per tier) and the plantations:contracts_completed statistic; INTEGRATIONS.md has an FTB Quests chapter.

CraftTweaker

Decision: no native ZenScript handlers. CraftTweaker's addJsonRecipe takes the same JSON for any recipe type, so handlers would only duplicate it. The tested example is examples/crafttweaker/scripts/plantations_examples.zs; an excerpt:

<recipetype:plantations:pressing>.addJsonRecipe("plantations_pressing_sunflower", {
    type: "plantations:pressing",
    ingredient: {item: "minecraft:sunflower"},
    count: 2,
    result: {id: "minecraft:yellow_dye", count: 3},
    presses: 2,
    heated: false
});

<recipetype:minecraft:campfire_cooking>.removeByName("plantations:campfire/roasted_eggshells");

The recipe ids are crafttweaker:<name>. Data maps and registries need a datapack.