程序包 cn.nukkit

类 Player

所有已实现的接口:
CommandSender, EntityDamageable, EntityNameable, InventoryHolder, IPlayer, ChunkLoader, Metadatable, Permissible, ServerOperator, Cloneable

public class Player extends EntityHuman implements CommandSender, InventoryHolder, ChunkLoader, IPlayer
作者:
MagicDroidX & Box (Nukkit Project)
  • 字段详细资料

    • EMPTY_ARRAY

      @PowerNukkitOnly @Since("1.4.0.0-PN") public static final Player[] EMPTY_ARRAY
    • SURVIVAL

      public static final int SURVIVAL
      另请参阅:
    • CREATIVE

      public static final int CREATIVE
      另请参阅:
    • ADVENTURE

      public static final int ADVENTURE
      另请参阅:
    • SPECTATOR

      public static final int SPECTATOR
      另请参阅:
    • VIEW

      public static final int VIEW
      另请参阅:
    • SURVIVAL_SLOTS

      public static final int SURVIVAL_SLOTS
      另请参阅:
    • CREATIVE_SLOTS

      public static final int CREATIVE_SLOTS
      另请参阅:
    • CRAFTING_SMALL

      public static final int CRAFTING_SMALL
      另请参阅:
    • CRAFTING_BIG

      public static final int CRAFTING_BIG
      另请参阅:
    • CRAFTING_ANVIL

      public static final int CRAFTING_ANVIL
      另请参阅:
    • CRAFTING_ENCHANT

      public static final int CRAFTING_ENCHANT
      另请参阅:
    • CRAFTING_BEACON

      public static final int CRAFTING_BEACON
      另请参阅:
    • CRAFTING_GRINDSTONE

      @PowerNukkitOnly public static final int CRAFTING_GRINDSTONE
      另请参阅:
    • CRAFTING_STONECUTTER

      @PowerNukkitOnly public static final int CRAFTING_STONECUTTER
      另请参阅:
    • CRAFTING_CARTOGRAPHY

      @PowerNukkitOnly public static final int CRAFTING_CARTOGRAPHY
      另请参阅:
    • CRAFTING_SMITHING

      @PowerNukkitOnly public static final int CRAFTING_SMITHING
      另请参阅:
    • DEFAULT_SPEED

      public static final float DEFAULT_SPEED
      另请参阅:
    • MAXIMUM_SPEED

      public static final float MAXIMUM_SPEED
      另请参阅:
    • PERMISSION_CUSTOM

      public static final int PERMISSION_CUSTOM
      另请参阅:
    • PERMISSION_OPERATOR

      public static final int PERMISSION_OPERATOR
      另请参阅:
    • PERMISSION_MEMBER

      public static final int PERMISSION_MEMBER
      另请参阅:
    • PERMISSION_VISITOR

      public static final int PERMISSION_VISITOR
      另请参阅:
    • ANVIL_WINDOW_ID

      public static final int ANVIL_WINDOW_ID
      另请参阅:
    • ENCHANT_WINDOW_ID

      public static final int ENCHANT_WINDOW_ID
      另请参阅:
    • BEACON_WINDOW_ID

      public static final int BEACON_WINDOW_ID
      另请参阅:
    • GRINDSTONE_WINDOW_ID

      @PowerNukkitOnly public static final int GRINDSTONE_WINDOW_ID
    • SMITHING_WINDOW_ID

      @Since("1.4.0.0-PN") @PowerNukkitOnly public static final int SMITHING_WINDOW_ID
    • RESOURCE_PACK_CHUNK_SIZE

      @Since("FUTURE") protected static final int RESOURCE_PACK_CHUNK_SIZE
      另请参阅:
    • interfaz

      protected final SourceInterface interfaz
    • playedBefore

      public boolean playedBefore
    • spawned

      public boolean spawned
    • loggedIn

      public boolean loggedIn
    • locallyInitialized

      @Since("1.4.0.0-PN") public boolean locallyInitialized
    • gamemode

      public int gamemode
    • lastBreak

      public long lastBreak
    • windowCnt

      protected int windowCnt
    • windows

      protected final com.google.common.collect.BiMap<Inventory,Integer> windows
    • windowIndex

      protected final com.google.common.collect.BiMap<Integer,Inventory> windowIndex
    • permanentWindows

      protected final Set<Integer> permanentWindows
    • closingWindowId

      @Since("1.4.0.0-PN") protected int closingWindowId
    • messageCounter

      protected int messageCounter
    • speed

      public Vector3 speed
    • achievements

      public final HashSet<String> achievements
    • craftingType

      public int craftingType
    • playerUIInventory

      protected PlayerUIInventory playerUIInventory
    • craftingGrid

      protected CraftingGrid craftingGrid
    • craftingTransaction

      protected CraftingTransaction craftingTransaction
    • enchantTransaction

      @Since("1.3.1.0-PN") protected EnchantTransaction enchantTransaction
    • repairItemTransaction

      @Since("1.4.0.0-PN") protected RepairItemTransaction repairItemTransaction
    • grindstoneTransaction

      @Since("1.4.0.0-PN") @PowerNukkitOnly protected GrindstoneTransaction grindstoneTransaction
    • smithingTransaction

      @Since("1.4.0.0-PN") @PowerNukkitOnly protected SmithingTransaction smithingTransaction
    • creationTime

      public long creationTime
    • randomClientId

      protected long randomClientId
    • forceMovement

      protected Vector3 forceMovement
    • teleportPosition

      protected Vector3 teleportPosition
    • connected

      protected boolean connected
    • socketAddress

      protected final InetSocketAddress socketAddress
    • removeFormat

      protected boolean removeFormat
    • username

      protected String username
    • iusername

      protected String iusername
    • displayName

      protected String displayName
    • startAction

      protected int startAction
    • sleeping

      protected Vector3 sleeping
    • clientID

      protected Long clientID
    • stepHeight

      protected float stepHeight
    • usedChunks

      public final Map<Long,Boolean> usedChunks
    • chunkLoadCount

      protected int chunkLoadCount
    • loadQueue

      protected final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<Boolean> loadQueue
    • nextChunkOrderRun

      protected int nextChunkOrderRun
    • hiddenPlayers

      protected final Map<UUID,Player> hiddenPlayers
    • newPosition

      protected Vector3 newPosition
    • chunkRadius

      protected int chunkRadius
    • viewDistance

      protected int viewDistance
    • chunksPerTick

      protected final int chunksPerTick
    • spawnThreshold

      protected final int spawnThreshold
    • spawnPosition

      protected Position spawnPosition
    • spawnBlockPosition

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected Vector3 spawnBlockPosition
    • inAirTicks

      protected int inAirTicks
    • startAirTicks

      protected int startAirTicks
    • adventureSettings

      protected AdventureSettings adventureSettings
    • checkMovement

      protected boolean checkMovement
    • foodData

      protected PlayerFood foodData
    • enableClientCommand

      protected boolean enableClientCommand
    • lastEnderPearl

      protected int lastEnderPearl
    • lastChorusFruitTeleport

      protected int lastChorusFruitTeleport
    • breakingBlock

      public Block breakingBlock
    • pickedXPOrb

      public int pickedXPOrb
    • formWindowCount

      protected int formWindowCount
    • formWindows

      protected Map<Integer,FormWindow> formWindows
    • serverSettings

      protected Map<Integer,FormWindow> serverSettings
    • dialogWindows

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") protected com.google.common.cache.Cache<String,FormWindowDialog> dialogWindows
      我们使用google的cache来存储NPC对话框发送信息 原因是发送过去的对话框客户端有几率不响应,在特定情况下我们无法清除这些对话框,这会导致内存泄漏 5分钟后未响应的对话框会被清除
    • dummyBossBars

      protected Map<Long,DummyBossBar> dummyBossBars
    • shouldLogin

      protected boolean shouldLogin
    • fishing

      public EntityFishingHook fishing
    • lastSkinChange

      public long lastSkinChange
    • lastRightClickTime

      protected double lastRightClickTime
    • lastRightClickPos

      protected Vector3 lastRightClickPos
    • lastPlayerdLevelUpSoundTime

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected int lastPlayerdLevelUpSoundTime
  • 构造器详细资料

  • 方法详细资料

    • getSoulSpeedMultiplier

      public float getSoulSpeedMultiplier()
    • 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 BlockEnderChest getViewingEnderChest()
    • setViewingEnderChest

      public void setViewingEnderChest(BlockEnderChest chest)
    • getLeaveMessage

      public TranslationContainer getLeaveMessage()
    • getClientSecret

      public String getClientSecret()
    • getClientId

      @Deprecated public Long getClientId()
      已过时。
      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)
      返回:
      random client id
    • isBanned

      public boolean isBanned()
      从接口复制的说明: IPlayer
      返回这个玩家是否被封禁(ban)。
      Returns if this player is banned.
      指定者:
      isBanned 在接口中 IPlayer
      返回:
      这个玩家的名称。
      The name of this player.
      另请参阅:
    • setBanned

      public void setBanned(boolean value)
      从接口复制的说明: IPlayer
      设置这个玩家是否被封禁(ban)。
      Sets this player to be banned or to be pardoned.
      指定者:
      setBanned 在接口中 IPlayer
      参数:
      value - 如果为true,封禁这个玩家。如果为false,解封这个玩家。
      true for ban and false for pardon.
      另请参阅:
    • isWhitelisted

      public boolean isWhitelisted()
      从接口复制的说明: IPlayer
      返回这个玩家是否已加入白名单。
      Returns if this player is pardoned by whitelist.
      指定者:
      isWhitelisted 在接口中 IPlayer
      返回:
      这个玩家是否已加入白名单。
      If this player is pardoned by whitelist.
      另请参阅:
    • setWhitelisted

      public void setWhitelisted(boolean value)
      从接口复制的说明: IPlayer
      把这个玩家加入白名单,或者取消这个玩家的白名单。
      Adds this player to the white list, or removes it from the whitelist.
      指定者:
      setWhitelisted 在接口中 IPlayer
      参数:
      value - 如果为true,把玩家加入白名单。如果为false,取消这个玩家的白名单。
      true for add and false for remove.
      另请参阅:
    • getPlayer

      public Player getPlayer()
      从接口复制的说明: IPlayer
      得到这个接口的Player对象。
      Returns a Player object for this interface.
      指定者:
      getPlayer 在接口中 IPlayer
      返回:
      这个接口的 Player对象。
      a Player object for this interface.
      另请参阅:
    • getFirstPlayed

      public Long getFirstPlayed()
      从接口复制的说明: IPlayer
      得到这个玩家第一次游戏的时间。
      Returns the time this player first played in this server.
      指定者:
      getFirstPlayed 在接口中 IPlayer
      返回:
      Unix时间(以秒为单位。
      Unix time in seconds.
    • getLastPlayed

      public Long getLastPlayed()
      从接口复制的说明: IPlayer
      得到这个玩家上次加入游戏的时间。
      Returns the time this player last joined in this server.
      指定者:
      getLastPlayed 在接口中 IPlayer
      返回:
      Unix时间(以秒为单位。
      Unix time in seconds.
    • hasPlayedBefore

      public boolean hasPlayedBefore()
      从接口复制的说明: IPlayer
      返回这个玩家以前是否来过服务器。
      Returns if this player has played in this server before.

      如果想得到这个玩家是不是第一次玩,可以使用:
      If you want to know if this player is the first time playing in this server, you can use:

      if(!player.hasPlayerBefore()) {...}
      指定者:
      hasPlayedBefore 在接口中 IPlayer
      返回:
      这个玩家以前是不是玩过游戏。
      If this player has played in this server before.
    • getAdventureSettings

      public AdventureSettings getAdventureSettings()
    • setAdventureSettings

      public void setAdventureSettings(AdventureSettings adventureSettings)
    • resetInAirTicks

      public void resetInAirTicks()
    • setAllowFlight

      @Deprecated public void setAllowFlight(boolean value)
      已过时。
    • getAllowFlight

      @Deprecated public boolean getAllowFlight()
      已过时。
    • 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)
      已过时。
    • hasAutoJump

      @Deprecated public boolean hasAutoJump()
      已过时。
    • spawnTo

      public void spawnTo(Player player)
      覆盖:
      spawnTo 在类中 EntityHuman
    • getServer

      public Server getServer()
      从接口复制的说明: CommandSender
      EntitySelector 返回命令发送者所在的服务器。
      Returns the server of the command sender.
      指定者:
      getServer 在接口中 CommandSender
      指定者:
      getServer 在接口中 IPlayer
      覆盖:
      getServer 在类中 Entity
      返回:
      命令发送者所在的服务器。
      the server of the command sender.
    • getRemoveFormat

      public boolean getRemoveFormat()
    • setRemoveFormat

      public void setRemoveFormat()
    • setRemoveFormat

      public void setRemoveFormat(boolean remove)
    • canSee

      public boolean canSee(Player player)
    • hidePlayer

      public void hidePlayer(Player player)
    • showPlayer

      public void showPlayer(Player player)
    • canCollideWith

      public boolean canCollideWith(Entity entity)
      覆盖:
      canCollideWith 在类中 Entity
    • resetFallDistance

      public void resetFallDistance()
      覆盖:
      resetFallDistance 在类中 Entity
    • isOnline

      public boolean isOnline()
      从接口复制的说明: IPlayer
      返回这个玩家是否在线。
      Returns if this player is online.
      指定者:
      isOnline 在接口中 IPlayer
      返回:
      这个玩家是否在线。
      If this player is online.
    • isOp

      public boolean isOp()
      从接口复制的说明: ServerOperator
      返回这个对象是不是服务器管理员。
      Returns if this object is an operator.
      指定者:
      isOp 在接口中 ServerOperator
      返回:
      这个对象是不是服务器管理员。
      if this object is an operator.
    • setOp

      public void setOp(boolean value)
      从接口复制的说明: ServerOperator
      把这个对象设置成服务器管理员。
      Sets this object to be an operator or not to be.
      指定者:
      setOp 在接口中 ServerOperator
      参数:
      value - true为授予管理员,false为取消管理员。
      true for giving this operator or false for cancelling.
    • isPermissionSet

      public boolean isPermissionSet(String name)
      指定者:
      isPermissionSet 在接口中 Permissible
    • isPermissionSet

      public boolean isPermissionSet(Permission permission)
      指定者:
      isPermissionSet 在接口中 Permissible
    • hasPermission

      public boolean hasPermission(String name)
      指定者:
      hasPermission 在接口中 Permissible
    • hasPermission

      public boolean hasPermission(Permission permission)
      指定者:
      hasPermission 在接口中 Permissible
    • addAttachment

      public PermissionAttachment addAttachment(Plugin plugin)
      指定者:
      addAttachment 在接口中 Permissible
    • addAttachment

      public PermissionAttachment addAttachment(Plugin plugin, String name)
      指定者:
      addAttachment 在接口中 Permissible
    • addAttachment

      public PermissionAttachment addAttachment(Plugin plugin, String name, Boolean value)
      指定者:
      addAttachment 在接口中 Permissible
    • removeAttachment

      public void removeAttachment(PermissionAttachment attachment)
      指定者:
      removeAttachment 在接口中 Permissible
    • recalculatePermissions

      public void recalculatePermissions()
      指定者:
      recalculatePermissions 在接口中 Permissible
    • isEnableClientCommand

      public boolean isEnableClientCommand()
    • setEnableClientCommand

      public void setEnableClientCommand(boolean enable)
    • sendCommandData

      public void sendCommandData()
    • getEffectivePermissions

      public Map<String,PermissionAttachmentInfo> getEffectivePermissions()
      指定者:
      getEffectivePermissions 在接口中 Permissible
    • initEntity

      protected void initEntity()
      覆盖:
      initEntity 在类中 EntityHuman
    • isPlayer

      public boolean isPlayer()
      指定者:
      isPlayer 在接口中 CommandSender
    • asPlayer

      public Player asPlayer()
      指定者:
      asPlayer 在接口中 CommandSender
    • isEntity

      public boolean isEntity()
      指定者:
      isEntity 在接口中 CommandSender
      返回:
      whether the sender is an entity
      please use this method to check whether the sender is an entity instead of using code "xxx instanceof Entity"
      because the sender may not an instance of "Entity" but in fact it is executing commands identity as an entity(eg: "ExecutorCommandSender")
    • asEntity

      public Entity asEntity()
      指定者:
      asEntity 在接口中 CommandSender
    • removeAchievement

      public void removeAchievement(String achievementId)
    • hasAchievement

      public boolean hasAchievement(String achievementId)
    • isConnected

      public boolean isConnected()
    • getDisplayName

      public String getDisplayName()
    • setDisplayName

      public void setDisplayName(String displayName)
    • setSkin

      public void setSkin(Skin skin)
      覆盖:
      setSkin 在类中 EntityHuman
    • getAddress

      public String getAddress()
    • getPort

      public int getPort()
    • getSocketAddress

      public InetSocketAddress getSocketAddress()
    • getNextPosition

      public Position getNextPosition()
    • isSleeping

      public boolean isSleeping()
    • getInAirTicks

      public int getInAirTicks()
    • isUsingItem

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

      public void setUsingItem(boolean value)
    • getButtonText

      public String getButtonText()
    • setButtonText

      public void setButtonText(String text)
    • unloadChunk

      public void unloadChunk(int x, int z)
    • unloadChunk

      public void unloadChunk(int x, int z, Level level)
    • isInOverWorld

      public boolean isInOverWorld()
    • getSpawn

      public Position getSpawn()
    • getSpawnBlock

      @PowerNukkitOnly @Since("1.4.0.0-PN") @Nullable public Vector3 getSpawnBlock()
      The block that holds the player respawn position. May be null when unknown.
      返回:
      The position of a bed, respawn anchor, or null when unknown.
    • setSpawnBlock

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setSpawnBlock(@Nullable Vector3 spawnBlock)
      Sets the position of the block that holds the player respawn position. May be null when unknown.
      参数:
      spawnBlock - The position of a bed or respawn anchor
    • sendChunk

      public void sendChunk(int x, int z, DataPacket packet)
    • sendChunk

      public void sendChunk(int x, int z, int subChunkCount, byte[] payload)
    • sendNextChunk

      protected void sendNextChunk()
    • doFirstSpawn

      protected void doFirstSpawn()
    • updateTrackingPositions

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void updateTrackingPositions()
    • updateTrackingPositions

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void updateTrackingPositions(boolean delayed)
    • orderChunks

      protected boolean orderChunks()
    • batchDataPacket

      @DeprecationDetails(by="Cloudburst Nukkit", since="1.4.0.0-PN", replaceWith="dataPacket(DataPacket)", reason="Batching packet is now handled near the RakNet layer") @Deprecated public boolean batchDataPacket(DataPacket packet)
      已过时。
    • dataPacket

      public boolean dataPacket(DataPacket packet)
      0 is true -1 is false other is identifer
      参数:
      packet - packet to send
      返回:
      packet successfully sent
    • dataPacket

      @DeprecationDetails(by="Cloudburst Nukkit", since="2019-05-08", replaceWith="dataPacket(DataPacket)", reason="ACKs are handled by the RakNet layer only") @PowerNukkitDifference(since="1.4.0.0-PN", info="Cloudburst changed the return values from 0/-1 to 1/0, breaking backward compatibility for no reason, we reversed that.") @Deprecated public int dataPacket(DataPacket packet, boolean needACK)
      已过时。
    • directDataPacket

      @Deprecated @DeprecationDetails(by="Cloudburst Nukkit", since="1.4.0.0-PN", replaceWith="dataPacket(DataPacket)", reason="Direct packets are no longer allowed") public boolean directDataPacket(DataPacket packet)
      已过时。
      0 is true -1 is false other is identifer
      参数:
      packet - packet to send
      返回:
      packet successfully sent
    • directDataPacket

      @DeprecationDetails(by="Cloudburst Nukkit", since="2019-05-08", replaceWith="dataPacket(DataPacket)", reason="ACK are handled by the RakNet layer and direct packets are no longer allowed") @PowerNukkitDifference(since="1.4.0.0-PN", info="Cloudburst changed the return values from 0/-1 to 1/0, breaking backward compatibility for no reason, we reversed that.") @Deprecated public int directDataPacket(DataPacket packet, boolean needACK)
      已过时。
    • getPing

      public int getPing()
    • sleepOn

      public boolean sleepOn(Vector3 pos)
    • setSpawn

      public void setSpawn(Vector3 pos)
    • stopSleep

      public void stopSleep()
    • awardAchievement

      public boolean awardAchievement(String achievementId)
    • getGamemode

      public int getGamemode()
    • setGamemode

      public boolean setGamemode(int gamemode)
    • setGamemode

      public boolean setGamemode(int gamemode, boolean clientSide)
    • setGamemode

      public boolean setGamemode(int gamemode, boolean clientSide, AdventureSettings newSettings)
    • sendSettings

      @Deprecated public void sendSettings()
      已过时。
    • isSurvival

      public boolean isSurvival()
    • isCreative

      public boolean isCreative()
    • isSpectator

      public boolean isSpectator()
    • isAdventure

      public boolean isAdventure()
    • getDrops

      public Item[] getDrops()
      覆盖:
      getDrops 在类中 EntityHumanType
    • fastMove

      public boolean fastMove(double dx, double dy, double dz)
      覆盖:
      fastMove 在类中 Entity
    • checkGroundState

      protected void checkGroundState(double movX, double movY, double movZ, double dx, double dy, double dz)
      覆盖:
      checkGroundState 在类中 Entity
    • reCalcOffsetBoundingBox

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public AxisAlignedBB reCalcOffsetBoundingBox()
    • checkBlockCollision

      protected void checkBlockCollision()
      覆盖:
      checkBlockCollision 在类中 Entity
    • checkNearEntities

      protected void checkNearEntities()
    • processMovement

      protected void processMovement(int tickDiff)
    • addMovement

      public void addMovement(double x, double y, double z, double yaw, double pitch, double headYaw)
      覆盖:
      addMovement 在类中 EntityHuman
    • setMotion

      public boolean setMotion(Vector3 motion)
      覆盖:
      setMotion 在类中 Entity
    • sendAttributes

      public void sendAttributes()
    • onUpdate

      public boolean onUpdate(int currentTick)
      覆盖:
      onUpdate 在类中 Entity
    • entityBaseTick

      public boolean entityBaseTick(int tickDiff)
      覆盖:
      entityBaseTick 在类中 EntityLiving
    • checkInteractNearby

      public void checkInteractNearby()
    • getEntityPlayerLookingAt

      public EntityInteractable getEntityPlayerLookingAt(int maxDistance)
      Returns the Entity the player is looking at currently
      参数:
      maxDistance - the maximum distance to check for entities
      返回:
      Entity|null either NULL if no entity is found or an instance of the entity
    • checkNetwork

      public void checkNetwork()
    • canInteract

      public boolean canInteract(Vector3 pos, double maxDistance)
    • canInteract

      public boolean canInteract(Vector3 pos, double maxDistance, double maxDiff)
    • processLogin

      protected void processLogin()
    • completeLoginSequence

      protected void completeLoginSequence()
    • handleDataPacket

      public void handleDataPacket(DataPacket packet)
    • 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.
      参数:
      message - message to send
      返回:
      successful
    • kick

      public boolean kick()
    • kick

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

      public boolean kick(String reason)
    • kick

      public boolean kick(PlayerKickEvent.Reason reason)
    • kick

      public boolean kick(PlayerKickEvent.Reason reason, String reasonString)
    • kick

      public boolean kick(PlayerKickEvent.Reason reason, boolean isAdmin)
    • kick

      public boolean kick(PlayerKickEvent.Reason reason, String reasonString, boolean isAdmin)
    • setViewDistance

      public void setViewDistance(int distance)
    • getViewDistance

      public int getViewDistance()
    • sendMessage

      public void sendMessage(String message)
      从接口复制的说明: CommandSender
      给命令发送者返回信息。
      Sends a message to the command sender.
      指定者:
      sendMessage 在接口中 CommandSender
      参数:
      message - 要发送的信息。
      Message to send.
      另请参阅:
    • sendMessage

      public void sendMessage(TextContainer message)
      从接口复制的说明: CommandSender
      给命令发送者返回信息。
      Sends a message to the command sender.
      指定者:
      sendMessage 在接口中 CommandSender
      参数:
      message - 要发送的信息。
      Message to send.
    • sendRawTextMessage

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void sendRawTextMessage(RawText text)
    • sendTranslation

      public void sendTranslation(String message)
    • sendTranslation

      public void sendTranslation(String message, String[] 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)
    • setRawTextSubTitle

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void setRawTextSubTitle(RawText text)
    • setTitleAnimationTimes

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

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void setRawTextTitle(RawText text)
    • 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)
    • setRawTextActionBar

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void setRawTextActionBar(RawText text)
    • setRawTextActionBar

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void setRawTextActionBar(RawText text, int fadein, int duration, int fadeout)
    • close

      public void close()
      覆盖:
      close 在类中 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(TextContainer message)
    • close

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

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

      public void save()
    • saveNBT

      public void saveNBT()
      覆盖:
      saveNBT 在类中 EntityHuman
    • save

      public void save(boolean async)
    • getOriginalName

      @PowerNukkitOnly @Since("1.5.1.0-PN") public String getOriginalName()
      从类复制的说明: Entity
      The name that English name of the type of this entity.
      覆盖:
      getOriginalName 在类中 EntityHuman
    • getName

      public String getName()
      从类复制的说明: Entity
      The current name used by this entity in the name tag, or the static name if the entity don't have nametag.
      指定者:
      getName 在接口中 CommandSender
      指定者:
      getName 在接口中 IPlayer
      覆盖:
      getName 在类中 EntityHuman
      返回:
      命令发送者的名称。
      the name of the command sender.
      另请参阅:
    • kill

      public void kill()
      覆盖:
      kill 在类中 EntityLiving
    • isValidRespawnBlock

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected boolean isValidRespawnBlock(Block block)
    • respawn

      @PowerNukkitDifference(info="will force using the spawnposition if the value spawnBlock is null,to fix the bug of command /spawnpoint", since="1.6.0.0-PNX") protected void respawn()
    • setHealth

      public void setHealth(float health)
      覆盖:
      setHealth 在类中 EntityLiving
    • setMaxHealth

      public void setMaxHealth(int maxHealth)
      覆盖:
      setMaxHealth 在类中 Entity
    • getExperience

      public int getExperience()
    • getExperienceLevel

      public int getExperienceLevel()
    • addExperience

      public void addExperience(int add)
    • addExperience

      @PowerNukkitOnly public void addExperience(int add, boolean playLevelUpSound)
    • calculateRequireExperience

      public static int calculateRequireExperience(int level)
    • setExperience

      public void setExperience(int exp)
    • setExperience

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

      @PowerNukkitOnly public void setExperience(int exp, int level, boolean playLevelUpSound)
    • sendExperience

      public void sendExperience()
    • sendExperience

      public void sendExperience(int exp)
    • sendExperienceLevel

      public void sendExperienceLevel()
    • sendExperienceLevel

      public void sendExperienceLevel(int level)
    • setAttribute

      public void setAttribute(Attribute attribute)
    • setMovementSpeed

      public void setMovementSpeed(float speed)
      覆盖:
      setMovementSpeed 在类中 EntityLiving
    • setMovementSpeed

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

      @Since("1.4.0.0-PN") public void sendMovementSpeed(float speed)
    • getKiller

      public Entity getKiller()
    • attack

      public boolean attack(EntityDamageEvent source)
      覆盖:
      attack 在类中 EntityHumanType
    • dropItem

      public boolean dropItem(Item item)
      Drops an item on the ground in front of the player. Returns if the item drop was successful.
      参数:
      item - to drop
      返回:
      bool if the item was dropped or if the item was null
    • dropAndGetItem

      @Since("1.4.0.0-PN") @Nullable public EntityItem dropAndGetItem(@Nonnull Item item)
      Drops an item on the ground in front of the player. Returns the dropped item.
      参数:
      item - to drop
      返回:
      EntityItem if the item was dropped or null if the item was null
    • sendPosition

      public void sendPosition(Vector3 pos)
    • sendPosition

      public void sendPosition(Vector3 pos, double yaw)
    • sendPosition

      public void sendPosition(Vector3 pos, double yaw, double pitch)
    • sendPosition

      public void sendPosition(Vector3 pos, double yaw, double pitch, int mode)
    • sendPosition

      public void sendPosition(Vector3 pos, double yaw, double pitch, int mode, Player[] targets)
    • checkChunks

      protected void checkChunks()
      覆盖:
      checkChunks 在类中 Entity
    • checkTeleportPosition

      protected boolean checkTeleportPosition()
    • sendPlayStatus

      protected void sendPlayStatus(int status)
    • sendPlayStatus

      protected void sendPlayStatus(int status, boolean immediate)
    • teleport

      public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause)
      覆盖:
      teleport 在类中 Entity
    • forceSendEmptyChunks

      protected void forceSendEmptyChunks()
    • teleportImmediate

      public void teleportImmediate(Location location)
    • teleportImmediate

      public void teleportImmediate(Location location, PlayerTeleportEvent.TeleportCause cause)
    • showFormWindow

      public int showFormWindow(FormWindow window)
      Shows a new FormWindow to the player You can find out FormWindow result by listening to PlayerFormRespondedEvent
      参数:
      window - to show
      返回:
      form id to use in PlayerFormRespondedEvent
    • showFormWindow

      public int showFormWindow(FormWindow window, int id)
      Shows a new FormWindow to the player You can find out FormWindow result by listening to PlayerFormRespondedEvent
      参数:
      window - to show
      id - form id
      返回:
      form id to use in PlayerFormRespondedEvent
    • showDialogWindow

      public void showDialogWindow(FormWindowDialog dialog)
    • addServerSettings

      public int addServerSettings(FormWindow window)
      Shows a new setting page in game settings You can find out settings result by listening to PlayerFormRespondedEvent
      参数:
      window - to show on settings page
      返回:
      form id to use in PlayerFormRespondedEvent
    • createBossBar

      @Deprecated public long createBossBar(String text, int length)
      已过时。
      Creates and sends a BossBar to the player
      参数:
      text - The BossBar message
      length - The BossBar percentage
      返回:
      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
      参数:
      dummyBossBar - DummyBossBar Object (Instantiate it by the Class Builder)
      返回:
      bossBarId The BossBar ID, you should store it if you want to remove or update the BossBar later
      另请参阅:
    • getDummyBossBar

      public DummyBossBar getDummyBossBar(long bossBarId)
      Get a DummyBossBar object
      参数:
      bossBarId - The BossBar ID
      返回:
      DummyBossBar object
      另请参阅:
    • getDummyBossBars

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

      @Deprecated public void updateBossBar(String text, int length, long bossBarId)
      已过时。
      Updates a BossBar
      参数:
      text - The new BossBar message
      length - The new BossBar length
      bossBarId - The BossBar ID
    • removeBossBar

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

      public int getWindowId(Inventory inventory)
    • getWindowById

      public Inventory getWindowById(int id)
    • addWindow

      public int addWindow(Inventory inventory)
    • addWindow

      public int addWindow(Inventory inventory, Integer forceId)
    • addWindow

      public int addWindow(Inventory inventory, Integer forceId, boolean isPermanent)
    • addWindow

      @Since("1.4.0.0-PN") public int addWindow(Inventory inventory, Integer forceId, boolean isPermanent, boolean alwaysOpen)
    • getTopWindow

      public Optional<Inventory> getTopWindow()
    • removeWindow

      public void removeWindow(Inventory inventory)
    • removeWindow

      @Since("1.4.0.0-PN") protected void removeWindow(Inventory inventory, boolean isResponse)
    • sendAllInventories

      public void sendAllInventories()
    • addDefaultWindows

      protected void addDefaultWindows()
    • getUIInventory

      public PlayerUIInventory getUIInventory()
    • getCursorInventory

      public PlayerCursorInventory getCursorInventory()
    • getCraftingGrid

      public CraftingGrid getCraftingGrid()
    • setCraftingGrid

      public void setCraftingGrid(CraftingGrid grid)
    • resetCraftingGridType

      public void resetCraftingGridType()
    • removeAllWindows

      public void removeAllWindows()
    • removeAllWindows

      public void removeAllWindows(boolean permanent)
    • getClosingWindowId

      @Since("1.4.0.0-PN") public int getClosingWindowId()
    • setMetadata

      public void setMetadata(String metadataKey, MetadataValue newMetadataValue)
      指定者:
      setMetadata 在接口中 Metadatable
      覆盖:
      setMetadata 在类中 Entity
    • getMetadata

      public List<MetadataValue> getMetadata(String metadataKey)
      指定者:
      getMetadata 在接口中 Metadatable
      覆盖:
      getMetadata 在类中 Entity
    • hasMetadata

      public boolean hasMetadata(String metadataKey)
      指定者:
      hasMetadata 在接口中 Metadatable
      覆盖:
      hasMetadata 在类中 Entity
    • removeMetadata

      public void removeMetadata(String metadataKey, Plugin owningPlugin)
      指定者:
      removeMetadata 在接口中 Metadatable
      覆盖:
      removeMetadata 在类中 Entity
    • onChunkChanged

      public void onChunkChanged(FullChunk chunk)
      指定者:
      onChunkChanged 在接口中 ChunkLoader
    • onChunkLoaded

      public void onChunkLoaded(FullChunk chunk)
      指定者:
      onChunkLoaded 在接口中 ChunkLoader
    • onChunkPopulated

      public void onChunkPopulated(FullChunk chunk)
      指定者:
      onChunkPopulated 在接口中 ChunkLoader
    • onChunkUnloaded

      public void onChunkUnloaded(FullChunk chunk)
      指定者:
      onChunkUnloaded 在接口中 ChunkLoader
    • onBlockChanged

      public void onBlockChanged(Vector3 block)
      指定者:
      onBlockChanged 在接口中 ChunkLoader
    • getLoaderId

      public int getLoaderId()
      指定者:
      getLoaderId 在接口中 ChunkLoader
    • isLoaderActive

      public boolean isLoaderActive()
      指定者:
      isLoaderActive 在接口中 ChunkLoader
    • getChunkCacheFromData

      public static BatchPacket getChunkCacheFromData(int chunkX, int chunkZ, int subChunkCount, byte[] payload)
    • isFoodEnabled

      public boolean isFoodEnabled()
    • setFoodEnabled

      public void setFoodEnabled(boolean foodEnabled)
    • getFoodData

      public PlayerFood getFoodData()
    • switchLevel

      public boolean switchLevel(Level level)
      覆盖:
      switchLevel 在类中 Entity
    • setCheckMovement

      public void setCheckMovement(boolean checkMovement)
    • isCheckingMovement

      public boolean isCheckingMovement()
      从以下版本开始:
      1.2.1.0-PN
    • setLocale

      public void setLocale(Locale locale)
    • getLocale

      public Locale getLocale()
    • setSprinting

      public void setSprinting(boolean value)
      覆盖:
      setSprinting 在类中 Entity
    • transfer

      public void transfer(InetSocketAddress address)
    • getLoginChainData

      public LoginChainData getLoginChainData()
    • pickupEntity

      public boolean pickupEntity(Entity entity, boolean near)
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Entity
    • equals

      public boolean equals(Object obj)
      覆盖:
      equals 在类中 Entity
    • isBreakingBlock

      public boolean isBreakingBlock()
    • showXboxProfile

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

      public void startFishing(Item fishingRod)
      Start fishing
      参数:
      fishingRod - fishing rod item
    • stopFishing

      public void stopFishing(boolean click)
      Stop fishing
      参数:
      click - clicked or forced
    • doesTriggerPressurePlate

      public boolean doesTriggerPressurePlate()
      从类复制的说明: Entity
      Whether the entity can active pressure plates. Used for EntityBats only.
      覆盖:
      doesTriggerPressurePlate 在类中 Entity
      返回:
      triggers pressure plate
    • onBlock

      @PowerNukkitOnly protected void onBlock(Entity entity, boolean animate)
      覆盖:
      onBlock 在类中 EntityHuman
    • getNoShieldTicks

      @PowerNukkitOnly @Since("1.4.0.0-PN") public int getNoShieldTicks()
    • setNoShieldTicks

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setNoShieldTicks(int noShieldTicks)
    • toString

      public String toString()
      覆盖:
      toString 在类中 Location
    • giveItem

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void giveItem(Item... items)
      Adds the items to the main player inventory and drops on the floor any excess.
      参数:
      items - The items to give to the player.
    • getTimeSinceRest

      @Since("1.4.0.0-PN") public int getTimeSinceRest()
    • setTimeSinceRest

      @Since("1.4.0.0-PN") public void setTimeSinceRest(int timeSinceRest)
    • sendPopupJukebox

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void sendPopupJukebox(String message)
    • sendSystem

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void sendSystem(String message)
    • sendWhisper

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void sendWhisper(String message)
    • sendWhisper

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void sendWhisper(String source, String message)
    • sendAnnouncement

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void sendAnnouncement(String message)
    • sendAnnouncement

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void sendAnnouncement(String source, String message)
    • completeUsingItem

      @PowerNukkitOnly @Since("1.5.1.0-PN") public void completeUsingItem(int itemId, int action)
    • isShowingCredits

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean isShowingCredits()
    • setShowingCredits

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setShowingCredits(boolean showingCredits)
    • showCredits

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void showCredits()
    • hasSeenCredits

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean hasSeenCredits()
    • setHasSeenCredits

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setHasSeenCredits(boolean hasSeenCredits)
    • dataPacketImmediately

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean dataPacketImmediately(DataPacket packet)
    • dataResourcePacket

      @PowerNukkitOnly @Since("1.5.2.0-PN") public boolean dataResourcePacket(DataPacket packet)
    • sendScoreboard

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void sendScoreboard(Scoreboard scoreboard, DisplaySlot slot)
    • clearScoreboardSlot

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void clearScoreboardSlot(DisplaySlot slot)
    • shakeCamera

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") public void shakeCamera(float intensity, float duration, CameraShakePacket.CameraShakeType shakeType, CameraShakePacket.CameraShakeAction shakeAction)
    • sendToast

      public void sendToast(String title, String content)