Suhird Singh
šŸ“Ž 1 file 12,932 chars
šŸ“„
pasted-code-1788272179248.txt
txt 541 lines
ā–¶
Minecraft Custom Watch Powers Plugin — Development Prompt

Create a complete Minecraft server plugin featuring 10 unique custom magical watches, each with its own powers, passive ability, custom texture, particles, sounds, and effects.

The plugin should be designed with clean, modular, maintainable code and should work on Paper/Spigot. Make the Minecraft version configurable where practical.

1. Custom Watches

Create exactly 10 different watches.

Each watch must have:

A unique name.
A unique custom texture/model.
A unique color/theme.
A unique set of abilities.
3 active abilities.
1 passive ability.
Unique particles for each ability.
Appropriate visual and/or sound effects.
Configurable cooldowns.
Configurable damage/effects/duration/range where applicable.

Example watch themes can include:

Time Watch
Shadow Watch
Flame Watch
Frost Watch
Storm Watch
Teleport Watch
Gravity Watch
Nature Watch
Void Watch
Blood Watch

You may design the exact abilities, but they must be sufficiently different from each other and balanced for multiplayer gameplay.

2. Ability Controls

Every watch has exactly three active abilities and one passive ability.

Ability 1 — Left Click
Activated by left-clicking while holding the watch in the player's hand.
Ability 1 is unlocked by default when the player obtains the watch.
It must have its own particles, effects, sounds, cooldown, and behavior.
Ability 2 — Right Click
Activated by right-clicking while holding the watch.
Locked initially.
The player must kill 10 players to unlock Ability 2 for that specific watch/player.
Once unlocked, it remains unlocked for that player.
Display an appropriate message when the ability is unlocked.
Ability 3 — Crouch + Right Click
Activated by sneaking/crouching and right-clicking while holding the watch.
Locked initially.
The player must kill 20 players to unlock Ability 3.
Once unlocked, it remains unlocked for that player.
Display an appropriate message when the ability is unlocked.
Passive Ability
The passive ability is always active while the player possesses the corresponding watch.
The watch does not need to be held for the passive to work.
The watch can be anywhere in the player's inventory, including:
Hotbar
Main inventory
Other normal inventory slots
The passive should stop working immediately when the watch is removed from the player's inventory.
If the player has multiple copies of the same watch, the passive should not stack unless explicitly configured to stack.
The player must hold the watch in their hand to use any of its three active abilities.
3. Watch Unlock Progress

Track player kills separately for watch ability progression.

For every player and every watch, track:

Player kill count.
Whether Ability 1 is unlocked.
Whether Ability 2 is unlocked.
Whether Ability 3 is unlocked.

Progress must be persistent across server restarts.

Example:

Player: Steve
Watch: Shadow Watch
Kills: 13
Ability 1: UNLOCKED
Ability 2: UNLOCKED
Ability 3: LOCKED


At 10 player kills:

Ability 2 UNLOCKED


At 20 player kills:

Ability 3 UNLOCKED


The plugin should count player kills, not mob kills.

Prevent exploits such as repeatedly killing the same player extremely quickly to artificially farm kills if possible. Add a configurable anti-farming/cooldown system.

4. Watch Distribution When Joining

When a player joins the server for the first time:

Automatically give them one random watch from the 10 available watches.
Every watch should have an equal chance by default.
The watch should be placed in their inventory.
If their inventory is full, safely handle the item using a configurable fallback such as dropping it at the player's location or retrying after the inventory becomes available.

A player should receive the automatic random watch only according to the configured first-join rule.

Do not give a new random watch every time an existing player reconnects unless enabled in configuration.

5. Watches Dropping on Death

When a player dies:

The watch/watches they possess should drop.
Watches must be physical Minecraft items that other players can pick up.
Dropped watches must never despawn naturally.
If possible, use persistent item data/PersistentDataContainer to identify watches rather than relying only on item names/lore.

When a watch drops:

Broadcast its coordinates to all online players through chat.

Example:

[WATCH DROP] A Shadow Watch has been dropped at:
X: 125
Y: 64
Z: -342
World: Survival


Make the message configurable.

