HomeJavaModsProtectorAPI
ProtectorAPI
ModsJava

ProtectorAPI

by lijinhong11 · on Modrinth

Which build do you need?

This mod ships a separate file for every mod loader and every version of the game. Pick both, then download — the wrong build installs fine and then does nothing in the game.

Mod loader

Minecraft version

⬇ Download for 26.1–26.2 · Bukkit⬇ Download for 1.21.8–1.21.11 · Bukkit⬇ Download for 26.1–26.2 · Folia⬇ Download for 1.21.8–1.21.11 · Folia⬇ Download for 26.1–26.2 · Paper⬇ Download for 1.21.8–1.21.11 · Paper⬇ Download for 26.1–26.2 · Purpur⬇ Download for 1.21.8–1.21.11 · Purpur⬇ Download for 26.1–26.2 · Spigot⬇ Download for 1.21.8–1.21.11 · Spigot
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

ProtectorAPI

An API try to provide a standard protection API.

What can it do?

  1. Get the protection range that protected by protection plugin
  2. Check player can place/break/interact the block
  3. Register flags easily
  4. You don't need to worry about multiple protection plugins in the server, ProtectorAPI handles it perfectly.

Supported Plugins

  1. Residence
  2. Dominion
  3. HuskClaims (since v1.0.3)
  4. IridiumSkyblock (since v2.0.0)
  5. PlotSquared
  6. WorldGuard
  7. RedProtect
  8. BentoBox
  9. GriefDefender (since v2.2.1)
  10. BlockLocker
  11. Bolt
  12. ChestProtection
  13. ChestShop (since v1.0.2)
  14. ExcellentClaims (since v1.1.0)
  15. FactionsUUID (since v1.0.3)
  16. FunnyGuilds (since v1.0.3)
  17. GriefPrevention (since v1.0.6)
  18. HuskTowns (since v1.0.6)
  19. Lands
  20. LockettePro (since v1.0.1)
  21. LWC (LWCX)
  22. NoBuildPlus (since v1.0.7)
  23. QuickShop-Reremake
  24. QuickShop-Hikari
  25. ShopChest
  26. 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);
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more