Interface PlatformPlayer

All Superinterfaces:
PlatformCommandSender
All Known Implementing Classes:
BukkitPlatformPlayer

public interface PlatformPlayer extends PlatformCommandSender
Represents a platform-independent player.
  • Method Details

    • isOnline

      boolean isOnline()
      Check whether or not this player is online the server.
      Returns:
      true if online, false if offline
    • getUniqueId

      @NotNull @NotNull UUID getUniqueId()
      Get the UUID of this player.
      Returns:
      the uuid
    • getWorld

      @NotNull @NotNull BlockAccessor getWorld()
      Get the world in which this player currently resides.
      Returns:
      the world
    • getItemInMainHand

      @NotNull @NotNull ItemStack getItemInMainHand()
      Get the ItemStack in the player's main hand.
      Returns:
      the item stack
    • getTargetBlock

      @NotNull @NotNull RayTraceResult getTargetBlock(int distance)
      Get the block the player is looking at within the given distance. If the player is looking at a block that exceeds the given distance, the result will be empty.
      Parameters:
      distance - the maximum block distance
      Returns:
      the result of the ray trace
    • getGameMode

      @NotNull @NotNull GameMode getGameMode()
      Get the GameMode of this player.
      Returns:
      the game mode
    • isSneaking

      boolean isSneaking()
      Check whether or not this player is sneaking.
      Returns:
      true if sneaking, false otherwise
    • sendPluginMessage

      void sendPluginMessage(@NotNull @NotNull NamespacedKey channel, byte[] message)
      Send a plugin message to this player over the given channel.
      Parameters:
      channel - the channel on which to send the message
      message - the message contents
    • kick

      void kick(@NotNull @NotNull String message)
      Kick this player from the server with the given disconnect message.
      Parameters:
      message - the disconnect message