Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Bypass pre-set slots, some shared host's do this so here is a simple bypass.
package com.colt.SlotsBypass;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.server.ServerListPingEvent;
public class SlotsBypass extends JavaPlugin implements Listener{
String permission = getConfig().getString("permission");
int maxplayers = getConfig().getInt("max-players");
public void onEnable() {
Bukkit.getServer().getPluginManager().registerEvents(this, this);
@EventHandler(priority = EventPriority.NORMAL)
public void playerLogin(PlayerLoginEvent e) {
Player p = e.getPlayer();
if(e.getResult() == PlayerLoginEvent.Result.KICK_FULL && !(Bukkit.getOnlinePlayers().size() > maxplayers &&
p.hasPermission(permission))) {
public void ping(ServerListPingEvent e){
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment