Skip to content

API Usage

RedstoneFuture edited this page Mar 19, 2026 · 3 revisions

RestrictionCheck

Plugin bukkitPlugin

= The plugin object.

ActionTypes actionType

= The ActionType enum what needs to be checked.

Location location

= The target location for the check.

Player targetPlayer

= The player for whom the check is to be performed. The player must be online on the server.

Warning

Depending on the restriction plugin, the respective event listener checks whether the player for whom the event was triggered is actually in a relevant world. In doing so, the world is sometimes queried based on the player’s position rather than the target block location.

Example on PlotSquared: PlayerInteractEvent listener

   @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
   public void onInteract(PlayerInteractEvent event) {
       Player player = event.getPlayer();
       BukkitPlayer pp = BukkitUtil.adapt(player);
       PlotArea area = pp.getPlotAreaAbs();
       if (area == null) {
           return;
       }

CheckMethods checkMethod

= The CheckMethod for the check. For more details, click here.

Clone this wiki locally