All Superinterfaces:
ISender

public interface IPlayer extends ISender
  • Method Details

    • sendActionBar

      void sendActionBar(String 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
    • executeCommands

      void executeCommands(List<String> commands)
      Execute the commands that are bundled with this MessageCompound
      Parameters:
      commands - the commands to execute. %player% with 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.