📄
pasted-code-1791997049020.txt
txt
640 lines
▶
# ZENO TOWN — Complete Minecraft Skill Progression Plugin (v2)
## Project Overview
Develop a complete, production-ready Minecraft server plugin called **ZenoSkills** for my server, **ZENO TOWN**.
The server is a peaceful Survival SMP focused on building, exploration, trading, community activities, and long-term progression. PvP is almost nonexistent and must never be required for players to progress.
The plugin's main purpose is to make ordinary Minecraft gameplay rewarding. Players gain experience in individual skills, level up, unlock cosmetic rewards, complete achievements, finish **daily, weekly, and monthly quests that track and complete automatically**, discover rare items, and build a permanent reputation in the community.
This must be a fully functional plugin, not a concept, prototype, or collection of mockup commands.
**What changed in v2:** Section 7 now defines Daily, Weekly, and Monthly quests with fully automatic progress tracking, automatic completion detection, and tiered rewards. Sections 10, 11, 12, 13, 14, 15, and 16 were updated to match.
---
## 1. Technical Requirements
- Target Paper Minecraft servers. Make the target Minecraft version configurable based on the server's actual version.
- Use Java and Maven with a clean, maintainable project structure.
- Use a compatible, stable API and avoid unnecessary dependencies.
- Store player data persistently using SQLite by default, with an architecture that can support MySQL/MariaDB later.
- Save player data safely and efficiently, with asynchronous database operations where appropriate.
- Include a complete `plugin.yml`, configuration files, permissions, commands, tab completion, and installation instructions.
- Support online and offline player statistics where practical.
- Never block the main server thread with slow database operations.
- Handle player disconnects, server restarts, invalid data, and database failures safely.
- Keep all player-facing messages configurable and support color codes and MiniMessage formatting.
- Do not depend on external paid services or proprietary APIs.
Before coding, inspect the existing project and identify its Minecraft version, Java version, dependencies, and build system. Adapt the implementation to the actual environment rather than assuming an incompatible setup.
**Build environment check:** Before writing code, confirm that Maven (or Gradle) is installed and that the Paper API dependency can actually be downloaded. If it cannot, say so plainly, tell me exactly what is missing, and do not claim the plugin compiles. Write the code anyway if I ask, and mark it as uncompiled and untested.
---
## 2. The Eight Skill Systems
Each player has eight independent skills, each with its own XP, level, progression bar, milestones, and statistics.
### Builder
Reward meaningful construction projects, verified build challenges, and approved community building contributions.
Rewards:
- Builder titles.
- Building-themed cosmetics.
- Decorative reward unlocks.
- Architect, Decorator, and Engineer mastery paths.
Do not award unlimited XP for placing and breaking the same blocks or for repeatedly manipulating a tiny area.
Vanilla Minecraft does not inherently know whether a build is beautiful or meaningful. Use configurable challenge objectives, reviewed submissions, and legitimate construction milestones instead of pretending that build quality can be determined automatically.
### Miner
Reward mining ores, discovering caves, completing mining objectives, and finding rare underground locations.
Rewards:
- Mining titles.
- Ore collection achievements.
- Cosmetic effects.
- Prospector, Cavern Delver, and Gem Collector mastery paths.
Apply configurable diminishing returns to repetitive actions and prevent automated XP farming.
### Farmer
Reward harvesting crops, breeding animals within reasonable limits, completing farming orders, and maintaining diverse farms.
Rewards:
- Farming titles.
- Garden decorations.
- Animal-themed cosmetics.
- Botanist, Rancher, and Harvest Master mastery paths.
Prevent unlimited XP from repeatedly harvesting or breeding through automated loops.
### Forager
Reward gathering wood, collecting flowers, finding plants, and discovering natural resources.
Rewards:
- Botanical cosmetics.
- Nature-themed titles.
- Collection achievements.
- Garden and forest decorations.
### Angler
Reward fishing, catching different fish, discovering rare catches, and completing fishing collections.
Rewards:
- Fishing trophies.
- Dock decorations.
- Angler titles.
- Rare collection achievements.
Use legitimate fishing events and configurable rarity rules. Do not award XP for artificial inventory duplication.
### Merchant
Reward legitimate player-to-player trading, completed delivery contracts, and fulfilled market orders.
Rewards:
- Merchant titles.
- Shop cosmetics.
- Market decorations.
- Trade-related achievements.
Prevent self-trading, repeated item transfers between cooperating accounts, and other obvious XP farming exploits. Do not unnecessarily punish legitimate player economies.
### Explorer
Reward visiting new locations, discovering biomes, finding structures, and completing exploration objectives.
Rewards:
- Explorer titles.
- Discovery Journal entries.
- Map and trophy cosmetics.
- Rare discovery achievements.
Avoid awarding XP repeatedly for leaving and returning to the same location.
### Artisan
Reward crafting, smelting, producing useful items, and completing crafting objectives.
Rewards:
- Workshop cosmetics.
- Artisan titles.
- Recipe-related achievements.
- Crafting collection milestones.
Use configurable action values and anti-exploit limits.
---
## 3. XP and Level Progression
Every skill must progress independently from level 1 to level 100.
Create a configurable XP formula rather than hardcoding every level.
Requirements:
- Early levels should feel rewarding.
- Midgame should offer steady progression.
- High levels should require meaningful long-term participation.
- Every skill must have its own XP and level.
- Display current XP, XP needed for the next level, and progress percentage.
- Announce level-ups to the player.
- Allow configurable level-up sounds, particles, and messages.
- Save all progress permanently.
- Do not reset levels when players die, disconnect, or take a break.
Use these milestone bands as the initial defaults:
- Levels 1–10: Beginner.
- Levels 11–25: Apprentice.
- Levels 26–50: Specialist.
- Levels 51–75: Expert.
- Levels 76–99: Master.
- Level 100: Grandmaster.
Allow administrators to configure the XP formula, milestone levels, rewards, and maximum skill level.
Do not make skill XP purchasable with real money.
---
## 4. Town Level and Overall Progression
Implement a separate overall player progression level called **Town Level**.
Town Level should reflect a balanced combination of:
- Skill progression.
- Permanent achievements.
- Exploration milestones.
- Collection completion.
- Community contributions.
- Quest completion (daily, weekly, and monthly), with caps so quests alone cannot dominate the level.
Prevent players from reaching high Town Levels by repeating one easily exploitable action.
Town Level rewards should focus on:
- Profile titles.
- Cosmetic unlocks.
- Chat prefixes where configured.
- Decorative rewards.
- Showcase features.
- Achievement recognition.
Town Level must not provide combat advantages or mandatory progression power.
---
## 5. Mastery Paths
At configurable milestones, allow players to choose a specialization for selected skills.
Examples:
Builder: Architect, Decorator, Engineer.
Miner: Prospector, Cavern Delver, Gem Collector.
Farmer: Botanist, Rancher, Harvest Master.
Requirements:
- Players must be able to view all available mastery paths before choosing.
- Each path must have configurable unlock conditions and rewards.
- Choosing a path should permanently save the choice.
- Allow administrators to configure whether and how players can change paths.
- Include a confirmation screen before changing paths.
- Mastery paths should mainly offer cosmetics, titles, collections, and small noncompetitive conveniences.
- No mastery path may be required to build, trade, or enjoy the server.
Create an extensible architecture so additional skills and mastery paths can be added through configuration or future development.
---
## 6. Achievements and Collections
Implement a persistent achievement system.
Example achievements:
- First Home: complete a beginner building milestone.
- Deep Explorer: discover a configurable number of locations.
- Master Angler: complete a fishing collection milestone.
- Market Regular: complete a configurable number of legitimate trades.
- Community Builder: contribute to an approved town project.
- Grandmaster: reach level 100 in a skill.
- Dedicated Citizen: complete a configurable number of daily, weekly, and monthly quests.
Requirements:
- Permanent achievement tracking.
- Configurable names, descriptions, icons, objectives, and rewards.
- Achievement categories.
- Completion notifications.
- A way to browse locked and unlocked achievements.
- Optional hidden achievements.
- Persistent collection progress.
- No duplicate reward claims.
Implement a Discovery Journal that tracks configurable discoveries, rare catches, collected items, and visited landmarks.
Do not generate fake discoveries or automatically complete collections when the player has not met the requirements.
---
## 7. Daily, Weekly, and Monthly Quests (Automatic)
Implement a configurable quest system with **three recurring tiers plus long-term objectives**:
- **Daily quests** — short, easy objectives that reset every day.
- **Weekly quests** — medium objectives that reset every week.
- **Monthly quests** — larger objectives that reset every month.
- Permanent achievement objectives.
- Collection objectives.
- Community contribution objectives.
- Optional event quests.
### 7.1 Automatic tracking and completion
Quests must track and complete **automatically**. Players should never have to run a command, press a button, or "accept" a quest to make progress.
- Every player is automatically assigned their current daily, weekly, and monthly quests the first time they join after a reset (or the first time they join at all).
- Progress updates automatically from real gameplay events: mining, harvesting, fishing, crafting, smelting, trading, exploring, building milestones, and community contributions.
- A quest is marked complete automatically the moment its objective is met.
- The player receives an automatic completion notification (chat message, title or action bar, sound, and optional particles, all configurable).
- Progress is saved persistently and survives disconnects, restarts, and crashes.
- Show progress through an optional boss bar, action bar, or scoreboard line (configurable per player and per server, and disableable).
- Quests are optional: players can ignore them with no penalty, and an optional config setting lets players hide quest notifications.
Quest progress must flow through the **same server-side validated event pipeline** as skill XP, so the anti-exploit rules in Section 12 apply equally. An action that is blocked, capped, or heavily diminished for XP purposes must not count toward quest progress either (for example, blocks the player placed themselves, items from automated farms where detectable, and repeated actions in a tiny area).
### 7.2 Rewards: automatic or claimed
Reward delivery must be configurable globally and per quest:
- `auto` (default): rewards are granted instantly on completion.
- `claim`: the player claims rewards from the quests GUI or `/skills rewards`.
In both modes:
- A reward can only ever be granted once per quest instance per player. Use a database-backed claimed flag and a transaction or unique constraint so duplicate events, double clicks, lag, relogs, and race conditions cannot grant it twice.
- If the player's inventory is full, do not drop items on the ground or lose them. Store the reward as pending and let the player claim it later.
- If the player is offline when a reward would be granted, store it and deliver it on next join.
- Rewards granted must be logged for administrators.
### 7.3 Tiered rewards
Rewards scale with the tier, and every value is configurable.
| Tier | Typical effort | Reset | Reward style |
|---|---|---|---|
| Daily | 5–15 minutes | Every day | Small skill XP, small Town XP, common cosmetic currency or items |
| Weekly | 1–2 hours across a week | Every week | Medium skill XP, Town XP, titles, cosmetic items |
| Monthly | Several sessions across a month | Every month | Large skill XP, Town XP, exclusive titles, rare cosmetics, decorative rewards |
Each quest may reward any combination of:
- Skill XP (to a specific skill or split across skills).
- Town XP or Town Level progress.
- Cosmetic unlocks and titles.
- Items (validated, with configurable item definitions).
- Currency, if an economy plugin is detected (Vault, optional soft dependency; skip safely if absent).
- Commands run by the server console, with placeholders, for admin-defined rewards.
**Tier completion bonuses** (all configurable, all optional):
- **Daily set bonus:** completing every assigned daily quest grants a bonus reward.
- **Weekly set bonus:** completing every assigned weekly quest grants a larger bonus.
- **Monthly set bonus:** completing every assigned monthly quest grants the largest bonus, including an exclusive monthly title or cosmetic.
- **Streak rewards (optional, gentle):** consecutive-period completion can grant small bonuses. Missing a period only resets the streak counter. It must never remove skill levels, XP, titles, or other permanent progress. Provide a configurable "streak freeze" or grace period.
Reward XP must respect configurable caps so quests cannot be the only way to reach high levels, and so quest XP does not bypass the progression curve.
### 7.4 Quest generation and rotation
- Define quest pools in `quests.yml` per tier. Each quest has an ID, name, description, tier, category, objective type, target amount, optional skill link, difficulty, weight, requirements, and rewards.
- Generate a configurable number of daily, weekly, and monthly quests from the pools at each reset (for example: 3 daily, 4 weekly, 3 monthly).
- Use weighted random selection with configurable rules: no duplicate quests in the same period, a configurable cooldown before the same quest can reappear, and a guaranteed spread across skills or categories so players are not forced into one skill.
- Selection may be **global** (everyone gets the same quests, good for community discussion) or **per-player** (each player gets their own selection), configurable per tier.
- Optionally scale targets and rewards using the player's skill levels or Town Level (configurable and disableable), so quests stay relevant to both new and veteran players.
- Support quest requirements, such as a minimum skill level or Town Level, so new players are not given impossible objectives.
- Avoid requiring excessive repetitive grinding. Provide configurable maximum target sizes and validate them at startup with warnings.
- Support objective types such as: break or mine blocks, harvest crops, breed animals, catch fish, craft items, smelt items, complete trades, discover biomes or structures, visit landmarks, contribute to community projects, reach a skill level, earn XP in a skill, and complete other quests.
Example daily quests:
- Harvest a configurable number of crops.
- Catch several fish.
- Craft a selection of useful items.
- Mine a handful of ores.
- Discover a designated landmark.
Example weekly quests:
- Complete several trades with different players.
- Visit multiple new biomes.
- Harvest and replant a diverse set of crops.
- Contribute materials to the active community project.
Example monthly quests:
- Catch a configurable number of different fish species.
- Complete a large mining objective across multiple sessions.
- Discover a set of rare structures or landmarks.
- Complete a long-running community project milestone.
### 7.5 Reset times and persistence
- Reset times are configurable in `config.yml`: timezone (default is the server-local timezone), daily reset time, weekly reset day and time, and monthly reset day and time.
- Resets must be computed from stored reset timestamps, not only from a running scheduler, so a server that was offline during a reset still performs the correct reset when it starts.
- Handle timezone changes, daylight saving, and months of different lengths correctly (including a configured reset day that does not exist in a short month).
- Resets must be idempotent: running a reset twice must not generate duplicate quests or duplicate rewards.
- On reset, unclaimed completed rewards remain claimable for a configurable grace period, then expire (or never expire if configured). Never silently discard earned rewards.
- Players currently online receive a reset notification.
- Never remove permanent skill progress because a player missed a day, week, or month.
- Store each player's quest instances (quest ID, tier, period ID, progress, completed time, claimed time) persistently, and keep a history so achievements such as "Dedicated Citizen" can count total completions.
### 7.6 Admin controls
Administrators can force a reset, regenerate a tier, add or remove a quest from the active rotation, complete a quest for a player for testing, and preview upcoming resets. See Section 10.
---
## 8. Living Town and Community Projects
Implement a community progression system for ZENO TOWN.
Administrators should be able to create community projects such as:
- The Grand Library.
- The Greenhouse.
- The Living Museum.
- The Town Hall.
- The Festival Grounds.
Each project should have:
- A configurable name and description.
- Contribution requirements.
- Progress tracking.
- Completion rewards.
- Milestone notifications.
- Optional cosmetic changes or unlockable features.
- A way for players to inspect current progress.
Contributions must be validated server-side. Prevent item duplication, repeated reward claims, and invalid contributions.
The plugin should not pretend it can automatically build a detailed structure unless a real structure-placement feature has been implemented. Community milestones may unlock configured rewards, commands, or administrative build stages.
Keep projects peaceful and cooperative. PvP must never be required.
Community project contributions can count toward weekly and monthly quest objectives (Section 7).
---
## 9. Player Profiles and Leaderboards
Create persistent player profiles containing:
- Player name and UUID.
- Town Level.
- Individual skill levels.
- Total skill XP.
- Highest skill.
- Unlocked titles.
- Mastery paths.
- Achievement completion.
- Collection progress.
- Community contributions.
- Quest statistics: total daily, weekly, and monthly quests completed, and current streaks.
Provide leaderboards for:
- Each skill.
- Town Level.
- Achievement points.
- Exploration discoveries.
- Community contributions.
- Quests completed (total, and optionally per tier).
Leaderboards should be configurable and optionally disableable.
Do not expose private account data or sensitive information.
Allow players to select an unlocked title for display. Avoid automatically replacing other plugins' chat formats or tab-list formatting unless explicitly configured.
---
## 10. Commands
Implement player commands with tab completion.
- `/skills` — Open the main skills menu.
- `/skills profile [player]` — View a player profile.
- `/skills view ` — View skill XP, level, and progression.
- `/skills top [skill|quests]` — View leaderboards.
- `/skills mastery` — View or select mastery paths.
- `/skills achievements` — Browse achievements.
- `/skills journal` — Open the Discovery Journal.
- `/skills quests [daily|weekly|monthly]` — View active quests, live progress, and time until each reset.
- `/skills rewards` — View and claim available rewards (including pending quest rewards).
- `/skills title` — Select an unlocked title.
- `/skills projects` — View community projects.
Administrative commands:
- `/zs admin reload` — Reload supported configuration files safely.
- `/zs admin info ` — Inspect player progression.
- `/zs admin xp ` — Add or remove XP using documented amount conventions.
- `/zs admin level ` — Set a skill level safely.
- `/zs admin reset [skill]` — Reset progression with explicit confirmation.
- `/zs admin quest complete ` — Complete a quest for testing or administration.
- `/zs admin quest progress ` — Set or add quest progress for testing.
- `/zs admin quest reset ` — Force a reset and regeneration of a tier (with confirmation).
- `/zs admin quest list ` — Show the current active quests, their period IDs, and next reset time.
- `/zs admin quest add|remove ` — Adjust the active rotation.
- `/zs admin project create ` — Create a community project from a configured template.
- `/zs admin debug` — Show plugin diagnostics and configuration status, including quest period IDs and next reset times.
Validate every argument, permission, amount, skill identifier, quest identifier, tier, and target player. Prevent negative values or overflow from corrupting data. Destructive operations must require confirmation.
---
## 11. GUI Design
Create clean, functional inventory GUIs that match the ZENO TOWN aesthetic.
Style:
- Dark, elegant, medieval fantasy.
- Deep purple, charcoal, and subtle cyan accents.
- Clear item names and readable descriptions.
- Consistent icons and lore.
- Minimal clutter.
- Useful back buttons and pagination.
Main menu:
- Eight skill icons.
- Town Level.
- Mastery Paths.
- Achievements.
- Discovery Journal.
- Quests.
- Rewards.
- Player profile.
**Quests menu:**
- Three tabs or buttons: Daily, Weekly, Monthly (plus Event and Long-Term when available).
- Each quest is shown as an item with its name, description, progress bar, current and target amounts, reward preview, and state: in progress, completed, reward pending, or claimed.
- Time remaining until each tier's reset.
- Tier completion bonus progress (for example, "2 of 3 dailies done — bonus on 3").
- Streak display, if enabled.
- A "Claim All" button that appears only when rewards are pending in `claim` mode, and does nothing unless there is something to claim.
- Progress updates live while the menu is open (throttled and configurable).
Each skill menu must show:
- Current level.
- Current XP.
- XP needed for the next level.
- Progress bar.
- Current milestone.
- Next reward.
- Mastery path.
- Relevant statistics.
- Active quests related to this skill.
GUI requirements:
- Handle invalid clicks safely.
- Prevent players from extracting menu items.
- Validate all interactions server-side.
- Support configurable menu items and reward icons.
- Avoid opening duplicate menus unnecessarily.
- Make every displayed action functional.
Do not use decorative buttons that do nothing. If a feature is unavailable or locked, clearly show why.
---
## 12. Anti-Exploit and Performance Requirements
The plugin must:
- Validate all XP-awarding and quest-progress actions server-side.
- Apply configurable cooldowns and diminishing returns.
- Detect repetitive low-value activity.
- Prevent duplicate rewards, including duplicate quest completion and duplicate reward claims.
- Prevent XP and quest progress multiplication from duplicated events.
- Track player-placed blocks (bounded memory or persistence, with cleanup) so placing and breaking cannot satisfy mining, foraging, or farming quests.
- Avoid trusting client-provided values.
- Avoid excessive database queries: cache active quests in memory, batch progress writes, and flush asynchronously on an interval and on logout and shutdown.
- Avoid synchronous database operations on the main thread.
- Clean up listeners and scheduled tasks on shutdown.
- Handle reloads without duplicating event listeners.
- Log important errors with enough detail to diagnose problems.
- Never silently discard player progression or earned rewards.
Do not use aggressive automated punishments based on uncertain exploit detection. Prefer limiting invalid XP and quest gains and recording diagnostic information for administrators.
---
## 13. Configuration
Provide a well-documented configuration structure with separate files where appropriate.
Include:
- `config.yml`
- `skills.yml`
- `rewards.yml`
- `quests.yml`
- `achievements.yml`
- `mastery.yml`
- `projects.yml`
- `messages.yml`
- `menus.yml`
All important values should be configurable:
- XP per action.
- Level formulas.
- Skill caps.
- Milestone rewards.
- Anti-exploit cooldowns.
- **Daily, weekly, and monthly reset times, timezone, and reset day rules.**
- **Number of quests per tier, selection mode (global or per-player), weights, cooldowns, and scaling rules.**
- **Quest pools, objectives, target amounts, and reward definitions per tier.**
- **Reward delivery mode (`auto` or `claim`), pending-reward expiry, and tier completion bonuses.**
- **Streak and grace-period settings.**
- **Quest progress display options (boss bar, action bar, scoreboard) and notification settings.**
- Reward definitions.
- GUI layouts.
- Permissions.
- Database settings.
- Debug logging.
Validate configurations during startup and display useful warnings for invalid values (for example, an unknown objective type, a target of zero, an unreachable quest requirement, or a pool with fewer quests than the configured count). Never overwrite player data when a configuration reload fails. If a quest is removed from the config while players have progress on it, keep their history and handle it gracefully.
---
## 14. Permissions
Create granular permissions for player and administrative functionality.
- `zenoskills.use`
- `zenoskills.profile`
- `zenoskills.leaderboard`
- `zenoskills.mastery`
- `zenoskills.quests`
- `zenoskills.quests.daily`
- `zenoskills.quests.weekly`
- `zenoskills.quests.monthly`
- `zenoskills.rewards`
- `zenoskills.admin.reload`
- `zenoskills.admin.xp`
- `zenoskills.admin.level`
- `zenoskills.admin.reset`
- `zenoskills.admin.quest`
- `zenoskills.admin.debug`
Use least-privilege defaults. Ordinary players must never receive administrative progression permissions.
---
## 15. Required Deliverables
Produce a complete working Maven project containing:
- All Java source files.
- `pom.xml`.
- `plugin.yml`.
- All default configuration files, including sample daily, weekly, and monthly quest pools with rewards.
- Database schema and initialization (including quest period, quest instance, pending reward, and quest history tables).
- GUI implementations.
- XP and level progression.
- All eight skills.
- Town Level.
- Mastery paths.
- Achievements and collections.
- Automatic daily, weekly, and monthly quests with rewards.
- Community projects.
- Player profiles and leaderboards.
- Permission checks.
- Error handling and logging.
- A README with build and installation instructions.
- Automated tests for XP formulas, level calculations, reward claims, persistence, and anti-exploit logic where practical. Quest tests must cover: daily, weekly, and monthly reset calculations (including offline catch-up, month-length edge cases, and daylight saving), quest generation rules, automatic progress and completion, duplicate reward prevention, pending rewards with a full inventory, and streak handling.
Build the JAR and verify that the project compiles successfully against the intended server API. Fix all compilation errors before declaring the task complete.
Do not claim that the plugin works unless it has actually been built and tested. If the build environment cannot download dependencies, state that clearly instead of reporting success.
---
## 16. Development Order
Implement the plugin in stages:
1. Inspect the environment and establish the correct server/API version and a working build.
2. Build the plugin skeleton, configuration system, database layer, and persistent player data.
3. Implement XP calculation, leveling, and all eight skills.
4. Implement anti-exploit validation and progression tests.
5. Add Town Level, rewards, and mastery paths.
6. Add achievements, collections, and the Discovery Journal.
7. Add the shared gameplay event pipeline, then daily, weekly, and monthly quests with automatic tracking, reset scheduling, and rewards.
8. Add community projects.
9. Add GUIs, profiles, leaderboards, and permissions.
10. Build, test, document, and fix the complete project.
Keep the code modular and readable. Do not put the entire plugin in one enormous Java class.
If the implementation is too large for one pass, complete a working stage at a time, preserve the existing project, and continue from the last verified stage. At the end of each stage, report what compiles, what was tested, and what is still unverified.
---
## Final Goal
Deliver a stable, polished Minecraft plugin that makes ZENO TOWN feel like a living progression-based survival world.
Players should be able to build beautiful homes, develop their favorite skills, discover rare things, complete achievements, finish daily, weekly, and monthly quests just by playing, help their community, and work toward long-term goals without being forced into PvP or repetitive grinding.
Prioritize data integrity, performance, fair progression, useful GUIs, configurability, and maintainability over unnecessary complexity.
Create the Maven/Paper project skeleton and default configuration.
Add SQLite-backed skill profiles, level progression, and guarded gameplay XP tracking.
Add automatically assigned daily/weekly/monthly quests with persistent progress and rewards.
Add player/admin commands and document the implemented scope.
Created the initial ZenoSkills Maven/Paper foundation: SQLite-backed profiles, configurable progression for all eight skills, guarded gameplay XP tracking, persistent daily/weekly/monthly quests, transactional quest XP rewards, player/admin commands, and default configuration files.
This is a staged foundation—not the complete design brief. GUIs, achievements and collections, mastery paths, leaderboards, community projects, economy/item rewards, and automated tests are still unimplemented. The project has not been built or tested, so I can’t claim it compiles successfully.
📄
pasted-code-1791999471991.txt
txt
197 lines
▶
# ZENO TOWN — ZenoSkills Add-On: Perks & Buffs
## How to use this add-on
This is an **add-on** to the main **ZenoSkills v2** prompt. Give the AI the main prompt first, then this document. Where the two conflict, this add-on wins for perks only. Everything else in the main prompt still applies: peaceful server, no PvP required, server-side validation, async database access, configurability, and the rule that nothing is claimed to work unless it was built and tested.
This add-on **replaces** the main prompt's statement that skills offer only cosmetics. Skills may now grant small, configurable **perks**. Town Level, mastery paths, and quests may also unlock or enhance perks as described below.
---
## 1. Perk Design Rules
Perks exist to make everyday gameplay feel better, not to create power over other players.
- Perks must be **peaceful and non-competitive**. No perk may increase damage dealt, reduce damage taken, grant combat effects, or give any advantage in PvP or against players.
- No perk may be required to build, trade, explore, or progress.
- Every perk is **configurable and disableable** (globally, per skill, and per perk), with every value in config.
- Every perk must have **small, capped effects**. Provide configurable maximum values so admins can keep the economy balanced.
- Perks are **off by default for risky ones** (anything that creates items or affects drops) until the admin enables them in `perks.yml`.
- Perks must work through the same server-side validated event pipeline as skill XP, and every perk trigger must obey the anti-exploit rules (see Section 6).
- Perks must never duplicate items through glitches, stack with other plugins in unsafe ways, or create items out of nothing in protected regions.
- Perks should be **compatible with common protection plugins**. Respect cancelled events and do not apply perks in areas where the player cannot build or break blocks.
- Players can **toggle individual perks on or off** for themselves (for example, disabling a visual effect they find distracting).
- Perks are **never lost** on death, disconnect, or reset of a quest period.
---
## 2. Perk Types
Implement a modular perk system with these types, so new perks can be added through config or code:
| Type | Description | Example |
|---|---|---|
| **Passive chance** | Small chance of a bonus on a validated action | 5% chance of one extra crop |
| **Passive effect** | Temporary potion-style effect in a specific context | Haste I while mining below Y=0 |
| **Convenience** | Quality-of-life feature, no extra resources | Auto-replant, larger build-wand radius |
| **Capacity** | Raises a soft limit | Extra shop slots, more market listings |
| **Cosmetic perk** | Visual or audio effects tied to a skill | Ore-vein sparkle, fishing splash trail |
Each perk definition in `perks.yml` has: ID, display name, description, icon, linked skill, perk type, unlock requirement (skill level, Town Level, mastery path, or achievement), per-level scaling, hard cap, cooldown, allowed worlds, and enabled flag.
---
## 3. Skill Perks (Defaults)
Use these as the initial defaults. All values are configurable, scale with skill level up to a cap, and unlock at configurable levels.
### Builder
- **Wider Reach (Convenience):** a small increase to the maximum range of the optional build wand.
- **Palette Unlocks (Cosmetic):** extra cosmetic block palettes and decorative items.
- **Steady Hands (Capacity):** a larger undo history for the build wand.
- No perk may place, copy, or duplicate blocks that the player does not have in their inventory (unless the admin deliberately enables a creative-style build feature).
### Miner
- **Prospector's Eye (Passive effect):** a small Haste boost while mining below a configurable depth.
- **Lucky Strike (Passive chance, off by default):** a low chance of one bonus drop from ores, using the same drop rules as vanilla and respecting Silk Touch. It must not apply to blocks the player placed.
- **Torchbearer (Convenience):** a faint personal light effect in caves (cosmetic only, configurable).
### Farmer
- **Green Thumb (Passive chance, off by default):** a low chance of one extra crop on mature harvest.
- **Auto-Replant (Convenience):** right-click a mature crop to harvest and replant in one action, consuming one seed from the drops. No extra seeds are created.
- **Animal Whisperer (Passive effect):** a small reduction in breeding cooldown, with a hard floor to prevent breeding loops.
### Forager
- **Woodcutter's Rhythm (Passive effect):** a small Haste boost while chopping logs.
- **Bountiful Branches (Passive chance, off by default):** a low chance of an extra sapling, apple, or flower from natural leaves and plants.
- **Tree Felling (Convenience, optional):** configurable limited tree felling with a maximum log count, requiring a tool with durability cost for every log removed.
### Angler
- **Quick Bite (Passive effect):** a small reduction in fishing wait time, with a floor.
- **Keen Eye (Passive chance):** a slight improvement in rare-catch weighting, configurable and capped.
- **Trophy Display (Cosmetic):** unlocks fish trophies and dock decorations.
### Merchant
- **Extra Stall (Capacity):** more shop or market listing slots, capped.
- **Haggler's Ledger (Convenience):** a personal transaction history view.
- **Shop Flair (Cosmetic):** shop sign and particle styles.
- Merchant perks must never create currency, change prices unfairly, or affect other players' transactions.
### Explorer
- **Wayfarer (Passive effect):** a short, low-level Speed boost after discovering a new biome or landmark (with cooldown).
- **Cartographer's Marks (Convenience):** personal map markers or waypoints for discovered locations, limited in number and stored per player.
- **Discovery Trophies (Cosmetic):** map and trophy cosmetics.
### Artisan
- **Material Saver (Passive chance, off by default):** a low chance of not consuming a single material when crafting selected items, with a daily cap and a blocklist for valuable or dupe-prone recipes.
- **Quick Hands (Convenience):** extra crafting shortcuts such as repeat-last-recipe, if technically supported and safe.
- **Workshop Flair (Cosmetic):** crafting effects and workshop decorations.
---
## 4. Town Level, Mastery Path, and Quest Perks
- **Town Level perks:** Town Level milestones may unlock general convenience perks such as extra home slots, extra title slots, extra profile showcase slots, and cosmetic effects. They must not grant combat power or resource generation.
- **Mastery path perks:** each mastery path (Architect, Decorator, Engineer, Prospector, Cavern Delver, Gem Collector, Botanist, Rancher, Harvest Master, and any added later) may enhance **one or two** perks of its skill or unlock a path-exclusive cosmetic or convenience perk. Choosing a path must never be mandatory, and non-path players still receive all base skill perks.
- **Quest perks (temporary):** completing daily, weekly, and monthly quests may grant a **temporary, configurable perk boost** for a limited duration instead of, or in addition to, other rewards. Examples: a daily quest grants a 30-minute boost to a skill's perk chance; a weekly quest grants a 2-hour effect; a monthly quest grants a rare cosmetic perk. Rules:
- Boosts must be small, capped, and non-stacking (a new boost refreshes the timer instead of multiplying).
- Boost timers persist across disconnects and restarts, and expire safely.
- The boost is granted automatically on quest completion (or on claim, if the quest's reward mode is `claim`), and only once per quest instance.
- Tier completion bonuses (all dailies, all weeklies, all monthlies) may grant a longer boost.
---
## 5. Perk Menu and Commands
### Player commands
- `/skills perks` — open the Perks menu.
- `/skills perks ` — view perks for a skill, with unlocked, locked, and next-unlock status.
- `/skills perks toggle ` — enable or disable one perk for yourself.
### Admin commands
- `/zs admin perk grant ` — grant a perk for testing or events.
- `/zs admin perk revoke ` — revoke a granted perk.
- `/zs admin perk boost ` — apply a temporary boost, with validation and a configurable maximum.
- `/zs admin perk list ` — list a player's perks and active boosts.
- Destructive or bulk operations require confirmation. Validate every perk ID, skill ID, duration, and target.
### Perks GUI
- Style matches the ZENO TOWN theme: dark, elegant, medieval fantasy with deep purple, charcoal, and subtle cyan accents.
- Show each perk with its icon, description, current effect value, cap, unlock requirement, and status (active, disabled by player, locked, or boosted).
- A locked perk must clearly show **why** it is locked and what unlocks it.
- Players can toggle perks directly from the menu, and every button must work.
- Show active temporary boosts with remaining time.
- Add a Perks button to the main menu and a Perks section to each skill menu.
### Permissions
- `zenoskills.perks` — use the perks menu and toggle personal perks (default: true).
- `zenoskills.admin.perk` — use the admin perk commands (default: op only).
- Ordinary players must never receive admin perk permissions.
---
## 6. Anti-Exploit and Performance Rules for Perks
- Perks must **never** trigger on blocks the player placed, items from known automated farms where detectable, or actions already blocked by diminishing returns.
- Chance-based perks use server-side randomness only, never client data, and are logged at debug level for diagnostics.
- Every item-producing perk has a **per-player cooldown and daily cap** (configurable) and a hard global limit.
- Item-producing perks never run if the event was cancelled by a protection plugin, and never drop items into protected or invalid locations.
- No perk may apply to creative-mode or spectator-mode players, and no perk applies in worlds not on the perk's allowed list.
- Potion-style perk effects must not overwrite stronger vanilla or plugin effects, and must be removed cleanly on world change, death, logout, perk toggle, or plugin disable.
- Cache each player's active perks in memory, recalculated only when their level, path, Town Level, or boosts change. Do not query the database during gameplay events.
- Persist perk toggles and boost timers asynchronously. Never block the main thread.
- Handle reloads without duplicating listeners, effects, or scheduled tasks.
- Do not punish players for uncertain exploit detection. Limit the perk, record diagnostics, and let admins review.
---
## 7. Configuration
Add `perks.yml` to the config set from the main prompt. It must contain:
- Global perk enable switch and per-skill switches.
- Every perk definition (Section 2 fields).
- Scaling formulas and caps per perk.
- Cooldowns, daily caps, allowed worlds, and blocklists (for example, recipes excluded from Material Saver).
- Quest boost durations, strengths, and refresh behavior.
- Mastery path perk enhancements.
- GUI icons and lore templates for perks (also in `menus.yml` where appropriate).
- Perk-related messages in `messages.yml`.
Validate on startup and reload with useful warnings: unknown skill or perk IDs, caps below base values, impossible unlock levels, conflicting perks, and risky settings (for example, "item-producing perk enabled with no daily cap"). A failed reload must not alter player data or remove existing perks and boosts.
Add database tables for toggled-off perks, granted perks, and active boosts, with safe migration for existing databases.
---
## 8. Tests and Deliverables
In addition to the main prompt's deliverables, include:
- `perks.yml` with all default perks above.
- Perk engine, perk listeners, boost manager, and Perks GUI.
- Updated README documenting every perk, its default values, and how to disable or tune it.
- Automated tests where practical for: perk scaling and caps, unlock requirements, chance calculation with seeded randomness, daily caps and cooldowns, boost refresh without stacking, boost expiry and persistence, player toggles, and rejection of perk triggers on player-placed blocks, cancelled events, and disallowed worlds or game modes.
Build the project and verify it compiles. Do not claim any perk works unless it was built and tested. If the build environment cannot download dependencies, say so plainly.
---
## 9. Development Order (Add-On Stages)
Apply these stages after the main prompt's skill, Town Level, mastery, and quest stages are working:
1. Build the perk definition loader, config validation, and database tables.
2. Implement the perk engine with in-memory caching, then the passive effect and convenience perks (the safest ones).
3. Implement chance-based and item-producing perks with caps, cooldowns, and protection checks.
4. Connect Town Level, mastery paths, and quest completions to perks and temporary boosts.
5. Add the Perks GUI, commands, and permissions.
6. Test, document, and fix. Report what compiles, what was tested, and what is unverified.
Keep the code modular, and do not put the perk system in one large class.
---
## Goal
Make everyday play in ZENO TOWN feel a bit smoother and more rewarding as players grow, with perks that are small, capped, optional, and fair, and that never turn the peaceful SMP into a power race.
Add perk definitions, startup validation, and database migration.
Build the cached perk engine and safe passive/convenience perks.
Add capped chance-based perks, cooldowns, and protection checks.
Connect Town Level, mastery, and quest boosts.
Add the perks GUI, commands, and permissions.
Add defaults, tests, and documentation; report build/test coverage.
Stage 1 implementation plan:
Add a structured
perks.ymlloader with validation and safe reload retention.Create persisted tables for player-disabled perks, admin grants, and timed boosts.
Seed
perks.ymlwith all 24 defaults and their unlock/scaling/cap settings.
Stage 5 plan:
Expose grant, boost, mastery, and toggle state through the perk service and async storage.
Add the
/skillshome/perks inventory screens and click handling.Register player/admin commands, tab completion, and separate permissions.
Added
perks.ymlloading and validation for all 24 definitions, with rejected reloads retaining the active perk configuration. Added safe SQLite tables for toggles, grants, boosts, mastery paths, and daily usage.Added cached perk state, mastery and Town Level unlocks, and persistent quest/admin boosts. Runtime handlers currently support Auto-Replant, Quick Bite, Lucky Strike, Green Thumb, and Bountiful Branches; the GUI marks other configured perks as not integrated rather than implying they work.
Added server-side chance rolls, placed-block and cancelled-event checks, cooldowns, per-player daily caps, and a global per-perk daily cap.
Connected quest completion/claim boosts transactionally, with non-stacking refresh behavior and expiry persistence.
Added skills and perks inventory menus, mastery selection, player toggle commands, admin perk commands, tab completion, and permissions.
Updated the README and added tests for configuration, scaling, chance rolls, limits, persistence, and transactional boost refresh.
I couldn’t run the build or tests in this session, so compilation and live-server behavior remain unverified. To verify in Kodari, click Compile in the desktop top bar, or on phone tap ⋮ → Compile Project, then click Compile in the window.
package com.zenotown.zenoskills;
import com.zenotown.zenoskills.command.AdminCommand;
import com.zenotown.zenoskills.command.SkillsCommand;
import com.zenotown.zenoskills.listener.GameplayListener;
import com.zenotown.zenoskills.gui.SkillsGuiListener;
import com.zenotown.zenoskills.model.PerkConfiguration;
import com.zenotown.zenoskills.model.MasteryConfiguration;
import com.zenotown.zenoskills.service.MasteryConfigurationLoader;
import com.zenotown.zenoskills.service.PerkConfigurationLoader;
import com.zenotown.zenoskills.service.PerkService;
import com.zenotown.zenoskills.service.ProgressionService;
import com.zenotown.zenoskills.service.QuestService;
import com.zenotown.zenoskills.storage.SqliteStorage;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
import java.util.List;
import java.util.Set;
public final class ZenoSkillsPlugin extends JavaPlugin {
private static final List<String> EXTRA_CONFIGS = List.of("skills.yml", "quests.yml", "messages.yml", "perks.yml", "rewards.yml",
"achievements.yml", "mastery.yml", "projects.yml", "menus.yml");
private FileConfiguration skillsConfig;
private FileConfiguration questsConfig;
private FileConfiguration messagesConfig;
private FileConfiguration perksFileConfig;
private FileConfiguration masteryFileConfig;
private FileConfiguration menusConfig;
private PerkConfiguration perkConfiguration;
private MasteryConfiguration masteryConfiguration;
private SqliteStorage storage;
private ProgressionService progression;
private PerkService perkService;
private QuestService questService;
@Override
public void onEnable() {
saveDefaultConfig();
for (String resource : EXTRA_CONFIGS) if (!new File(getDataFolder(), resource).exists()) saveResource(resource, false);
loadExtraConfigurations();
if (!loadPerkConfiguration()) {
getServer().getPluginManager().disablePlugin(this);
return;
}
String databaseName = getConfig().getString("database.file", "data.db");
storage = new SqliteStorage(new File(getDataFolder(), databaseName));
progression = new ProgressionService(this, storage);
perkService = new PerkService(this, storage);
questService = new QuestService(this, storage, progression);
progression.setQuestService(questService);
int markerLimit = Math.max(1, getConfig().getInt("anti-exploit.placed-block-tracking-limit", 250000));
storage.initialize().thenCompose(ignored -> storage.loadPlacedBlocks(markerLimit)).whenComplete((placedBlocks, error) -> {
if (isEnabled()) getServer().getScheduler().runTask(this, () -> finishStartup(placedBlocks, error, markerLimit));
});
}
private void finishStartup(Set<String> placedBlocks, Throwable error, int markerLimit) {
if (!isEnabled()) return;
if (error != null) {
getLogger().severe("Could not initialize SQLite storage: " + error.getMessage());
getServer().getPluginManager().disablePlugin(this);
return;
}
perkService.loadGlobalDailyUsage();
perkService.startDailyUsageRefresh();
GameplayListener listener = new GameplayListener(this, storage, placedBlocks, markerLimit);
getServer().getPluginManager().registerEvents(listener, this);
getServer().getPluginManager().registerEvents(new SkillsGuiListener(), this);
SkillsCommand skillsCommand = new SkillsCommand(this);
getCommand("skills").setExecutor(skillsCommand);
getCommand("skills").setTabCompleter(skillsCommand);
AdminCommand adminCommand = new AdminCommand(this);
getCommand("zs").setExecutor(adminCommand);
getCommand("zs").setTabCompleter(adminCommand);
for (Player player : getServer().getOnlinePlayers()) progression.load(player);
getLogger().info("ZenoSkills storage and gameplay tracking are ready.");
}
@Override
public void onDisable() {
if (progression != null) progression.saveAll();
if (perkService != null) perkService.clear();
if (storage != null) storage.close();
}
public boolean reloadSupportedConfigs() {
reloadConfig();
loadExtraConfigurations();
if (!loadPerkConfiguration()) return false;
progression.reloadCurve();
perkService.refreshOnline();
questService.reload();
questService.reloadPeriodClock();
for (Player player : getServer().getOnlinePlayers()) questService.loadPlayer(player);
return true;
}
private void loadExtraConfigurations() {
skillsConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "skills.yml"));
questsConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "quests.yml"));
messagesConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "messages.yml"));
perksFileConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "perks.yml"));
masteryFileConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "mastery.yml"));
menusConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "menus.yml"));
}
private boolean loadPerkConfiguration() {
try {
PerkConfiguration candidate = PerkConfigurationLoader.load(perksFileConfig,
getConfig().getInt("progression.max-level", 100), getLogger());
MasteryConfiguration candidateMastery = MasteryConfigurationLoader.load(masteryFileConfig, candidate,
getConfig().getInt("progression.max-level", 100), getLogger());
perkConfiguration = candidate;
masteryConfiguration = candidateMastery;
return true;
} catch (IllegalArgumentException exception) {
getLogger().severe("Could not load perks.yml: " + exception.getMessage());
return false;
}
}
public FileConfiguration getSkillsConfig() { return skillsConfig; }
public FileConfiguration getQuestsConfig() { return questsConfig; }
public FileConfiguration getMessagesConfig() { return messagesConfig; }
public FileConfiguration getMenusConfig() { return menusConfig; }
public PerkConfiguration getPerkConfiguration() { return perkConfiguration; }
public MasteryConfiguration getMasteryConfiguration() { return masteryConfiguration; }
public PerkService getPerkService() { return perkService; }
public ProgressionService getProgression() { return progression; }
public QuestService getQuestService() { return questService; }
}