thirstfr
📎 1 file 6,233 chars
📄
pasted-code-1773149701653.txt
txt 309 lines
▶
Act as a senior Minecraft plugin developer with 5+ years of experience creating professional, optimized plugins.

Create a HIGH QUALITY Minecraft plugin for my client.

SERVER ENVIRONMENT
Server Software: Paper
Minecraft Version: 1.21.x
Language: Java
API: Spigot/Paper API
Build System: Maven

PLUGIN NAME
PhobiaAbilities

GENERAL DESCRIPTION

Players are assigned one random Phobia when they join the server.

There are 8 different Phobias.

Each Phobia has:
• 1 Passive Ability
• Ability1 (Active)
• Ability2 (Active)

Abilities are activated using commands.

ABILITY COMMANDS

/ability1
Uses the player's first active ability.

/ability2
Uses the player's second active ability.

ENERGY SYSTEM

Energy range: -3 to 5

Energy gain:
+1 energy for killing a player

Energy loss:
-1 energy when dying

Limits:
Minimum energy: -3
Maximum energy: 5

Unlock system:
0 energy → only passive ability active
2 energy → unlock Ability1
4 energy → unlock Ability2

Using abilities DOES NOT consume energy.

Command:
/energy

This command shows the player's current energy.

PHOBIA ASSIGNMENT

When a player joins the server:

• they receive a random phobia
• a rolling animation appears in the center of the screen
• the phobia icon appears above the hotbar in the action bar
• the phobia name is displayed
• the player starts with 0 energy

The phobia icon must support custom resource pack textures.

PHOBIA ICON SYSTEM

Each phobia has a specific item icon.

This icon must appear in TWO places:

1. Above the hotbar (action bar UI)
2. Inside the /phobia INVENTORY GUI

The plugin MUST allow changing these icons in the config.yml.

Example config structure:

phobia-icons:
arachnophobia: SPIDER_EYE
acrophobia: FEATHER
nyctophobia: ENDER_EYE
claustrophobia: STONE
aquaphobia: HEART_OF_THE_SEA
pyrophobia: BLAZE_POWDER
phasmophobia: GHAST_TEAR
ranidaphobia: SLIME_BALL

Server owners should be able to easily change the icon item without editing code.

If the item is changed in config.yml it must automatically update both:
• the INVENTORY GUI item
• the action bar icon

INVENTORY GUI COMMAND

/phobia

Permission: admin

Opens a INVENTORY GUI displaying all 8 phobias.

Each phobia is represented by its configured icon item.

Each item must include lore explaining:

• passive ability
• ability1
• ability2

ADMIN COMMANDS

/rerollphobia

Admin command.

Gives the admin a Nether Star named:

"Reroll Token"

If a player right-clicks this item:

• their phobia resets
• a new random phobia is rolled
• their energy resets to 0

/setenergy  <-3 to 5>

Admin command that sets a player's energy.

PARTICLE SYSTEM

Whenever a player uses an active ability:

• particles form a circular ring above the player's head
• particles last 3.5 seconds
• medium particle density

Each phobia has its own unique color combination.

7 phobias use two-color particle combinations.

1 phobia uses rainbow particles.

Both abilities of the same phobia must use the same particle colors.

PHOBIAS

Arachnophobia
Fear of Spiders

Passive:
If a spider is within 10 blocks, the player gains Speed II for 30 seconds.

Ability1:
Automatically breaks or ignores cobwebs within 3 blocks.
Cooldown: 1 minute 30 seconds.

Ability2:
Trap a target in cobwebs and give them Poison for 10 seconds.
Cooldown: 2 minutes.

Acrophobia
Fear of Heights

Passive:
The player takes no fall damage.

Ability1:
Dash in the direction the player is looking while breaking blocks in the path.
Cooldown: 1 minute.

Ability2:
Launch the nearest player upwards and then slam them back down at high speed.
Cooldown: 1 minute 30 seconds.

Nyctophobia
Fear of Darkness

Passive:
Permanent invisibility.
Also bypasses Totems of Undying.

Ability1:
Gain Strength II and Speed II for 6 seconds.
Cooldown: 1 minute 30 seconds.

Ability2:
Give a target Blindness and Weakness I for 10 seconds.
Cooldown: 2 minutes.

Claustrophobia
Fear of Small Spaces

Passive:
When the player is below Y level 30 they deal 1.2x damage.

Ability1:
Trap nearby enemies in a 7x7 sphere and apply Mining Fatigue.
Cooldown: 1 minute 30 seconds.

Ability2:
Shrink to 1 block tall and gain Speed III for 15 seconds.
Cooldown: 2 minutes 30 seconds.

Aquaphobia
Fear of Water

Passive:
Water Breathing, Regeneration I, and Speed III while in water.

Ability1:
Spawn a drowning wave affecting enemies within 5 blocks.
Cooldown: 1 minute 30 seconds.

Ability2:
Spawn a giant wave that knocks targets away and deals 3 hearts of damage.
Cooldown: 2 minutes.

Pyrophobia
Fear of Fire

