sh4n3sh4dy

read this make it into the plugin

📎 1 file 4,011 chars
📄
pasted-code-1781717901173.txt
txt 1 lines
▶
Create a Minecraft plugin called **Celestial Teams**. The plugin should be a premium-style team management system with placeholders, commands, permissions, team utilities, and fully customizable formatting. Core Team System Players can create and manage teams. Each team has: - Team name - Team display colour - Team members - Team owner - Team home - Team warps Team Name Formatting IMPORTANT: All team names must ALWAYS be displayed using this font style: ᴛʜɪs ғᴏɴᴛ: ᴀ ʙ ᴄ ᴅ ᴇ ғ ɢ ʜ ɪ ᴊ ᴋ ʟ ᴍ ɴ ᴏ ᴘ ǫ ʀ s ᴛ ᴜ ᴠ ᴡ x ʏ ᴢ When a player creates or renames a team: * Automatically convert the team name into this small-cap font. * Store the formatted version. * Every time the team name appears anywhere, it must use this font (especially in placeholders). Examples: * "Celestial" → "ᴄᴇʟᴇsᴛɪᴀʟ" * "Warriors" → "ᴡᴀʀʀɪᴏʀs" Team names: * Must have a maximum length of **14 characters** * Must not exceed 14 characters at all * Must prevent longer names from being created Team Colours Every team can have a custom display colour. The selected team colour should apply EVERYWHERE the team name appears. Examples: * Chat messages * Scoreboards * Tab list * Team placeholders * Team info messages * Other plugin integrations using placeholders If a player's team name is shown, it should automatically appear in that team's chosen colour. Add Minecraft colour options: Available colours: * Black * Dark Blue * Dark Green * Dark Aqua * Dark Red * Dark Purple * Gold * Blue * Green * Aqua * Red * Light Purple * Yellow * White Support Minecraft colour codes: &0 - &f Example: A team named "Celestial" with blue colour displays as: ᴄᴇʟᴇsᴛɪᴀʟ but coloured blue everywhere it appears. ## PlaceholderAPI Support Add PlaceholderAPI support. Placeholders: %celestialteams_team_name% * Returns the formatted and coloured team name %celestialteams_team_raw% * Returns only the formatted name without colour %celestialteams_team_color% * Returns the team colour %celestialteams_team_prefix% * Returns the formatted coloured team name %celestialteams_team_members% * Returns team member count Placeholders must work in: * Chat plugins * Scoreboards * Tab plugins * Any PlaceholderAPI supported plugin ## Commands ### Player Commands /team create  * Creates a team * Automatically converts the name into the required font * Applies the 14 character limit * Creator becomes owner /team delete * Deletes the player's team /team rename  * Changes the team name * Applies font conversion * Enforces 14 character limit /team color  * Changes the team's display colour * Provide tab completion for all Minecraft colours /team invite  * Invites a player /team accept * Accepts an invite /team leave * Leaves a team /team info Shows: * Team name (formatted + coloured) * Owner * Members * Team colour * Team warps ## Team Home System Commands: /team sethome * Sets team home /team home * Teleports to team home /team delhome * Removes team home Add: * Configurable cooldown * Configurable teleport delay ## Team Warp System Commands: /team setwarp  * Creates a team warp /team warp  * Teleports to a team warp /team delwarp  * Deletes a warp /team warps * Lists all team warps Add configurable warp limits. ## Permissions Permissions: * celestialteams.create * celestialteams.delete * celestialteams.rename * celestialteams.color * celestialteams.home * celestialteams.sethome * celestialteams.warp * celestialteams.setwarp * celestialteams.admin ## Admin Commands /celestialteams reload * Reload configuration /celestialteams info  * View team details /celestialteams delete  * Force delete a team ## Configuration Create: * config.yml * messages.yml * teams.yml Configurable: * Prefix * Messages * Team limits * Warp limits * Cooldowns * Teleport delays * Default colours * Team formatting The final result should feel like a polished, production-ready team plugin where team names are always shown in the custom small-cap font and always use the team's selected colour everywhere.
Kodari AI
KodariJun 17 at 5:48 pm 68
CelestialTeams
A premium team management plugin featuring custom small-caps font rendering for all team names, per-team display colours applied everywhere, full PlaceholderAPI integration, team homes and warps with configurable cooldowns and teleport delays, invite system, and a complete admin suite. All team names are auto-converted to a stylised unicode font on creation or rename and stored persistently in YAML.

