disaplin

create a staff chat plugin

Kodari AI
KodariMar 6 at 6:38 pm 7,075 (v2)

I’ll create a staff chat plugin with toggle mode, custom formatting, and sound notifications.

StaffChat
A comprehensive staff communication system allowing staff members to communicate privately across the server. Features include toggle mode for persistent staff chat, quick message commands, customizable message formats with rank prefixes, sound notifications for incoming messages, and permission-based access control. Supports color codes and provides efficient staff coordination tools.

Staff chat plugin created with the following features:

  • /sc <message> to send staff messages or /sc toggle for persistent mode

  • Customizable message formats and sound notifications

  • Toggle mode automatically cleared on logout

  • Reload command for admins

  • Permission-based access with staffchat.use

disaplin

is there a config.yml?

Kodari AI
KodariMar 6 at 6:39 pm 4,308 (v2)

I can see from the project structure that there is a config.yml at src/main/resources/config.yml. Let me read it to show you its contents.

Yes, there is a config.yml file at src/main/resources/config.yml. It contains:

  • Prefix: Staff chat prefix with color codes

  • Format: Message format template

  • Sound: Notification sound settings (enabled, type, volume, pitch)

  • Toggle Messages: Messages shown when staff chat is enabled/disabled

  • Messages: General messages for no permission, empty messages, and reload success

disaplin

is this for paper 1.21.10

Kodari AI
KodariMar 6 at 6:40 pm 2,449 (v2)

I’ll check the project configuration to see what version this plugin targets.

This plugin is configured for Paper/Spigot 1.21.1 (there’s no 1.21.10 version - you might mean 1.21.1 or 1.21.3).

Current configuration:

  • API Version: 1.21.1-R0.1-SNAPSHOT in build.gradle

  • Minimum Version: api-version: '1.17' in plugin.yml (runs on 1.17+)

  • Java Version: 17

This means the plugin will:

  • ✅ Run on Paper/Spigot 1.21, 1.21.1, 1.21.2, 1.21.3

  • ✅ Run on any 1.17+ server

  • ✅ Work with modern Paper features

If you want to update to the latest 1.21.3, I can update the dependency. Did you mean 1.21.1 or would you like me to update to 1.21.3?

disaplin

add placeholderapi integration

Kodari AI
KodariMar 7 at 10:01 pm 2,970 (v2)

I’ll add PlaceholderAPI integration to your StaffChat plugin. Let me first check the existing code structure.

