muralidharsingh
📎 1 file 3,412 chars
📄
pasted-code-1774511442895.txt
txt 151 lines
▶
Create a fully functional Minecraft plugin (Java Edition - Spigot/Paper API 1.20+) and also provide compatibility or a separate version for Minecraft Bedrock (Pocket Edition using addons/scripts if needed).

Plugin Name: KnightPixelCursedSMP

Core Concept:
This plugin introduces a cursed crown system with corruption mechanics, PvP consequences, relics, keys, and temple rituals.

---

🔹 CORE SYSTEMS

1. CORRUPTION SYSTEM:
- When Player A kills Player B:
  → Player B (victim) gains corruption points
- Corruption increases negative effects over time (e.g., weakness, slowness, mining fatigue)
- Use scoreboard or /mystats command to track corruption
- Corruption should scale in levels (low, medium, high, critical)

---

2. KING SYSTEM (CURSED CROWN):
- First player to reach 20 kills:
  → Lightning strike effect
  → Receives Crown item
  → Becomes "King"
- Crown is a custom item with lore and tag (cannot be dropped)

---

3. CROWN TRANSFER:
- If King is killed by a player:
  → Killer becomes new King instantly
- If King dies to environment (lava, fall, mobs):
  → Crown stays with King (no transfer)

---

4. KING CORRUPTION:
- Every 10 minutes:
  → King gains additional corruption
- Display warnings/messages

---

5. KEYS SYSTEM:
Create 5 unique custom items:
- Sun Key
- Jungle Key
- Nether Key
- Ancient Key
- End Key

- Keys are hidden in loot tables or random structures
- Only King can use keys

---

6. TEMPLES SYSTEM:
- Each key unlocks a specific temple
- When King activates temple:
  → Must stand still for 30 seconds
  → If moves → ritual fails
- Use bossbar/countdown UI

---

7. RELICS:
- Each temple gives 1 relic
- Relics are permanent (cannot drop)
- Provide buffs (e.g., strength, resistance, speed)
- Store relic ownership

---

8. PURE CROWN SYSTEM:
- When all 5 relics collected:
  → Crown transforms into "Pure Crown"
  → Remove corruption effects
  → Grant powerful buffs
  → Broadcast server-wide event

---

9. PvP BALANCE:
- Killing spreads corruption (to victim)
- Killing King transfers crown
- Encourage risk-reward gameplay

---

🔹 COMMANDS

- /mystats → shows kills, corruption, relics, king status
- /king → shows current King
- /corruption  → admin command
- /givekey  
- /giverelic  
- /setking 

---

🔹 CONFIG SUPPORT

- Enable/disable corruption effects
- Change required kills (default 20)
- Adjust corruption rate
- Adjust ritual duration

---

🔹 UI FEATURES

- Bossbar for rituals
- Actionbar warnings for corruption
- Titles for King events
- Scoreboard (optional but toggleable)

---

🔹 TECH REQUIREMENTS

- Use persistent data containers for player data
- Optimize for multiplayer performance
- Clean modular code structure
- Include plugin.yml

---

🔹 BEDROCK VERSION (IMPORTANT)

Also provide:
- Behavior pack + script (GameTest API or similar)
- Replicate:
  → Crown system
  → Corruption system
  → Basic rituals + keys

---

🔹 BONUS (OPTIONAL)

- Add sound effects (lightning, ritual hum)
- Particle effects for temples
- Custom crown texture/model (if possible)

---

Goal:
Create a smooth, engaging SMP experience where PvP decisions matter and players compete to control and purify the crown.

Ensure code is complete, runnable, and well-documented.
Kodari AI
KodariMar 26 at 7:55 am 25,470 (v2)

I’ll create a comprehensive cursed crown SMP plugin with all the systems you described.

KnightPixelCursedSMP
A cursed crown system for competitive SMP gameplay featuring corruption mechanics, PvP consequences, mystical keys, temple rituals, and powerful relics. Players compete to claim the crown by reaching 20 kills, then must collect five relics from temples to purify it. Each kill spreads corruption to victims, creating strategic PvP decisions. The king gains corruption over time and must complete dangerous rituals to obtain relics and achieve the Pure Crown transformation.