Coordinates should be accurate to the watch's actual drop location.

If multiple watches are dropped at the same location, send appropriate messages for each watch or combine them intelligently.

6. Picking Up Watches

Players can pick up additional watches.

A player can therefore possess multiple different watches.

For example:

Player inventory:
- Flame Watch
- Frost Watch
- Shadow Watch


The player may switch between them.

Rules:

Passive effects apply when the corresponding watch exists somewhere in the inventory.
Active abilities require the watch to be held in the player's main hand.
A player cannot activate an ability of a watch that they are not currently holding.
Watches should be identifiable through persistent item metadata.
Players should be able to safely move watches between inventory slots.
7. Watch Items and Custom Textures

Every watch must have a unique custom texture/model.

Implement the item system so that each watch can have its own texture through a resource pack/custom model data system appropriate for the target Minecraft version.

The plugin should:

Give each watch a unique model/texture identifier.
Store the watch type in persistent item data.
Display the watch's name using custom colors.
Display useful lore such as:
✦ Shadow Watch

Passive:
Shadow Veil

Ability I:
Shadow Strike

Ability II:
Shadow Step
Kills Required: 10
Status: LOCKED

Ability III:
Shadow Realm
Kills Required: 20
Status: LOCKED


The lore should dynamically update to show whether abilities are locked/unlocked.

If the plugin cannot automatically provide the actual resource-pack assets, create the required resource-pack/model structure and clearly document where the texture files need to be placed.

8. Ability Effects

Every ability must feel visually unique.

Each active ability should have:

Custom particles.
Appropriate sounds.
Visual effects.
Gameplay effects.
Cooldown.
Range/targeting rules.
Configurable values.
Ability activation feedback.

Examples of possible effects:

Lightning
Fire
Ice
Teleportation
Knockback
Temporary invisibility
Speed
Strength
Slowness
Levitation
Area damage
Time manipulation
Projectile attacks
Particle trails
Explosions without unnecessary terrain destruction

Avoid making every ability simply deal damage.

The 10 watches should have meaningfully different gameplay mechanics.

9. Ability Cooldowns

Every active ability must have a cooldown.

Display cooldown feedback to the player when they attempt to use an ability that is still on cooldown.

Example:

[Watch] Ability is on cooldown for 3.2 seconds.


Cooldowns should be configurable.

Example configuration:

watches:
  flame:
    ability1:
      cooldown: 5
    ability2:
      cooldown: 15
    ability3:
      cooldown: 45


Use a reliable cooldown system that does not cause memory leaks.

10. Admin Commands

Create an admin command:

/watches


with useful subcommands.

Give a Watch
/watches give  


Give a specific watch to a player.

Example:

/watches give Steve flame

Give Random Watch
/watches random 


Give the specified player one random watch.

Give All Watches
/watches giveall 


Give the player all 10 watches.

Unlock All Abilities

Create an admin command:

/watches unlockall 


This must immediately unlock:

Ability 1
Ability 2
Ability 3

for all 10 watches for that player.

The player should not need to achieve the required kills after using this command.

Reset Progress
/watches reset 


Reset the player's watch progression.

List Watches
/watches list


Display all 10 available watches.

Reload
/watches reload


Reload configuration without restarting the server where safely possible.

11. Permissions

Add permissions such as:

watches.admin
watches.command.give
watches.command.random
watches.command.giveall
watches.command.unlockall
watches.command.reset
watches.command.reload


Normal players should not have access to administrative commands.

12. Configuration

Create a detailed config.yml.

It should allow server administrators to configure:

Watch names.
Watch colors.
Ability names.
Ability descriptions.
Ability cooldowns.
Damage.
Range.
Duration.
Particle counts.
Particle types.
Sounds.
Kill requirements.
First-join random watch behavior.
Death-drop behavior.
Drop announcement.
Anti-kill-farming settings.
Whether duplicate watches are allowed.
Whether passive abilities stack.
Messages.
Debug mode.

Example:

settings:
  give-random-watch-on-first-join: true
  watches-drop-on-death: true
  watches-never-despawn: true
  announce-watch-drops: true
  ability-2-kills-required: 10
  ability-3-kills-required: 20
  passive-effects-stack: false

