LawrenceThePlayer
📎 1 file 1,146 chars
📄
perm.txt
txt 42 lines
▶
You are an expert Minecraft Paper/Spigot plugin developer (Java 17+).

Build a plugin that automatically scans all installed plugins and registers their commands as LuckPerms permissions.

All permissions MUST use this format:
flyhighsmp.perm.
flyhighsmp.perm..

CORE FEATURES:
1. Scan all loaded plugins on startup
2. Extract all commands (including aliases when possible)
3. Convert commands into permission nodes using the format above
4. Register permissions using LuckPerms API ONLY (no config edits)
5. Add permissions to the default group
6. Avoid duplicate permissions

EDGE CASES:
- Plugins with no commands
- Dynamic runtime commands
- Command aliases
- Conflicts

OPTIONAL:
- /permreload command
- Config file for blacklist/enabled plugins
- Debug mode
- /permlist command

ARCHITECTURE:
- Separate classes for scanning, generating, and LuckPerms handling
- Use Bukkit PluginEnableEvent / PluginDisableEvent

OUTPUT:
- Full Java source code
- plugin.yml
- Maven or Gradle setup
- config.yml example
- Setup instructions

RULES:
- Do NOT edit LuckPerms config files
- Must be optimized and production-ready
Kodari AI
KodariApr 10 at 6:11 pm 15,920 (v2)

I’ll create a comprehensive plugin that scans all installed plugins and registers their commands as LuckPerms permissions.

CommandPermSync
Automatically scans all plugins and registers their commands as LuckPerms permissions with the format flyhighsmp.perm.<command>. Features include automatic scanning on plugin load/unload, configurable blacklist, debug mode, and admin commands for permission management. Integrates with LuckPerms API to add permissions to default groups without manual configuration.

Now I’ll create the complete plugin structure:

All files created! The plugin will:

  • Scan all plugins on startup and register their commands as LuckPerms permissions

  • Use the format flyhighsmp.perm.<command> and flyhighsmp.perm.<command>.<subcommand>

  • Register permissions directly via LuckPerms API (no config editing)

  • Handle dynamic plugin loading/unloading

  • Support blacklisting plugins and defining subcommands in config

  • Provide admin commands for reloading and listing permissions

LawrenceThePlayer

add allowed plugin,

Kodari AI
KodariApr 10 at 6:23 pm 4,137 (v2)

I’ll read the project files to understand the current structure and then add the allowed plugin feature.

I’ll add an “allowed plugins” whitelist feature to complement the existing blacklist system.

Plan:

  • Add allowed-plugins config option (when populated, only these plugins are scanned)

  • Update ConfigManager to read allowed plugins list

  • Update PluginScanner logic to support whitelist mode

Added whitelist mode: when allowed-plugins is populated, only those plugins will be scanned for commands. When empty, blacklist mode is used as before.

LawrenceThePlayer
📎 1 file 2,026 chars
📄
perm.txt
txt 77 lines
▶
You are an expert Minecraft Paper/Spigot plugin developer (Java 17+).

Build a plugin that automatically scans only allowed installed plugins and registers their commands as LuckPerms permissions.

All permissions MUST use this format:
flyhighsmp.perm.
flyhighsmp.perm..

CORE FEATURES:
1. Plugin Scanning
- Scan all loaded plugins on startup
- Only process plugins listed in allowed-plugins in config
- Ignore all other plugins completely

2. Permission Generation
- Extract all c (including aliases when possible)
- Convert each command into permission nodes:
flyhighsmp.perm.
flyhighsmp.perm..

Example:
- /warp home ? flyhighsmp.perm.warp.home
- /kit starter ? flyhighsmp.perm.kit.starter

3. LuckPerms Integration
- Use LuckPerms API ONLY
- Do NOT edit LuckPerms config files
- Register permissions into the default group
- Avoid duplicate permissions

CONFIG STRUCTURE:

allowed-plugins:
  - Essentials
  - WorldEdit
  - LuckPerms

permission-format:
  prefix: "flyhighsmp.perm"
  
  essentials:
    worlds:
      - world
      - world_nether

WORLD RESTRICTION RULE:
- Each plugin can define its own allowed worlds
- If a plugin has its own section, it overrides default
- If player is in a world not listed, permissions do not apply there

