Skip to content

1.10.2 API Registration and Events

JohnBraham edited this page Nov 28, 2026 · 2 revisions

Registration lifecycle and Forge events

Minecraft 1.10.2 · Sky’s Realistic Weather 0.1.22.110021 · API 8 · config 8. See version support before using these examples in another port.

Startup registration

Call registerBiomeClimate and registerPlantGrowthProfile during initialization or post-initialization, on both physical client and server distributions. Registration closes at load completion. Duplicate selectors/biome overrides, invalid definitions or late registration are programming errors and throw exceptions; register each definition once rather than every world load or tick.

BiomeClimate(temperatureOffset, seasonalScale, precipitationRule) registers a biome modifier. The offset is in MC units in [-2,2], the scale is in [0,2], and precipitation is BIOME_DEFAULT, ALLOW or DRY. This does not assign a preset ID to a biome: use config/CraftTweaker biome mappings for that separate operation.

PlantGrowthProfile(minimum, idealMinimum, idealMaximum, maximum) uses finite MC-unit knots with minimum < ideal minimum <= ideal maximum < maximum. PlantGrowthProfile.EXEMPT retains native growth. Config and script definitions can override a Java registration. A profile does not register a new block or item.

Runtime putTemperatureZone/removeTemperatureZone are a separate contract. Call them on the server world’s logical thread when a controller changes state; they remain runtime-only and are cleared with the world.

Subscribe on MinecraftForge.EVENT_BUS

Event Payload and meaning
SeasonChangedEvent WorldServer world, previous Season, current SeasonSnapshot. Fired after the server observes a shared calendar boundary. A time jump reports the destination rather than replaying every crossed boundary.
WeatherEpisodeChangedEvent WorldServer world, Optional previous/current WeatherEpisode. Reports the Overworld carrier episode after an end-of-tick weather update; not a per-position storm-entry event.
SeasonalSurfaceEvent Cancelable surface change, including seasonal population changes. Contains world, immutable position, original/proposed block states and action.

The surface actions are ACCUMULATE_SNOW, FREEZE_WATER, THAW_SNOW and THAW_ICE. A handler can cancel a proposed mod action to protect a place. Return promptly; do not load chunks, recursively alter the target block or perform network work from the handler. Vanilla melting and another mod’s surface changes remain their own systems.

The episode event can end with an empty current. It does not fire for every moving storm band crossing a player, every client particle change or every live-feed observation. After receiving it, query a loaded position for local effects rather than assuming all biomes share the carrier’s weather. getTemperatureEpisode lets a consumer inspect the separate thermal lane.

The complete setup example demonstrates event registration and surface cancellation. There is no public event for every temperature delta or every crop roll; sample only when your feature needs it, and avoid expensive all-loaded-chunk scans each tick.


Wiki home · Minecraft 1.10.2 guide · Implementation source

Clone this wiki locally