messages:
  watch-drop: "&6[WATCH DROP] &f%watch% dropped at &eX:%x% Y:%y% Z:%z%"
  ability-locked: "&cThis ability is locked!"
  ability-unlocked: "&aYou unlocked %ability%!"
  cooldown: "&cAbility cooldown: &e%time%s"

watches:
  flame:
    display-name: "&cFlame Watch"
    ability1:
      name: "&cFlame Burst"
      cooldown: 5
    ability2:
      name: "&6Inferno Dash"
      cooldown: 15
    ability3:
      name: "&4Meteor Strike"
      cooldown: 45

13. Data Storage

Player progression must survive:

Server restart.
Plugin reload.
Player logout/login.

Store:

Kill count.
Unlock status.
Any necessary watch-specific progression.

Use a reliable storage solution such as:

YAML, or
SQLite.

Prefer SQLite if the plugin is expected to support larger servers.

Do not store progression only in memory.

14. Death and Item Safety

Make sure watches cannot accidentally disappear because of:

Normal item despawn.
Chunk unloading.
Server restart.
Plugin reload.

Dropped watches should be persistent.

However, provide an administrator configuration option to remove old dropped watches if necessary.

Handle edge cases such as:

Player dies in lava.
Player dies in the void.
Player dies with a full inventory.
Multiple watches are dropped.
Server restarts while watches are on the ground.
Chunks unload while watches are dropped.
Player dies while holding a watch.
Player owns multiple copies of a watch.
15. Combat/Kill Tracking

Only count valid player-versus-player kills toward the unlock system.

Do not count:

Mob kills.
Environmental deaths unless caused by a tracked player according to the configured rules.
Fake damage events.
Plugin-generated kills that should not count.

Ideally, support kills caused by abilities as valid PvP kills.

Make the kill-tracking logic reliable and prevent accidental double-counting.

When a player reaches:

10 kills


unlock Ability 2.

When they reach:

20 kills


unlock Ability 3.

Send an announcement/message such as:

&6&lWATCH EVOLUTION
&aYou have unlocked Ability II for your watches!

16. User Interface / Feedback

Whenever a player receives a watch, clearly tell them what they received.

Example:

&6&l✦ WATCH OBTAINED ✦
&fYou received: &cFlame Watch


When using an ability, provide visual feedback.

When an ability is locked:

&cAbility II is locked.
&7Kill 10 players to unlock it.


For Ability III:

&cAbility III is locked.
&7Kill 20 players to unlock it.


Optionally use action bars, boss bars, sounds, and titles for major unlocks.

17. Event Handling

Use appropriate Bukkit/Paper events for:

PlayerJoinEvent
PlayerDeathEvent
EntityDamageByEntityEvent
PlayerInteractEvent
PlayerPickupItemEvent / appropriate modern Paper equivalent
PlayerDropItemEvent
Inventory events
PlayerToggleSneakEvent where necessary
Item entity events
Chunk events where necessary
Plugin enable/disable events

Make sure event handling is compatible with the selected Minecraft version.

Avoid deprecated APIs when modern alternatives are available.

18. Ability Input Priority

Handle the controls carefully so that Minecraft's normal interactions do not unintentionally activate abilities.

The plugin should correctly distinguish:

