Interface TabPlayer


public interface TabPlayer
An interface representing a player
  • Method Details

    • forceRefresh

      void forceRefresh()
      Refreshes all visuals on the player
    • getName

      String getName()
      Returns player's name
      Returns:
      Player's name
    • getUniqueId

      UUID getUniqueId()
      Returns player's UUID
      Returns:
      Player's UUID
    • getTablistUUID

      UUID getTablistUUID()
      Returns player's uuid used in TabList. This may only be different from real uuid if TAB is installed on velocity with some specific velocity setup
      Returns:
      player's uuid in TabList
    • getVersion

      ProtocolVersion getVersion()
      Returns player's protocol version
      Returns:
      player's protocol version
    • getPlayer

      Object getPlayer()
      Returns platform-specific entity
      Returns:
      an instance of bukkit/bungee player depending on platform
    • getWorld

      String getWorld()
      Returns player's current world name (on BungeeCord this requires bridge installed)
      Returns:
      name of world where player is currently in, "N/A" on BungeeCord if bridge is not installed
    • getServer

      String getServer()
      Returns player's current server name on BungeeCord (on bukkit this returns "N/A")
      Returns:
      name of server where player is currently in, "N/A" on bukkit
    • hasPermission

      boolean hasPermission(String permission)
      Performs platform-specific API call to check for permission and returns the result
      Parameters:
      permission - the permission to check for
      Returns:
      true if player has permission, false if not
    • sendCustomPacket

      void sendCustomPacket(TabPacket packet)
      Sends the player a custom universal packet
      Parameters:
      packet - packet to send
    • sendCustomPacket

      void sendCustomPacket(TabPacket packet, TabFeature feature)
      Sends the player a custom universal packet and adds that packet into counter that is displayed in /tab cpu
      Parameters:
      packet - packet to send
      feature - feature to increment sent packet counter of
    • sendCustomPacket

      void sendCustomPacket(TabPacket packet, String feature)
      Sends the player a custom universal packet and adds that packet into counter that is displayed in /tab cpu
      Parameters:
      packet - packet to send
      feature - feature to increment sent packet counter of
    • sendPacket

      void sendPacket(Object packet)
      Sends the player a platform-specific packet
      Parameters:
      packet - an instance of packet depending on platform
    • getProperty

      Property getProperty(String name)
      Returns player's property by name
      Parameters:
      name - name of property
      Returns:
      the property or null if not found
    • sendMessage

      void sendMessage(String message, boolean translateColors)
      Sends a message to the player
      Parameters:
      message - message to be sent
      translateColors - whether colors should be translated or not
    • sendMessage

      void sendMessage(IChatBaseComponent message)
      Sends specified component as a chat message
      Parameters:
      message - message to send
    • getChannel

      io.netty.channel.Channel getChannel()
      Returns player's netty channel. On servers running version 1.7 or older returns null.
      Returns:
      player's channel
    • getPing

      int getPing()
      Returns player's ping calculated by server
      Returns:
      player's ping
    • getSkin

      Skin getSkin()
      Returns player's skin data
      Returns:
      player's skin
    • isLoaded

      boolean isLoaded()
      Returns true once the player is successfully loaded (onJoin method ran through all methods)
      Returns:
      true if player is fully loaded, false otherwise
    • setProperty

      boolean setProperty(TabFeature feature, String identifier, String rawValue)
      Sets property with specified name to new value. If property did not exist before, it is created and true is returned. If it existed, it is overridden and true is returned. false is returned otherwise.
      Parameters:
      feature - feature using this property to get placeholders registered
      identifier - property name
      rawValue - new raw value
      Returns:
      true if value changed / did not exist, false if value did not change
    • loadPropertyFromConfig

      boolean loadPropertyFromConfig(TabFeature feature, String property)
      Loads property from config using standard property loading algorithm
      Parameters:
      property - property name to load
      Returns:
      true if value did not exist or changed, false otherwise
    • loadPropertyFromConfig

      boolean loadPropertyFromConfig(TabFeature feature, String property, String ifNotSet)
      Loads property from config using standard property loading algorithm. If the property is not set in config, ifNotSet value is used.
      Parameters:
      property - property name to load
      ifNotSet - value to use if property is not defined in config
      Returns:
      true if value did not exist or changed, false otherwise
    • getTeamName

      String getTeamName()
      Returns name of player's scoreboard team or null if NameTag feature is disabled
      Returns:
      name of player's team
    • getTeamNameNote

      String getTeamNameNote()
      Returns user-friendly explanation of team name
      Returns:
      explanation behind team name
    • isDisguised

      boolean isDisguised()
      Returns true if player is disguised using LibsDisguises, false if not
      Returns:
      true if player is disguised, false if not
    • hasInvisibilityPotion

      boolean hasInvisibilityPotion()
      Returns true if player has invisibility potion, false if not. For bukkit, API is used, for BungeeCord, bridge is used.
      Returns:
      true if player has invisibility potion, false if not
    • isVanished

      boolean isVanished()
      Checks if player is vanished using any supported vanish plugin and returns the result.
      Returns:
      true if player is vanished, false if not
    • isOnline

      boolean isOnline()
      Calls platform-specific method and returns the result
      Returns:
      true if player is online, false if not
    • getGamemode

      int getGamemode()
      Returns GameMode of the player (0 for survival, 1 creative, 2 adventure, 3 spectator)
      Returns:
      GameMode of the player
    • isBedrockPlayer

      boolean isBedrockPlayer()
      Returns true if this is a bedrock player, false if not
      Returns:
      true if player is a bedrock player, false if not
    • getGroup

      String getGroup()
      Returns player's primary permission group. If group has been changed using setTemporaryGroup(String), returns that value. Otherwise, returns group detected by standard group assign logic
      Returns:
      player's primary permission group
    • setTemporaryGroup

      void setTemporaryGroup(String group)
      Temporarily overrides player's group and applies all changes coming from new group. This includes all properties and sorting, if used.
      Parameters:
      group - New group to use
      See Also:
    • hasTemporaryGroup

      boolean hasTemporaryGroup()
      Returns temporary group applied to the player using setTemporaryGroup(String). If no group was set, returns null
      Returns:
      Temporary group assigned to player or null if not set
      See Also:
    • resetTemporaryGroup

      void resetTemporaryGroup()
      Resets temporary group assigned using setTemporaryGroup(String). If no temporary group is set, doesn't do anything.
      See Also:
    • getNickname

      String getNickname()
      Returns player's game profile name as seen by other players. By default, this returns player's name. If using a nickname / disguise plugin that changes game profile name for other players and change was successfully detected, returns that value.
      Returns:
      player's game profile name as seen by other players