Skip to content

Storm Builder

RealDarkStudios edited this page Jun 15, 2025 · 1 revision

The Storm Builder is an easy way to create and spawn Storms in the level.

To start creating a storm, use any of the following:

// Assuming WeatherHandler `weatherHandler`
StormBuilder fromWeatherHandler = new StormBuilder(weatherHandler, Type.SUPERCELL, Vec3.ZERO);

// Assuming Level `level`
StormBuilder fromLevel = new StormBuilder(level, Type.SQUALL, Vec3.ZERO);

// Assuming ResourceKey<Level> `dimension`
StormBuilder fromDimension = new StormBuilder(dimension, Type.SUPERCELL, new Vec3(100, 0, 100));

// Assuming Player 'player'
StormBuilder fromPlayer = StormBuilder.atPlayer(Type.SQUALL, player);

Once you have a StormBuilder, you can use any of the following methods:

// The default values of the function are shown as the parameters here
StormBuilder builder = StormBuilder.atPlayer(Type.SUPERCELL, player)
    .velocity(new Vec3(100, 0, 100)) // Set the velocity of the storm
    .aimAtPlayer(player) // Do not aim at player and spawn at their position because it WILL NOT move. This is a known bug with PMWeather
    .aimAtAnyPlayer() // Aims at any nearby player
    .visualOnly(false) // Sets the storm to be visual only
    .risk(0.5F) // Sets the risk of the storm, used to calculate the max stage (if not specified)
    .rankineFactor(4.5F) // Sets the rankine factor of the storm
    .width(15.0F) // Sets the width of the storm
    .maxWidth(15) // Sets the max width of the storm
    .stage(0) // Sets the stage of the storm
    .maxStage(2) // Sets the max stage of the storm
    .energy(10) // Sets the energy of the storm
    .coldEnergy(0) // Sets the cold energy of the storm
    .maxColdEnergy(300) // Sets the max cold energy of the storm
    .windspeed(0) // Sets the windspeed of the storm
    .maxWindpseed(0); // Sets the max windspeed of the storm

To actually create this storm, we must use #build(). To spawn the storm in the world, we must use #buildAndSpawn()

// Assuming builder from above
Storm notSpawned = builder.build();
// Will spawn the storm in the world and sync it to clients automatically
Storm spawned = builder.buildAndSpawn();

Clone this wiki locally