S
📎 1 file 2,018 chars
📄
pasted-code-1776257980011.txt
txt 29 lines
▶
Create a custom Spigot/Paper Minecraft plugin for version 1.21+ with the following technical specifications and commands:

COMMANDS & PERMISSIONS:
1. /vault get - Gives the Admin the special 'VAULT' block. (Permission: vault.admin)
2. /vault randomkey - Selects a random online player and gives them the 'TRIAL_KEY'. (Permission: vault.admin)
3. /vault stop - Force stops any active ritual or tracking. (Permission: vault.admin)
4. /vault settime  - Adjust the ritual duration (Default: 20). (Permission: vault.admin)

PART 1: THE VAULT & LOCKING MECHANIC
- Block: Must use the 1.21 'VAULT' block.
- Setup: When an Admin holds an item and Shift + Right-Clicks a placed Vault, that item is "stored" inside (metadata).
- Visual: Once the ritual starts, the stored item must appear as a FLOATING and SPINNING item entity 0.5 blocks above the Vault.

PART 2: THE KEY & DYNAMIC TRACKING
- Item: Use 'TRIAL_KEY' with an Enchantment Glow.
- Tracking: Automatically give a 'RECOVERY_COMPASS' to all online players (except the holder). 
- Logic: The compass must dynamically point to the 'TRIAL_KEY' holder's current X, Y, Z.
- Transition: If the holder dies, broadcast a TITLE to everyone: "§6NEW KEY HOLDER: §f{Killer}". 
- The compass must instantly update to track the new player who picked up the key.

PART 3: THE RITUAL & BOSSBAR
- Activation: Key Holder must Right-Click the Vault with the Trial Key.
- BossBar: A persistent BossBar for ALL players: "§bVault Ritual | Coords: {X} {Y} {Z} | Time: {MM:SS}".
- Continuity: If the ritual is active and the Key Holder dies, the 20-minute timer does NOT reset. The new holder must simply reach and defend the vault until the timer hits zero.

PART 4: MESSAGES & UI
- Kill Message: "§c[DEATH] §f{DeadPlayer} §7eliminated! §6{Killer} §fnow holds the Key!" (Chat + Title).
- Success: "§aThe Vault has been conquered!" (Broadcast when timer ends).
- Item Drop: After 20 minutes, the spinning item drops as a physical item on top of the Vault.
Kodari AI
KodariApr 15 at 1:03 pm 19,302 (v2)

I’ll create a comprehensive vault ritual plugin with dynamic player tracking, boss bars, and a timed ritual system.

VaultRitual
An advanced vault conquest system featuring dynamic player tracking, ritual mechanics, and PvP competition. Players compete to hold the Trial Key and complete a 20-minute ritual at a secured vault location. Features include real-time compass tracking, persistent boss bars, floating item displays, and automatic key transfer on death. Includes admin commands for vault setup, key distribution, and ritual management.

All files created! The plugin features:

  • Vault system with item storage using shift+right-click

  • Trial Key with enchantment glow and dynamic tracking

  • Compass tracking that updates every 0.5s to point at key holder

  • Floating item display using invisible armor stand with rotation

  • Boss bar showing coordinates and countdown timer

  • Death mechanics that transfer the key and update tracking

  • Admin commands for full control

  • Persistent data saving vault location between restarts

The ritual timer continues even if the key holder dies, and all tracking/UI updates automatically for the new holder.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
15 993
src/main/java/com/vaultritual/VaultRitualPlugin.java
package com.vaultritual;

import com.vaultritual.commands.VaultCommand;
import com.vaultritual.listeners.KeyListener;
import com.vaultritual.listeners.PlayerListener;
import com.vaultritual.listeners.VaultListener;
import com.vaultritual.managers.BossBarManager;
import com.vaultritual.managers.CompassManager;
import com.vaultritual.managers.KeyManager;
import com.vaultritual.managers.RitualManager;
import com.vaultritual.managers.VaultManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class VaultRitualPlugin extends JavaPlugin {
    
    private VaultManager vaultManager;
    private KeyManager keyManager;
    private RitualManager ritualManager;
    private CompassManager compassManager;
    private BossBarManager bossBarManager;
    private FileConfiguration config;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        this.config = getConfig();
        
        this.vaultManager = new VaultManager(this);
        this.keyManager = new KeyManager(this);
        this.bossBarManager = new BossBarManager(this);
        this.compassManager = new CompassManager(this);
        this.ritualManager = new RitualManager(this);
        
        this.vaultManager.loadData();
        
        getCommand("vault").setExecutor(new VaultCommand(this));
        
        Bukkit.getPluginManager().registerEvents(new VaultListener(this), this);
        Bukkit.getPluginManager().registerEvents(new KeyListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
        
        getLogger().info("VaultRitual has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (ritualManager.isActive()) {
            ritualManager.stopRitual();
        }
        vaultManager.saveData();
        getLogger().info("VaultRitual has been disabled!");
    }
    
    public String getMessage(String path) {
        return config.getString("messages." + path, "&cMessage not found: " + path)
                .replace("&", "§");
    }
}