savtier1

A one of a kind netherite chest plate that gives you resistance 2 And after three hits strikes lightning on the person you're fighting

Kodari AI
KodariMay 25 at 3:33 pm 6,337 (v2)

I’ll create a unique lightning-strike chestplate plugin with hit tracking mechanics.

ThunderStrike
A custom netherite chestplate plugin that grants permanent Resistance 2 while worn and strikes lightning on enemies after landing three hits. The chestplate features unique lore, tracks hits per target automatically, and resets counters after each lightning strike. Includes admin commands to distribute the legendary armor and fully configurable messages and effects.

Now I’ll create the plugin structure with all necessary files.

All files created! The plugin features:

Core functionality:

  • Custom netherite chestplate with configurable name and lore

  • Permanent Resistance 2 effect while wearing the chestplate

  • Hit counter tracks attacks per target automatically

  • Lightning strikes on the enemy after 3 hits, then resets

  • /thunderstrike [player] command to distribute the chestplate

Configuration options:

  • Customizable item name, lore, and appearance

  • Adjustable hit requirement (default: 3 hits)

  • Adjustable resistance level (default: 2)

  • Toggle between real lightning (damage) or visual effect only

  • Configurable messages and sound effects

Permission system:

  • thunderstrike.give - Give the chestplate (default: OP)

  • thunderstrike.use - Use the chestplate abilities (default: everyone)

The plugin uses XSeries for cross-version compatibility with materials and sounds, and all hit counters are automatically cleaned up when players disconnect.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 351
src/main/java/me/thunderstrike/ThunderStrike.java
package me.thunderstrike;

import me.thunderstrike.commands.GiveCommand;
import me.thunderstrike.listeners.ChestplateListener;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class ThunderStrike extends JavaPlugin {

    private final Map<UUID, Map<UUID, Integer>> hitCounter = new HashMap<>();

    @Override
    public void onEnable() {
        saveDefaultConfig();

        getCommand("thunderstrike").setExecutor(new GiveCommand(this));
        getServer().getPluginManager().registerEvents(new ChestplateListener(this), this);

        getLogger().info("ThunderStrike has been enabled!");
    }

    @Override
    public void onDisable() {
        hitCounter.clear();
        getLogger().info("ThunderStrike has been disabled!");
    }

    public int getHitCount(UUID attacker, UUID target) {
        return hitCounter.getOrDefault(attacker, new HashMap<>()).getOrDefault(target, 0);
    }

    public void incrementHitCount(UUID attacker, UUID target) {
        hitCounter.computeIfAbsent(attacker, k -> new HashMap<>())
                  .merge(target, 1, Integer::sum);
    }

    public void resetHitCount(UUID attacker, UUID target) {
        Map<UUID, Integer> attackerMap = hitCounter.get(attacker);
        if (attackerMap != null) {
            attackerMap.remove(target);
            if (attackerMap.isEmpty()) {
                hitCounter.remove(attacker);
            }
        }
    }

    public void resetAllHitsFor(UUID player) {
        hitCounter.remove(player);
    }
}