All Superinterfaces:
ISender

public interface IPlayer extends ISender
  • Method Details

    • send

      default CompletableFuture<Void> send(MessageConfiguration.MessageSlot slot, String message, int time)
      Show the message to the user in the given slot. Bossbar and Title use time as parameter for how long they should be displayed.
      Parameters:
      slot - the slot the display the message in
      message - the message to show
      time - how long the title or bossbar should be displayed
      Returns:
      a CompletableFuture, complete it to remove the bossbar
    • send

    • sendActionBar

      void sendActionBar(String message)
      Shows the text in the action bar of the player.
      Parameters:
      message - the message to show
    • sendActionBar

      void sendActionBar(net.kyori.adventure.text.Component message)
      Shows the text in the action bar of the player.
      Parameters:
      message - the message to show
    • sendBossbar

      Shows a boss bar to the player.
      Parameters:
      message - the message to show
      style - the style of the bossbar
      color - the color of the bossbar
      time - how many seconds should it be shown
      Returns:
      a CompletableFuture, complete it to remove the bossbar
    • sendMessage

      void sendMessage(String message)
      Shows the text in the chat of the player.
      Specified by:
      sendMessage in interface ISender
      Parameters:
      message - the message to show
    • sendTitle

      CompletableFuture<Void> sendTitle(String message, String submessage, int time)
      Shows the text as a title to the player.
      Parameters:
      message - the title to show
      submessage - the subtitle to show
      time - how many seconds should it be shown
      Returns:
      a CompletableFuture, complete it to remove the title
    • openBook

      void openBook(net.kyori.adventure.inventory.Book book)
      Shows a book to the player.
      Parameters:
      book - the book
    • executeCommands

      void executeCommands(List<String> commands)
      Execute the commands that are bundled with this MessageCompound
      Parameters:
      commands - the commands to execute. Supported placeholders will be replaced. %player% will be replaced with the players name
    • identity

      UserIdentity identity()
      Gets the UserIdentity associated with this IPlayer.
      Returns:
      the associated UserIdentity
    • kick

      void kick(net.kyori.adventure.text.Component reason)
      Kicks the player from the server.
    • same

      boolean same(IPlayer other)
      Checks if the encapsulated player is the same object as the other.
      Parameters:
      other - the other IPlayer
      Returns:
      whether the encapsulated players objects are the same
    • getLocale

      Locale getLocale()
      Returns the locale the player is using.
      Returns:
      the locale the player is using.
    • getServerName

      Optional<String> getServerName()
      Returns the name of the server the player is on.
      Returns:
      the name of the server the player is on. Optional is empty on non-proxy servers or when the player is not connected to a backend server.
    • isOnline

      boolean isOnline()
      Checks if this player is currently online
      Returns:
      true if they are online
    • getServerVersion

      @Nullable ServerVersion getServerVersion()
      Gets the MC version the player is using. The value returned by the proxy implementations may be inaccurate, especially for older version.
      Returns:
      the protocol version the player is currently using or null if the player is using a not recognized protocol version