Passive:
Permanent Fire Resistance.
Permanent Strength I in the Nether.

Ability1:
Set a target on true fire for 15 seconds.
Cooldown: 1 minute.

Ability2:
Drain any water within a 3 block radius for 5 seconds.
Cooldown: 1 minute.

Phasmophobia
Fear of Ghosts

Passive:
Permanent invisibility.

Ability1:
Turn fully invisible and gain Speed II for 10 seconds.
Cooldown: 1 minute 30 seconds.

Ability2:
Put a target into Adventure Mode for 7 seconds.
Cooldown: 1 minute 30 seconds.

Ranidaphobia
Fear of Frogs

Passive:
5% chance on hit to apply Poison to the target for 6 seconds.

Ability1:
Pull a target toward you from up to 20 blocks away.
Cooldown: 30 seconds.

Ability2:
Give a target Slowness III and Feather Falling for 7 seconds.
Cooldown: 2 minutes.

DEVELOPMENT REQUIREMENTS

The plugin must include:

• clean object oriented code
• separate classes for abilities
• cooldown manager
• particle manager
• phobia manager
• energy manager
• command manager
• INVENTORY GUI system

FILES REQUIRED

plugin.yml
config.yml
language/messages.yml

PROJECT STRUCTURE

Use a clean Maven structure with packages such as:

abilities
commands
managers
events
INVENTORY GUI
utils

OTHER REQUIREMENTS

• highly optimized for large servers
• fully commented code
• professional structure
• easy to expand with new phobias
• use Minecraft's small font style for UI text
• make the plugin extremely polished and professional
Kodari AI
KodariMar 10 at 1:46 pm 88,259 (v2)

I’ll plan this carefully before writing any code.

Plan:

  • Maven project with Paper API, XSeries (JitPack), Lombok

  • 8 Phobia ability classes extending abstract PhobiaAbility

  • Managers: PhobiaManager, EnergyManager, CooldownManager, ParticleManager

  • GUI framework from documentation

  • Rolling animation via repeating task on join

  • Passive effects via repeating scheduler + event listeners

  • All particles via XParticle, all materials via XMaterial, no raw Bukkit enums

PhobiaAbilities
Assigns players a random phobia on join with a rolling animation. Each phobia provides 1 passive and 2 active abilities unlocked via an energy system (-3 to 5). Energy gained by killing players, lost on death. Active abilities trigger colored particle rings. Includes full GUI showing all phobias, admin reroll token item, energy management commands, action bar icon display, and config-driven phobia icons supporting custom resource pack textures.

Now let me verify that player.setScale() is a Paper 1.21 API method and add a safety check, then confirm all cross-references are correct.

I’ve identified all the issues. Here’s what needs to be fixed across the entire project:

  1. All ability classes use PotionEffectType.* enum constants directly — must use XPotion.matchXPotion()

  2. Several ability classes use Material.COBWEB, Material.AIR, Material.WATER, etc. directly — must use XMaterial

  3. ParticleManager uses Particle.DUST enum constant directly — must use XParticle.of("DUST")

  4. PhobiaMenuGUI uses new ItemStack(Material.STONE) etc. as fallbacks — remove raw Material refs

Now rewriting all affected files:

Now let me verify the pom.xml has the Lombok annotation processor properly configured and check for the bungee import in PhobiaManager:

Good. The bungee action bar API works fine in Paper since Paper bundles it. Now let me execute all the necessary rewrites to fix every direct Bukkit enum violation:

All 11 files have been corrected. Here’s a summary of every change made:

  • All 8 ability classes — replaced every PotionEffectType.* enum constant with the XPotion.matchXPotion("NAME").map(xp -> xp.buildPotionEffect(ticks, amp)).ifPresent(entity::addPotionEffect) pattern

  • ArachnophobiaAbility + AcrophobiaAbility — cached Material.COBWEB and Material.AIR as static finals via XMaterial.matchXMaterial("COBWEB").map(XMaterial::parseMaterial).orElse(null), used for all block comparisons and setType() calls

  • PyrophobiaAbility — same XMaterial caching pattern for WATER, KELP, SEAGRASS, and AIR; restore logic uses the cached Material variable (effectively final inside lambda)

  • ClaustrophobiaAbility — player.setScale(0.5/1.0) kept as Paper 1.21 native API, only potion types migrated

  • PlayerCombatListener — replaced inline new PotionEffect(PotionEffectType.POISON, ...) with XPotion chain

  • ParticleManager — replaced Particle.DUST enum constant with XParticle.of("DUST").ifPresent(xp -> world.spawnParticle(xp.get(), ...)), while keeping Particle.DustOptions (a static inner class, not an enum constant) as-is

  • PhobiaMenuGUI — removed all new ItemStack(Material.*) fallbacks, replaced with chained XMaterial lookups; added null guards throughout

thirstfr

sowhen i use the texturepack it will show the text stone as the texture i used?

Kodari AI
KodariMar 10 at 1:55 pm 3,325 (v2)

This is a Minecraft resource pack / custom model data concept question. Here’s how it works:


