triggersgodr2
📎 1 file 4,693 chars
📄
pasted-code-1772636938082.txt
txt 384 lines
▶
Create a Minecraft Spigot/Paper plugin (Java) called QuestSystem with a full INVENTORY GUI quest system, admin quest creator, daily quests, Vault rewards, and auto-generated quests.

Compatibility:

- Paper / Spigot 1.20+
- Java 17

Dependencies:

- Vault API (for economy rewards)

---

MAIN PLAYER COMMAND

/quest

Running "/quest" must open the quest INVENTORY GUI immediately.
It must NOT show the player's name or text menu. It must always open the inventory INVENTORY GUI.

---

QUEST INVENTORY GUI

The quest menu must use exactly 4 rows (36 slots).

INVENTORY GUI Layout Rules:

- Total slots: 36
- Only the first 4 rows are used for quests.
- Quests are placed from slot 0 → slot 35 in order.
- The INVENTORY GUI size must be configurable in config.yml.

Example:

config.yml

INVENTORY GUI:
  rows: 4

Quest items should automatically fill:

slot 0
slot 1
slot 2
...
slot 35

If there are more quests than the page size, use pagination.

Navigation Buttons:

- Next Page → Arrow
- Previous Page → Arrow
- Quest History → Book & Quill

---

QUEST INVENTORY GUI ITEM DISPLAY

Each quest item must show:

Name:
Quest Name

Lore:
Type: BREAK / KILL / WALK
Progress: 25 / 100
Reward: $5000
Click to accept

---

QUEST SYSTEM

Players can:

- Accept quests
- Track progress
- Complete quests
- Claim rewards
- Abandon quests

Abandon command:
/quest abandon

Abandoning resets progress.

---

PROGRESS DISPLAY

When a player makes progress show ActionBar text:

Progress: 24 / 100

---

QUEST COMPLETION

When a quest completes:

Show Title:

&a&lQuest Completed

Send message only to that player:

You earned $5000

Give money using Vault economy.

Also:

- Play level up sound
- Optional firework

---

QUEST TYPES

Supported quest types:

BREAK
KILL
WALK

Events used:

BlockBreakEvent
EntityDeathEvent
PlayerMoveEvent

Walk quest counts distance walked in blocks.

---

ADMIN COMMANDS (OP ONLY)

Add Quest:

/quest add

Command flow:

Step 1:
Choose type:

BREAK
KILL
WALK

Step 2:

If BREAK:
Show list of all Minecraft blocks.

If KILL:
Show list of all mobs.

If WALK:
Skip selection.

Step 3:
Enter amount.

Examples:

Break how many blocks?
Kill how many mobs?
Walk how many blocks?

Step 4:
Enter quest reward money.

Example:
5000

Step 5:
Enter quest name.

Example:
Stone Master

Quest saved automatically to quests.yml.

---

REMOVE QUEST

/quest remove

This command must list all quest names (not IDs).

Example:

Stone Master
Zombie Slayer
Traveler

Admin selects the quest name to remove.

---

QUEST FILE

quests.yml stores all quests.

Example:

quests:
  quest1:
    name: "Stone Master"
    type: BREAK
    block: STONE
    amount: 100
    reward_money: 5000

---

AUTO QUEST GENERATION

Plugin must be able to auto generate quests.

Command:

/quest generate

This generates 100 new quests automatically.

Quest generation rules:

Types randomly chosen:

- BREAK
- KILL
- WALK

Random amounts depending on quest type.

Reward range:
$5000 → $50000

Examples generated:

Break 500 stone
Kill 50 zombies
Walk 2000 blocks

Quest names should be auto generated like:

Stone Breaker I
Stone Breaker II
Zombie Hunter I
Traveler I

Generated quests must automatically be saved to quests.yml.

Running "/quest generate" again must create more quests without deleting existing ones.

---

DAILY QUEST SYSTEM

Every 24 hours:

Player quests reset.

Plugin randomly selects quests from quests.yml.

Example:

config.yml

daily_quest_amount: 3

3 quests are selected randomly each day.

---

RANDOM QUEST CONTROL

/quest random on
Enable daily random quests

/quest random off
Disable daily quests

---

RELOAD COMMAND

/quest reload

Reloads:

config.yml
quests.yml

---

QUEST HISTORY

Quest History button:
Book & Quill.

Shows:

Completed quests
Reward received
Completion time

---

PLAYER DATA STORAGE

Save player progress in:

playerdata/.yml

Example:

active_quests:
  quest1:
    progress: 42

completed:
  quest3:
    completed_at: 1714000000

---

CONFIG FILE

