Hi, i have discovered a way to cheat slots to your server without paying any extra money(if your server provider charges you money for that) Its this simple code right here Code (Text): private void cheatSlots(int amount) { MinecraftServer ms = ((CraftServer) getServer()).getServer(); try { Field playerListField = ms.getClass().getField("v"); playerListField.setAccessible(true); Field playerCount = playerListField.getClass().getField("maxPlayers"); playerCount.setAccessible(true); playerCount.set(playerCount, amount); } catch (Exception e ) { getLogger().log(Level.WARNING, "Failed to cheat Minecraft server slots", e); e.printStackTrace(); } } So lets break it down. First we get the Minecraft Server instance Then we get field "v", that refers to PlayerList class we need to set it accessible because it is private, not public How do i know that ? if you use BuildTool and you go to work/decompile-<some number here>/net/minecraft/server/ there is the source code for vanilla* minecraft server So we have Field "v", what next ? we get the class of Field "v" and we get field "maxPlayers" and we need to set it accessible again, because it is protected not public and then we set that to like a 100 and here we go, we now have 100 slots on our server without paying any extra money DISCLAIMER: I DO NOT take any responsibility for the damage you can cause I DO NOT take any responsibility if your server provider discovers you are doing this, and removes your server or something. I DID NOT test this code yet, i don't know if this works, in theory it should, if it does not, tell me in comments WARNING: You WILL get into trouble if you use this code on your own * = probably not full vanilla, there might be some modifications
If your hosting company has limitations on your player cap, there's a reason for it. I see no reason to intentionally circumvent restrictions made by a company, especially considering it could get you into some serious trouble. We consider this malicious code (evidently not as serious as a force-op resource, but malicious none-the-less). It would probably just warrant a warning and resource removal if it were published on the resources section - At least as far as I've been informed. Maybe another resource staff could confirm that for me, but eh... EDIT: I feel like it's also worth noting that most of us here are rather experienced developers and either 1. Do not run a server, or 2. Would have figured out how to do this on our own Also... ServerListPingEvent#setMaxPlayers() - Nah this is client bound packet manipulation
I agree, however mild the malicious code is, it still is. I don't see the point in cheating out a hosting company. You get what you pay for, it's as simple as that.
That sets what what will player see in their client, not how many clients can connect to server the the same time
Just looked at the source code and realized that is in fact what it does My bad. Either way, my first reply still applies
But you know what is funny, it is that easy to bypass the slot limit, can't they just make an plugin that will get that variable and report it to the backend and that will check if stuff matches ? is it that hard ? If you want to host servers, make it so it is not that easy to break, more ppl use your hosting, more ppl will think "How can i break this ?" because ppl will try to break it. Like me
Why even bother with slots, if they can just limit you through hardware (which is also the reason there is a slot limit, like @2008Choco suggested). Also, you can just uncancel the PlayerLoginEvent if the reason is KICK_FULL
hey, 16GB ram probably isnt going to limit me, and 4x Intel Xeon also not BUT Hicoria allows you to set only some amnout of players, they dont allow you to use like 100 slots for 2GB ram (Hicoria is just an example)
Hicoria charges you like a dolar per 5 slots, and they limit slots by the number of ram you have, like WTF ? if i want 10 slots i need 4 GB ram.
All the VPS i bought have FTP, and a web panel isn't a big deal you can do most stuff with putty easily, i had no idea what a VPS was some months ago, you just have to learn and put some effort into it. What i think is a big deal is security, way easier to get hacked.