ZS SIYAM
📎 1 file 3,531 chars
📄
pasted-code-1794651930386.txt
txt 29 lines
▶
Act as an expert Minecraft Spigot/Paper plugin developer. Write the complete, production-ready Java source code, plugin.yml, config.yml, and pom.xml for a custom Minecraft plugin named BloodMoon targeting Paper/Spigot 1.20.4 - 1.21+ (Java 17/21).

### Core Requirements & Dependencies
- Soft-Dependencies: Hook into LifeStealZ or LifestealCore via their APIs (or fallback gracefully to modifying the player's max health attribute directly if neither API is detected, while checking that at least one of them is installed on startup).
- Auto-Trigger Condition: Monitor online player counts. When the server reaches 30 or more online players, automatically start the Blood Moon event (include a configurable cooldown in config.yml so it does not spam-trigger if players join/leave around 30).
- Time & Weather Lock: When the Blood Moon starts, automatically set the world time to midnight (18000 ticks), lock the daylight cycle (doDaylightCycle = false), and optionally trigger thunder/storm weather until the event ends. Restore normal time and daylight cycle when the event finishes.

### Gameplay Mechanics & Features
1. 2-Heart Lifesteal Drop: During the Blood Moon, whenever a player kills another player:
   - The victim loses 2 hearts (4.0 HP) instead of the default 1 heart.
   - The victim drops a physical Heart Item (or the killer directly gains 2 hearts, configurable in config.yml). Hook directly into LifeStealZ/LifestealCore's heart-drop/health logic so it syncs with their database and elimination/ban system.
2. 2x Mob Damage & Buffs: All hostile mobs deal 2x damage (event.getDamage() * 2.0) to players during the event. Additionally, give hostile mobs subtle red particle effects (DUST / REDSTONE particles) and a chance to spawn with increased speed or strength.
3. Blood Moon Loot & XP Boost: Mobs killed by players during the Blood Moon drop 2x Experience and have a configurable chance to drop bonus rewards (e.g., Golden Apples, Diamonds, or custom commands).
4. Atmospheric Immersion:
   - Display a crimson BossBar at the top of the screen showing the remaining Blood Moon timer.
   - Send a dramatic Title & Subtitle alert (&4&lBLOOD MOON RISING) with a global sound effect (ENTITY_WITHER_SPAWN or ENTITY_ENDER_DRAGON_GROWL) when the event begins and ends.
   - Apply ambient sound cues or subtle visual effects to players every few minutes.
5. Combat Tag & Anti-Abuse: Prevent players from logging out to avoid losing 2 hearts (apply an instant death/heart penalty on combat-log during the event) and prevent heart-farming from the same IP/player within a short cooldown.

### Commands & Permissions
- /bloodmoon start — Force-start the Blood Moon event (bloodmoon.admin).
- /bloodmoon stop — Force-stop the active Blood Moon event (bloodmoon.admin).
- /bloodmoon status — Check if a Blood Moon is active, time remaining, and players needed to trigger (bloodmoon.use).
- /bloodmoon reload — Reload config.yml (bloodmoon.admin).

### Output Instructions
- Provide clean, modular, well-commented Java classes (BloodMoonPlugin.java, EventManager.java, CombatListener.java, MobListener.java, BloodMoonCommand.java, and a LifestealHook.java interface supporting both LifeStealZ and LifestealCore).
- Include the full config.yml with every value customizable (player threshold, event duration, cooldown, mob damage multiplier, heart drop amount, worlds enabled, messages, and sounds).
- Include the plugin.yml, pom.xml, and exact terminal commands to build the .jar file using Maven.
Kodari AI
KodariNov 14 at 10:29 am 9
BloodMoon
BloodMoon is a Spigot/Paper plugin that triggers a dramatic survival event when 30+ players are online. It locks time to midnight, enables stormy weather, doubles mob damage with red particle effects, boosts XP and loot drops, and implements a 2-heart lifesteal system on player kills. Features a crimson BossBar timer, dramatic titles and sounds, combat logging penalties, and anti-farming cooldowns. Includes commands to start, stop, check status, and reload the event, with full config customization and soft-dependency hooks for LifeStealZ or LifestealCore APIs.
  • Build the event, world-state restoration, combat protections, mob effects, commands, and configuration.

  • Use a direct-health fallback only when neither Lifesteal plugin is present; verified API adapters are needed before safely changing their stored hearts.

Created BloodMoon with event controls, world restoration, mob buffs and rewards, combat tagging, and configurable messages.

Lifesteal integration remains incomplete: verified LifeStealZ and LifestealCore API documentation wasn’t available. If either plugin is installed, Blood Moon heart changes are disabled to avoid corrupting its data. Without either plugin, direct max-health fallback is used.

To build the jar in Kodari, click Compile in the top bar, then Compile in the window. Once it succeeds, click Download.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
9 534
src/main/java/com/kodari/bloodmoon/BloodMoonPlugin.java
package com.kodari.bloodmoon;

import org.bukkit.ChatColor;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
import java.io.IOException;

public final class BloodMoonPlugin extends JavaPlugin {
    private EventManager events;
    private LifestealHook lifesteal;
    private File stateFile;
    private YamlConfiguration state;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        stateFile = new File(getDataFolder(), "state.yml");
        state = YamlConfiguration.loadConfiguration(stateFile);
        lifesteal = LifestealHook.create(this);
        events = new EventManager(this);
        events.recover();
        getServer().getPluginManager().registerEvents(new CombatListener(this, events, lifesteal), this);
        getServer().getPluginManager().registerEvents(new MobListener(this, events), this);
        BloodMoonCommand command = new BloodMoonCommand(this, events);
        getCommand("bloodmoon").setExecutor(command);
        getCommand("bloodmoon").setTabCompleter(command);
        events.beginMonitor();
    }

    @Override
    public void onDisable() {
        if (events != null) events.stop(false);
    }

    public YamlConfiguration state() { return state; }
    public void saveState() {
        try { state.save(stateFile); } catch (IOException e) { getLogger().severe("Could not save state.yml: " + e.getMessage()); }
    }
    public String color(String text) { return ChatColor.translateAlternateColorCodes('&', text == null ? "" : text); }
    public String message(String key) { return color(getConfig().getString("messages.prefix", "") + getConfig().getString("messages." + key, key)); }
}