bukkit Event Handling Event Priorities

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Bukkit has a system called Event Priorities to help plugins handle events in the correct older. The seven priorities are (in older from first executed to last):

  • Lowest
  • Low
  • Normal (default)
  • High
  • Highest
  • Monitor

If you are planning to cancel a lot of events (e.g. protection plugin) it would be a good idea to use lower priority (or lowest) to avoid problems.

You should never modify outcome of an event at MONITOR.

@EventHandler //same as @EventHandler(priority = EventPriority.NORMAL)
public void onLogin(PlayerLoginEvent event) {
    // normal login
}

@EventHandler(priority = EventPriority.HIGH)
public void onLogin(PlayerLoginEvent event) {
    // high login
}

More info:



Got any bukkit Question?