OPTIONAL FEATURES:
- /permreload ? reload config and rescan plugins
- /permlist  ? list generated permissions
- Debug mode logging

ARCHITECTURE:
- PluginScanner (detect plugins + commands)
- PermissionGenerator (build permission nodes)
- LuckPermsHandler (register permissions)
- WorldPermissionManager (checks allowed worlds per plugin)

Use Bukkit events:
- PluginEnableEvent
- PluginDisableEvent

OUTPUT REQUIRED:
- Full Java source code
- plugin.yml
- Maven or Gradle build file
- config.yml example
- Setup instructions

RULES:
- Do NOT modify LuckPerms config files
- Must be production-ready and optimized
- Must support dynamic plugin loading/unloading
- Must prevent duplicate permission registration
Kodari AI
KodariApr 10 at 6:52 pm 22,616 (v2)

I’ll analyze the existing project structure and build out the complete plugin functionality.

Looking at the existing code, I can see the core functionality is in place but missing the world restriction feature from the requirements. I’ll implement this critical feature along with some improvements.

Analysis:

  • Core scanning and permission registration works

  • Missing: Per-plugin world context for LuckPerms

  • Missing: World restriction configuration structure

  • Need: Enhanced permission registration with world context

All files have been updated with world restriction functionality. The plugin now supports per-plugin world contexts in LuckPerms, allowing permissions to only work in specified worlds.

LawrenceThePlayer

use allowed world instead of blocklist

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
Code
12 668
src/main/java/com/flyhighsmp/commandpermsync/CommandPermSync.java
package com.flyhighsmp.commandpermsync;

import com.flyhighsmp.commandpermsync.command.PermListCommand;
import com.flyhighsmp.commandpermsync.command.PermReloadCommand;
import com.flyhighsmp.commandpermsync.config.ConfigManager;
import com.flyhighsmp.commandpermsync.generator.PermissionGenerator;
import com.flyhighsmp.commandpermsync.listener.PluginLoadListener;
import com.flyhighsmp.commandpermsync.luckperms.LuckPermsHandler;
import com.flyhighsmp.commandpermsync.scanner.PluginScanner;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.List;
import java.util.Map;

@Getter
public class CommandPermSync extends JavaPlugin {
    private ConfigManager configManager;
    private PluginScanner pluginScanner;
    private PermissionGenerator permissionGenerator;
    private LuckPermsHandler luckPermsHandler;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.pluginScanner = new PluginScanner(this);
        this.permissionGenerator = new PermissionGenerator(this);
        this.luckPermsHandler = new LuckPermsHandler(this);
        
        if (!luckPermsHandler.isAvailable()) {
            getLogger().severe("LuckPerms not found! Disabling plugin.");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }
        
        Bukkit.getPluginManager().registerEvents(new PluginLoadListener(this), this);
        
        getCommand("permreload").setExecutor(new PermReloadCommand(this));
        getCommand("permlist").setExecutor(new PermListCommand(this));
        
        Bukkit.getScheduler().runTaskLater(this, this::performInitialScan, 20L);
        
        getLogger().info("CommandPermSync enabled successfully!");
    }

    @Override
    public void onDisable() {
        getLogger().info("CommandPermSync disabled.");
    }
    
    public void performInitialScan() {
        if (configManager.isDebug()) {
            getLogger().info("Starting initial plugin scan...");
        }
        
        Map<String, List<String>> allCommands = pluginScanner.scanAllPlugins();
        int totalRegistered = 0;
        
        for (Map.Entry<String, List<String>> entry : allCommands.entrySet()) {
            String pluginName = entry.getKey();
            List<String> commands = entry.getValue();
            
            for (String command : commands) {
                List<String> permissions = permissionGenerator.generatePermissions(command);
                for (String permission : permissions) {
                    if (luckPermsHandler.registerPermission(permission, pluginName)) {
                        totalRegistered++;
                        if (configManager.isDebug()) {
                            getLogger().info("Registered: " + permission + " (from " + pluginName + ")");
                        }
                    }
                }
            }
        }
        
        getLogger().info("Registered " + totalRegistered + " command permissions from " + allCommands.size() + " plugins.");
    }
}