pixelmctitan
📎 1 file 8,233 chars
📄
pasted-code-1779421277559.txt
txt 118 lines
▶
[22-05-2026 09:10 AM] Yash: A comprehensive, highly detailed, production-ready technical specification for a Spigot/Paper Minecraft plugin tailored for "Red Moon SMP". 
Target Environment: Latest Minecraft Version (Java).

==========================================================================================
PLUGIN NAME: Red Moon SMP - Core Mechanics & Clan Abilities (Module 2 - Deep Specification)
==========================================================================================

[GENERAL SYSTEM ARCHITECTURE]
- Persistent Storage: Must read/write from 'config.yml' or a dedicated 'players.yml' data file instantly when data changes.
- Performance Guard: Environmental checks (like sunlight exposure) must NOT run on the main server thread for every tick. Use a BukkitRunnable asynchronous task running every 20 ticks (1 second) to minimize server TPS impact.
- Dependency Cleanliness: Rely strictly on the latest Paper/Spigot API methodologies.

==========================================================================================
1. TIME-OF-DAY LOGIC & ENVIRONMENTAL CHECK ENGINE (UNDER THE HOOD)
==========================================================================================
The plugin must implement a repeating scheduler (1-second intervals) that scans all online players and checks their assigned clan and environment:

- Daytime Definition: World time between 0 and 12000 ticks.
- Nighttime Definition: World time between 13000 and 23000 ticks.
- Sunlight Exposure Logic (Strict Check):
  * A player is considered "Exposed to Sun" ONLY if:
    1. The world time is Daytime.
    2. The player's current X, Z coordinate has a clear view of the sky (world.getHighestBlockYAt(x, z) <= player.getLocation().getY()).
    3. The player is not under a solid block or transparent roof that blocks sunlight.
    4. The weather in that world is not raining or thundering.

==========================================================================================
2. VAMPIRE CLAN: DEEP MECHANICS, BUFFS, DEBUFFS & ABILITIES
==========================================================================================
- PASSIVE STATE (DAYTIME):
  * Trigger: When "Exposed to Sun" is TRUE.
  * Effect 1 (Visual/Audio): Play a smoking particle effect (Particle.SMOKE) at the player's head location every 1 second.
  * Effect 2 (Damage): Inflict 2.0 damage (1 Heart) directly to the player's health pool every 2 seconds. This damage must bypass regular armor reduction unless the player wears a specific designated "Sun-Shield" armor piece defined in config.
  * Effect 3 (Potion Debuffs): Apply PotionEffectType.SLOW (Level 1) and PotionEffectType.WEAKNESS (Level 1) with an infinite duration, refreshing every second while exposed.

- PASSIVE STATE (NIGHTTIME):
  * Trigger: Automatically when world time enters Nighttime.
  * Effect 1: Apply permanent PotionEffectType.NIGHT_VISION (Level 1).
  * Effect 2: Apply permanent PotionEffectType.SPEED (Level 1) and PotionEffectType.INCREASE_DAMAGE (Strength 1).
  * Effect 3: Remove all daytime debuffs and stop sun damage immediately.

- ACTIVE ABILITIES (WITH CODE LOGIC):
  1. Blood Drain (Trigger: Left-Click on an Entity while holding a specific trigger item or via hotkey/command):
     * Target: Any LivingEntity within a 3.5-block raycast line of sight.
     * Action: Instantly subtract 6.0 damage (3 Hearts) from the target entity. Simultaneously, add 6.0 health (3 Hearts) to the Vampire's current health bar (capped at max health).
     * Visual: Spawn Particle.REDSTONE (Colored red) running in a line from the target to the Vampire.
     * Cooldown: 45 seconds (Tracked via UUID in a HashMap).

  2. Bat Form / Dash (Trigger: Double-tap Spacebar or Right-Click with an empty hand while sneaking):
     * Action: Calculate the player's direction vector, multiply it by 2.5 (configurable), and apply it to the player's velocity Vector (player.setVelocity(vector)).
