Compatibility
Minecraft: Java Edition
1.21–1.21.9
1.20.x
1.19.x
1.18.x
1.17.x
Platforms
Creators
Details
Licensed GPL-3.0-only
Published 4 months ago
Updated 3 months ago
ProtectorAPI
An API try to provide a standard protection API.
What can it do?
- Get the protection range that protected by protection plugin
- Check player can place/break/interact the block
- Register flags easily
- You don't need to worry about multiple protection plugins in the server, ProtectorAPI handles it perfectly.
Supported Plugins
- Residence
- Dominion
- HuskClaims (since v1.0.3)
- PlotSquared
- WorldGuard
- RedProtect
- BentoBox
- BlockLocker
- Bolt
- ChestProtection
- ChestShop (since v1.0.2)
- FactionsUUID (since v1.0.3)
- FunnyGuilds (since v1.0.3)
- GriefPrevention (since v1.0.6)
- HuskTowns (since v1.0.6)
- Lands
- LockettePro (since v1.0.1)
- LWC (LWCX)
- NoBuildPlus (since v1.0.7)
- QuickShop-Reremake
- QuickShop-Hikari
- ShopChest
- Towny
Usage
See https://lijinhong11.gitbook.io/protectorapi/start/readme
Develop
See https://lijinhong11.gitbook.io/protectorapi/develop/setup
Javadocs: https://javadoc.io/doc/io.github.lijinhong11/protectorapi-api/latest
Develop Examples
Check whether a player can place
Player player = ...;
boolean allow = ProtectorAPI.allowPlace(player);
If you need to check wehether a player can place a block at a location (safer than previous method):
Player player = ...;
Block block = ...;
boolean allow = ProtectorAPI.allowPlace(player, block);
Check whether a player can break
Player player = ...;
boolean allow = ProtectorAPI.allowBreak(player);
If you need to check whether a player can break a block at a location (safer than previous method):
Player player = ...;
Block block = ...;
boolean allow = ProtectorAPI.allowBreak(player, block);
Check whether a player can interact
NOTE: RedProtect didn't have a more general interaction flag, so we uses "redstone" flag to check instead.
Player player = ...;
boolean allow = ProtectorAPI.allowInteract(player);
If you need to whether a player can interact block at a location (safer than previous method):
Player player = ...;
Block block = ...;
boolean allow = ProtectorAPI.allowInteract(player, block);


