Class PreLookupProfileEvent

java.lang.Object
org.bukkit.event.Event
com.destroystokyo.paper.event.profile.PreLookupProfileEvent

@NullMarked public class PreLookupProfileEvent extends Event
Allows a plugin to intercept a Profile Lookup for a Profile by name

At the point of event fire, the UUID and properties are unset.

If a plugin sets the UUID, and optionally the properties, the API call to look up the profile may be skipped.

No guarantees are made about thread execution context for this event. If you need to know, check Event.isAsynchronous()

  • Constructor Details

    • PreLookupProfileEvent

      @Internal public PreLookupProfileEvent(String name)
  • Method Details

    • getName

      public String getName()
      Returns:
      Name of the profile
    • getUUID

      public @Nullable UUID getUUID()
      If this value is left null by the completion of the event call, then the server will trigger a call to the Mojang API to look up the UUID (Network Request), and subsequently, fire a LookupProfileEvent
      Returns:
      The UUID of the profile if it has already been provided by a plugin
    • setUUID

      public void setUUID(@Nullable UUID uuid)
      Sets the UUID for this player name. This will skip the initial API call to find the players UUID.

      However, if Profile Properties are needed by the server, you must also set them or else an API call might still be made.

      Parameters:
      uuid - the UUID to set for the profile or null to reset
    • getProfileProperties

      public Set<ProfileProperty> getProfileProperties()
      Returns:
      The currently pending pre-populated properties. Any property in this Set will be automatically prefilled on this Profile
    • setProfileProperties

      public void setProfileProperties(Set<ProfileProperty> properties)
      Clears any existing pre-populated properties and uses the supplied properties Any property in this Set will be automatically prefilled on this Profile
      Parameters:
      properties - The properties to add
    • addProfileProperties

      public void addProfileProperties(Set<ProfileProperty> properties)
      Adds any properties currently missing to the pre-populated properties set, replacing any that already were set. Any property in this Set will be automatically prefilled on this Profile
      Parameters:
      properties - The properties to add
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()