[22-05-2026 09:10 AM] Yash: * Visual: Spawn Particle.SQUID_INK or black particles at the launch site and play Sound.ENTITY_BAT_TAKEOFF.
     * Fall Damage Protection: Give the player immunity to fall damage for the next 5 seconds following this dash.
     * Cooldown: 30 seconds.

==========================================================================================
3. WEREWOLF CLAN: DEEP MECHANICS, BUFFS, DEBUFFS & ABILITIES
==========================================================================================
- PASSIVE STATE (DAYTIME):
  * Status: Standard Vanilla Human. No buffs, no debuffs. Regular status bars.

- PASSIVE STATE (NIGHTTIME):
  * Trigger: Automatically when world time enters Nighttime.
  * Effect 1: Apply permanent PotionEffectType.SPEED (Level 2), PotionEffectType.JUMP (Level 2), and PotionEffectType.DAMAGE_RESISTANCE (Level 1).
  * Effect 2 (Weapon Mastery): Intercept EntityDamageByEntityEvent. If the damager is a Werewolf holding an AXE or using BARE HANDS, multiply the final damage output by 1.5x.

- ACTIVE ABILITIES (WITH CODE LOGIC):
  1. Alpha Roar (Trigger: Right-Click while holding an empty hand and looking upward):
     * Action: Locate all LivingEntities within a bounding box of 7 blocks around the Werewolf.
     * If the entity is an Enemy/Vampire: Apply PotionEffectType.SLOW (Level 2) and PotionEffectType.CONFUSION (Nausea) for 5 seconds.
     * If the entity is a fellow Werewolf ally: Apply PotionEffectType.INCREASE_DAMAGE (Strength 2) for 8 seconds.
     * Visual/Audio: Play Sound.ENTITY_WOLF_HOWL at max volume and pitch 0.8, and spawn Particle.CRIT radiating outward in a circle.
     * Cooldown: 60 seconds.

  2. Rupture / Leap (Trigger: Left-Click while holding a Golden Axe or Custom Item):
     * Action: Launch the player upward and forward by modifying their velocity vector (Y-axis velocity increased by 1.5, directional vector by 1.8).
     * Visual: Spawn Particle.EXPLOSION_NORMAL at the feet of the Werewolf.
     * Fall Damage Immunity: Explicitly store the player's UUID in a "LeapFallProtection" HashSet. Listen to EntityDamageEvent (DamageCause.FALL), cancel the damage if the UUID is present, and immediately remove them from the HashSet.
     * Cooldown: 20 seconds.

==========================================================================================
ADMIN MANDATORY OVERRIDES & TESTING INFRASTRUCTURE
==========================================================================================
Crucial Rule: Any player with 'redmoon.admin' or active 'Bypass Mode' must bypass ALL restrictions, cooldowns, and clan conditions across both Survival and Creative modes.

Commands to Implement:
1. /redmoon core settime 
   - Changes the world time via world.setTime() to easily swap and test passive logic cycles instantly.
2. /redmoon core toggledebuff 
   - Temporarily toggles a metadata tag on the player ("redmoon_debuff_disabled"). If true, the environmental scheduler completely skips applying sun damage or debuffs to this user.
3. /redmoon core forceability   
   - Directly executes the underlying method for an ability (e.g., Blood Drain, Alpha Roar) targeting the specified player, bypassing HashMap cooldown checks entirely.
4. /redmoon core status 
   - Returns a formatted chat log containing: Clan Type, Current World Time, Exposure to Sun (True/False), Active Potion Modifiers, and active Cooldown timers down to the millisecond.

