actualbuca
📎 1 file 1,388 chars
📄
pasted-code-1779772182963.txt
txt 2 lines
▶
Make me an on plugin papermc 1.21.11 which functions as a Crates plugin like AdvancedCrates, It must have configurable opening animations if the crate is put on randomised, It must also have configurable effects and users must be able to change if the server is put on Randomised Rewards, this makes the rewards of an crate randomised and will show a opening animation in the UI and the Selective Rewards allows players who have an key for this crate to select a reward out of the crate. There must also be command support which you can configure in /crates editor, as example if you press on Add command while configuring a reward, it will ask you to type the command in chat without the / and to select the player to receive it he must send something like eco give %player% 1000 to give the player 1000 money upon winning the reward from the crate. /crates editor must have all the configurable settings for each crate, Crate creation, Key creations and all that just like AdvancedCrates does. For keys, you can configure if the key is virtual or physical. The difference between these 2 are that physical keys are an item and a virtual key is displayed in a configurable hologram above the crate with a placeholder being %crazycrates_keyname% and this will show the amount of keys the player has of that key.
It must have all the features from phoenixcrates aswell and excellentcrates.
Kodari AI
KodariMay 26 at 5:14 am 28,852 (v2)

I’ll create a comprehensive crates plugin with all the features you requested - randomised/selective modes, configurable animations, virtual/physical keys, hologram support, and a full GUI editor.

CrazyCrates
Advanced crates plugin with randomised and selective reward modes, configurable opening animations, virtual and physical key systems, hologram displays, command rewards with placeholders, and a complete in-game GUI editor. Features include crate creation, key management, particle effects, and a comprehensive reward configuration system similar to PhoenixCrates and ExcellentCrates.

I’ve created a comprehensive CrazyCrates plugin with all the features you requested:

✅ Core Features Implemented:

  1. Two Opening Modes:

    • Randomised: CS:GO-style spinning animation with random rewards

    • Selective: Player chooses their reward from a menu

  2. Key System:

    • Virtual Keys: Tracked per-player, displayed in holograms with placeholders

    • Physical Keys: Actual items in inventory with glow effects

  3. Hologram Support:

    • Displays above crates

    • Shows virtual key count with %crazycrates_[crate_id]_keys% placeholder

    • PlaceholderAPI integration ready

  4. Complete GUI System:

    • /crates - Main menu to view and open crates

    • /crates editor - Full configuration GUI

    • Crate management, reward configuration

    • Preview system for all crates

  5. Command Rewards:

    • Supports commands with %player% placeholder

    • Example: eco give %player% 1000

    • Broadcast messages for rare rewards

  6. Configurable Animations:

    • CSGO, ROULETTE, WHEEL, INSTANT types

    • Adjustable duration and effects

    • Sound effects during opening

  7. Particle Effects:

    • Configurable per-crate

    • Runs continuously around crate blocks

  8. Admin Commands:

    • /key give <player> <crate> <amount> - Give keys

    • /key preview <crate> - Preview rewards

    • /crates reload - Reload configuration

🎮 Usage:

  1. Place a chest (or configured block) to create a crate location

  2. Configure crates in crates/example.yml

  3. Give keys: /key give Player example 5

  4. Right-click crates to open them

  5. Use /crates editor for in-game configuration

The plugin uses Maven as requested, XSeries for cross-version compatibility, and follows all modern Minecraft development practices!

actualbuca

Also make it so I can do /crates givekeyall example for keyalls

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
37 2,497
src/main/java/com/crazycrates/CrazyCrates.java
package com.crazycrates;

import com.crazycrates.commands.CratesCommand;
import com.crazycrates.commands.KeyCommand;
import com.crazycrates.config.ConfigManager;
import com.crazycrates.hologram.HologramManager;
import com.crazycrates.inventory.gui.GUIListener;
import com.crazycrates.inventory.gui.GUIManager;
import com.crazycrates.listener.CrateInteractListener;
import com.crazycrates.listener.PlayerJoinListener;
import com.crazycrates.manager.CrateManager;
import com.crazycrates.manager.KeyManager;
import com.crazycrates.manager.RewardManager;
import com.crazycrates.storage.PlayerDataStorage;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CrazyCrates extends JavaPlugin {
    
    private ConfigManager configManager;
    private CrateManager crateManager;
    private KeyManager keyManager;
    private RewardManager rewardManager;
    private GUIManager guiManager;
    private HologramManager hologramManager;
    private PlayerDataStorage playerDataStorage;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.configManager.loadConfig();
        
        this.playerDataStorage = new PlayerDataStorage(this);
        this.playerDataStorage.load();
        
        this.crateManager = new CrateManager(this);
        this.crateManager.loadCrates();
        
        this.keyManager = new KeyManager(this);
        this.rewardManager = new RewardManager(this);
        this.guiManager = new GUIManager();
        this.hologramManager = new HologramManager(this);
        
        registerCommands();
        registerListeners();
        
        this.hologramManager.spawnAllHolograms();
        
        getLogger().info("CrazyCrates has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (hologramManager != null) {
            hologramManager.removeAllHolograms();
        }
        
        if (playerDataStorage != null) {
            playerDataStorage.save();
        }
        
        getLogger().info("CrazyCrates has been disabled!");
    }
    
    private void registerCommands() {
        getCommand("crates").setExecutor(new CratesCommand(this));
        getCommand("key").setExecutor(new KeyCommand(this));
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new CrateInteractListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
    }
    
    public void reload() {
        configManager.loadConfig();
        
        hologramManager.removeAllHolograms();
        crateManager.loadCrates();
        hologramManager.spawnAllHolograms();
        
        playerDataStorage.load();
    }
}