sebbe_pl

make me a plugin for admin chat i want the command to be /ac and let only people that have permission to write on the chat to see this

Kodari AI
KodariJan 20 at 9:48 pm 2,776 (v2)

I’ll create a simple admin chat plugin with the /ac command for staff communication.

AdminChat
A lightweight admin chat system enabling staff members to communicate privately in-game. Players with the admin.chat permission can send and receive messages using the /ac command. Features customizable message formatting and color-coded prefixes to clearly distinguish admin communications from regular chat.

Plugin created! Features:

  • Command /ac <message> for admin chat

  • Permission admin.chat required to send and receive messages

  • Customizable prefix and message format in config.yml

  • Only players with permission can see admin chat messages

  • Console can also send admin chat messages

sebbe_pl

add also possibility for admins to check players /msg what they type to other player and such also add possibility for owner to see what commands other admins have used and when same for checking msg what time and between who

Kodari AI
KodariJan 20 at 9:51 pm 6,467 (v2)

I’ll add message and command tracking features for admins and owners. Let me first read the existing files to understand the structure.

Now I’ll implement the tracking features:

  • Message spy for admins to see player /msg

  • Command tracking for owners to see admin commands

  • Log viewing commands with timestamps

Features added:

Message Spy System:

  • /spy - Toggle message spy to see all player /msg, /tell, /w, /whisper commands in real-time

  • Admins with admin.spy permission can monitor private messages between players

  • Messages are logged to plugins/AdminChat/logs/messages/YYYY-MM-DD.log

Command Tracking:

  • All commands used by admins (players with admin.chat permission) are automatically logged

  • Logs stored in plugins/AdminChat/logs/commands/YYYY-MM-DD.log

  • Includes timestamp and full command

Log Viewing:

  • /logs messages [date] [player] - View message logs

  • /logs commands [date] [player] - View command logs

  • Shows last 20 entries by default

  • Filter by date (YYYY-MM-DD format) and/or player name

  • Owners can see what commands admins used and when

All logs include timestamps in format: [YYYY-MM-DD HH:mm:ss]

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
8 425
src/main/java/com/adminchat/AdminChat.java
package com.adminchat;

import com.adminchat.commands.AdminChatCommand;
import com.adminchat.commands.LogsCommand;
import com.adminchat.commands.SpyCommand;
import com.adminchat.listeners.MessageSpyListener;
import org.bukkit.plugin.java.JavaPlugin;

public class AdminChat extends JavaPlugin {
    
    private MessageSpyListener spyListener;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        spyListener = new MessageSpyListener(this);
        getServer().getPluginManager().registerEvents(spyListener, this);
        
        getCommand("ac").setExecutor(new AdminChatCommand(this));
        getCommand("spy").setExecutor(new SpyCommand(this, spyListener));
        getCommand("logs").setExecutor(new LogsCommand(this));
        
        getLogger().info("AdminChat has been enabled!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("AdminChat has been disabled!");
    }
}