headslayer303-spec

"I need a plugin where I can add a world name (for example, pvp) in the plugin's config folder. The plugin should create a separate folder for that world, and only the plugins/config files placed inside that world's folder should work in that specific world. Similar to how a proxy has separate plugin folders, I want each world to have its own separate plugin folder and only load those plugins in that world." Like that pluginconfigfolder world <lobby> our is folder my jo plugin add karo wo plugin hi is world my show ho our kam kare our ye commond bi ho /example world lobby plugin is sy us world ky plugin show ho jo kam kar rahy our jo nhi kar rahy is sary text ko English my likho

Kodari AI
KodariJun 25 at 1:10 pm 9
WorldPluginFolders
A per-world plugin configuration manager for Bukkit servers. Allows admins to define worlds in config, automatically creates isolated folder structures for each world inside the plugin directory, and lets you place plugin config files per world. Includes a command to inspect which plugins are configured and actively loaded per world. Supports dynamic world folder creation and real-time status checks via /wpf world &lt;name&gt;.

Here’s the plan:

  1. Main plugin class — loads config, initializes managers

  2. ConfigManager — reads world list, command name

  3. WorldManager — creates world folders, scans plugin subfolders, checks Bukkit plugin status

  4. WorldCommand — /wpf world <worldname> with tab completion

  5. plugin.yml, config.yml


How it works:

Folder Structure

After enabling, the plugin auto-creates:

Plain Text
plugins/WorldPluginFolders/
  worlds/
    lobby/          ← drop plugin config folders here
      Essentials/
        config.yml
      LuckPerms/
        config.yml
    pvp/
      CombatPlugin/
        config.yml
    survival/

Commands

Command
Description
/wpf world lobby
Shows all plugin folders inside
worlds/lobby/
— green ✔ if that plugin is currently loaded on the server, red ✘ if not
/wpf list
Lists all worlds from config and how many plugin folders each has
/wpf reload
Reloads config and creates any missing world folders

Setup Steps

  1. Add world names to config.yml under worlds:

  2. Run /wpf reload — folders are created automatically

  3. Drop plugin config subfolders inside each world’s directory

  4. Run /wpf world <worldname> to see status

Note: This plugin organizes and displays per-world config snapshots. To hot-swap a plugin’s config when switching worlds, you would extend PlayerChangedWorldEvent — let me know if you want that added.

Kodari can make mistakes. Review important code before using.
Files
src
Code
7 479
src/main/java/com/worldpluginfolders/WorldPluginFolders.java
package com.worldpluginfolders;

import com.worldpluginfolders.commands.WorldCommand;
import com.worldpluginfolders.managers.ConfigManager;
import com.worldpluginfolders.managers.WorldManager;
import org.bukkit.plugin.java.JavaPlugin;

public class WorldPluginFolders extends JavaPlugin {

    private ConfigManager configManager;
    private WorldManager worldManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.configManager = new ConfigManager(this);
        this.worldManager = new WorldManager(this, configManager);

        worldManager.initializeWorldFolders();

        String cmd = configManager.getCommandName();
        WorldCommand worldCommand = new WorldCommand(this, worldManager, configManager);

        if (getCommand(cmd) != null) {
            getCommand(cmd).setExecutor(worldCommand);
            getCommand(cmd).setTabCompleter(worldCommand);
        } else {
            getLogger().warning("Command '" + cmd + "' not found in plugin.yml! Check your config.");
        }

        getLogger().info("WorldPluginFolders enabled. Managing " + configManager.getWorlds().size() + " world(s).");
    }

    @Override
    public void onDisable() {
        getLogger().info("WorldPluginFolders disabled.");
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public WorldManager getWorldManager() {
        return worldManager;
    }
}