How Custom Textures Work in Plugins

When you give an item a Custom Model Data value in code:

Java
meta.setCustomModelData(1001);

And in your resource pack you define:

JSON
{
  "overrides": [
    { "predicate": { "custom_model_data": 1001 }, "model": "item/my_custom_item" }
  ]
}

✅ What the player sees:

  • With the resource pack → Your custom texture/model

  • Without the resource pack → The base item (e.g. a Stone, Stick, etc.)


The “Stone” Trick

Yes! Many plugins use Stone (or other items) as the base material because:

  • Stone is not a tool, so it won’t show durability

  • It’s a simple, neutral item

  • Players with the pack see your custom texture

  • Players without the pack just see a stone

Common base items used:

Base Item
Why
STONE
Neutral, simple
STICK
Common for custom tools
PAPER
Common for custom books/scrolls
NETHER_STAR
Glowing effect by default

Summary

Yes — with the texture pack applied, the item will show your custom texture. Without it, it shows as whatever the base material is (e.g. Stone).

Would you like help setting up custom model data in your PhobiaAbilities plugin items?

thirstfr

it just shows plain text

1 image attached
Kodari AI
KodariMar 10 at 1:59 pm 9,596 (v2)

Let me read the relevant files to find the energy display code.

The issue is clear. In startActionBarTask(), iconMaterial is the raw config string (e.g. "STONE") being printed literally as [STONE] in the action bar. The fix is to drop that and show the phobia name properly formatted instead.

The iconMaterial is the raw material name string from config being printed verbatim. I’ll replace it with a proper Unicode symbol per phobia configurable in config.yml, and fix the action bar format string.

The action bar now shows a colored ✦ symbol followed by the phobia name and energy bar — the raw material string [STONE] is gone.

thirstfr

so what do i do now?

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
35 2,173
src/main/java/com/phobiaabilities/PhobiaAbilities.java
package com.phobiaabilities;

import com.phobiaabilities.commands.*;
import com.phobiaabilities.events.PassiveListener;
import com.phobiaabilities.events.PlayerCombatListener;
import com.phobiaabilities.events.PlayerInteractListener;
import com.phobiaabilities.events.PlayerJoinListener;
import com.phobiaabilities.gui.GUIListener;
import com.phobiaabilities.gui.GUIManager;
import com.phobiaabilities.managers.CooldownManager;
import com.phobiaabilities.managers.EnergyManager;
import com.phobiaabilities.managers.ParticleManager;
import com.phobiaabilities.managers.PhobiaManager;
import lombok.Getter;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;

@Getter
public class PhobiaAbilities extends JavaPlugin {

    private static PhobiaAbilities instance;

    private PhobiaManager phobiaManager;
    private EnergyManager energyManager;
    private CooldownManager cooldownManager;
    private ParticleManager particleManager;
    private GUIManager guiManager;

    private FileConfiguration messages;

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

        saveDefaultConfig();
        loadMessages();

        this.cooldownManager = new CooldownManager();
        this.energyManager = new EnergyManager(this);
        this.phobiaManager = new PhobiaManager(this);
        this.particleManager = new ParticleManager(this);
        this.guiManager = new GUIManager();

        registerCommands();
        registerListeners();

        this.particleManager.startRingTask();
        this.phobiaManager.startActionBarTask();

        getLogger().info("PhobiaAbilities has been enabled.");
    }

    @Override
    public void onDisable() {
        getLogger().info("PhobiaAbilities has been disabled.");
    }

    private void loadMessages() {
        File msgFile = new File(getDataFolder(), "language/messages.yml");
        if (!msgFile.exists()) {
            saveResource("language/messages.yml", false);
        }
        this.messages = YamlConfiguration.loadConfiguration(msgFile);
    }

    public String msg(String key) {
        String prefix = messages.getString("prefix", "&8[&6Phobia&8] &r");
        String val = messages.getString(key, "&cMissing message: " + key);
        return colorize(prefix + val);
    }

    public String msgRaw(String key) {
        return colorize(messages.getString(key, "&cMissing: " + key));
    }

    public static String colorize(String text) {
        return text.replace("&", "\u00A7");
    }

    private void registerCommands() {
        getCommand("ability1").setExecutor(new AbilityOneCommand(this));
        getCommand("ability2").setExecutor(new AbilityTwoCommand(this));
        getCommand("energy").setExecutor(new EnergyCommand(this));
        getCommand("phobia").setExecutor(new PhobiaGUICommand(this));
        getCommand("rerollphobia").setExecutor(new RerollPhobiaCommand(this));
        getCommand("setenergy").setExecutor(new SetEnergyCommand(this));
    }

    private void registerListeners() {
        GUIListener guiListener = new GUIListener(guiManager);
        getServer().getPluginManager().registerEvents(guiListener, this);
        getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerCombatListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerInteractListener(this), this);
        getServer().getPluginManager().registerEvents(new PassiveListener(this), this);
    }

    public static PhobiaAbilities getInstance() {
        return instance;
    }
}