Spile Playz
📎 1 file 12,950 chars
📄
pasted-code-1788079654916.txt
txt 589 lines
▶
You are an expert Minecraft Paper plugin developer.

Create a complete production-ready Minecraft plugin called "BruhDailyKeys" for my Minecraft server.

SERVER:
- Server: Bruhmunity
- Minecraft server software: Paper
- Paper version: 26.2
- Java: 25
- The server uses Phoenix Crates Lite for crate keys.
- I initially considered using the Quests plugin, but I want this system to be STANDALONE. Do not require Quests.

IMPORTANT:
I want the final result to be a COMPLETE BUILDABLE PLUGIN PROJECT, not pseudocode, partial code, or examples.

Generate every required file:
- build.gradle.kts
- settings.gradle.kts
- plugin.yml
- config.yml
- all Java source files
- README.md
- any required data/storage classes
- any required GUI classes
- any required listeners/managers/utilities

The project must compile successfully against Paper 26.2 / Java 25.

==================================================
CORE SYSTEM
==================================================

There are 3 crate-key tiers:

1. COMMON KEY
2. EPIC KEY
3. MYTHICAL KEY

Phoenix Crates Lite should handle the actual crate keys.

The plugin should execute Phoenix Crates commands from the server console.

Default commands:

Common:
crates giveKey common %player% 1

Epic:
crates giveKey epic %player% 1

Mythical:
crates giveKey mythical %player% 1

Make all commands configurable in config.yml.

==================================================
1. COMMON DAILY KEY
==================================================

When a player joins the server:

- Check whether the player has received their Common Key within the last 24 hours.
- If they have not, immediately give them 1 Common Key.
- Start a 24-hour cooldown.
- If they join again before 24 hours, do NOT give another key.
- Store the cooldown persistently so restarting the server does not reset it.

The Common Key should NOT require a quest.

Add configurable options:

common:
  enabled: true
  cooldown-hours: 24
  reward-command: "crates giveKey common %player% 1"

Allow configurable messages.

==================================================
2. EPIC DAILY QUEST
==================================================

Every player should have ONE active Epic quest per daily cycle.

The Epic quest should be randomly selected from a configurable pool.

Epic quests should generally take approximately 1 hour for an average player.

Examples:

- Mine 100 Logs
- Mine 100 Cobblestone
- Mine 100 Stone
- Kill 100 Zombies
- Kill 100 Skeletons
- Kill 100 Spiders
- Kill 100 Creepers
- Kill 100 easy mobs
- Catch 50 fish
- Harvest 100 crops

The quest pool must be configurable.

Example:

epic:
  enabled: true
  reward-command: "crates giveKey epic %player% 1"

  quests:
    mine_logs:
      display: "Mine 100 Logs"
      type: BLOCK_BREAK
      amount: 100
      blocks:
        - OAK_LOG
        - SPRUCE_LOG
        - BIRCH_LOG
        - JUNGLE_LOG
        - ACACIA_LOG
        - DARK_OAK_LOG
        - MANGROVE_LOG
        - CHERRY_LOG

    mine_cobblestone:
      display: "Mine 100 Cobblestone"
      type: BLOCK_BREAK
      amount: 100
      blocks:
        - COBBLESTONE

    kill_zombies:
      display: "Kill 100 Zombies"
      type: KILL
      amount: 100
      entities:
        - ZOMBIE

    fish:
      display: "Catch 50 Fish"
      type: FISH
      amount: 50

When the player completes the Epic quest:

- Give exactly 1 Epic Key.
- Mark the Epic quest as completed.
- Do not allow the same player to claim another Epic reward during that daily cycle.
- Save completion persistently.

==================================================
3. MYTHICAL DAILY QUEST
==================================================

Every player should have ONE active Mythical quest per daily cycle.

Randomly select one Mythical quest from a configurable pool.

Mythical quests should generally take approximately 3 hours for an average player.

Examples:

- Kill 100 difficult mobs
- Kill 100 Endermen
- Kill 100 Blazes
- Kill 100 Wither Skeletons
- Catch 100 fish
- Mine 200 Deepslate
- Kill 100 difficult enemies
- Complete other configurable difficult objectives

Example:

mythical:
  enabled: true
  reward-command: "crates giveKey mythical %player% 1"

  quests:
    kill_difficult:
      display: "Kill 100 Difficult Mobs"
      type: KILL
      amount: 100
      entities:
        - ENDERMAN
        - BLAZE
        - WITCH
        - WITHER_SKELETON

    kill_endermen:
      display: "Kill 100 Endermen"
      type: KILL
      amount: 100
      entities:
        - ENDERMAN

    fish:
      display: "Catch 100 Fish"
      type: FISH
      amount: 100

When completed:

- Give exactly 1 Mythical Key.
- Mark it completed.
- Do not allow another Mythical reward during the same daily cycle.
- Save everything persistently.

==================================================
DAILY RANDOMIZATION
==================================================

Create a configurable daily reset time.

Default:

00:00 server time.

At the daily reset:

- Every player gets a new random Epic quest.
- Every player gets a new random Mythical quest.
- Epic progress resets.
- Mythical progress resets.
- Completion status resets.