I’ll add PlaceholderAPI integration to your StaffChat plugin with:

  • PlaceholderAPI expansion for custom placeholders (%staff

[Generation stopped]

disaplin

add placeholderapi integration and impliment a shortcut to do it (putting # before a message to make it send to staff chat) but for regular players without permission its just a normal message with a # at the beginning

Kodari AI
KodariMar 7 at 10:03 pm 5,120 (v2)

I’ll read the existing files first to understand the current implementation, then add PlaceholderAPI integration and the # shortcut feature.

Now I’ll add PlaceholderAPI integration and the # shortcut feature.

Perfect! I’ve added PlaceholderAPI integration and the # shortcut feature.

Changes made:

  • Added PlaceholderAPI dependency and soft-depend declaration

  • Created PlaceholderAPI hook that automatically detects and enables placeholder support

  • Updated message formatting to parse placeholders (e.g., %player_name%, %vault_rank%, etc.) when PlaceholderAPI is available

  • Implemented # shortcut: staff with permission send to staff chat, regular players send normal messages with #

  • Added configurable shortcut settings (can disable or change the symbol)

Now staff can use #message as a quick shortcut, and you can use any PlaceholderAPI placeholders in your format string in config.yml!

disaplin

add hex codes, minimessage, and etc. support and make sure all commands in this plugin overrides any other plugins that could have the same commands

Kodari AI
KodariMar 7 at 10:08 pm 16,163 (v2)

I’ll read all existing files to understand the current implementation, then add MiniMessage support and ensure command overrides.

I’ll add MiniMessage, hex code support, and ensure command override functionality.

  • Creating ColorUtil for MiniMessage + hex + legacy support

  • Adding command override system to force priority over other plugins

  • Updating configs with MiniMessage examples

All files updated with MiniMessage support, hex code handling (&#RRGGBB format), and command override system that forces priority over other plugins using load: STARTUP and explicit command registration.

disaplin

add the old mc color does (&e, &a, &l, &r) alongside the minimessage, gradient and etc. support

Kodari AI
KodariMar 7 at 10:13 pm 10,961 (v2)

I’ll read the existing files to see the current ColorUtil implementation and then enhance it with legacy color code support.

Looking at the code, ColorUtil already supports both legacy codes and MiniMessage, but there’s a bug in the colorizeComponent() method and the mixed format support could be better. Let me fix and enhance it to properly support legacy codes (&e, &a, etc.), hex codes (&#RRGGBB), and MiniMessage tags all together in the same string.

Enhanced ColorUtil to properly support all formats together. Now you can use:

All three formats in the same string:

  • Legacy codes: &a, &e, &l, &r, etc.

  • Hex codes: &#FF5555

  • MiniMessage: <red>, <gradient:red:blue>, <rainbow>, etc.

Example usage:

YAML
# config.yml - all these work now:
prefix: "&8[&cStaff&8]&r"  # Legacy
prefix: "<dark_gray>[<red>Staff<dark_gray>]"  # MiniMessage  
prefix: "&#FF0000Staff Chat"  # Hex
prefix: "&a[<gradient:blue:green>Staff</gradient>&a]"  # Mixed!

The code now converts legacy and hex codes to MiniMessage format first, then processes everything together, allowing you to mix all three formats freely.

disaplin

its still not working make sure legacy still works with all this

Kodari AI
KodariMar 7 at 10:17 pm 4,900 (v2)

I’ll read all the current files to identify what’s not working with legacy chat support.

I can see the issue - MessageUtil.colorize() returns Component which only works on Paper, not legacy Spigot servers. For full compatibility, it needs to return String.

Changed MessageUtil to return String instead of Component for full legacy compatibility - now works on both Spigot and Paper servers while supporting MiniMessage and legacy color codes.

disaplin

whats the permissions

Kodari AI
KodariMar 7 at 10:20 pm 1,446 (v2)

I’ll check the project files to see what permissions are configured.

Based on the plugin files, here are the permissions for the StaffChat plugin:

Permissions:

  1. staffchat.use

    • Description: Allows access to staff chat

    • Default: op

    • What it allows: Send messages to staff chat and use the toggle command

    • Commands: /sc <message>, /sc toggle

  2. staffchat.sound

    • Description: Receive sound notifications for staff messages

    • Default: op

    • What it allows: Plays sound notifications when staff messages are sent

  3. staffchat.admin

    • Description: Allows reloading the configuration

    • Default: op

    • What it allows: Reload the plugin configuration

    • Commands: /sc reload

Usage Summary:

  • Regular staff members need staffchat.use to chat and staffchat.sound to hear notifications

  • Admins need staffchat.admin to reload the config

  • All permissions default to op (server operators)

You can assign these permissions using your permission plugin (like LuckPerms) to control who has access to each feature.

disaplin

add placeholder api support

disaplin

add placeholder api support

disaplin

add placeholderapi support

disaplin

add placeholderapi support

Kodari AI
KodariMar 13 at 4:36 am 17,545 (v2)

I’ll add PlaceholderAPI support to the StaffChat plugin. Let me first read the existing files to understand the structure.

I can see PlaceholderAPI is already partially integrated (it’s in build.gradle and MessageUtil uses it). However, I’ll create a PlaceholderAPI expansion so StaffChat can provide its own placeholders for other plugins to use.

PlaceholderAPI support added with custom expansion providing %staffchat_toggled%, %staffchat_status%, and %staffchat_prefix% placeholders.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
11 686
src/main/java/com/staffchat/StaffChat.java
package com.staffchat;

import com.staffchat.commands.StaffChatCommand;
import com.staffchat.integrations.StaffChatExpansion;
import com.staffchat.listeners.StaffChatListener;
import com.staffchat.managers.ConfigManager;
import com.staffchat.managers.StaffChatManager;
import lombok.Getter;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class StaffChat extends JavaPlugin {

    private ConfigManager configManager;
    private StaffChatManager staffChatManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.staffChatManager = new StaffChatManager(this);

        if (getServer().getPluginManager().getPlugin("PlaceholderAPI") != null) {
            com.staffchat.utils.MessageUtil.setPlaceholderAPIEnabled(true);
            new StaffChatExpansion(this).register();
            getLogger().info("PlaceholderAPI found! Placeholder support enabled.");
        }

        registerCommands();
        getServer().getPluginManager().registerEvents(new StaffChatListener(this), this);

        getLogger().info("StaffChat has been enabled successfully!");
    }

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

    private void registerCommands() {
        StaffChatCommand executor = new StaffChatCommand(this);
        
        PluginCommand staffchatCmd = getCommand("staffchat");
        if (staffchatCmd != null) {
            staffchatCmd.setExecutor(executor);
            staffchatCmd.setTabCompleter(executor);
        }
        
        PluginCommand scCmd = getCommand("sc");
        if (scCmd != null) {
            scCmd.setExecutor(executor);
            scCmd.setTabCompleter(executor);
        }
    }
}