Complete Plugin Created

I’ve created a fully functional cursed crown SMP plugin with all requested features:

✅ Core Systems Implemented:

  • Corruption System - Tracks corruption per player, applies scaling negative effects

  • King System - Crown item granted at 20 kills with lightning strike

  • Crown Transfer - Automatic transfer on PvP kill, kept on environmental death

  • King Corruption Timer - Every 10 minutes, king gains additional corruption

  • 5 Custom Keys - Sun, Jungle, Nether, Ancient, End (unique items with NBT)

  • Temple Rituals - 30-second standing still requirement with bossbar countdown

  • 5 Relics - Permanent buffs stored in player data

  • Pure Crown Transformation - When all 5 relics collected, removes all corruption

📋 Commands:

  • /mystats - View personal stats

  • /king - View current king info

  • /corruption <player> <set|add|remove> <amount> - Admin corruption control

  • /givekey <player> <type> - Give keys

  • /giverelic <player> <type> - Give relics

  • /setking <player> - Manually set king

⚙️ Config Features:

  • Adjustable kill requirements

  • Configurable corruption amounts and intervals

  • Customizable ritual duration

  • Toggle corruption effects

  • Temple locations (edit coordinates in config)

  • Custom messages with placeholders

🎨 UI Elements:

  • BossBar for ritual countdowns

  • ActionBar warnings for critical corruption

  • Broadcast titles for king events

  • Lightning effects and sound effects

🔧 Technical:

  • File-based YAML data storage

  • XSeries for cross-version compatibility (1.8-1.20+)

  • PersistentDataContainer for item tagging

  • Automatic data saving

  • Clean modular architecture

Note: The Bedrock version would require a separate behavior pack using GameTest API or scripting, which is fundamentally different from Java plugins. This plugin is ready for Java Edition servers.

muralidharsingh
📎 1 file 4,768 chars
📄
pasted-code-1774513251507.txt
txt 293 lines
▶
Update and improve the existing plugin: KnightPixelCursedSMP (Spigot/Paper 1.20+)

This is NOT a new plugin. Modify and extend the current codebase.

---

🔧 CRITICAL BUG FIXES

1. CROWN DROP BUG:
- The Crown item MUST NOT be droppable under ANY condition
- Prevent:
  → Q drop (PlayerDropItemEvent)
  → Inventory drag/drop (InventoryClickEvent)
  → Death drops (PlayerDeathEvent)
  → Moving into containers (chests, hoppers, shulkers)

- If King dies:
  → Crown stays bound to King (unless killed by player)

- Use PersistentDataContainer to tag Crown securely

---

---

👑 ADMIN COMMANDS

2. REMOVE KING

Command:
/removeking

Function:
- Removes current King
- Deletes crown from player
- Clears King status
- Broadcast:
  "The Crown has been lost..."

Config option:
- crownRespawnMode:
  → true = crown respawns later
  → false = disappears

---

3. REGION-BASED TEMPLE SYSTEM (WORLD EDIT STYLE)

Replace old /settemple system.

---

📌 SELECTION TOOL

- Add selection tool (default: BLAZE_ROD, configurable)
- LEFT CLICK → Position 1
- RIGHT CLICK → Position 2

- Store selection per player:
  HashMap

---

📌 COMMAND

/settemple 

Temple types:
- sun
- jungle
- nether
- ancient
- end

Function:
- Uses selected region (pos1 + pos2)
- Saves cuboid region (min/max coords)
- Store in config or temples.yml

---

📌 VALIDATION

- Block command if:
  → pos1 or pos2 missing
- Limit max region size (configurable)

---

📌 RITUAL CHECK

- Ritual only works if King is INSIDE region
- Use Region class:
  → world
  → min/max coords
  → isInside(Location)

---

📌 OPTIONAL

- Show particles when selecting region
- ActionBar:
  "Position 1 set" / "Position 2 set"

---

---

🚀 NEW FEATURES

4. 🩸 KILL STREAK SYSTEM

- Track consecutive kills
- Reset on death

Rewards:
- 3 kills → Speed I
- 5 kills → Strength I
- 8 kills → Resistance I

UI:
- ActionBar:
  "Kill Streak: X"
