Skip to content

1wairesd/CommandGuard

Repository files navigation

CommandGuard

Cross-platform command blocker and tab-complete manager for Minecraft networks.

Modrinth Version Modrinth Downloads JitPack License CodeFactor


Platforms

Platform Versions
Paper / Spigot 1.16.5+
Velocity 3.x

Features

  • Tab-complete filtering — players only see commands they're allowed to use
  • Command blocking with custom actions: message, title, sound, console_command, give_potion_effect
  • Whitelist mode — allow only specific commands, block everything else
  • Permission groups with priority, inheritance (extends) and same-priority merging
  • Per-server groups — different tab lists per backend server (proxy only)
  • Cross-server TabSync — proxy pushes the allowed list to backend via plugin messaging
  • Spy-client protection — filters raw TAB_COMPLETE packets so hack clients can't discover hidden commands
  • Multi-languageen_EN, ru_RU bundled, add your own in plugins/CommandGuard/lang/
  • Colon command blocking — optionally block all namespace:command bypasses

Installation

  1. Download the jar for your platform from Modrinth
  2. Drop it into plugins/
  3. Start the server — config and lang files are generated automatically
  4. Edit plugins/CommandGuard/config.yml
  5. Run /cg reload (Spigot) or /cgv reload (Velocity)

API

Use the CommandGuard API to listen to the CommandBlockedEvent or query tab groups from another plugin.

Gradle

maven {
    name = "jitpack.io"
    url = "https://jitpack.io"
}
compileOnly 'com.github.1wairesd:CommandGuard:VERSION:api'

Maven

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
<dependency>
    <groupId>com.github.1wairesd</groupId>
    <artifactId>CommandGuard</artifactId>
    <version>VERSION</version>
    <classifier>api</classifier>
    <scope>provided</scope>
</dependency>

Replace VERSION with a release tag (e.g. 2025.04.4) or main-SNAPSHOT for the latest commit.

Usage example

// Listen to the blocked event on Spigot
@EventHandler
public void onCommandBlocked(BukkitCommandBlockedEvent event) {
    event.getPlayer().sendMessage("Blocked: " + event.getFullCommand());
    event.setCancelled(true); // allow the command through
}

// Query tab groups via the API
CGAPI api = CGAPIProvider.get();
List<String> allowed = api.getTabGroupManager().getTabCommands(permissions);

Commands

Command Platform Permission Description
/cg reload Spigot commandguard.admin Reload config and refresh tab for all players
/cg check <player> Spigot commandguard.admin Show active tab group for a player
/cg updategroup <player> Spigot commandguard.admin Push updated tab list to a player
/cgv reload Velocity commandguard.admin Reload config and push TabSync to all players
/cgv check <player> Velocity commandguard.admin Show active tab group for a player
/cgv updategroup <player> Velocity commandguard.admin Push TabSync to a player

Permissions

Permission Description
commandguard.admin Access to all /cg and /cgv commands
commandguard.bypass.commands Bypass command blocking
commandguard.bypass.tab Bypass tab-complete filtering
commandguard.tab.<group> Assign a player to a tab group

Documentation

1wairesd.github.io/1wairesdIndustriesWiki


License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages