CoreProtect Tutorial

"*CoreProtect is a fast, efficient, data logging and anti-griefing tool. Rollback and restore any amount of damage. Designed with large servers in mind, CoreProtect will record and manage data without impacting your server performance.*"

CoreProtect will log any action on your server allowing you to keep track of who placed or broke blocks, removed items from a storage block, and who killed specific mob types in a radius. Furthermore, it allows you to roll back (AKA undo) the changes made by specific users within a specified period of time.

### How to Install It

If the server software you use allows adding plugins then:

1. Download the plugin's jar file from the official plugin page. This will require creating or signing into your SpigotMC account.
2. Upload the plugin jar to your Minecraft server's file directory within the "**plugins**" folder.
	* Usually Minecraft host panels (I.e. Multicraft or Pterodactyl) will allow directly uploading files that are under 1 MB in size. For beginners this can be an easier way to update your plugins.
	* Alternatively, to add or update multiple plugin jars at once you may connect to your server's files using an FTP/SFTP client such as FileZilla or WinSCP.
3. Restart your server.
4. Optionally set CoreProtect to use a MySQL database to store data. CoreProtect has to log many actions and thus it is known to take up a lot of data over the course of your server map's existence (I.e. 25+ GB). Storing the data in a MySQL database will store the data outside of your MC server's files and has several other benefits.
	* In your MC server host's panel create a MySQL database.
		+ Multicraft Steps: https://youtu.be/COfNVnKxxbA
		+ Pterodactyl Steps:
		+ If you're not sure which your server host uses then you may ask them or just look at both guides and see which looks similar.
	* Then view your server's files.
	* Go into plugins > CoreProtect > config.yml.
	* Then edit the MySQL details to be a MySQL database credentials you have created.

### Command Usage

Commands use the prefix "/co" when typing the plugin's commands in-game. In order to use CoreProtect commands a player must be opped or have the relevant command's permission assigned to them in a permissions plugin, such as LuckPerms.

#### `/co inspect`

1. Alias: `/co i`
2. Purpose: Toggle viewing block data.
3. Usage: Right-click & left-click blocks to view block data history of broken & placed blocks.
4. Example:
5. Example of when this command is useful:
	* Let's say your server does not allow destroying other people's builds (AKA griefing). If someone griefs then you can view who it was and how long ago they did it.
6. Official Wiki Link: here.

#### `/co lookup` `[params]`

1. Alias: `/co l [params]`
2. Purpose: Lookup actions a user performed by specifying relevant parameters to narrow down your results. Almost all parameters are optional.
3. Usage Example: /co lookup player:\_DragonsEatPigs time:1h radius:100 b:deepslate\_diamond\_ore
	* This will search for all deepslate\_diamond\_ore that the player \_DragonsEatPigs has mined within 100 blocks of where you, the one running the command, are standing.
4. Example: See image.
5. Example of when this is useful:
	* If someone uses an x-ray hack or resource pack then you can still catch them even months after they've done the deed. For instance, periodically you can lookup all instances of when players mined deepslate\_diamond\_ore within the last X days and then teleport them to inspect their surroundings and see if the player mined straight to the ore or not (more on this later).
6. Parameters:

7. Official Wiki Link: here.

#### `/co rollback` `[params]`

1. Alias: `/co rb [params]`
2. Purpose: Rollback (undo) data using specified parameters to determine what you are undoing.
3. Usage: `/co rb p:_DragonsEatPigs t:1d r:100`
	* This would rollback everything \_DragonsEatPigs did in the last day within a 100 block radius of where you are standing.
	* **Side note regarding staff abuse:**
		+ It is recommended to not give anyone on your staff team this power- only yourself. The command can be abused to duplicate items. I've encountered *many* "trusted" staff that abused this power over the years on many servers. If you want to avoid grief then use an anti-grief land claim plugin, such as Grief Prevention.
	* With great power comes great responsibility.
		+ Keep in mind the ability to roll back things is a very powerful command. It could can be used for great good or great harm depending on its usage. You could destroy the server with a single command, destroy a specific user's life with a command, or duplicate items using it. However, it can also be used for good things like rolling back x-ray tunnels and rolling back inappropriate builds made in the world. Or rolling back **everything** a new player (that was caught x-raying) did, to prevent their hidden diamond storage(s) from entering the server's economy at some point. Only do this for new players, not regular players caught x-raying as modifying too much will drastically change many builds the user helped make, forests the user chopped, etc.
4. Parameters: See the "`/co lookup [params]`" section for a table providing the list of parameters.
5. Official Wiki Link: here.

Additional commands can be found on the CoreProtect's Official Wiki page here.

### Find Players That Are Using X-Ray

X-Ray is the act of using a modded client (aka a "Hacked" client) or X-Ray resource pack that allows a player to see exact ore and mob spawner locations. It is usually not allowed on servers but some malicious players will use it anyways. Contrary to popular belief, you do not need to be online at the same time as the player x-raying in order to catch and ban them for x-raying. CoreProtect will allow you to catch players both during the act and long after they have done so.

**Here's an example of how to use "/co lookup" and "/co inspect" to find X-Rayers:**

John322 and MyNameIsKittens12 are doing some serious x-raying. They've obtained 576 diamond blocks worth of diamonds and have more coming. However, they're also very cautious and make sure to only mine at 3:00 am when all server's staff are asleep. A few days pass and they think they got away with it. Then a staff member (YOU) decide to check all recent diamond ore mined locations.

You type: `/co lookup t:5d r:global b:deepslate_diamond_ore, diamond_ore`. This command will check who has broken or placed diamond ore in the last 5 days. It also shows you the time the ore was mined/placed and the coordinates. You may then click the coordinates in order to teleport them.

Now you're in the tunnel where the diamond ore was mined. Use `/gm 3` (spectator mode) to view the tunnels and see if they look straight and fairly normal, or totally random like they were mining to specific spots. Some x-rayers are more careful than others, but generally most x-rayers will mine straight to diamond ore many many times. Keep in mind that just because someone is mining randomly does not mean they are x-raying. Additionally, if someone has mined 3 diamond ore veins in a row using this random pattern, that's suspicious yes. But not enough to ban them because it could be luck.

With the combination of `/co i` to check for other diamond ore locations in the area, and an x-ray resource pack (yes, you should be using an x-ray resource pack when checking for x-rayers), you can get a pretty good idea of whether someone was x-raying or not. It certainly never hurts to also ask other staff members to review it and get a second opinion. Keep in mind when using an x-ray resource pack that if there are other diamond ore veins (not singular diamonds) nearby that are clearly visible from the tunnel, the player probably wasn't x-raying.

It is important to note that there is a lot that goes into determining whether a player is actually x-raying or not. In short, if a player is mining directly to diamond ore 15 times in a row, they're probably x-raying and you should consult with other staff to see what they think (as they may see something you do not).

Lastly, note there are **A LOT** of reasons why a player may suddenly change direction while mining and run into diamond ore, for example. Similarly, a player may mine *STRAIGHT* to a zombie spawner dungeon. Neither of these guarantee the player was x-raying. If a player suddenly changes direction maybe they ran into an obstacle they didn't want to deal with such as gravel, dirt, lava, water, or mobs. And if they mined straight to a spawner they could've been using subtitles for their sound (which helps find things like that). Be sure to confront the player about why they did X before banning them.

### Additional Information

* Plugin Page: https://www.spigotmc.org/resources/coreprotect.8631/
* Official Wiki: https://docs.coreprotect.net/
* Official Discord: https://discord.gg/b4DZ4jy
* Bug Reporting: https://github.com/PlayPro/CoreProtect/issues