rma.ftbl
📎 1 file 1,619 chars
📄
pasted-code-1779183728545.txt
txt 33 lines
▶
Create a Minecraft Paper/Spigot plugin (1.20+ compatible) that adds a cross-platform mute system between Minecraft and Discord.

Minecraft side requirements:

Implement a /mute  [reason] command for players with mute.use permission.

Muted players cannot send messages in chat.

If a muted player tries to chat, show them: You are muted. Reason: 

Show other online players:  is muted and cannot chat.

Implement /unmute  command.

Mute data must persist across server restarts (stored in a file or lightweight database like SQLite).

Add a permission node: mute.bypass — players with this can chat while muted.

Discord bot integration:

Assume an existing Discord bot with a command handler is running alongside the Minecraft server.

The bot has a working /mute command that mutes a user in Discord channels.

The plugin must listen to that existing bot's /mute command via a simple HTTP endpoint, Redis, or a shared database (your choice, but implement a REST API or socket listener inside the plugin).

When the Discord bot executes /mute @User reason, the bot sends a POST request to http://localhost:8080/api/mute (or similar) with JSON: {"discord_id": "123", "minecraft_username": "PlayerName", "reason": "spam", "duration_minutes": 10}

The plugin receives this request and applies the same Minecraft mute (including reason and optional duration).

Likewise, if a Minecraft player is muted via /mute in-game, the plugin should optionally notify the Discord bot via a webhook or second API call (configurable).

Configuration options (config.yml):
Kodari AI
KodariMay 19 at 9:44 am 10,959 (v2)

I’ll create a cross-platform mute system plugin that integrates Minecraft with Discord.

CrossMute
A unified mute system that synchronizes punishments between Minecraft and Discord. Players muted in-game are automatically muted in Discord and vice versa. Features persistent mute storage, duration-based temporary mutes, bypass permissions, and a REST API for external integrations. Includes webhook notifications to keep both platforms synchronized. Supports custom mute reasons and expiration tracking.

Now I’ll create the plugin structure with all necessary components.

All core files have been created! The plugin includes:

Core Components:

  • CrossMutePlugin - Main plugin class with manager initialization

  • MuteManager - Handles mute storage, persistence, and expiration checking

  • MuteData - Data model for mute information

Commands:

  • /mute <player> [duration] [reason] - Mute players with optional duration

  • /unmute <player> - Remove mutes

Features:

  • REST API server on port 8080 with /api/mute, /api/unmute, /api/status endpoints

  • Discord webhook notifications for in-game mutes/unmutes

  • Persistent storage in mutes.yml

  • Automatic expiration checking every 60 seconds

  • Permission mute.bypass to chat while muted

  • API key authentication for external requests

The Discord bot can POST to http://localhost:8080/api/mute with JSON containing discord_id, minecraft_username, reason, and duration_minutes to sync mutes from Discord to Minecraft.

rma.ftbl

remove ALL discord integration

Kodari AI
KodariMay 19 at 12:48 pm 27,434 (v2)

I’ll remove all Discord integration components from the plugin.

All Discord integration has been removed. The plugin now operates as a standalone Minecraft mute system with:

  • /mute <player> [duration] [reason] command

  • /unmute <player> command

  • Persistent mute storage in mutes.yml

  • Automatic expiration checking

  • mute.bypass permission to chat while muted

  • mute.notify permission to see mute/unmute notifications

  • Configurable messages and mute settings

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
10 476
src/main/java/com/crossmute/CrossMutePlugin.java
package com.crossmute;

import com.crossmute.command.MuteCommand;
import com.crossmute.command.UnmuteCommand;
import com.crossmute.listener.ChatListener;
import com.crossmute.manager.MuteManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CrossMutePlugin extends JavaPlugin {
    
    private MuteManager muteManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.muteManager = new MuteManager(this);
        
        muteManager.load();
        
        getCommand("mute").setExecutor(new MuteCommand(this));
        getCommand("unmute").setExecutor(new UnmuteCommand(this));
        
        getServer().getPluginManager().registerEvents(new ChatListener(this), this);
        
        getServer().getScheduler().runTaskTimer(this, () -> {
            muteManager.checkExpiredMutes();
        }, 1200L, 1200L);
        
        getLogger().info("CrossMute has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (muteManager != null) {
            muteManager.save();
        }
        
        getLogger().info("CrossMute has been disabled!");
    }
}