GriefPrevention for Minecraft
Automatically prevent all types of grief!
GriefPrevention is a Minecraft plugin designed to protect servers from grief.
Before I begin explaining the history of this project, it is important to understand some keywords.
Forge: a community driven minecraft modding platform focused on both client and server.
Sponge : a community driven minecraft modding platform currently focused on servers.
SpongeForge: part of the Sponge ecosystem designed as a coremod for Forge. It essentially gives Forge servers the ability to run Sponge plugins as well as use all the enhancements that Sponge adds such as performance.
SpongeVanilla: part of the Sponge ecosystem designed as a vanilla server replacement in order to run Sponge plugins.
SpongeAPI: a minecraft API designed from the ground up with mods in mind. It is different from Bukkit API in that it doesn't have hooks for vanilla only features but rather generic hooks to allow for mod support.
Bukkit : a minecraft API that allows developers to expand the functionality via plugins.
WorldGuard: a Bukkit plugin designed to protect regions.
MCPC/Cauldron: a minecraft server replacement that hooked into both Forge and CraftBukkit in order to allow both mods and bukkit plugins to run together. This project ended at the same time of CraftBukkit back in 2014.
GriefPrevention was originally created by BigScary for the Bukkit platform and is currently being maintained on a fork located here.
Back in October 2015, I reached out to BigScary to see if he would port his project to the Sponge platform. He explained how he had no time to take on another project but had no problem if I was able to port it. Sponge is another project I originally started with sk89q. It's essentially the replacement for what MCPC/Cauldron used to be but far better due to all the talented developers we have acquired over the years. As one of the Sponge leads, we desperately needed a plugin to protect sponge servers from grief so I decided to take on the task of porting GriefPrevention.
The Sponge version of GriefPrevention is now mostly rewritten due to the need of supporting mods and all the extra features I have added along the years. However, it does attempt at keeping the original look/feel intact for Bukkit users that come to Sponge.
GriefPrevention, for Sponge, is a plugin that provides self-service region protection functionality, giving you additional options to fine tune aspects such as door, chest, and build permissions for users or groups of users! Below are some basic instructions for claim management.
A claim represents an area or volume of blocks for protection. You create claims by using a golden shovel (configurable) or using WorldEdit and using the
/claim command. Once created a user can setup flags, trust, permissions, options, and more to protect their claim.
There are 5 Types of claim's :
- Admin - A claim designed for admins that can be created around any other type of player claim. Creating an admin claim around another claim allows the admin to force protection settings to all claims within it. Admin claims have no size limitations and are immune to expirations.
- Basic - The default claim used by players. It supports subdivisions.
- Subdivision - A subdivision is a claim within
- Town - A claim designed for players to manage other basic claims. It currently supports any type of player claim within it. With town claims, players inside the town gain the Town Chat feature which allows everyone within town to chat with eachother. The town owner controls all claims within except for admin claims.
- Wilderness - A global claim that covers all land not claimed by players. There is only 1 wilderness claim per world that cannot be deleted. It is used to manage protection in all unclaimed land. It is also used for global bans that affect all claims.
There are 2 different claim creation modes which define how the claim is shaped :
- 2D - Claims the area from bedrock to sky.
- 3D(Cuboid) - In 3D mode the Y-level is set depending on where exactly you clicked allowing for more control over your exact claim size.
To switch between modes use
For a player to claim an area or volume, they need the permissions and enough claim blocks for the size of their claim which can be configured with Options.
You create claims with a golden shovel (configurable), which can also change claim size and position.
- Creating a new claim: Right click at two points to mark the corners
- Resizing a claim: Right click once in an existing claim to see the markers. Right click on a corner block and then again on a different position to move that corner.
- Cancelling operations: Putting away a golden shovel without completing an operation cancels all actions
Basic tool, you can use it to indicate the position of claims, and identify who the owners of the claims are.
- Right clicking shows existing claim locations
- Shift right clicking searches for all claims in a 100 block radius and shows their location
- Left clicking hides the markers
The trust system is designed for basic protection management. Trust can be given to a specific player or group of players.
There are four different types of trust: Accessors, Builders, Containers, and Managers.
Access trust allows a player to interact with any other non-inventory block.
Example: Lever, Door, Piston
Container trust includes access with the addition of inventory blocks.
Build trust includes container with the addition of allowing the player to place and break blocks.
Manager trust includes builder with the addition of editing the claim such as resizes. It does not allow the player to delete a claim. Only the owner can do this.
For more information, see Trust System
The flag system is designed for advanced protection. Flags can be applied to players, groups, or claims directly.
A list of all current flags can be found here :
The flag system is similar to WorldGuard but more advanced as it is more generic in order to support mods. The biggest change is the ability to define sources. Sources allow a player to control protection based on the source of the event. For example, a player can prevent enderman from placing blocks by specifying
minecraft:enderman as a source. This makes the system more efficient as it avoids having to add a new flag just to handle a specific source.
To make it easier to manage flags, I created a clickable chat interface to quickly modify flags as well as check current settings.
Here is a screenshot showing the
/cf command screen
For more information, see Flags
Options are a way to configure plugins using player/group contexts through your permission system, this gives you the benefit of being able to set different settings for different players, groups, worlds etc.
GriefPrevention makes use of this permissions feature by giving the player the ability to apply claim options to a player, group, or specific claim.
For example, the option
griefprevention.blocks-accrued-per-hour controls how many blocks a player accumulates as they play. An admin could adjust this option for their VIP rank providing a greater incentive to become a VIP.
For a full list of options, see Advanced Options
GriefPrevention supports global bans with the addition of showing a player the reason why the ban is in place.
Below is a screenshot showing an active ban.
GriefPrevention provides a near complete API for developers to create plugins that extend functionality or hook into GP for server specific needs.
One GP plugin that extends functionality for sky claiming is SkyClaims.
GriefPrevention's default config offers extended customization for your server. An admin can override specific config settings for a specific world or dimension such as default claim flags, user allowed flags, and protection modules.
GriefPrevention allows for admins to control each protection module on their server. The protection modules can be broken down into the following categories :
- Block-Changes: block-break, block-place
- Collisions: collide-block, collide-entity
- Commands: command-execute, command-execute-pvp
- Movements: enter-claim, exit-claim
- Entity: entity-damage, entity-riding, entity-spawn, entity-teleport-from, entity-teleport-to
- Explosions: explosion, explosion-surface
- Fire-Spread: fire-spread
- Interacts: interact-block-primary, interact-block-secondary, interact-entity-primary, interact-entity-secondary, interact-inventory, interact-inventory-click, interact-item-primary, interact-item-secondary
- Item: item-drop, item-pickup, item-spawn, item-use
- Liquids: liquid-flow
- Portals: portal-use
- Projectiles: projectile-impact-block, projectile-impact-entity
Here is how it looks in configuration
For more information, see Global Config
WorldEdit CUI is a client-side mod that provides enhanced visuals for WorldEdit. GriefPrevention worked closely with Mumfrey to be able to use the same visuals for claims. When it is installed onto the client, it will replace the default visuals as shown below.
Note: In order for WECUI to work properly, the server must be running WorldEdit and the client must be using the liteloader version of WECUI.
For more information, see WECUI Improved Visuals
GriefPrevention comes equipped with its own debugging tool. You simply use the
/gpdebug record [playername] command to record actions for a specific user or all. When done, you simply type
/gpdebug paste which will generate a gist output as shown below.
GriefPrevention for Sponge was created in October 2015 and is still being maintained today. It only works on the Sponge platform. If you are using the Bukkit platform, check the Original Plugin link below.
The next big feature will be schematic support. Schematics will allow admins to backup and restore claim states for things like server events. It also will be used to restore a claim to its natural state after it has expired.
How to contribute?
If you want to contribute to the project, you can one of two things :
Posted on Utopian.io - Rewarding Open Source Contributors