001 package org.bukkit.event;
002
003 import java.lang.annotation.ElementType;
004 import java.lang.annotation.Retention;
005 import java.lang.annotation.RetentionPolicy;
006 import java.lang.annotation.Target;
007
008 /**
009 * An annotation to mark methods as being event handler methods
010 */
011 @Target(ElementType.METHOD)
012 @Retention(RetentionPolicy.RUNTIME)
013 public @interface EventHandler {
014
015 /**
016 * Define the priority of the event.
017 * <p>
018 * First priority to the last priority executed:
019 * <ol>
020 * <li>LOWEST
021 * <li>LOW
022 * <li>NORMAL
023 * <li>HIGH
024 * <li>HIGHEST
025 * <li>MONITOR
026 * </ol>
027 */
028 EventPriority priority() default EventPriority.NORMAL;
029
030 /**
031 * Define if the handler ignores a cancelled event.
032 * <p>
033 * If ignoreCancelled is true and the event is cancelled, the method is
034 * not called. Otherwise, the method is always called.
035 */
036 boolean ignoreCancelled() default false;
037 }