Plan:

  1. pom.xml + plugin.yml — Maven build + plugin descriptor

  2. config.yml + messages.yml — all configurable values

  3. Team.java — data model (Lombok)

  4. SmallCapsUtil + TeamColorUtil + MessageUtil — utilities

  5. ConfigManager — load/reload config + messages

  6. TeamManager — all team logic + persistence + teleport delay

  7. TeamCommand + AdminCommand — command/tab handlers

  8. CelestialExpansion — PAPI placeholders

  9. TeleportListener — cancel teleport on move

  10. CelestialTeams — main class wiring everything

Here’s a summary of what was built:


CelestialTeams — fully structured across 15 files:

Layer
Files
Build
pom.xml
(Maven, Spigot + PAPI + Lombok)
Resources
plugin.yml
,
config.yml
,
messages.yml
Core
CelestialTeams.java
,
ConfigManager.java
Model
Team.java
(Lombok
@Getter/@Setter
)
Manager
TeamManager.java
— all team logic + YAML persistence
Utilities
SmallCapsUtil
,
TeamColorUtil
,
MessageUtil
Commands
TeamCommand
(15 subcommands + tab completion),
AdminCommand
PAPI
CelestialExpansion
— 5 placeholders
Events
TeleportListener
— cancels countdown on movement/disconnect

Key behaviours:

  • All team names auto-converted to ᴀ ʙ ᴄ ᴅ ᴇ ғ... unicode small-caps on create/rename

  • 14-character hard limit checked before conversion

  • Team colour applies everywhere via getDisplayName() returning §9ᴄᴇʟᴇsᴛɪᴀʟ

  • Teleport delay (movement cancels it) + cooldown both configurable in config.yml

  • Full messages.yml configuration for every player-facing string

  • Teams persisted to teams.yml including home + named warps with world/xyz/yaw/pitch

sh4n3sh4dy

[17:53:33 INFO] gimzonodes@space ~ : _SH4N3 issued server command: /team create [17:53:33 ERROR] gimzonodes@space ~ : Command exception: /team create org.bukkit.command.CommandException: Unhandled exception executing command 'team' in plugin CelestialTeams v1.0.0 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.21.10-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.3.10.jar:?] at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java:5) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:105) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:458) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.commands.Commands.performCommand(Commands.java:364) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.commands.Commands.performCommand(Commands.java:352) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.server.network.ServerGamePacketListenerImpl.performUnsignedChatCommand(ServerGamePacketListenerImpl.java:2321) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$12(ServerGamePacketListenerImpl.java:2294) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:176) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1537) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:180) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:150) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1517) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1511) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.server.MinecraftServer.recordTaskExecutionTimeWhileWaiting(MinecraftServer.java:1229) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1352) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:384) ~[paper-1.21.10.jar:1.21.10-129-3e25649] at java.base/java.lang.Thread.run(Unknown Source) ~[?:?] Caused by: java.lang.NullPointerException: Cannot invoke "com.celestialteams.CelestialTeams.getConfigManager()" because "com.celestialteams.util.MessageUtil.plugin" is null at CelestialTeams-1.0.0.jar/com.celestialteams.util.MessageUtil.send(MessageUtil.java:24) ~[CelestialTeams-1.0.0.jar:?] at CelestialTeams-1.0.0.jar/com.celestialteams.command.TeamCommand.handleCreate(TeamCommand.java:72) ~[CelestialTeams-1.0.0.jar:?] at CelestialTeams-1.0.0.jar/com.celestialteams.command.TeamCommand.onCommand(TeamCommand.java:50) ~[CelestialTeams-1.0.0.jar:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.21.10-R0.1-SNAPSHOT.jar:?] ... 24 more

