trigger_god
๐Ÿ“Ž 1 file 3,931 chars
๐Ÿ“„
pasted-code-1772635350875.txt
txt 274 lines
โ–ถ
Create a Minecraft Spigot/Paper plugin (Java) called QuestSystem with a full INVENTORY GUI quest system, admin quest creator, daily random quests, and Vault economy rewards.

Compatibility:

- Paper / Spigot 1.20+
- Java 17

Dependencies:

- Vault API (for economy rewards)

Main Player Command:
/quest

When a player runs "/quest", open a modern quest INVENTORY GUI.

Quest INVENTORY GUI:

- Inventory INVENTORY GUI titled "Quests"
- Must include:
  - Next Page button (Arrow)
  - Previous Page button (Arrow)
  - Quest History button (Book & Quill)

Each quest item shows:

- Quest Name
- Description
- Progress
- Reward money
- Click to accept quest

Players can:

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

If a player abandons a quest, their progress resets completely.

Progress Display:
Whenever a player makes progress show Action Bar message:

Progress: 35 / 100

Quest Completion:
When a quest is completed:

- Show Title message

&a&lQuest Completed

- Send chat message only to that player
- Give Vault money reward
- Play level up sound
- Optional firework

Quest rewards must be configurable inside quests.yml.

Example quests.yml:

quests:
  quest1:
    name: "Stone Breaker"
    type: BREAK
    block: STONE
    amount: 100
    reward_money: 250

Admin Commands (OP Only)

Add Quest:
/quest add

This command should guide the admin step-by-step.

Step 1:
Choose quest type:

BREAK
KILL
WALK

Step 2 depending on type:

If BREAK:
Show list of all Minecraft blocks.

Admin selects block.

If KILL:
Show list of all mobs.

Admin selects mob.

If WALK:
No selection needed.

Step 3:
Ask admin for amount.

Examples:

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

Step 4:
Ask admin for Quest Reward Money.

Example:

Enter reward amount:

Example input:
500

Step 5:
Ask admin for Quest Name.

Example:
Stone Master

Then the plugin automatically:

- Creates a new quest entry
- Assigns internal ID:

quest1
quest2
quest3

- Saves it inside quests.yml

Remove Quest:
/quest remove

This command should list all quest names.

Example:

Stone Master
Zombie Slayer
Traveler

Admin selects a quest name to remove.

The plugin removes the quest from quests.yml.

Quest File:

quests.yml must store all quests added.

Example:

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

Daily Quest System:

Every 24 hours:

- Player quest progress resets
- Plugin selects random quests from quests.yml
- Assigns them as daily quests

Example:
3 random quests per day.

Random Quest Controls:

/quest random on
โ†’ Enables daily random quests

/quest random off
โ†’ Disables random quests

Reload Command:

/quest reload

Reloads:

- config.yml
- quests.yml

Quest Tracking Events:

Use:

BlockBreakEvent โ†’ break quests
EntityDeathEvent โ†’ kill quests
PlayerMoveEvent โ†’ walk quests

Walk quests should count distance walked.

Quest History:

Completed quests move to Quest History INVENTORY GUI.

Quest History button:
Book & Quill icon.

Show:

- Completed quests
- Reward received
- Completion time

Player Data Storage:

Save player progress in:

playerdata/.yml

Example:

active_quests:
  quest1:
    progress: 55

completed:
  quest3:
    completed_at: 1714000000

Config File:

config.yml

random_quests_enabled: true
daily_quest_amount: 3

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

Files to Generate:

Provide full code including:

Main plugin class
Quest manager
Quest data system
Quest INVENTORY GUI
Quest history INVENTORY GUI
Admin quest creator system
Random quest rotation system
Vault economy integration
Event listeners
Commands

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 2:46 pm 32,083 (v2)

Iโ€™ll create a comprehensive Quest System plugin with inventory GUI, admin quest creator, daily quests, and Vault integration.

QuestSystem
A feature-rich quest system plugin with inventory GUI interface, allowing players to accept, track, and complete quests for economy rewards. Includes an interactive admin quest creator, daily random quest rotation, multi-type quest support (break blocks, kill entities, walk distance), quest history tracking, and seamless Vault economy integration with progress displays and completion effects.

Now Iโ€™ll create the complete Quest System plugin with all features.

All files created successfully! The Quest System plugin includes:

Features:

  • Fully functional inventory GUI quest menu with pagination

  • Quest history tracking with completion timestamps

  • Admin quest creator with interactive chat & GUI system

  • Daily random quest rotation (configurable)

  • Three quest types: BREAK blocks, KILL entities, WALK distance

  • Action bar progress display

  • Quest completion effects (title, chat, sound, firework)

  • Vault economy integration for rewards

  • Player data persistence (YAML)

  • Commands: /quest, /quest add, /quest remove, /quest random on/off, /quest reload

Architecture:

  • Event-driven GUI framework with button handlers

  • Proper manager separation (Quest, Data, Config, RandomQuest, Creator, GUI)

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

  • Lombok for clean code (@Getter, @Setter, @AllArgsConstructor)

  • All imports included, no Bukkit enums used directly

The plugin is ready to compile and run on Paper/Spigot 1.20+ with Java 17!

trigger_god

Quests are not showing fix

Kodari AI
KodariMar 4 at 2:55 pm 13,977 (v2)

Iโ€™ll investigate why quests are not showing by reading the relevant files.

Found the bug! The issue is in the initialization order in QuestSystem.java.

Problem: RandomQuestManager is created before questManager.loadQuests() is called. When RandomQuestManager initializes, it tries to rotate quests but there are no quests loaded yet, resulting in an empty daily quest list.

Hereโ€™s the fix:

Also need to add null filtering in the GUI to prevent crashes if quest IDs donโ€™t match:

Fixed the initialization order - quests are now loaded before the RandomQuestManager initializes, ensuring daily quests are properly populated.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
26 1,538
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.QuestCreatorChatListener;
import com.questsystem.listeners.QuestProgressListener;
import com.questsystem.managers.ConfigManager;
import com.questsystem.managers.QuestCreatorManager;
import com.questsystem.managers.QuestDataManager;
import com.questsystem.managers.QuestManager;
import com.questsystem.managers.RandomQuestManager;
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 QuestManager questManager;
    private QuestDataManager questDataManager;
    private ConfigManager configManager;
    private RandomQuestManager randomQuestManager;
    private QuestCreatorManager questCreatorManager;
    private GUIManager guiManager;
    private Economy economy;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("quests.yml", false);
        
        if (!setupEconomy()) {
            getLogger().severe("Vault not found! Disabling plugin.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        
        configManager = new ConfigManager(this);
        questManager = new QuestManager(this);
        questManager.loadQuests();
        questDataManager = new QuestDataManager(this);
        randomQuestManager = new RandomQuestManager(this);
        questCreatorManager = new QuestCreatorManager(this);
        guiManager = new GUIManager();
        
        randomQuestManager.startRotationTask();
        
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new QuestProgressListener(this), this);
        Bukkit.getPluginManager().registerEvents(new QuestCreatorChatListener(this), this);
        
        getCommand("quest").setExecutor(new QuestCommand(this));
        
        getLogger().info("QuestSystem has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (questDataManager != null) {
            Bukkit.getOnlinePlayers().forEach(player -> 
                questDataManager.savePlayerData(player.getUniqueId())
            );
        }
        getLogger().info("QuestSystem has been disabled!");
    }
    
    private boolean setupEconomy() {
        if (getServer().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;
    }
}