Class PermissionEntityEvent

java.lang.Object
org.bukkit.event.Event
ru.tehkode.permissions.events.PermissionEvent
ru.tehkode.permissions.events.PermissionEntityEvent
All Implemented Interfaces:
Serializable

public class PermissionEntityEvent extends PermissionEvent
Bukkit event fired when a permission user or group is created, modified, or removed.

Listeners receive the affected entity (or its identifier when deserialized), the entity type, and the kind of change that occurred. The entity reference may be lazily re-resolved from the PermissionManager if it was not available at construction time.

See Also:
  • Field Details

  • Constructor Details

    • PermissionEntityEvent

      public PermissionEntityEvent(UUID sourceUUID, PermissionEntity entity, PermissionEntityEvent.Action action)
      Creates an entity change event.
      Parameters:
      sourceUUID - UUID of the server that originated this event; must not be null
      entity - affected permission entity; must not be null
      action - kind of change that occurred; must not be null
  • Method Details

    • getAction

      public PermissionEntityEvent.Action getAction()
      Returns the kind of change that triggered this event.
      Returns:
      action descriptor; never null
    • getEntity

      public PermissionEntity getEntity()
      Returns the permission entity affected by this event.

      If the entity reference was not available (for example after deserialization), it is re-resolved from the registered PermissionManager using getEntityIdentifier() and getType().

      Returns:
      affected entity, or null if it cannot be resolved
    • getEntityIdentifier

      public String getEntityIdentifier()
      Returns the identifier of the affected entity.
      Returns:
      entity identifier (user name/UUID or group name); never null
    • getType

      public PermissionEntity.Type getType()
      Returns whether the affected entity is a user or a group.
      Returns:
      entity type; never null
    • getHandlers

      public org.bukkit.event.HandlerList getHandlers()
      Returns the Bukkit handler list for this event type.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      handler list; never null
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Returns the static Bukkit handler list for PermissionEntityEvent.
      Returns:
      handler list; never null