IMPORTANT:
The random quest should be selected PER PLAYER, not globally.

For example:

Player A:
Epic = Mine 100 Logs

Player B:
Epic = Kill 100 Zombies

Player C:
Epic = Mine 100 Cobblestone

This should be randomized independently.

Players who are offline during reset should receive their new quests when they next join.

Do NOT reset progress simply because the server restarts.

Use a date/cycle identifier rather than relying only on timers.

==================================================
QUEST PROGRESS
==================================================

Track progress persistently.

Supported objective types should include at minimum:

- BLOCK_BREAK
- KILL
- FISH

Structure the code so additional types can easily be added later.

For BLOCK_BREAK:

- Only count blocks listed in the quest configuration.

For KILL:

- Only count entities listed in the quest configuration.

For FISH:

- Count successfully caught fish, not merely casting the fishing rod.

Prevent obvious abuse where appropriate.

Do not count invalid/unrelated actions.

==================================================
PLAYER DATA
==================================================

Persist:

- UUID
- Common key last-reward timestamp
- Current daily cycle
- Current Epic quest ID
- Epic progress
- Epic completion
- Current Mythical quest ID
- Mythical progress
- Mythical completion

Use a reliable persistent storage system.

A simple YAML/JSON data file is acceptable if implemented safely.

Do not lose player progress after server restart.

Avoid saving to disk on every single block break if that would cause excessive disk I/O.

Use safe periodic saves and save important state changes appropriately.

==================================================
PLAYER COMMAND
==================================================

Create:

/dailyquests

Aliases:

/dq
/daily

It should display the player's current:

COMMON
EPIC
MYTHICAL

information.

Example:

================================
        DAILY QUESTS
================================

COMMON
✓ Daily Common Key received
Next reward: 18h 32m

EPIC
Mine 100 Cobblestone
Progress: 63 / 100
Reward: 1 Epic Key

MYTHICAL
Kill 100 Endermen
Progress: 27 / 100
Reward: 1 Mythical Key

Next daily reset: 7h 14m

================================

Use configurable colors/messages.

==================================================
ADMIN COMMANDS
==================================================

Create:

/dailyquests reload
/dailyquests reset 
/dailyquests reroll  epic
/dailyquests reroll  mythical
/dailyquests status 

Permission:

bruhdailykeys.admin

Commands must have proper permission checks and useful error messages.

"reload" should reload config.yml safely.

"reset" should reset the player's daily quest data.

"reroll" should give that player a new random quest for the specified tier.

==================================================
COMPLETION BEHAVIOR
==================================================

When Epic reaches the required amount:

Send:

&b&lEPIC QUEST COMPLETE &8» &fYou received &b1 Epic Key&f!

Then execute:

crates giveKey epic PLAYER 1

When Mythical reaches the required amount:

Send:

&5&lMYTHICAL QUEST COMPLETE &8» &fYou received &51 Mythical Key&f!

Then execute:

crates giveKey mythical PLAYER 1

Make sure rewards cannot be duplicated due to:

- server restart
- reconnecting
- event firing multiple times
- race conditions
- rapidly completing objectives

Set the completion state BEFORE or atomically with reward handling where appropriate.

==================================================
COMMON KEY MESSAGE
==================================================

When a player receives the daily Common Key:

&a&lDAILY REWARD &8» &fYou received &a1 Common Key&f!

==================================================
CONFIGURATION
==================================================

Make as much as possible configurable:

- reward commands
- cooldown
- daily reset time
- quest amounts
- quest names
- quest descriptions
- materials
- entities
- messages
- sounds
- whether announcements are enabled
- whether progress messages are enabled

Use sensible defaults.

==================================================
OPTIONAL GUI
==================================================

If practical, implement:

/dailyquests

as an inventory GUI.

GUI should show:

- Common Key status
- Epic quest
- Epic progress
- Mythical quest
- Mythical progress
- completion status
- time until reset

However, functionality is more important than GUI.

If a GUI is implemented, make it configurable and make sure it does not interfere with normal inventory behavior.

==================================================
ANTI-ABUSE
==================================================

Prevent players from easily abusing the system.

Examples:

- Don't count blocks broken by plugins if possible.
- Don't count invalid entity kills.
- Don't reward more than once.
- Don't allow duplicate completion after reconnect.
- Don't allow a completed quest to continue rewarding.
- Don't reset progress accidentally.
- Avoid counting fake/invalid fishing events.

Do not make the anti-abuse system so aggressive that legitimate gameplay stops counting.

==================================================
CODE QUALITY
==================================================

Use clean architecture.

Prefer separate classes such as:

BruhDailyKeys
QuestManager
Quest
QuestType
PlayerData
PlayerDataManager
QuestListener
CommonRewardManager
CommandManager
ConfigManager
RewardManager

Use enums where appropriate.

Use Bukkit/Paper APIs correctly.

Use Adventure/MiniMessage or another modern Paper-compatible message system where appropriate.

Do not use deprecated APIs unless absolutely necessary.

Add comments for complicated logic.

