Weather Rocket

Overview

Class: crazypants.enderio.machine.obelisk.weather.EntityWeatherRocket Extends: EntityFireworkRocket

EntityWeatherRocket is a modified firework rocket entity spawned by the Weather Obelisk. It extends Minecraft’s EntityFireworkRocket with a custom maximum age and effects system tied to weather tasks.

Spawning

Spawned by TileWeatherObelisk when a weather task (Rain, Thunder, or Clear) is activated. It is spawned with a WeatherTask ordinal stored in its data watcher at index DATA_ID = 24.

Attributes

Attribute Value
Max Age 70 ticks (~3.5 seconds)
Data Watcher ID 24
Parent Class EntityFireworkRocket

Behavior

onEntityUpdate()

On the client side, every MAX_AGE / 10 ticks (7 ticks), after 30 ticks have passed, the doEffect() method is called to render particle effects.

setDead()

When the rocket is set dead (times out or is destroyed):

  • If server-side, it calls WeatherTask.complete(world) for the associated task to finalize the weather change.
  • The weather task is determined by reading the data watcher ordinal.

handleHealthUpdate()

Empty override — the rocket does not respond to health update packets.

Effects (Client-Side)

doEffect() spawns a large 3D grid of EntityFireworkSparkFX particles:

  • Grid size: 5 blocks in each direction (11×11×11 cube)
  • Sound: fireworks.largeBlast (or fireworks.largeBlast_far if ticksExisted > 40)
  • Particle color: Determined by WeatherTask.color.getRGB()
  • Trail: Enabled, twinkle: disabled
  • Speed: 1.0

The particle grid iterates with random offsets for a scattered, firework-like burst appearance.

Weather Tasks

The data watcher stores the current WeatherTask ordinal:

Task Effect
RAIN Tells the weather obelisk to begin rain
THUNDER Tells the weather obelisk to begin thunderstorm
CLEAR Tells the weather obelisk to clear weather

When the rocket’s lifetime expires and setDead() is called, the appropriate task’s complete() method is invoked server-side to finalize the weather change.

Notes

  • This entity is not a mob — it is a utility entity for weather control.
  • It uses reflection to override the private lifetime field of EntityFireworkRocket from the default Minecraft value to 70 ticks.
  • The particle effects only render client-side; server-side only handles the weather task completion.
  • The entity does not deal damage and has no collision with players or blocks.

第三方集成

集成 Mod 集成类型 功能
Thaumcraft 要素注册 物品要素标签