mikelsitotsu

Hi, I want to create a fairly easy Minecraft 1.21.11 plugin. I want it so that when a player dies, a message appears on the screen saying: "(Player name) IS DEAD!" and then it starts raining for 1 hour with a countdown timer at the bottom above the hotbar with the message: "Corrupted rain will stop at: (time remaining)." Also, I want it to add another hour of rain every time a new player dies.

Kodari AI
KodariMar 10 at 12:50 am 7,569 (v2)

I’ll create a death-triggered rain punishment plugin for you.

CorruptedRain
A dramatic atmospheric punishment plugin that triggers corrupted rain when players die. Each death displays a bold announcement title and adds one hour to an ongoing rain timer. All online players see a persistent countdown above their hotbar showing when the cursed weather will end. Multiple deaths stack additional hours, creating prolonged dark atmosphere.

Plugin created! When a player dies:

  • All players see the title “{Player name} IS DEAD!”

  • Rain starts (or adds another hour if already raining)

  • Countdown timer appears above hotbar showing time remaining in HH:MM:SS format

mikelsitotsu

Perfect, it worked incredibly well, Now I want the rain to be a storm, and I want it to only be able to be stopped with the command /weather clear. It shouldn't be possible to stop the rain naturally, or even if a player falls asleep. The storm should last forever until the timer runs out.

I also want to add that when a player dies, all players on the server should be blinded for 10 seconds, and the following combination of sounds should play at the same time:

  • minecraft:item.trident.thunder PITCH 0.4
  • minecraft:entity.wither.death PITCH 0.4

And after it's all over, send another title to the screen saying: "Prepare to suffer." With the sound: minecraft:entity.skeleton_horse.death with PITCH 0.5

Kodari AI
KodariMar 10 at 1:19 am 10,216 (v2)

I’ll read the existing files first to understand the current implementation, then modify it to add storm support, prevent natural weather clearing, and enhance the death effects.

Now I’ll modify the plugin to add storm support, prevent natural weather clearing, and enhance the death effects with blindness and multiple sounds.

All modifications complete! The plugin now features:

Storm Enhancements:

  • Full thunderstorm (rain + lightning) that lasts forever until timer expires or /weather clear is used

  • WeatherChangeListener prevents natural weather clearing and sleep-based clearing

  • ThunderChangeListener ensures thunder stays active throughout

Death Effects:

  • All players receive 10 seconds of blindness

  • Two sounds play simultaneously: trident thunder and wither death (both pitch 0.4)

  • After 10 seconds, “Prepare to suffer.” title appears with skeleton horse death sound (pitch 0.5)

mikelsitotsu

perfect thanks, Now you can now configure the chat to display the following message every time someone dies: "La corrupcion ha tomado el alma de (player). Ahora sufrira hasta el final de los tiempos." All text should be red, except for the player's name.

Also, add a subtitle to the first death message stating the reason for the player's death in color purple.

Finally, ensure the storm and timer continue even if the server is shut down; they should save and only stop when the timer reaches zero.

Kodari AI
KodariMar 10 at 2:39 am 13,223 (v2)

I’ll add the custom death chat message, death reason subtitle, and persistence for the storm/timer across server restarts.

All changes applied: death chat message displays in red with player name in white, death reason shown as purple subtitle on first title, and storm/timer now persist across server restarts via raindata.yml file.

mikelsitotsu

Now I want you to add some commands to the plugin.

A reload command to reload the plugin while on the server.

Another command to start the storm along with a timer for a certain amount of time, and also to stop the storm.

I also want you to add a message to the chat whenever a player activates a Totem of Undying, which should be: "¡El jugador (player) ha consumido un TOTEM!"

Kodari AI
KodariMar 10 at 11:31 pm 18,857 (v2)

I’ll read the existing files to understand the structure, then add the commands and totem message functionality.

I’ll add the commands and totem message functionality to the plugin.

Now I’ll update the main plugin class and configuration files:

All files have been created and updated. The plugin now includes:

  • /corruptedrain reload command to reload the configuration

  • /corruptedrain start <seconds> command to manually start the storm with a timer

  • /corruptedrain stop command to stop the storm

  • Totem of Undying activation message broadcasting to all players

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
9 519
src/main/java/com/corruptedrain/CorruptedRain.java
package com.corruptedrain;

import com.corruptedrain.command.CommandHandler;
import com.corruptedrain.listener.DeathListener;
import com.corruptedrain.listener.TotemListener;
import com.corruptedrain.listener.WeatherChangeListener;
import com.corruptedrain.manager.RainManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CorruptedRain extends JavaPlugin {
    
    private RainManager rainManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.rainManager = new RainManager(this);
        
        getServer().getPluginManager().registerEvents(new DeathListener(this), this);
        getServer().getPluginManager().registerEvents(new WeatherChangeListener(this), this);
        getServer().getPluginManager().registerEvents(new TotemListener(this), this);
        
        CommandHandler commandHandler = new CommandHandler(this);
        getCommand("corruptedrain").setExecutor(commandHandler);
        getCommand("corruptedrain").setTabCompleter(commandHandler);
        
        getLogger().info("CorruptedRain has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (rainManager != null) {
            rainManager.shutdown();
        }
        
        getLogger().info("CorruptedRain has been disabled!");
    }
}