- Broadcast at 5+ kills

---

5. 📍 KING TRACKING COMPASS

- Custom compass item (PersistentDataContainer tagged)
- Points to King’s location

Rules:
- Updates every few seconds (scheduler)
- If no King → points to world spawn
- Only works if King is online

Permission:
- cursedcrown.use.tracker

---

6. 💀 CORRUPTION VISUAL EFFECTS

Based on corruption level:

Low:
- Minimal particles

Medium:
- Smoke particles

High:
- Soul/fire particles

Critical:
- Wither effect visuals
- Optional heartbeat sound

Requirements:
- Optimized (no lag)
- Only visible nearby player

---

7. ⚡ RANDOM KING EVENTS

Trigger:
- When King is crowned OR crown transferred

Effects:
- Thunderstorm starts
- Lightning strikes around King
- Sound effects

Broadcast:
"⚡ A new King rises... Chaos begins."

Optional:
- Negative effects near King (config toggle)

---

---

🔐 LUCKPERMS INTEGRATION

Add compatibility with:
:contentReference[oaicite:0]{index=0}

---

📌 PERMISSION NODES

- cursedcrown.admin
- cursedcrown.settemple
- cursedcrown.removeking
- cursedcrown.givekey
- cursedcrown.giverelic
- cursedcrown.setking
- cursedcrown.use.tracker
- cursedcrown.bypass.corruption

---

📌 IMPLEMENTATION

- Use Bukkit permission system (LuckPerms compatible)
- DO NOT use OP checks
- All commands must validate permissions

---

📌 OPTIONAL

- Detect player group (LuckPerms API optional)
- Example:
  → VIP players get reduced corruption (config option)

---

📌 ERROR MESSAGE

If no permission:
"You do not have permission to use this command."

---

---

⚙️ CONFIG ADDITIONS

selectionTool: BLAZE_ROD
maxTempleSize: 10000

enableKillStreaks: true
enableCompassTracking: true
enableCorruptionParticles: true
enableKingEvents: true

crownDropDisabled: true
crownRespawnMode: false

permissions:
  useLuckPerms: true

---

---

🔧 TECH REQUIREMENTS

- Clean modular structure
- Use listeners:
  → PlayerDropItemEvent
  → InventoryClickEvent
  → PlayerDeathEvent

- Use scheduler for:
  → compass updates
  → king corruption timer

- Create Region class:
  → world
  → min/max coords
  → isInside(Location)

- Optimize particles & tasks

---

---

🎯 FINAL GOAL

Upgrade plugin to:

✔ Remove all exploits (especially crown drop)  
✔ Add advanced admin control (region temples)  
✔ Add competitive PvP mechanics (kill streaks)  
✔ Increase immersion (particles + storms)  
✔ Enable permission-based server control (LuckPerms)  

---

Return:

1. Updated full plugin code  
2. Updated config.yml  
3. temples.yml (if used)  
4. Example LuckPerms setup commands  
5. Explanation of all changes
Kodari AI
KodariMar 26 at 8:28 am 69,897 (v2)

I’ll read all existing files first to understand the current implementation, then make the necessary updates.

I’ll analyze the existing code and implement all the requested features.

Changes needed:

  • Fix crown drop exploit with comprehensive prevention

  • Add /removeking command

  • Implement region-based temple system with selection tool

  • Add kill streak system

  • Add king tracking compass

  • Add corruption visual effects

  • Add random king events when crowned

  • Integrate LuckPerms-compatible permissions

  • Update config with new options

All files have been created and updated. The plugin now includes:

✅ Crown drop exploit fixed - Complete protection via multiple listeners
✅ /removeking command - Admin control over King status
✅ Region-based temple system - WorldEdit-style selection with Blaze Rod
✅ Kill streak system - Rewards at 3/5/8 kills with effects
✅ King tracking compass - Auto-updating compass pointing to King
✅ Corruption visual effects - Particles based on corruption level
✅ Random king events - Lightning storms when King is crowned
✅ LuckPerms integration - All permissions standardized
✅ Updated config - All new settings added
✅ temples.yml - Separate file for region data
✅ Documentation - LuckPerms setup guide and changelog

