4k.mates

can you make a velocity 3.5 compatible dynamic slots plugin what that means is that there is plus 1 max slot offset. for example when there is 0 players online tha max slots are 1 and when someone joins the max slots are 2

Kodari AI
KodariMar 10 at 4:18 pm 5,319 (v2)

I’ll create a Velocity 3.5 compatible dynamic slots plugin that always shows max slots as current players + 1.

DynamicSlots
A Velocity proxy plugin that dynamically adjusts the maximum player slots displayed in the server list. The max slots are always set to the current player count plus one, creating a dynamic capacity that grows with the player base. When zero players are online, it shows 1 slot available. When one player joins, it shows 2 slots, and so on. This gives a constantly updating and adaptive server capacity display.

Plugin created! This Velocity proxy plugin dynamically adjusts the max player slots shown in the server list to always be current players + 1. When the server list is pinged, it calculates the current player count and sets max slots accordingly (0 players = 1 max, 1 player = 2 max, etc.).

4k.mates

what compile method should i use java?

Kodari AI
KodariMar 10 at 4:18 pm 3,503 (v2)

For Minecraft plugin development with Gradle, use these dependency scopes:

compileOnly

Use for APIs provided by the server at runtime:

  • spigot-api / paper-api / bukkit

  • velocity-api (for proxy plugins)

  • bungeecord-api (for BungeeCord plugins)

  • Other plugins: vault, luckperms, placeholderapi, etc.

Gradle
compileOnly 'com.velocitypowered:velocity-api:3.3.0-SNAPSHOT'
compileOnly 'com.destroystokyo.paper:paper-api:1.20.1-R0.1-SNAPSHOT'

implementation

Use for libraries you bundle with your plugin:

  • hikari-cp (database connection pooling)

  • jedis (Redis client)

  • Other libraries your plugin directly imports

Gradle
implementation 'com.zaxxer:HikariCP:5.0.1'

annotationProcessor

Use for annotation processing (Velocity plugins):

Gradle
annotationProcessor 'com.velocitypowered:velocity-api:3.3.0-SNAPSHOT'

Never use:

  • ❌ shadowJar / shade plugins

  • ❌ implementation for server APIs (causes conflicts)

  • ❌ Manual jar packaging

XSeries and Kotlin stdlib are auto-detected - never add them manually!


Which is your project? Spigot, Paper, Velocity, or BungeeCord? I can show you the exact build.gradle setup.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
4 100
src/main/java/com/dynamicslots/velocity/DynamicSlotsPlugin.java
package com.dynamicslots.velocity;

import com.google.inject.Inject;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.proxy.ProxyServer;
import org.slf4j.Logger;

@Plugin(
    id = "dynamicslots",
    name = "DynamicSlots",
    version = "1.0.0",
    description = "Dynamically adjusts max player slots to current players + 1",
    authors = {"DynamicSlots"}
)
public class DynamicSlotsPlugin {

    private final ProxyServer server;
    private final Logger logger;

    @Inject
    public DynamicSlotsPlugin(ProxyServer server, Logger logger) {
        this.server = server;
        this.logger = logger;
    }

    @Subscribe
    public void onProxyInitialization(ProxyInitializeEvent event) {
        server.getEventManager().register(this, new ServerPingListener(server));
        logger.info("DynamicSlots has been enabled!");
        logger.info("Max slots will dynamically adjust to current players + 1");
    }
}