Class CloudPlayer

All Implemented Interfaces:
org.cloudburstmc.api.command.CommandSender, org.cloudburstmc.api.entity.Creature, org.cloudburstmc.api.entity.Damageable, org.cloudburstmc.api.entity.Entity, org.cloudburstmc.api.entity.Human, org.cloudburstmc.api.entity.Living, org.cloudburstmc.api.inventory.InventoryHolder, org.cloudburstmc.api.level.ChunkLoader, org.cloudburstmc.api.permission.Permissible, org.cloudburstmc.api.permission.ServerOperator, org.cloudburstmc.api.player.Player

public class CloudPlayer extends EntityHuman implements org.cloudburstmc.api.command.CommandSender, org.cloudburstmc.api.inventory.InventoryHolder, org.cloudburstmc.api.level.ChunkLoader, org.cloudburstmc.api.player.Player
Author:
MagicDroidX & Box Nukkit Project
  • Field Details

    • DEFAULT_SPEED

      public static final float DEFAULT_SPEED
      See Also:
      Constant Field Values
    • MAXIMUM_SPEED

      public static final float MAXIMUM_SPEED
      See Also:
      Constant Field Values
    • session

      protected final com.nukkitx.protocol.bedrock.BedrockServerSession session
    • spawned

      public boolean spawned
    • loggedIn

      public boolean loggedIn
    • lastBreak

      public long lastBreak
    • speed

      public com.nukkitx.math.vector.Vector3f speed
    • windows

      protected final com.google.common.collect.BiMap<org.cloudburstmc.api.inventory.Inventory,​Byte> windows
    • windowIndex

      protected final com.google.common.collect.BiMap<Byte,​org.cloudburstmc.api.inventory.Inventory> windowIndex
    • permanentWindows

      protected final it.unimi.dsi.fastutil.bytes.ByteSet permanentWindows
    • windowCnt

      protected byte windowCnt
    • playerData

      protected final PlayerData playerData
    • messageCounter

      protected int messageCounter
    • forceMovement

      protected com.nukkitx.math.vector.Vector3f forceMovement
    • creationTime

      public long creationTime
    • randomClientId

      protected long randomClientId
    • teleportPosition

      protected com.nukkitx.math.vector.Vector3f teleportPosition
    • foodData

      protected final PlayerFood foodData
    • connected

      protected boolean connected
    • removeFormat

      protected boolean removeFormat
    • username

      protected String username
    • iusername

      protected String iusername
    • displayName

      protected String displayName
    • startAction

      protected int startAction
    • newPosition

      protected com.nukkitx.math.vector.Vector3f newPosition
    • stepHeight

      protected float stepHeight
    • hiddenPlayers

      protected final Map<UUID,​CloudPlayer> hiddenPlayers
    • viewDistance

      protected int viewDistance
    • chunksPerTick

      protected final int chunksPerTick
    • spawnThreshold

      protected final int spawnThreshold
    • inAirTicks

      protected int inAirTicks
    • startAirTicks

      protected int startAirTicks
    • adventureSettings

      protected CloudAdventureSettings adventureSettings
    • sleeping

      protected com.nukkitx.math.vector.Vector3i sleeping
    • spawnLocation

      protected org.cloudburstmc.api.level.Location spawnLocation
    • enableClientCommand

      protected boolean enableClientCommand
    • lastEnderPearl

      protected int lastEnderPearl
    • lastChorusFruitTeleport

      protected int lastChorusFruitTeleport
    • breakingBlock

      public org.cloudburstmc.api.block.Block breakingBlock
    • pickedXPOrb

      public int pickedXPOrb
    • formWindowCount

      protected AtomicInteger formWindowCount
    • formWindows

      protected Map<Integer,​Form<?>> formWindows
    • serverSettings

      protected CustomForm serverSettings
    • serverSettingsId

      protected int serverSettingsId
    • dummyBossBars

      protected Map<Long,​DummyBossBar> dummyBossBars
    • fishing

      public org.cloudburstmc.api.entity.projectile.FishingHook fishing
    • packetsRecieved

      public int packetsRecieved
    • lastSkinChange

      public long lastSkinChange
  • Constructor Details

    • CloudPlayer

      public CloudPlayer(com.nukkitx.protocol.bedrock.BedrockServerSession session, ClientChainData chainData)
  • Method Details

    • getStartActionTick

      public int getStartActionTick()
    • startAction

      public void startAction()
    • stopAction

      public void stopAction()
    • getLastEnderPearlThrowingTick

      public int getLastEnderPearlThrowingTick()
    • onThrowEnderPearl

      public void onThrowEnderPearl()
    • getLastChorusFruitTeleport

      public int getLastChorusFruitTeleport()
    • onChorusFruitTeleport

      public void onChorusFruitTeleport()
    • getViewingEnderChest

      public org.cloudburstmc.api.blockentity.EnderChest getViewingEnderChest()
      Specified by:
      getViewingEnderChest in interface org.cloudburstmc.api.player.Player
    • setViewingEnderChest

      public void setViewingEnderChest(org.cloudburstmc.api.blockentity.EnderChest chest)
      Specified by:
      setViewingEnderChest in interface org.cloudburstmc.api.player.Player
    • getCraftingInventory

      public CloudCraftingGrid getCraftingInventory()
      Specified by:
      getCraftingInventory in interface org.cloudburstmc.api.player.Player
    • getLeaveMessage

      public TranslationContainer getLeaveMessage()
    • getClientSecret

      public String getClientSecret()
    • getClientId

      @Deprecated public Long getClientId()
      Deprecated.
      This might disappear in the future. Please use getUniqueId() instead (IP + clientId + name combo, in the future it'll change to real UUID for online auth)
      Returns:
      random client id
    • isBanned

      public boolean isBanned()
      Specified by:
      isBanned in interface org.cloudburstmc.api.player.Player
    • setBanned

      public void setBanned(boolean value)
      Specified by:
      setBanned in interface org.cloudburstmc.api.player.Player
    • isWhitelisted

      public boolean isWhitelisted()
      Specified by:
      isWhitelisted in interface org.cloudburstmc.api.player.Player
    • setWhitelisted

      public void setWhitelisted(boolean value)
      Specified by:
      setWhitelisted in interface org.cloudburstmc.api.player.Player
    • isInitialized

      public boolean isInitialized()
    • setInitialized

      public void setInitialized(boolean initialized)
    • getFirstPlayed

      public OptionalLong getFirstPlayed()
      Specified by:
      getFirstPlayed in interface org.cloudburstmc.api.player.Player
    • getAdventureSettings

      public CloudAdventureSettings getAdventureSettings()
    • setAdventureSettings

      public void setAdventureSettings(CloudAdventureSettings adventureSettings)
    • resetInAirTicks

      public void resetInAirTicks()
      Specified by:
      resetInAirTicks in interface org.cloudburstmc.api.player.Player
    • setAllowFlight

      @Deprecated public void setAllowFlight(boolean value)
      Deprecated.
    • getAllowFlight

      @Deprecated public boolean getAllowFlight()
      Deprecated.
    • setAllowModifyWorld

      public void setAllowModifyWorld(boolean value)
    • setAllowInteract

      public void setAllowInteract(boolean value)
    • setAllowInteract

      public void setAllowInteract(boolean value, boolean containers)
    • setAutoJump

      @Deprecated public void setAutoJump(boolean value)
      Deprecated.
    • hasAutoJump

      @Deprecated public boolean hasAutoJump()
      Deprecated.
    • getLastPlayed

      public OptionalLong getLastPlayed()
      Specified by:
      getLastPlayed in interface org.cloudburstmc.api.player.Player
    • getServer

      public CloudServer getServer()
      Specified by:
      getServer in interface org.cloudburstmc.api.command.CommandSender
      Specified by:
      getServer in interface org.cloudburstmc.api.entity.Entity
      Specified by:
      getServer in interface org.cloudburstmc.api.player.Player
      Overrides:
      getServer in class BaseEntity
    • getRemoveFormat

      public boolean getRemoveFormat()
    • setRemoveFormat

      public void setRemoveFormat()
    • setRemoveFormat

      public void setRemoveFormat(boolean remove)
    • hasPlayedBefore

      public boolean hasPlayedBefore()
      Specified by:
      hasPlayedBefore in interface org.cloudburstmc.api.player.Player
    • canSee

      public boolean canSee(CloudPlayer player)
    • hidePlayer

      public void hidePlayer(CloudPlayer player)
    • canCollideWith

      public boolean canCollideWith(org.cloudburstmc.api.entity.Entity entity)
      Specified by:
      canCollideWith in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      canCollideWith in class BaseEntity
    • spawnTo

      public void spawnTo(CloudPlayer player)
      Overrides:
      spawnTo in class EntityHuman
    • createAddEntityPacket

      protected com.nukkitx.protocol.bedrock.BedrockPacket createAddEntityPacket()
      Overrides:
      createAddEntityPacket in class EntityHuman
    • isOnline

      public boolean isOnline()
      Specified by:
      isOnline in interface org.cloudburstmc.api.player.Player
    • isOp

      public boolean isOp()
      Specified by:
      isOp in interface org.cloudburstmc.api.player.Player
      Specified by:
      isOp in interface org.cloudburstmc.api.permission.ServerOperator
    • setOp

      public void setOp(boolean value)
      Specified by:
      setOp in interface org.cloudburstmc.api.player.Player
      Specified by:
      setOp in interface org.cloudburstmc.api.permission.ServerOperator
    • isSpawned

      public boolean isSpawned()
      Specified by:
      isSpawned in interface org.cloudburstmc.api.player.Player
    • isPermissionSet

      public boolean isPermissionSet(String name)
      Specified by:
      isPermissionSet in interface org.cloudburstmc.api.permission.Permissible
    • isPermissionSet

      public boolean isPermissionSet(org.cloudburstmc.api.permission.Permission permission)
      Specified by:
      isPermissionSet in interface org.cloudburstmc.api.permission.Permissible
    • hasPermission

      public boolean hasPermission(String name)
      Specified by:
      hasPermission in interface org.cloudburstmc.api.permission.Permissible
    • hasPermission

      public boolean hasPermission(org.cloudburstmc.api.permission.Permission permission)
      Specified by:
      hasPermission in interface org.cloudburstmc.api.permission.Permissible
    • addAttachment

      public org.cloudburstmc.api.permission.PermissionAttachment addAttachment(org.cloudburstmc.api.plugin.PluginContainer plugin)
      Specified by:
      addAttachment in interface org.cloudburstmc.api.permission.Permissible
    • addAttachment

      public org.cloudburstmc.api.permission.PermissionAttachment addAttachment(org.cloudburstmc.api.plugin.PluginContainer plugin, String name)
      Specified by:
      addAttachment in interface org.cloudburstmc.api.permission.Permissible
    • addAttachment

      public org.cloudburstmc.api.permission.PermissionAttachment addAttachment(org.cloudburstmc.api.plugin.PluginContainer plugin, String name, Boolean value)
      Specified by:
      addAttachment in interface org.cloudburstmc.api.permission.Permissible
    • removeAttachment

      public void removeAttachment(org.cloudburstmc.api.permission.PermissionAttachment attachment)
      Specified by:
      removeAttachment in interface org.cloudburstmc.api.permission.Permissible
    • recalculatePermissions

      public void recalculatePermissions()
      Specified by:
      recalculatePermissions in interface org.cloudburstmc.api.permission.Permissible
    • isEnableClientCommand

      public boolean isEnableClientCommand()
    • resetFallDistance

      public void resetFallDistance()
      Specified by:
      resetFallDistance in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      resetFallDistance in class BaseEntity
    • setEnableClientCommand

      public void setEnableClientCommand(boolean enable)
    • getEffectivePermissions

      public Map<String,​org.cloudburstmc.api.permission.PermissionAttachmentInfo> getEffectivePermissions()
      Specified by:
      getEffectivePermissions in interface org.cloudburstmc.api.permission.Permissible
    • showPlayer

      public void showPlayer(CloudPlayer player)
    • initEntity

      protected void initEntity()
      Overrides:
      initEntity in class EntityHuman
    • isPlayer

      public boolean isPlayer()
      Specified by:
      isPlayer in interface org.cloudburstmc.api.command.CommandSender
    • sendCommandData

      public void sendCommandData()
    • removeAchievement

      public void removeAchievement(String achievementId)
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface org.cloudburstmc.api.player.Player
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface org.cloudburstmc.api.player.Player
    • setDisplayName

      public void setDisplayName(String displayName)
    • hasAchievement

      public boolean hasAchievement(String achievementId)
    • getSkin

      public org.cloudburstmc.api.player.skin.Skin getSkin()
      Specified by:
      getSkin in interface org.cloudburstmc.api.player.Player
      Overrides:
      getSkin in class EntityHuman
    • setSkin

      public void setSkin(org.cloudburstmc.api.player.skin.Skin skin)
      Specified by:
      setSkin in interface org.cloudburstmc.api.player.Player
      Overrides:
      setSkin in class EntityHuman
    • getSerializedSkin

      public com.nukkitx.protocol.bedrock.data.skin.SerializedSkin getSerializedSkin()
    • setSkin

      public void setSkin(com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin)
    • getServerId

      public UUID getServerId()
      Specified by:
      getServerId in interface org.cloudburstmc.api.player.Player
      Overrides:
      getServerId in class EntityHuman
    • getAddress

      public String getAddress()
    • getSocketAddress

      public InetSocketAddress getSocketAddress()
    • getPort

      public int getPort()
    • isSleeping

      public boolean isSleeping()
      Specified by:
      isSleeping in interface org.cloudburstmc.api.player.Player
    • getInAirTicks

      public int getInAirTicks()
    • getNextPosition

      public com.nukkitx.math.vector.Vector3f getNextPosition()
    • isUsingItem

      public boolean isUsingItem()
      Returns whether the player is currently using an item (right-click and hold).
      Returns:
      bool
    • getButtonText

      public String getButtonText()
    • setUsingItem

      public void setUsingItem(boolean value)
    • setButtonText

      public void setButtonText(String text)
    • getSpawn

      public org.cloudburstmc.api.level.Location getSpawn()
      Specified by:
      getSpawn in interface org.cloudburstmc.api.player.Player
    • setSpawn

      public void setSpawn(org.cloudburstmc.api.level.Location location)
      Specified by:
      setSpawn in interface org.cloudburstmc.api.player.Player
    • doFirstSpawn

      protected void doFirstSpawn()
    • getPing

      public long getPing()
    • sleepOn

      public boolean sleepOn(com.nukkitx.math.vector.Vector3i pos)
      Specified by:
      sleepOn in interface org.cloudburstmc.api.player.Player
    • stopSleep

      public void stopSleep()
      Specified by:
      stopSleep in interface org.cloudburstmc.api.player.Player
    • awardAchievement

      public boolean awardAchievement(String achievementId)
    • getGamemode

      public org.cloudburstmc.api.player.GameMode getGamemode()
      Specified by:
      getGamemode in interface org.cloudburstmc.api.player.Player
    • setGamemode

      public boolean setGamemode(org.cloudburstmc.api.player.GameMode gamemode)
    • sendPacket

      public boolean sendPacket(com.nukkitx.protocol.bedrock.BedrockPacket packet)
      0 is true -1 is false other is identifer
      Parameters:
      packet - packet to send
      Returns:
      packet successfully sent
    • sendPacketInternal

      public void sendPacketInternal(com.nukkitx.protocol.bedrock.BedrockPacket packet)
    • sendSettings

      @Deprecated public void sendSettings()
      Deprecated.
    • isSurvival

      public boolean isSurvival()
      Specified by:
      isSurvival in interface org.cloudburstmc.api.player.Player
    • isCreative

      public boolean isCreative()
      Specified by:
      isCreative in interface org.cloudburstmc.api.player.Player
    • isSpectator

      public boolean isSpectator()
      Specified by:
      isSpectator in interface org.cloudburstmc.api.player.Player
    • isAdventure

      public boolean isAdventure()
      Specified by:
      isAdventure in interface org.cloudburstmc.api.player.Player
    • getDrops

      public org.cloudburstmc.api.item.ItemStack[] getDrops()
      Overrides:
      getDrops in class EntityHuman
    • sendPacketImmediately

      public boolean sendPacketImmediately(com.nukkitx.protocol.bedrock.BedrockPacket packet)
      0 is true -1 is false other is identifer
      Parameters:
      packet - packet to send
      Returns:
      packet successfully sent
    • checkBlockCollision

      protected void checkBlockCollision()
      Overrides:
      checkBlockCollision in class BaseEntity
    • checkNearEntities

      protected void checkNearEntities()
    • setGamemode

      public boolean setGamemode(org.cloudburstmc.api.player.GameMode gamemode, boolean clientSide)
    • canOpenInventory

      public boolean canOpenInventory()
    • openInventory

      public void openInventory(CloudPlayer who)
    • closeInventory

      public void closeInventory(CloudPlayer who)
    • setMotion

      public boolean setMotion(com.nukkitx.math.vector.Vector3f motion)
      Specified by:
      setMotion in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      setMotion in class BaseEntity
    • sendAttributes

      public void sendAttributes()
    • checkGroundState

      protected void checkGroundState(double movX, double movY, double movZ, double dx, double dy, double dz)
      Overrides:
      checkGroundState in class BaseEntity
    • checkInteractNearby

      public void checkInteractNearby()
    • processMovement

      protected void processMovement(int tickDiff)
    • addMovement

      public void addMovement(double x, double y, double z, double yaw, double pitch, double headYaw)
      Overrides:
      addMovement in class BaseEntity
    • onUpdate

      public boolean onUpdate(int currentTick)
      Specified by:
      onUpdate in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      onUpdate in class BaseEntity
    • getEntityPlayerLookingAt

      public org.cloudburstmc.api.entity.Interactable getEntityPlayerLookingAt(int maxDistance)
      Returns the Entity the player is looking at currently
      Parameters:
      maxDistance - the maximum distance to check for entities
      Returns:
      Entity|null either NULL if no entity is found or an instance of the entity
    • canInteract

      public boolean canInteract(com.nukkitx.math.vector.Vector3f pos, double maxDistance)
    • canInteract

      public boolean canInteract(com.nukkitx.math.vector.Vector3f pos, double maxDistance, double maxDiff)
    • completeLoginSequence

      public void completeLoginSequence()
    • checkNetwork

      public void checkNetwork()
    • processLogin

      public void processLogin()
    • chat

      public boolean chat(String message)
      Sends a chat message as this player. If the message begins with a / (forward-slash) it will be treated as a command.
      Parameters:
      message - message to send
      Returns:
      successful
    • kick

      public boolean kick()
    • kick

      public boolean kick(String reason, boolean isAdmin)
    • kick

      public boolean kick(String reason)
    • kick

      public boolean kick(org.cloudburstmc.api.event.player.PlayerKickEvent.Reason reason)
    • kick

      public boolean kick(org.cloudburstmc.api.event.player.PlayerKickEvent.Reason reason, String reasonString)
    • kick

      public boolean kick(org.cloudburstmc.api.event.player.PlayerKickEvent.Reason reason, boolean isAdmin)
    • kick

      public boolean kick(org.cloudburstmc.api.event.player.PlayerKickEvent.Reason reason, String reasonString, boolean isAdmin)
    • handleDataPacket

      public void handleDataPacket(com.nukkitx.protocol.bedrock.BedrockPacket packet)
    • getChunkRadius

      public int getChunkRadius()
    • getXuid

      public String getXuid()
      Specified by:
      getXuid in interface org.cloudburstmc.api.player.Player
    • sendMessage

      public void sendMessage(String message)
      Specified by:
      sendMessage in interface org.cloudburstmc.api.command.CommandSender
    • sendMessage

      public void sendMessage(org.cloudburstmc.api.locale.TextContainer message)
      Specified by:
      sendMessage in interface org.cloudburstmc.api.command.CommandSender
    • sendTranslation

      public void sendTranslation(String message, Object... parameters)
    • sendChat

      public void sendChat(String message)
    • sendChat

      public void sendChat(String source, String message)
    • sendPopup

      public void sendPopup(String message)
    • sendPopup

      public void sendPopup(String message, String subtitle)
    • sendTip

      public void sendTip(String message)
    • clearTitle

      public void clearTitle()
    • resetTitleSettings

      public void resetTitleSettings()
      Resets both title animation times and subtitle for the next shown title
    • setSubtitle

      public void setSubtitle(String subtitle)
    • setTitleAnimationTimes

      public void setTitleAnimationTimes(int fadein, int duration, int fadeout)
    • sendTitle

      public void sendTitle(String title)
    • sendTitle

      public void sendTitle(String title, String subtitle)
    • sendTitle

      public void sendTitle(String title, String subtitle, int fadeIn, int stay, int fadeOut)
    • sendActionBar

      public void sendActionBar(String title)
    • sendActionBar

      public void sendActionBar(String title, int fadein, int duration, int fadeout)
    • close

      public void close()
      Specified by:
      close in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      close in class EntityHuman
    • close

      public void close(String message)
    • close

      public void close(String message, String reason)
    • close

      public void close(String message, String reason, boolean notify)
    • close

      public void close(org.cloudburstmc.api.locale.TextContainer message)
    • close

      public void close(org.cloudburstmc.api.locale.TextContainer message, String reason)
    • setChunkRadius

      public void setChunkRadius(int chunkRadius)
    • save

      public void save()
      Specified by:
      save in interface org.cloudburstmc.api.player.Player
    • getChunkManager

      public PlayerChunkManager getChunkManager()
    • getName

      public String getName()
      Specified by:
      getName in interface org.cloudburstmc.api.command.CommandSender
      Specified by:
      getName in interface org.cloudburstmc.api.entity.Entity
      Specified by:
      getName in interface org.cloudburstmc.api.player.Player
      Overrides:
      getName in class EntityHuman
    • getTeleportPosition

      public com.nukkitx.math.vector.Vector3f getTeleportPosition()
    • setTeleportPosition

      public void setTeleportPosition(com.nukkitx.math.vector.Vector3f teleportPosition)
    • getForceMovement

      public com.nukkitx.math.vector.Vector3f getForceMovement()
    • setForceMovement

      public void setForceMovement(com.nukkitx.math.vector.Vector3f forceMovement)
    • getNewPosition

      public com.nukkitx.math.vector.Vector3f getNewPosition()
    • setNewPosition

      public void setNewPosition(com.nukkitx.math.vector.Vector3f newPosition)
    • close

      public void close(org.cloudburstmc.api.locale.TextContainer message, String reason, boolean notify)
    • setHealth

      public void setHealth(float health)
      Specified by:
      setHealth in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      setHealth in class EntityLiving
    • setMaxHealth

      public void setMaxHealth(int maxHealth)
      Specified by:
      setMaxHealth in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      setMaxHealth in class BaseEntity
    • getExperience

      public int getExperience()
    • getExperienceLevel

      public int getExperienceLevel()
    • addExperience

      public void addExperience(int add)
    • calculateRequireExperience

      public static int calculateRequireExperience(int level)
    • setExperience

      public void setExperience(int exp)
    • setExperience

      public void setExperience(int exp, int level)
    • sendExperience

      public void sendExperience()
    • sendExperience

      public void sendExperience(int exp)
    • sendExperienceLevel

      public void sendExperienceLevel()
    • sendExperienceLevel

      public void sendExperienceLevel(int level)
    • setAttribute

      public void setAttribute(org.cloudburstmc.api.entity.Attribute attr)
    • setMovementSpeed

      public void setMovementSpeed(float speed)
      Specified by:
      setMovementSpeed in interface org.cloudburstmc.api.player.Player
      Overrides:
      setMovementSpeed in class EntityLiving
    • setMovementSpeed

      public void setMovementSpeed(float speed, boolean send)
    • getKiller

      public org.cloudburstmc.api.entity.Entity getKiller()
    • attack

      public boolean attack(org.cloudburstmc.api.event.entity.EntityDamageEvent source)
      Specified by:
      attack in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      attack in class EntityHuman
    • dropItem

      public boolean dropItem(org.cloudburstmc.api.item.ItemStack item)
      Drops an item on the ground in front of the player. Returns if the item drop was successful.
      Parameters:
      item - to drop
      Returns:
      bool if the item was dropped or if the item was null
    • sendPosition

      public void sendPosition(com.nukkitx.math.vector.Vector3f pos)
    • sendPosition

      public void sendPosition(com.nukkitx.math.vector.Vector3f pos, double yaw)
    • sendPosition

      public void sendPosition(com.nukkitx.math.vector.Vector3f pos, double yaw, double pitch)
    • sendPosition

      public void sendPosition(com.nukkitx.math.vector.Vector3f pos, double yaw, double pitch, com.nukkitx.protocol.bedrock.packet.MovePlayerPacket.Mode mode)
    • sendPosition

      public void sendPosition(com.nukkitx.math.vector.Vector3f pos, double yaw, double pitch, com.nukkitx.protocol.bedrock.packet.MovePlayerPacket.Mode mode, Set<CloudPlayer> targets)
    • loadAdditionalData

      public void loadAdditionalData(com.nukkitx.nbt.NbtMap tag)
      Overrides:
      loadAdditionalData in class EntityHuman
    • saveAdditionalData

      public void saveAdditionalData(com.nukkitx.nbt.NbtMapBuilder tag)
      Overrides:
      saveAdditionalData in class EntityHuman
    • save

      public void save(boolean async)
      Specified by:
      save in interface org.cloudburstmc.api.player.Player
    • kill

      public void kill()
      Specified by:
      kill in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      kill in class EntityLiving
    • sendPlayStatus

      protected void sendPlayStatus(com.nukkitx.protocol.bedrock.packet.PlayStatusPacket.Status status)
    • sendPlayStatus

      protected void sendPlayStatus(com.nukkitx.protocol.bedrock.packet.PlayStatusPacket.Status status, boolean immediate)
    • checkChunks

      protected void checkChunks()
      Overrides:
      checkChunks in class BaseEntity
    • teleportImmediate

      public void teleportImmediate(org.cloudburstmc.api.level.Location location)
    • teleportImmediate

      public void teleportImmediate(org.cloudburstmc.api.level.Location location, org.cloudburstmc.api.event.player.PlayerTeleportEvent.TeleportCause cause)
    • showFormWindow

      public int showFormWindow(Form<?> window)
      Shows a new FormWindow to the player You can find out FormWindow result by listening to PlayerFormRespondedEvent
      Parameters:
      window - to show
      Returns:
      form id
    • showFormWindow

      public int showFormWindow(Form<?> window, int id)
      Shows a new FormWindow to the player You can find out FormWindow result by listening to PlayerFormRespondedEvent
      Parameters:
      window - to show
      id - form id
      Returns:
      form id
    • removeFormWindow

      public Form<?> removeFormWindow(int id)
    • getServerSettings

      public CustomForm getServerSettings()
    • getServerSettingsId

      public int getServerSettingsId()
    • setServerSettings

      public int setServerSettings(CustomForm window)
      Shows a new setting page in game settings You can find out settings result by listening to PlayerFormRespondedEvent
      Parameters:
      window - to show on settings page
      Returns:
      form id
    • createBossBar

      @Deprecated public long createBossBar(String text, int length)
      Deprecated.
      Creates and sends a BossBar to the player
      Parameters:
      text - The BossBar message
      length - The BossBar percentage
      Returns:
      bossBarId The BossBar ID, you should store it if you want to remove or update the BossBar later
    • createBossBar

      public long createBossBar(DummyBossBar dummyBossBar)
      Creates and sends a BossBar to the player
      Parameters:
      dummyBossBar - DummyBossBar Object (Instantiate it by the Class Builder)
      Returns:
      bossBarId The BossBar ID, you should store it if you want to remove or update the BossBar later
      See Also:
      DummyBossBar.Builder
    • getDummyBossBar

      public DummyBossBar getDummyBossBar(long bossBarId)
      Get a DummyBossBar object
      Parameters:
      bossBarId - The BossBar ID
      Returns:
      DummyBossBar object
      See Also:
      Set BossBar text, Set BossBar length, Set BossBar color
    • getDummyBossBars

      public Map<Long,​DummyBossBar> getDummyBossBars()
      Get all DummyBossBar objects
      Returns:
      DummyBossBars Map
    • updateBossBar

      @Deprecated public void updateBossBar(String text, int length, long bossBarId)
      Deprecated.
      Updates a BossBar
      Parameters:
      text - The new BossBar message
      length - The new BossBar length
      bossBarId - The BossBar ID
    • removeBossBar

      public void removeBossBar(long bossBarId)
      Removes a BossBar
      Parameters:
      bossBarId - The BossBar ID
    • getWindowId

      public byte getWindowId(org.cloudburstmc.api.inventory.Inventory inventory)
      Specified by:
      getWindowId in interface org.cloudburstmc.api.player.Player
    • getWindowById

      public org.cloudburstmc.api.inventory.Inventory getWindowById(int id)
    • addWindow

      public byte addWindow(org.cloudburstmc.api.inventory.Inventory inventory, Byte forceId, boolean isPermanent)
      Specified by:
      addWindow in interface org.cloudburstmc.api.player.Player
    • getTopWindow

      public Optional<org.cloudburstmc.api.inventory.Inventory> getTopWindow()
    • removeWindow

      public void removeWindow(org.cloudburstmc.api.inventory.Inventory inventory)
      Specified by:
      removeWindow in interface org.cloudburstmc.api.player.Player
    • removeWindowById

      public org.cloudburstmc.api.inventory.Inventory removeWindowById(byte id)
    • sendAllInventories

      public void sendAllInventories()
    • addDefaultWindows

      protected void addDefaultWindows()
    • getInventory

      public CloudPlayerInventory getInventory()
      Specified by:
      getInventory in interface org.cloudburstmc.api.inventory.InventoryHolder
      Specified by:
      getInventory in interface org.cloudburstmc.api.player.Player
      Overrides:
      getInventory in class EntityCreature
    • getEnderChestInventory

      public CloudEnderChestInventory getEnderChestInventory()
      Specified by:
      getEnderChestInventory in interface org.cloudburstmc.api.player.Player
    • getCursorInventory

      public PlayerCursorInventory getCursorInventory()
    • getInventoryManager

      public PlayerInventoryManager getInventoryManager()
    • getCraftingTransaction

      public @Nullable CraftItemStackTransaction getCraftingTransaction()
    • setCraftingTransaction

      public void setCraftingTransaction(@Nullable CraftItemStackTransaction craftingTransaction)
    • removeAllWindows

      public void removeAllWindows()
    • removeAllWindows

      public void removeAllWindows(boolean permanent)
    • checkTeleportPosition

      protected boolean checkTeleportPosition()
    • teleport

      public boolean teleport(org.cloudburstmc.api.level.Location location, org.cloudburstmc.api.event.player.PlayerTeleportEvent.TeleportCause cause)
      Specified by:
      teleport in interface org.cloudburstmc.api.entity.Entity
      Overrides:
      teleport in class BaseEntity
    • isChunkInView

      public boolean isChunkInView(int x, int z)
    • onChunkChanged

      public void onChunkChanged(org.cloudburstmc.api.level.chunk.Chunk chunk)
      Specified by:
      onChunkChanged in interface org.cloudburstmc.api.level.ChunkLoader
    • getLoaderId

      public int getLoaderId()
      Specified by:
      getLoaderId in interface org.cloudburstmc.api.level.ChunkLoader
    • isLoaderActive

      public boolean isLoaderActive()
      Specified by:
      isLoaderActive in interface org.cloudburstmc.api.level.ChunkLoader
    • isFoodEnabled

      public boolean isFoodEnabled()
    • setFoodEnabled

      public void setFoodEnabled(boolean foodEnabled)
    • getFoodData

      public PlayerFood getFoodData()
    • setLocale

      public void setLocale(Locale locale)
    • getLocale

      public Locale getLocale()
    • setSprinting

      public void setSprinting(boolean value)
      Overrides:
      setSprinting in class EntityHuman
    • transfer

      public void transfer(InetSocketAddress address)
    • getLoginChainData

      public org.cloudburstmc.api.util.LoginChainData getLoginChainData()
    • setLoginChainData

      public void setLoginChainData(org.cloudburstmc.api.util.LoginChainData loginChainData)
    • onChunkUnloaded

      public void onChunkUnloaded(org.cloudburstmc.api.level.chunk.Chunk chunk)
      Specified by:
      onChunkUnloaded in interface org.cloudburstmc.api.level.ChunkLoader
    • onChunkLoaded

      public void onChunkLoaded(org.cloudburstmc.api.level.chunk.Chunk chunk)
      Specified by:
      onChunkLoaded in interface org.cloudburstmc.api.level.ChunkLoader
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isBreakingBlock

      public boolean isBreakingBlock()
    • showXboxProfile

      public void showXboxProfile(String xuid)
      Show a window of a XBOX account's profile
      Parameters:
      xuid - XUID
    • sendSignChange

      public void sendSignChange(com.nukkitx.math.vector.Vector3i position, String[] lines)
      Sends a sign change. Sends "fake" sign contents by sending a sign change packet. This does not actually modify the sign lines and is only temporary.
      Parameters:
      position - the position of the sign
      lines - the lines to send
    • startFishing

      public void startFishing(org.cloudburstmc.api.item.ItemStack fishingRod)
    • stopFishing

      public void stopFishing(boolean click)
    • switchLevel

      public boolean switchLevel(CloudLevel level)
      Overrides:
      switchLevel in class BaseEntity
    • pickupEntity

      public boolean pickupEntity(org.cloudburstmc.api.entity.Entity entity, boolean near)
    • toString

      public String toString()
      Overrides:
      toString in class BaseEntity