Interface User

  • All Superinterfaces:
    net.kyori.adventure.audience.Audience, ChatUser, net.kyori.adventure.identity.Identified, MetadataHolder, PermissionHolder, net.kyori.adventure.pointer.Pointered
    All Known Subinterfaces:
    ProxyUser, ServerUser

    @NonExtendable
    public interface User
    extends ChatUser, net.kyori.adventure.identity.Identified
    Represents a connected Minecraft player.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void disconnect​(@NotNull net.kyori.adventure.text.Component reason)
      Disconnect this user from the platform.
      @NotNull Optional<SocketAddress> getAddress()
      Get the address of this user.
      @NotNull UUID getId()
      Get the unique id representing this user.
      int getLatency()
      Get the latency in milliseconds between this user and the platform.
      default @NotNull net.kyori.adventure.identity.Identity identity()
      Gets the identity.
      void sendData​(@NotNull String channel, byte[] data)
      Send a plugin message to this user.
      • Methods inherited from interface net.kyori.adventure.audience.Audience

        clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, showTitle, stopSound, stopSound
      • Methods inherited from interface net.kyori.adventure.pointer.Pointered

        get, getOrDefault, getOrDefaultFrom, pointers
    • Method Detail

      • getId

        @NotNull
        @NotNull UUID getId()
        Get the unique id representing this user.
        Returns:
        user unique id.
      • getAddress

        @NotNull
        @NotNull Optional<SocketAddress> getAddress()
        Get the address of this user.
        Returns:
        an Optional containing the address of this user, if available, otherwise an empty optional.
      • getLatency

        int getLatency()
        Get the latency in milliseconds between this user and the platform.
        Returns:
        latency between this user and the platform.
      • sendData

        void sendData​(@NotNull
                      @NotNull String channel,
                      byte[] data)
        Send a plugin message to this user.
        Parameters:
        channel - Plugin message channel.
        data - Data.
      • disconnect

        void disconnect​(@NotNull
                        @NotNull net.kyori.adventure.text.Component reason)
        Disconnect this user from the platform.
        Parameters:
        reason - Disconnect reason.
      • identity

        @NotNull
        default @NotNull net.kyori.adventure.identity.Identity identity()
        Gets the identity.
        Specified by:
        identity in interface net.kyori.adventure.identity.Identified
        Returns:
        the identity