==========================================================================================
CONFIG.YML DEFAULT TEMPLATE STRUCTURE REQUIRED
==========================================================================================
The plugin must generate a default config with the following keys:
`yaml
config-version: 1.0
[22-05-2026 09:10 AM] Yash: settings:
  sun-damage-amount: 2.0
  sun-damage-interval-seconds: 2
vampire:
  abilities:
    blood-drain:
      cooldown: 45
      damage: 6.0
    bat-dash:
      cooldown: 30
      multiplier: 2.5
werewolf:
  abilities:
    alpha-roar:
      cooldown: 60
      radius: 7.0
    rupture-leap:
      cooldown: 20
Kodari AI
KodariMay 22 at 3:44 am 15,415 (v2)

I’ll create a comprehensive Red Moon SMP plugin with vampire and werewolf clan systems featuring time-based mechanics, abilities, and environmental checks.

RedMoonSMP
A clan-based survival plugin featuring Vampire and Werewolf mechanics with dynamic day/night cycles. Vampires suffer sun damage during daytime but gain night buffs and Blood Drain/Bat Dash abilities. Werewolves transform at night with enhanced strength and Alpha Roar/Rupture Leap powers. Includes async environmental checking, persistent data storage, configurable values, and admin testing commands for complete server customization.

Plan

  • Core architecture: Async environment checker, clan manager, data persistence

  • Vampire mechanics: Sun damage/debuffs (day), night buffs, Blood Drain + Bat Dash abilities

  • Werewolf mechanics: Standard (day), enhanced stats + damage (night), Alpha Roar + Rupture Leap abilities

  • Admin tools: Time control, debuff toggles, force abilities, status checking

  • Config-driven: All values customizable


Complete!

Created a full RedMoonSMP plugin with:

✅ Vampire Clan: Sun damage (2 HP/2s when exposed), daytime debuffs (Slow/Weakness), nighttime buffs (Night Vision/Speed/Strength), Blood Drain (6 damage heal 6 HP, 3.5 block range, 45s CD), Bat Dash (2.5x velocity boost + 5s fall protection, 30s CD)

✅ Werewolf Clan: Normal during day, nighttime buffs (Speed II/Jump II/Resistance), 1.5x damage with axes/fists at night, Alpha Roar (7 block radius: enemies get Slow II + Nausea 5s, allies get Strength II 8s, 60s CD), Rupture Leap (jump + fall protection, 20s CD)

✅ Environment System: Async checker (20 tick intervals), strict sunlight detection (clear sky, daytime, above highest block, not stormy)

✅ Admin Commands: /redmoon setclan, settime, toggledebuff, forceability, status, reload - full testing suite

✅ Data Persistence: players.yml auto-saves clan assignments

✅ Config-Driven: All damage values, cooldowns, durations, ranges customizable in config.yml

All abilities use XSeries for cross-version compatibility, damage listeners handle fall protection + werewolf bonus damage, cooldown system tracks UUID-based ability timers.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
18 1,182
src/main/java/com/redmoonsmp/RedMoonSMP.java
package com.redmoonsmp;

import com.redmoonsmp.clan.ClanManager;
import com.redmoonsmp.command.RedMoonCommand;
import com.redmoonsmp.data.PlayerDataManager;
import com.redmoonsmp.environment.EnvironmentChecker;
import com.redmoonsmp.listener.DamageListener;
import com.redmoonsmp.listener.InteractListener;
import com.redmoonsmp.listener.PlayerJoinListener;
import com.redmoonsmp.util.CooldownManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class RedMoonSMP extends JavaPlugin {
    private ClanManager clanManager;
    private PlayerDataManager dataManager;
    private CooldownManager cooldownManager;
    private EnvironmentChecker environmentChecker;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.cooldownManager = new CooldownManager();
        this.dataManager = new PlayerDataManager(this);
        this.clanManager = new ClanManager(this);
        this.environmentChecker = new EnvironmentChecker(this);
        
        dataManager.loadAllPlayers();
        
        Bukkit.getPluginManager().registerEvents(new DamageListener(this), this);
        Bukkit.getPluginManager().registerEvents(new InteractListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        
        getCommand("redmoon").setExecutor(new RedMoonCommand(this));
        
        environmentChecker.start();
        
        getLogger().info("RedMoonSMP enabled successfully!");
    }
    
    @Override
    public void onDisable() {
        if (environmentChecker != null) {
            environmentChecker.stop();
        }
        
        if (dataManager != null) {
            dataManager.saveAllPlayers();
        }
        
        getLogger().info("RedMoonSMP disabled successfully!");
    }
}