How can I combat and prevent hacking on a vanilla Minecraft server?

I have a vanilla minecraft server (1.8.7) and I've taken some measures to prevent hacking, but I still have people logging in and breaking stuff at spawn.
Here are some things I've tried to prevent hacking:
Ops.json
file is read-only, which is preventing people from adding themselves as OP using certain software.- Command blocks constantly change gamemodes from creative to survivor for anyone in creative that isn't me.
- Command blocks kill any activated TNT in the spawn protected area.
- Books and quills are removed from peoples inventories to prevent them from using them to hack.
- The
spawn-protection
setting inserver.properties
set to about 70 (but people are still managing to break individual blocks somehow). - Ban people who are cheating (but I can't always be online)
I've also read that the Bukkit anti-cheat mods aren't 100% when it comes to hacked clients themselves.
Is there anything else I can do to prevent people from logging in and breaking stuff? I have some loyal players and I hate having to do roll-backs and make everyone lose hours of work on the server...
Best Answer
Try making a redstone clock, and attaching a command block to it. In the command block, input this command: /gamemode 2 @a[x=(centre of your spawn X), y=(Y of your spawn), z=(Z of your spawn), r=(The radius you want)
. That will give Adventure mode to anyone within the custom Radius of your spawn.
Pictures about "How can I combat and prevent hacking on a vanilla Minecraft server?"



Does vanilla Minecraft have anti cheat?
Absolutely! Lots of vanilla servers use command-block powered anticheat systems. Show activity on this post. Vanilla does not protect against any hacks except flying.Can you get hacked by playing Minecraft?
Microsoft, which owns Minecraft, confirmed that some versions of the world's best-selling game are vulnerable to a new online security flaw that could give control of the computer to hackers. \u201cThe vulnerability poses a potential risk of your computer being compromised,\u201d said Minecraft in a statement.Does 2b2t allow hacking?
As the server has virtually no rules or authority, griefing and hacking are common amongst players, with no risk of getting banned. The server is permanently set to hard difficulty and player versus player combat is enabled throughout.Can someone hack a server?
There are two primary ways a server may be compromised: The hacker has guessed a password of a user on the server. This may be a email, ftp, or ssh user. The hacker has gained access through a security hole in a web application (or its addons/plugins) such as WordPress, Joomla, Drupal, etc.Hacking is allowed on this Minecraft Server
More answers regarding how can I combat and prevent hacking on a vanilla Minecraft server?
Answer 2
Use a whitelist and player-vetting
Rather than being reactive and banning problem players, be proactive and restrict connections only to the people you personally allow.
Players can act as a vetting service for new players too: if they refer their friends, there's a level of trust and your chances of adding a troll is significantly reduced.
From the Minecraft Server/Admin Console:
# Enable/Disable the Whitelist
/whitelist on
/whitelist off
# Add/Remove a player to the Whitelist
/whitelist add <PlayerName>
/whitelist remove <PlayerName>
# List all players currently whitelisted
/whitelist list
You can also modify the whitelist manually, by enabling it in server.properties
and then adding names to white-list.txt
(or in later versions, whitelist.json
). If you modify these files while the server is running you can force a reload without restarting the server:
# Reload the whitelist from disk
/whitelist reload
Note that OPs will bypass the whitelist, so no need to add them to the list explicitly.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Darya Sannikova, Brett Sayles, Brett Sayles, Erik Mclean