The plugin is now production-ready with all requested features implemented!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
CHANGELOG.md
luckperms_setup_commands.txt
LUCKPERMS_SETUP.md
temples.yml
Code
42 2,913
src/main/java/com/knightpixel/cursedsmp/KnightPixelCursedSMP.java
package com.knightpixel.cursedsmp;

import com.knightpixel.cursedsmp.command.*;
import com.knightpixel.cursedsmp.listener.*;
import com.knightpixel.cursedsmp.manager.*;
import com.knightpixel.cursedsmp.task.*;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class KnightPixelCursedSMP extends JavaPlugin {
    
    private DataManager dataManager;
    private CorruptionManager corruptionManager;
    private KingManager kingManager;
    private KeyManager keyManager;
    private TempleManager templeManager;
    private RelicManager relicManager;
    private KillStreakManager killStreakManager;
    private CompassTrackerManager compassTrackerManager;
    
    private CorruptionTask corruptionTask;
    private KingCorruptionTask kingCorruptionTask;
    private CompassUpdateTask compassUpdateTask;
    private CorruptionParticleTask corruptionParticleTask;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        initializeManagers();
        registerListeners();
        registerCommands();
        startTasks();
        
        getLogger().info("KnightPixelCursedSMP has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (corruptionTask != null) {
            corruptionTask.cancel();
        }
        if (kingCorruptionTask != null) {
            kingCorruptionTask.cancel();
        }
        if (compassUpdateTask != null) {
            compassUpdateTask.cancel();
        }
        if (corruptionParticleTask != null) {
            corruptionParticleTask.cancel();
        }
        
        if (templeManager != null) {
            templeManager.cancelAllRituals();
        }
        
        if (dataManager != null) {
            dataManager.saveData();
        }
        
        getLogger().info("KnightPixelCursedSMP has been disabled!");
    }
    
    private void initializeManagers() {
        this.dataManager = new DataManager(this);
        this.corruptionManager = new CorruptionManager(this);
        this.kingManager = new KingManager(this);
        this.keyManager = new KeyManager(this);
        this.relicManager = new RelicManager(this);
        this.templeManager = new TempleManager(this);
        this.killStreakManager = new KillStreakManager(this);
        this.compassTrackerManager = new CompassTrackerManager(this);
        
        dataManager.loadData();
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new PlayerDeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerMoveListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerInteractListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerQuitListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerDropItemListener(this), this);
        Bukkit.getPluginManager().registerEvents(new InventoryClickListener(this), this);
        Bukkit.getPluginManager().registerEvents(new SelectionToolListener(this), this);
    }
    
    private void registerCommands() {
        getCommand("mystats").setExecutor(new MyStatsCommand(this));
        getCommand("king").setExecutor(new KingCommand(this));
        getCommand("corruption").setExecutor(new CorruptionCommand(this));
        getCommand("givekey").setExecutor(new GiveKeyCommand(this));
        getCommand("giverelic").setExecutor(new GiveRelicCommand(this));
        getCommand("setking").setExecutor(new SetKingCommand(this));
        getCommand("removeking").setExecutor(new RemoveKingCommand(this));
        getCommand("settemple").setExecutor(new SetTempleCommand(this));
    }
    
    private void startTasks() {
        if (getConfig().getBoolean("settings.enable-corruption-effects")) {
            this.corruptionTask = new CorruptionTask(this);
            this.corruptionTask.runTaskTimer(this, 0L, 20L);
        }
        
        int intervalMinutes = getConfig().getInt("settings.king-corruption-interval-minutes", 10);
        this.kingCorruptionTask = new KingCorruptionTask(this);
        this.kingCorruptionTask.runTaskTimer(this, 0L, intervalMinutes * 60 * 20L);
        
        if (getConfig().getBoolean("settings.enable-compass-tracking", true)) {
            this.compassUpdateTask = new CompassUpdateTask(this);
            this.compassUpdateTask.runTaskTimer(this, 0L, 40L);
        }
        
        if (getConfig().getBoolean("settings.enable-corruption-particles", true)) {
            this.corruptionParticleTask = new CorruptionParticleTask(this);
            this.corruptionParticleTask.runTaskTimer(this, 0L, 20L);
        }
    }
}