Class Player

All Implemented Interfaces:
CommandSender, InventoryHolder, net.kyori.adventure.audience.Audience, net.kyori.adventure.pointer.Pointered, net.kyori.adventure.sound.Sound.Emitter

public class Player extends LivingEntity implements CommandSender, InventoryHolder
  • Field Details

    • CHAT_DEFAULT_FORMAT

      public static final String CHAT_DEFAULT_FORMAT
      See Also:
    • clientConnection

      public final ClientConnection clientConnection
    • playerInteractManager

      public final PlayerInteractManager playerInteractManager
    • username

      protected final String username
    • gamemode

      protected org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode gamemode
    • watcher

      protected DataWatcher watcher
    • selectedSlot

      protected byte selectedSlot
    • playerInventory

      protected final PlayerInventory playerInventory
    • inventoryView

      protected final InventoryView inventoryView
    • additionalHearts

      protected float additionalHearts
    • score

      protected int score
    • skinLayers

      protected byte skinLayers
    • mainHand

      protected byte mainHand
  • Constructor Details

  • Method Details

    • nextContainerId

      protected int nextContainerId()
    • getSelectedSlot

      public byte getSelectedSlot()
    • setSelectedSlot

      public void setSelectedSlot(byte slot)
    • getGamemode

      public org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode getGamemode()
    • setGamemode

      public void setGamemode(org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode gamemode)
    • setEntityId

      @Deprecated protected void setEntityId(int entityId)
      Deprecated.
    • getAdditionalHearts

      public float getAdditionalHearts()
    • setAdditionalHearts

      public void setAdditionalHearts(float additionalHearts)
    • getScore

      public int getScore()
    • setScore

      public void setScore(int score)
    • getSkinLayers

      public byte getSkinLayers()
    • setSkinLayers

      public void setSkinLayers(byte skinLayers)
    • getMainHand

      public byte getMainHand()
    • setMainHand

      public void setMainHand(byte mainHand)
    • getDataWatcher

      public DataWatcher getDataWatcher()
      Overrides:
      getDataWatcher in class Entity
    • isValid

      public boolean isValid()
      Overrides:
      isValid in class Entity
    • remove

      public void remove()
      Overrides:
      remove in class Entity
    • getName

      public String getName()
      Specified by:
      getName in interface CommandSender
    • hasPermission

      public boolean hasPermission(String permission)
      Specified by:
      hasPermission in interface CommandSender
    • teleport

      public void teleport(Location location)
      Overrides:
      teleport in class Entity
    • setLocation

      protected void setLocation(Location location)
    • sendPluginMessage

      public void sendPluginMessage(net.kyori.adventure.key.Key channel, byte[] data) throws IOException
      Throws:
      IOException
    • sendPluginMessage

      @Deprecated public void sendPluginMessage(String channel, byte[] data) throws IOException
      Deprecated.
      Throws:
      IOException
    • sendMessage

      public void sendMessage(String message, UUID uuid)
      Specified by:
      sendMessage in interface CommandSender
    • sendMessage

      public void sendMessage(String message)
      Specified by:
      sendMessage in interface CommandSender
    • disconnect

      public void disconnect()
    • disconnect

      public void disconnect(String reason)
    • disconnect

      public void disconnect(net.kyori.adventure.text.Component reason)
    • chat

      public void chat(String message)
    • chat

      public void chat(String message, boolean verbose)
    • chat

      public void chat(String message, boolean verbose, byte[] saltSignature, Instant time)
    • setResourcePack

      public void setResourcePack(String url, String hash, boolean forced, net.kyori.adventure.text.Component prompt)
    • setPlayerListHeaderFooter

      public void setPlayerListHeaderFooter(String header, String footer)
    • setTitle

      public void setTitle(String title)
    • setSubTitle

      public void setSubTitle(String subTitle)
    • setTitleTimer

      public void setTitleTimer(int fadeIn, int stay, int fadeOut)
    • setTitleSubTitle

      public void setTitleSubTitle(String title, String subTitle, int fadeIn, int stay, int fadeOut)
    • openBook

      public void openBook(net.kyori.adventure.inventory.Book book)
      Specified by:
      openBook in interface net.kyori.adventure.audience.Audience
    • stopSound

      public void stopSound(net.kyori.adventure.sound.SoundStop stop)
      Specified by:
      stopSound in interface net.kyori.adventure.audience.Audience
    • playSound

      public void playSound(@NotNull @NotNull net.kyori.adventure.sound.Sound sound, @NotNull @NotNull net.kyori.adventure.sound.Sound.Emitter emitter)
      Specified by:
      playSound in interface net.kyori.adventure.audience.Audience
    • playSound

      public void playSound(@NotNull @NotNull net.kyori.adventure.sound.Sound sound, double x, double y, double z)
      Specified by:
      playSound in interface net.kyori.adventure.audience.Audience
    • playSound

      public void playSound(@NotNull @NotNull net.kyori.adventure.sound.Sound sound)
      Specified by:
      playSound in interface net.kyori.adventure.audience.Audience
    • sendActionBar

      public void sendActionBar(@NotNull @NotNull net.kyori.adventure.text.Component message)
      Specified by:
      sendActionBar in interface net.kyori.adventure.audience.Audience
    • sendPlayerListHeaderAndFooter

      public void sendPlayerListHeaderAndFooter(@NotNull @NotNull net.kyori.adventure.text.Component header, @NotNull @NotNull net.kyori.adventure.text.Component footer)
      Specified by:
      sendPlayerListHeaderAndFooter in interface net.kyori.adventure.audience.Audience
    • sendTitlePart

      public <T> void sendTitlePart(net.kyori.adventure.title.TitlePart<T> part, @NotNull T value)
      Specified by:
      sendTitlePart in interface net.kyori.adventure.audience.Audience
    • clearTitle

      public void clearTitle()
      Specified by:
      clearTitle in interface net.kyori.adventure.audience.Audience
    • resetTitle

      public void resetTitle()
      Specified by:
      resetTitle in interface net.kyori.adventure.audience.Audience
    • showBossBar

      @Deprecated public void showBossBar(@NotNull @NotNull net.kyori.adventure.bossbar.BossBar bar)
      Deprecated.
      Specified by:
      showBossBar in interface net.kyori.adventure.audience.Audience
    • hideBossBar

      @Deprecated public void hideBossBar(@NotNull @NotNull net.kyori.adventure.bossbar.BossBar bar)
      Deprecated.
      Specified by:
      hideBossBar in interface net.kyori.adventure.audience.Audience
    • getInventory

      public PlayerInventory getInventory()
      Specified by:
      getInventory in interface InventoryHolder
    • getInventoryView

      public InventoryView getInventoryView()
    • updateInventory

      public void updateInventory()
    • openInventory

      public void openInventory(Inventory inventory)
    • closeInventory

      public void closeInventory()
    • getEquipment

      public EntityEquipment getEquipment()
    • getHolder

      public InventoryHolder getHolder()
      Specified by:
      getHolder in interface InventoryHolder