Skip to content

Events

FeatherMC’s built-in features fire events so plugins can watch or override what they decide. Register listeners the usual Bukkit way. Both events are only fired when the feature is turned on in feather.yml.

Called when the anti-lag-machine guard is about to remove a dense cluster of primed TNT before it detonates. It is cancellable. Cancel it to let the TNT explode as normal.

MethodReturns
getCenter()A copy of the center Location of the cluster about to be removed.
getTntCount()How many primed TNT were counted within the configured radius.
isCancelled() and setCancelled(boolean)Whether the guard is allowed to remove the cluster.
@EventHandler
public void onMassTnt(final TntMassDetonationEvent event) {
// Let the TNT explode inside the arena, and block it everywhere else.
if (isInsideArena(event.getCenter())) {
event.setCancelled(true);
}
}

Called when the built-in anti-cheat check flags a player. You can change the action FeatherMC takes, or cancel the event to ignore the flag entirely. This is a good place to hand the decision to a dedicated anti-cheat such as Grim or Vulcan.

MethodReturns
getPlayer()The flagged Player.
getCheck()The check that flagged. Today the only value is AUTOCLICKER.
getMeasuredCps()The measured attack clicks per second.
getAction() and setAction(AntiCheatAction)The action FeatherMC will take, after any plugin changes. LOG, CANCEL or KICK.
isCancelled() and setCancelled(boolean)Whether to ignore the flag.
@EventHandler
public void onFlag(final AntiCheatFlagEvent event) {
if (event.getMeasuredCps() > 30) {
event.setAction(AntiCheatAction.KICK);
}
}

Adapted from the PaperMC docs (CC BY-SA 4.0). About these docs.