jaxstar.wow

a mod where when a creeper approaches u it plays the igniting animation but before it explodes it asks u do you want me to explode? and u have a choice to say yes or no and if you pick no it will get levitation 10 for infinite seconds and if you say yes it will explode and you got 10 seconds to pick or else it will explode in ur face

Kodari AI
KodariMay 22 at 9:55 pm 6,644 (v2)

I’ll create a hilarious creeper negotiation plugin where players can choose whether creepers explode!

CreeperChoice
A comedic plugin that lets players negotiate with igniting creepers. When a creeper starts its explosion countdown, it politely asks the player if they want it to explode. Players have 10 seconds to click Yes or No in chat. Choosing No sends the creeper flying with infinite levitation, while Yes triggers the explosion. No response results in an automatic blast. Features interactive chat buttons and explosion control.

Project structure

Core mechanics:

  • Intercept creeper explosions before they happen

  • Present clickable chat choices (Yes/No)

  • 10-second countdown timer

  • Apply levitation effect or trigger explosion based on choice

Files:

  1. Main plugin class

  2. Explosion listener

  3. Creeper manager (tracks pending choices)

  4. Configuration for messages

  5. Plugin metadata

Project created! CreeperChoice gives players 10 seconds to decide whether creepers should explode.

How it works

  1. Creeper ignites → explosion cancelled, AI frozen

  2. Player gets clickable chat buttons → [YES] (explode) or [NO] (levitate)

  3. 10-second countdown → shows remaining time

  4. Choice outcome:

    • YES → Creeper explodes

    • NO → Creeper gets Levitation X for 999999 ticks (flies away forever)

    • No response → Auto-explodes

Files created

  • Main plugin with reload command

  • CreeperManager tracks pending choices and countdown timers

  • Listener intercepts ExplosionPrimeEvent and handles button clicks

  • Config for customizable messages and timing

Key features

  • Interactive chat buttons with hover text

  • Nearest player detection

  • Configurable timeout, levitation duration/amplifier

  • Automatic cleanup if creeper dies or player logs out

  • /creeperchoice reload admin command

The creeper will freeze in place, ask politely, and await your decision! 🧨

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 413
src/main/java/com/example/creeperchoice/CreeperChoice.java
package com.example.creeperchoice;

import com.example.creeperchoice.listener.CreeperChoiceListener;
import com.example.creeperchoice.manager.CreeperManager;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public class CreeperChoice extends JavaPlugin {
    
    private CreeperManager creeperManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.creeperManager = new CreeperManager(this);
        
        getServer().getPluginManager().registerEvents(new CreeperChoiceListener(this, creeperManager), this);
        
        getLogger().info("CreeperChoice has been enabled! Creepers will now ask before exploding.");
    }
    
    @Override
    public void onDisable() {
        if (creeperManager != null) {
            creeperManager.cleanup();
        }
        getLogger().info("CreeperChoice has been disabled.");
    }
    
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("creeperchoice")) {
            if (args.length > 0 && args[0].equalsIgnoreCase("reload")) {
                if (!sender.hasPermission("creeperchoice.admin")) {
                    sender.sendMessage(ChatColor.RED + "You don't have permission to use this command.");
                    return true;
                }
                
                reloadConfig();
                creeperManager.cleanup();
                sender.sendMessage(ChatColor.GREEN + "CreeperChoice configuration reloaded!");
                return true;
            }
        }
        return false;
    }
    
    public String getMessage(String path) {
        return ChatColor.translateAlternateColorCodes('&', getConfig().getString(path, ""));
    }
    
    public int getTimeout() {
        return getConfig().getInt("choice-timeout", 10);
    }
    
    public int getLevitationDuration() {
        return getConfig().getInt("levitation-duration", 999999);
    }
    
    public int getLevitationAmplifier() {
        return getConfig().getInt("levitation-amplifier", 10);
    }
}