config.yml example:

INVENTORY GUI:
  rows: 4

daily_quest_amount: 3

random_quests_enabled: true

reward_range:
  min: 5000
  max: 50000

messages:
  quest_completed_title: "&a&lQuest Completed"
  progress: "&eProgress: {progress}/{goal}"

---

FILES TO GENERATE

Provide full code for:

Main plugin class
Quest manager
Quest generator system
Quest INVENTORY GUI system
Quest history INVENTORY GUI
Admin quest creator
Daily quest system
Vault economy integration
Event listeners
Command handlers

Also generate:

plugin.yml
config.yml
quests.yml

plugin.yml example:

name: QuestSystem
version: 1.0
main: your.package.QuestSystem
api-version: 1.20

commands:
  quest:
    description: Quest command
Kodari AI
KodariMar 4 at 3:13 pm 28,473 (v2)

I’ll create a comprehensive quest system plugin with inventory GUI, admin quest creator, daily quests, Vault rewards, and auto-generation.

QuestSystem
A complete quest management system featuring an inventory GUI for quest browsing, admin tools for quest creation, automatic quest generation, and daily quest rotation. Players can accept, track, and complete BREAK, KILL, and WALK quests with Vault economy rewards. Includes progress tracking with ActionBar updates, quest history, pagination support, and configurable quest limits.

Now I’ll create the complete quest system with all required features.

Complete quest system created with all requested features:

Features Implemented:

  • ✅ Inventory GUI with pagination (4 rows, configurable)

  • ✅ Quest types: BREAK, KILL, WALK with progress tracking

  • ✅ Admin quest creator with interactive flow

  • ✅ Quest auto-generation (100 quests with random types, amounts, rewards)

  • ✅ Daily quest rotation system

  • ✅ Quest history GUI

  • ✅ Vault economy integration for rewards

  • ✅ ActionBar progress updates

  • ✅ Title on quest completion + sound + optional firework

  • ✅ /quest opens GUI immediately

  • ✅ /quest abandon abandons active quest

  • ✅ /quest add starts quest creator

  • ✅ /quest remove lists quests to remove

  • ✅ /quest generate creates 100 quests

  • ✅ /quest random on/off toggles daily quests

  • ✅ /quest reload reloads configs

  • ✅ Player data persistence in playerdata/<uuid>.yml

All files created with XSeries for cross-version compatibility, Lombok for cleaner code, and proper Vault economy integration.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
22 1,815
src/main/java/com/questsystem/QuestSystem.java
package com.questsystem;

import com.questsystem.commands.QuestCommand;
import com.questsystem.inventory.gui.GUIListener;
import com.questsystem.inventory.gui.GUIManager;
import com.questsystem.listeners.QuestProgressListener;
import com.questsystem.managers.ConfigManager;
import com.questsystem.managers.DailyQuestManager;
import com.questsystem.managers.PlayerDataManager;
import com.questsystem.managers.QuestGeneratorManager;
import com.questsystem.managers.QuestManager;
import lombok.Getter;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class QuestSystem extends JavaPlugin {
    private Economy economy;
    private ConfigManager configManager;
    private QuestManager questManager;
    private PlayerDataManager playerDataManager;
    private GUIManager guiManager;
    private QuestGeneratorManager generatorManager;
    private DailyQuestManager dailyQuestManager;

    @Override
    public void onEnable() {
        if (!setupEconomy()) {
            getLogger().severe("Vault economy provider not found! Disabling plugin.");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        this.configManager = new ConfigManager(this);
        this.questManager = new QuestManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.guiManager = new GUIManager();
        this.generatorManager = new QuestGeneratorManager(this);
        this.dailyQuestManager = new DailyQuestManager(this);

        getCommand("quest").setExecutor(new QuestCommand(this));

        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new QuestProgressListener(this), this);

        this.dailyQuestManager.startDailyRotation();

        getLogger().info("QuestSystem has been enabled!");
    }

    @Override
    public void onDisable() {
        if (this.dailyQuestManager != null) {
            this.dailyQuestManager.stopDailyRotation();
        }
        if (this.playerDataManager != null) {
            this.playerDataManager.saveAllData();
        }
        getLogger().info("QuestSystem has been disabled!");
    }

    private boolean setupEconomy() {
        if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
            return false;
        }
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
            return false;
        }
        economy = rsp.getProvider();
        return economy != null;
    }

    public void reload() {
        this.configManager.reload();
        this.questManager.loadQuests();
        this.dailyQuestManager.stopDailyRotation();
        this.dailyQuestManager.startDailyRotation();
    }
}