momsdominator777

Create a so-called "kamikaze button" that, when used, causes the immediate annihilation of the character along with a massive explosion covering an area of ​​approximately 50 by 50 tiles.

Kodari AI
KodariAug 25 at 7:03 pm 1
KamikazeDetonator
A Minecraft plugin adding a kamikaze button item that, when right-clicked, instantly kills the player and triggers a massive 50x50 block explosion. The explosion destroys terrain, damages nearby entities, creates visual and sound effects, and leaves a crater. Configurable explosion radius, damage, and cooldown. Includes permissions to restrict usage and a warning message before detonation.
  • Create a minimal Paper plugin build and manifest.

  • Add /kamikazebutton (alias /kamikaze) to give the custom button.

  • Detect the tagged button on right-click, consume it, instantly kill the player, and trigger a power-25 destructive explosion.

Created the Kamikaze Button plugin.

  • /kamikazebutton and /kamikaze give players a tagged stone button.

  • Right-clicking it consumes the button and immediately kills the player.

  • Triggers a destructive power-25 explosion, covering approximately a 50×50 block area.

  • Added Paper plugin metadata and Gradle project configuration.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
6 189
src/main/java/com/kodari/kamikaze/KamikazePlugin.java
package com.kodari.kamikaze;

import com.cryptomorin.xseries.XMaterial;
import java.util.Collections;
import org.bukkit.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;

public final class KamikazePlugin extends JavaPlugin {
    private NamespacedKey buttonKey;

    @Override
    public void onEnable() {
        buttonKey = new NamespacedKey(this, "kamikaze_button");
        getServer().getPluginManager().registerEvents(new KamikazeListener(this), this);
        getCommand("kamikazebutton").setExecutor(new GiveButtonCommand(this));
    }

    public NamespacedKey getButtonKey() {
        return buttonKey;
    }

    public ItemStack createButton() {
        ItemStack button = XMaterial.matchXMaterial("STONE_BUTTON")
                .map(XMaterial::parseItem)
                .orElse(null);
        if (button == null) {
            return null;
        }

        ItemMeta meta = button.getItemMeta();
        if (meta == null) {
            return null;
        }
        meta.setDisplayName(ChatColor.RED + "Kamikaze Button");
        meta.setLore(Collections.singletonList(ChatColor.GRAY + "Right-click to annihilate yourself."));
        meta.getPersistentDataContainer().set(buttonKey, org.bukkit.persistence.PersistentDataType.BYTE, (byte) 1);
        button.setItemMeta(meta);
        return button;
    }
}