Skip to content

1.11.2 CraftTweaker

JohnBraham edited this page Nov 27, 2026 · 2 revisions

CraftTweaker 3 scripts

Minecraft 1.11.2 · Sky’s Realistic Weather 0.1.21.111021 · API 8 · config 8. See version support for qualification.

Target: CraftTweaker 1.11.2 3.1.0-legacy (crafttweaker). Example:

import mods.skysrealisticweather.Climate;

// Absolute Celsius temperatures, regardless of a player's display units.
// Selector syntax matches plant_growth.mappings, including block properties.
Climate.setCropTemperatureCelsius("minecraft:wheat", -5, 5, 25, 40);
Climate.exemptCrop("minecraft:nether_wart");
Climate.mapBiome("minecraft:plains", "central_european");

Place this in the pack's scripts directory as a .zs file. Crop definitions resolve in this order: script, config, Java API registration, bundled rule. Specific property selectors beat general selectors within the same source. Unknown plants keep native growth; magical crops remain exempt unless mapped. Sky never destroys crops, speeds them above native growth or replaces native soil, light, genetics and fertiliser checks.

The script actions support CraftTweaker undo/reload. While a world is running, changed definitions are held pending its next restart. Weather, existing crop rules and connected clients keep the active snapshot. /skyweather validate reports pending changes. An unchanged reload does not require a restart.

CraftTweaker 3.1.0-legacy runs its initial scripts after spawn terrain preparation. Script biome mappings apply before gameplay and to subsequently generated chunks. Put mappings needed for initial spawn generation in biome_climates in Sky's config. Existing terrain is never regenerated.

Read-only queries accept a CraftTweaker IPlayer:

// Use from an event that supplies a player, rather than at script load time.
// Climate.getSeason(player) -> "spring", "summer", "autumn", "winter", or "unavailable"
// Climate.getLocalClimate(player) -> IData map
// Climate.getPlantGrowth(player, x, y, z) -> IData map

Check available before using results. Local climate includes temperatureCelsius, source, precipitation, climate and season when available. Plant growth includes multiplier and reason. These queries inspect loaded positions only; they do not generate terrain.

Full starter script

Save this as scripts/skyweather.zs, remove examples you do not want, and use your pack’s actual registry IDs:

import mods.skysrealisticweather.Climate;

// Absolute Celsius: minimum, ideal minimum, ideal maximum, maximum.
Climate.setCropTemperatureCelsius("minecraft:wheat", -5, 5, 25, 40);
Climate.exemptCrop("minecraft:nether_wart");
Climate.mapBiome("minecraft:plains", "central_european");

setCropTemperatureCelsius requires finite, ordered knots: minimum < ideal minimum <= ideal maximum < maximum. Plant selectors use the same syntax as config mappings. mapBiome requires a registry ID and an existing preset ID. Invalid definitions are reported in the CraftTweaker log. The bridge supports at most 8192 script crop selectors and at most 8192 total biome mapping IDs when combined with defaults.

Query result keys

Call Result
Climate.getSeason(player) Lowercase shared-calendar season, or unavailable.
Climate.getLocalClimate(player) available; when available, temperatureCelsius and source, with atmospheric precipitation, resolved climate and shared season when a climate frame exists.
Climate.getPlantGrowth(player, x, y, z) available; when available, multiplier and lowercase reason. Requires an existing supported plant at a loaded position.

These player queries belong in a callback that supplies an IPlayer; they cannot produce a live world reading during the initial script parse. Check available rather than treating an absent number as zero. getLocalClimate samples the player’s block position and effective local temperature, so it can differ from an outdoor reading or an eye-height thermometer.

Changed definitions after /mt reload do not rewrite the active world’s rules mid-session. Restart the world to activate them; restart the game/server after changing ordinary Forge config. Query-only scripts do not need operator permission to inspect the player’s local climate.


Wiki home · Minecraft 1.11.2 guide · Version support

Clone this wiki locally