when i try use it this happens

Kodari AI
KodariJun 17 at 5:54 pm 7

MessageUtil.init(plugin) is never called in onEnable(), so plugin stays null. Fix:

MessageUtil.init(this) is now called right after the managers are ready, so plugin will never be null when commands fire.

sh4n3sh4dy

There is an issue. when i do /team color or any of the team commands it says i am not in a team. but when i do /team create to try and join a team, it says i am already in one. so idk what to do

sh4n3sh4dy

can you add a teams chat feature, where players can talk in their teams so when they do /team chat [message] it types it in their team chat that only players in their team cans ee

Kodari AI
KodariJun 29 at 6:44 am 13

Done. Here’s what was added:

  • /team chat <message> — routes the message only to online team members

  • Format is fully configurable in messages.yml under team-chat-format:

    Plain Text
    {team} | {player}: {message}
    

    which renders as e.g. §9ᴄᴇʟᴇsᴛɪᴀʟ §8| §7_SH4N3§8: §fhey team! — coloured with your team’s display colour automatically since {team} uses getDisplayName()

  • Added to tab completion and the /team help menu

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
17 1,542
src/main/java/com/celestialteams/CelestialTeams.java
package com.celestialteams;

import com.celestialteams.command.AdminCommand;
import com.celestialteams.command.TeamCommand;
import com.celestialteams.listener.TeleportListener;
import com.celestialteams.manager.ConfigManager;
import com.celestialteams.manager.TeamManager;
import com.celestialteams.placeholder.CelestialExpansion;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public class CelestialTeams extends JavaPlugin {

    private ConfigManager configManager;
    private TeamManager teamManager;
    private CelestialExpansion placeholderExpansion; // Track expansion instance for clean unregistration

    @Override
    public void onEnable() {
        // Initialize MessageUtil FIRST so other managers can use it safely during startup
        com.celestialteams.util.MessageUtil.init(this);

        configManager = new ConfigManager(this);
        configManager.loadAll();

        teamManager = new TeamManager(this);
        teamManager.loadTeams();

        // FIX: Safe registration checks for commands to prevent server boot failure if plugin.yml is edited incorrectly
        TeamCommand teamCmd = new TeamCommand(this);
        PluginCommand teamCommandObj = getCommand("team");
        if (teamCommandObj != null) {
            teamCommandObj.setExecutor(teamCmd);
            teamCommandObj.setTabCompleter(teamCmd);
        } else {
            getLogger().warning("Command '/team' is missing from plugin.yml!");
        }

        AdminCommand adminCmd = new AdminCommand(this);
        PluginCommand adminCommandObj = getCommand("celestialteams");
        if (adminCommandObj != null) {
            adminCommandObj.setExecutor(adminCmd);
            adminCommandObj.setTabCompleter(adminCmd);
        } else {
            getLogger().warning("Command '/celestialteams' is missing from plugin.yml!");
        }

        getServer().getPluginManager().registerEvents(new TeleportListener(this), this);

        if (getServer().getPluginManager().getPlugin("PlaceholderAPI") != null) {
            placeholderExpansion = new CelestialExpansion(this);
            placeholderExpansion.register();
            getLogger().info("PlaceholderAPI hooked successfully.");
        }

        getLogger().info("CelestialTeams enabled.");
    }

    @Override
    public void onDisable() {
        if (teamManager != null) {
            teamManager.saveTeams();
        }
        
        // FIX: Cleanly unregister expansion to avoid memory leak states upon reloads
        if (placeholderExpansion != null) {
            try {
                placeholderExpansion.unregister();
            } catch (Exception e) {
                // Catch quietly in case PAPI is disabling at the same exact frame
            }
        }
        
        getLogger().info("CelestialTeams disabled.");
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public TeamManager getTeamManager() {
        return teamManager;
    }
}