burfii0090
📎 1 file 2,328 chars
📄
pasted-code-1782019668110.txt
txt 53 lines
▶
Mystic Cats Plugin (Ability Activation & Colorful Names)

Create a Minecraft Java Edition Paper/Spigot plugin that works with Bedrock Edition players via Geyser and Floodgate.

Ability Activation System

- The player must first sneak (shift), and then right-click (like placing a block) to activate the cat's ability.
- No ability is activated by default; it only triggers after this combination.

Cat Name Styling

- Each cat's name should be uniquely color-coded based on its power level.
  - For example, "Shadow Cat" (weaker) should have a subtle or dark color.
  - The stronger cats (like Void Emperor or Cosmic) should have vibrant, glowing, or bold colors, reflecting their power.
- Ensure all cat names use color codes in their display name.

Command System

- Ensure all commands work properly. The following commands must function:
  - "/catinfo" — Shows the player's current cat, ability, cooldowns, and details.
  - "/catgive " — Gives a Mystery Cat Spawn Egg to a player.
  - Any other commands like "/catcooldown", "/catreload", etc., must also work consistently.

Data Persistence

- All cat data must be saved permanently:
  - Player UUID
  - Cat UUID
  - Cat Ability Type
  - Cooldown timers
  - First join status
- Data should survive server restarts and crashes.

Code Behavior

- Use event listeners to detect when a player sneaks (shift) and right-clicks (like block placing).
- Only then, trigger the cat’s ability.
- Ensure abilities run for 1 minute, with a 30-second cooldown per ability use.
- All cat names should be colored using Minecraft color codes based on their power tier (e.g., Shadow Cat = dark grey, Cosmic Cat = bright purple, etc.).

Command Support

- Ensure all commands respond correctly regardless of the player’s platform (Java or Bedrock via Geyser).
- Commands must be registered in the plugin.yml file and have appropriate executors set up.

Quality Requirements

- Use proper Java event handling.
- Ensure no illegal access (use public methods for external calls).
- Use color codes and ActionBar/BossBar for feedback.
- Ensure all abilities, cooldowns, and visual effects are smoothly implemented and do not conflict.

Ensure the plugin is optimized, tested, and works consistently across both Java and Bedrock players.
Kodari AI
KodariJun 21 at 5:40 am 80
MysticCats
A Minecraft plugin that assigns players a unique Mystic Cat companion with tiered power levels and colored names. Each cat grants a special ability activated by Sneak + Right-Click, lasting 60 seconds with a 30-second cooldown. Features 9 cat tiers (Shadow to Void Emperor), BossBar ability countdown, ActionBar feedback, persistent data storage, GUI-based cat info display, and full Geyser/Floodgate Bedrock support.

Plan:

  1. Core enum + data class (CatType, CatData)

  2. Managers (CatManager, AbilityManager)

  3. GUI framework (InventoryHandler, InventoryButton, InventoryGUI, GUIManager, GUIListener, CatInfoGUI)

  4. Listeners (CatListener, PlayerJoinListener)

  5. Commands (CatCommandExecutor)

  6. Utility + main class + resources

Now I need to add getPlayerDataSize() to CatManager:The files all need to actually be created — they were referenced but not yet written. Let me create them all:

Here’s a full breakdown of everything built:


🐱 MysticCats — What’s Included

9 Tiered Cats

Cat
Color
Ability
Tier
Shadow Cat
Dark Gray
Invisibility II
1
Forest Cat
Green
Regen II + Speed I
2
Storm Cat
Blue
Lightning strike every 10s
3
Flame Cat
Gold
Fire Resistance + ignite mobs every 5s
4
Frost Cat
Aqua
Speed I + slow mobs every 5s
5
Thunder Cat
Yellow
Strength II + knockback pulse
6
Void Cat
Dark Purple
Night Vision + random teleport
7
Cosmic Cat
Light Purple
Night Vision + Jump II + Speed II
8
Void Emperor
Gradient
Resistance II + wither mobs every 5s
9

Key Systems

  • Activation — Sneak + Right-Click triggers the cat’s ability

  • BossBar — Countdown timer matching the cat’s color during active ability (60s)

  • ActionBar — Live status updates while ability is running; cooldown feedback on failed activation

  • Weighted random — Lower-tier cats roll more frequently from Mystery Eggs

  • Persistence — All cat data (UUID, type, cooldown) saved to data.yml, auto-saved every 5 minutes + on shutdown

  • First join — Player is automatically assigned a random cat with a welcome message

Commands

Command
Description
Permission
/catinfo
Opens GUI with cat details, ability info, and status
default
/catgive <player>
Gives a Mystery Cat Spawn Egg
mysticcats.admin
/catcooldown
Shows ability active/cooldown/ready status
default
/catreload
Reloads config and data
mysticcats.admin

Bedrock/Geyser Compatibility

All features use standard Paper event hooks that Geyser translates transparently — no special handling needed. Commands work identically for Java and Bedrock players.

Kodari can make mistakes. Review important code before using.
Files
src
Code
17 1,345
src/main/java/com/kodari/mysticcats/MysticCats.java
package com.kodari.mysticcats;

import com.kodari.mysticcats.command.CatCommandExecutor;
import com.kodari.mysticcats.inventory.gui.GUIListener;
import com.kodari.mysticcats.inventory.gui.GUIManager;
import com.kodari.mysticcats.listener.CatListener;
import com.kodari.mysticcats.listener.PlayerJoinListener;
import com.kodari.mysticcats.manager.AbilityManager;
import com.kodari.mysticcats.manager.CatManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

public class MysticCats extends JavaPlugin {

    @Getter private static MysticCats instance;

    @Getter private CatManager catManager;
    @Getter private AbilityManager abilityManager;
    @Getter private GUIManager guiManager;

    @Override
    public void onEnable() {
        instance = this;

        saveDefaultConfig();

        catManager = new CatManager(this);
        catManager.loadData();

        abilityManager = new AbilityManager(this, catManager);
        guiManager = new GUIManager();

        // Register listeners
        getServer().getPluginManager().registerEvents(new CatListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);

        // Register commands
        CatCommandExecutor executor = new CatCommandExecutor(this);
        getCommand("catinfo").setExecutor(executor);
        getCommand("catinfo").setTabCompleter(executor);
        getCommand("catgive").setExecutor(executor);
        getCommand("catgive").setTabCompleter(executor);
        getCommand("catcooldown").setExecutor(executor);
        getCommand("catcooldown").setTabCompleter(executor);
        getCommand("catreload").setExecutor(executor);
        getCommand("catreload").setTabCompleter(executor);

        // Auto-save every 5 minutes (6000 ticks)
        int intervalMinutes = getConfig().getInt("settings.auto-save-interval", 5);
        long intervalTicks = intervalMinutes * 60L * 20L;
        getServer().getScheduler().runTaskTimer(this, () -> catManager.saveAll(), intervalTicks, intervalTicks);

        getLogger().info("MysticCats enabled — " + catManager.getPlayerDataSize() + " cats loaded.");
    }

    @Override
    public void onDisable() {
        if (catManager != null) {
            catManager.saveAll();
        }
        getLogger().info("MysticCats disabled — data saved.");
    }
}