Left click in air.
Left click on a block.
Right
Kodari AI
KodariSep 1 at 2:23 pm 3
MysticWatches
A comprehensive Minecraft plugin introducing 10 unique magical watches, each with 3 active abilities and 1 passive ability. Players receive a random watch on first join, unlock abilities through PvP kills, and lose watches on death with persistent drop announcements. Features custom textures via model data, configurable cooldowns/effects, SQLite progression storage, anti-farming protection, and full admin command suite with permissions. Uses a modular GUI framework for ability management and dynamic item lore updates.
  1. Core plugin and configuration: create the Paper/Spigot entry point, 10-watch definitions, persistent progression, item metadata, and configurable messages.

  2. Gameplay: implement the 30 active abilities, passive effects, cooldowns, PvP progression, first-join distribution, and death drops.

  3. Administration and assets: add /watches subcommands, permissions, resource-pack model structure, and setup documentation.

  1. Built the CustomWatches Paper plugin with:

    • Exactly 10 themed watches.

    • 30 active abilities and 10 passive abilities.

    • Persistent YAML progression.

    • Watch metadata via PersistentDataContainer.

    • Custom model data values 1001–1010.

    • Configurable cooldowns, damage, ranges, particles, sounds, effects, and messages.

  2. Added gameplay systems:

    • Left-click, right-click, and crouch-right-click ability controls.

    • Kill-based unlocks at configurable thresholds.

    • PvP anti-farming cooldowns.

    • First-join/random watch distribution.

    • Inventory passive effects.

    • Death drops with coordinate broadcasts.

    • Non-despawning watch item entities.

    • Duplicate-watch configuration.

  3. Added /watches administration commands:

    • give

    • random

    • giveall

    • unlockall

    • reset

    • list

    • reload

  4. Added permissions and tab completion through plugin.yml.

  5. Added resource-pack model templates under resource-pack/, including custom model overrides for all 10 watches. Texture PNG files should be placed in: resource-pack/assets/kodari_watches/textures/item/

Kodari can make mistakes. Review important code before using.
Files
resource-pack
src
build.gradle
manifest.kod
Code
27 758
src/main/java/com/kodari/watches/WatchesPlugin.java
package com.kodari.watches;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Map;

public class WatchesPlugin extends JavaPlugin {
    private ConfigManager config;
    private ProgressManager progress;
    private WatchItemFactory items;
    private CooldownManager cooldowns;
    private AbilityService abilities;
    private PassiveManager passives;

    @Override public void onEnable() {
        saveDefaultConfig();
        config = new ConfigManager(this);
        progress = new ProgressManager(this);
        items = new WatchItemFactory(this, config, progress);
        cooldowns = new CooldownManager();
        abilities = new AbilityService(this, config, progress, cooldowns);
        passives = new PassiveManager(this, items, config);
        WatchListener listener = new WatchListener(this);
        getServer().getPluginManager().registerEvents(listener, this);
        WatchesCommand command = new WatchesCommand(this);
        getCommand("watches").setExecutor(command);
        getCommand("watches").setTabCompleter(command);
        getServer().getScheduler().runTaskTimer(this, () -> getServer().getOnlinePlayers().forEach(passives::apply), 1L, 10L);
    }

    @Override public void onDisable() { if (progress != null) progress.save(); }
    public ConfigManager config() { return config; }
    public ProgressManager progress() { return progress; }
    public WatchItemFactory items() { return items; }
    public AbilityService abilities() { return abilities; }
    public PassiveManager passives() { return passives; }

    public void giveWatch(Player player, WatchType type) {
        if (!config.setting("allow-duplicate-watches", false) && hasWatch(player, type)) { message(player, "duplicate", "%watch%", config.watchName(type)); return; }
        ItemStack item = items.create(type, player.getUniqueId());
        Map<Integer, ItemStack> leftovers = player.getInventory().addItem(item);
        if (!leftovers.isEmpty()) {
            if (config.config().getString("settings.full-inventory-fallback", "drop").equalsIgnoreCase("drop")) leftovers.values().forEach(value -> player.getWorld().dropItem(player.getLocation(), value));
            else leftovers.values().forEach(value -> player.getWorld().dropItem(player.getLocation(), value));
        }
        message(player, "obtained", "%watch%", config.watchName(type));
    }

    private boolean hasWatch(Player player, WatchType type) { for (ItemStack item : player.getInventory().getContents()) if (items.getType(item).orElse(null) == type) return true; return false; }
    public void message(Player player, String key, String... replacements) { player.sendMessage(format(config.message(key), replacements)); }
    public void broadcast(String key, String... replacements) { String message = format(config.message(key), replacements); getServer().broadcastMessage(message); }
    private String format(String text, String... replacements) { String result = text == null ? "" : text; for (int i = 0; i + 1 < replacements.length; i += 2) result = result.replace(replacements[i], replacements[i + 1]); return ChatColor.translateAlternateColorCodes('&', result); }
}