Handle plugin disable safely.

Save all data before shutdown.

==================================================
PHOENIX CRATES
==================================================

Do NOT require Phoenix Crates as a hard Java dependency.

Simply execute the configured reward command through the server console.

This means the plugin remains compatible if Phoenix Crates Lite is updated.

If Phoenix Crates is not installed, log a clear warning when attempting to issue a reward instead of crashing the plugin.

==================================================
BUILD
==================================================

The project must compile with:

Paper 26.2
Java 25
Gradle

Use:

api-version: '26.2'

The final project should produce:

BruhDailyKeys-1.0.0.jar

==================================================
README
==================================================

Include complete installation instructions:

1. Install Java 25.
2. Build with Gradle.
3. Locate the JAR in build/libs.
4. Put JAR into plugins/.
5. Restart Paper.
6. Configure config.yml.
7. Make sure Phoenix Crates Lite is installed.
8. Test the reward commands.
9. Use /dailyquests.

Also document every configuration option and every command.

==================================================
FINAL REQUIREMENT
==================================================

Do not give me pseudocode.

Do not omit classes.

Do not say "implement this yourself."

Produce the COMPLETE source code for every file required to build the plugin.

Before giving the final answer, mentally check for:
- compilation errors
- missing imports
- incorrect Paper API usage
- incorrect plugin.yml
- incorrect Gradle configuration
- null handling
- duplicate rewards
- persistence problems
- daily reset problems
- player reconnect problems
- quest randomization problems
- Phoenix Crates command execution

The final result should be a real, buildable Paper 26.2 plugin project called BruhDailyKeys.
Kodari AI
KodariAug 30 at 8:59 am 3
BruhDailyKeys
A standalone Paper plugin providing daily crate key rewards and quests with three tiers. Players receive a Common key every 24 hours, plus randomly assigned Epic and Mythical quests that reset daily. The plugin tracks progress for block breaking, mob killing, and fishing objectives, awarding keys upon completion. Features persistent player data storage, configurable quest pools, daily reset scheduling, and a GUI displaying quest status. Includes admin commands for reloading, resetting, and rerolling quests. Integrates with Phoenix Crates Lite through configurable console commands.
  1. Create the Gradle/Paper project metadata and default configuration.

  2. Add quest models, YAML persistence, reward execution, and daily-cycle management.

  3. Add event listeners and the /dailyquests player/admin command.

  4. Add installation and configuration documentation.

Created the complete BruhDailyKeys Paper plugin project.

Included:

  • Gradle Kotlin build targeting Paper 26.2 and Java 25

  • plugin.yml and fully configurable config.yml

  • Persistent YAML player data storage with safe atomic saves

  • Common 24-hour key rewards

  • Per-player randomized Epic and Mythical daily quests

  • BLOCK_BREAK, KILL, and FISH objectives

  • Daily cycle handling with configurable reset time

  • Duplicate-reward protection

  • Phoenix Crates console command integration

  • /dailyquests, /dq, and /daily

  • Admin commands:

    • /dailyquests reload

    • /dailyquests reset <player>

    • /dailyquests reroll <player> <epic|mythical>

    • /dailyquests status <player>

  • Configurable messages, sounds, progress notifications, quest pools, and reward commands

  • Complete README with setup and configuration documentation

Build with:

Shell
gradle build

Output:

Plain Text
build/libs/BruhDailyKeys-1.0.0.jar
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle.kts
README.md
settings.gradle.kts
Code
17 1,380
src/main/java/com/bruhmunity/dailykeys/BruhDailyKeys.java
package com.bruhmunity.dailykeys;

import com.bruhmunity.dailykeys.command.DailyQuestsCommand;
import com.bruhmunity.dailykeys.config.ConfigManager;
import com.bruhmunity.dailykeys.data.PlayerDataManager;
import com.bruhmunity.dailykeys.listener.QuestListener;
import com.bruhmunity.dailykeys.quest.QuestManager;
import com.bruhmunity.dailykeys.reward.RewardManager;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public class BruhDailyKeys extends JavaPlugin {
    private ConfigManager configManager;
    private PlayerDataManager playerDataManager;
    private QuestManager questManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        configManager = new ConfigManager(this);
        playerDataManager = new PlayerDataManager(this);
        RewardManager rewardManager = new RewardManager(this, configManager);
        questManager = new QuestManager(this, configManager, playerDataManager, rewardManager);

        Bukkit.getPluginManager().registerEvents(new QuestListener(questManager), this);

        DailyQuestsCommand commandExecutor = new DailyQuestsCommand(this, configManager, questManager);
        PluginCommand command = getCommand("dailyquests");
        if (command != null) {
            command.setExecutor(commandExecutor);
            command.setTabCompleter(commandExecutor);
        } else {
            getLogger().severe("The dailyquests command is missing from plugin.yml.");
        }

        Bukkit.getScheduler().runTaskTimer(this, playerDataManager::saveIfDirty, 600L, 600L);
        getLogger().info("BruhDailyKeys enabled.");
    }

    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveNow();
        }
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public QuestManager getQuestManager() {
        return questManager;
    }
}