接口 Player

所有超级接口:
AnimalTamer, Attributable, CommandSender, ConfigurationSerializable, Conversable, Damageable, Entity, HumanEntity, InventoryHolder, LivingEntity, Metadatable, Nameable, OfflinePlayer, Permissible, PluginMessageRecipient, ProjectileSource, ServerOperator

玩家对象
  • 方法详细资料

    • getDisplayName

      String getDisplayName()
      获得玩家在聊天信息中的昵称.

      这个昵称只显示在聊天信息中,能以颜色加以修饰.

      原文:Gets the "friendly" name to display of this player. This may include color.

      Note that this name will not be displayed in game, only in chat and places defined by plugins.

      返回:
      显示的名称.
    • setDisplayName

      void setDisplayName(String name)
      设置玩家在聊天信息中的昵称.

      这个名字只显示在聊天信息中,能以颜色加以修饰.

      原文Sets the "friendly" name to display of this player. This may include color.

      Note that this name will not be displayed in game, only in chat and places defined by plugins.

      参数:
      name - 显示的名称.
    • getPlayerListName

      String getPlayerListName()
      得到玩家显示在tab列表中的名称.

      原文:Gets the name that is shown on the player list.

      返回:
      玩家名(显示于tab列表)
    • setPlayerListName

      void setPlayerListName(String name)
      设置玩家显示在Tab列表中的名称.

      不允许超过16个字符,不允许重复.但支持ChatColor颜色代码.

      如果设置为null则不在玩家列表中显示.(玩家自己还是看得到的,只不过别人看不到).

      ("list name"指代“玩家显示在Tab列表中的名称”)(以下解释的是服务器如何处理冲突玩家名,你用代码违法操作肯定是会抛出异常的) 这个名字区分大小写且唯一,也就意味着两个字母相同但字母大小写有别的名字被当作为两个不同的人. 如果一玩家以与某个游戏内玩家的自定义的"list name"相冲突的名字加入游戏, 则追加一个随机数字至这个玩家的"list name". 如果这个玩家的名字较长,那么名字末尾的部分会被截除.

      原文:Sets the name that is shown on the in-game player list.

      The name cannot be longer than 16 characters, but ChatColor is supported.

      If the value is null, the name will be identical to HumanEntity.getName().

      This name is case sensitive and unique, two names with different casing will appear as two different people. If a player joins afterwards with a name that conflicts with a player's custom list name, the joining player's player list name will have a random number appended to it (1-2 characters long in the default implementation). If the joining player's name is 15 or 16 characters long, part of the name will be truncated at the end to allow the addition of the two digits.

      参数:
      name - 新的显示在玩家列表中的名字
      抛出:
      IllegalArgumentException - 当有名称相同时抛出
      IllegalArgumentException - 当名称超过16个字符时抛出
    • setCompassTarget

      void setCompassTarget(Location loc)
      设置玩家指南针的指向的位置(Location).

      原文:Set the target of the player's compass.

      参数:
      loc - 指向
    • getCompassTarget

      Location getCompassTarget()
      得到玩家指南针的指向的位置(Location).

      译注:默认为出生点.

      原文: Get the previously set compass target.

      返回:
      指向
    • getAddress

      InetSocketAddress getAddress()
      得到一个Address对象,包括这个玩家的IP以及登入端口.

      原文:Gets the socket address of this player

      返回:
      玩家的Address对象
    • sendRawMessage

      void sendRawMessage(String message)
      发送一条不含颜色代码的消息.

      译注:就是会把颜色代码过滤掉然后CommandSender.sendMessage(java.lang.String)

      原文:Sends this sender a message raw

      指定者:
      sendRawMessage 在接口中 Conversable
      参数:
      message - 要发送的消息
    • kickPlayer

      void kickPlayer(String message)
      踢出玩家,并且发送一条自定义的踢出消息.

      原文:Kicks player with custom kick message.

      参数:
      message - 踢出消息
    • chat

      void chat(String msg)
      强制玩家发送一个聊天消息,或强制使用命令(需要在内容前加 "/").

      原文:Says a message (or runs a command).

      参数:
      msg - 要发送的聊天消息
    • performCommand

      boolean performCommand(String command)
      强制玩家执行某个命令.

      原文:Makes the player perform the given command

      参数:
      command - 要执行的命令(不带'/')
      返回:
      JavaPlugin内的onCommand()方法的返回值
    • isSneaking

      boolean isSneaking()
      判断玩家是否在潜行中.

      原文:Returns if the player is in sneak mode

      返回:
      如果在潜行模式返回true
    • setSneaking

      void setSneaking(boolean sneak)
      设置玩家潜行模式开启/取消.

      原文:Sets the sneak mode the player

      参数:
      sneak - true表示在潜行,false反之
    • isSprinting

      boolean isSprinting()
      判断玩家是否在疾跑.

      原文:Gets whether the player is sprinting or not.

      返回:
      true表示玩家在疾跑,false反之
    • setSprinting

      void setSprinting(boolean sprinting)
      设置玩家疾跑状态开启/取消.

      原文:Sets whether the player is sprinting or not.

      参数:
      sprinting - true表示在疾跑,false反之
    • saveData

      void saveData()
      保存玩家数据(位置,血量,背包,移动方向 及其他信息至在world/player文件夹中的"玩家名.dat"文件).

      原文:Saves the players current location, health, inventory, motion, and other information into the username.dat file, in the world/player folder

    • loadData

      void loadData()
      加载上一次保存的数据(从在world/player文件夹中的玩家名.dat文件中加载 位置,血量,背包,移动方向及其他信息).

      这将会覆盖当前内存中的数据.

      原文:Loads the players current location, health, inventory, motion, and other information from the username.dat file, in the world/player folder.

      Note: This will overwrite the players current inventory, health, motion, etc, with the state from the saved dat file.

    • setSleepingIgnored

      void setSleepingIgnored(boolean isSleeping)
      是否忽略该玩家.如果设置为true,不需要该玩家睡觉,只需其他人睡觉,时间也能改变.

      如果所有玩家都把这个项设置为true但是没有人睡觉,则什么事也不会发生.

      原文:Sets whether the player is ignored as not sleeping. If everyone is either sleeping or has this flag set, then time will advance to the next day. If everyone has this flag set but no one is actually in bed, then nothing will happen.

      参数:
      isSleeping - 是否忽略该玩家
    • isSleepingIgnored

      boolean isSleepingIgnored()
      查看setSleepingIgnored(boolean)方法所设置的值.

      默认为false.

      原文:Returns whether the player is sleeping ignored.

      返回:
      判断是否全部睡觉时是否忽略该玩家
    • playNote

      @Deprecated void playNote(Location loc, byte instrument, byte note)
      已过时。
      不安全的参数
      Play a note for a player at a location. This requires a note block at the particular location (as far as the client is concerned). This will not work without a note block. This will not work with cake.

      译注:貌似就是让一个音符盒播放指定乐器的指定声音..没试过...

      参数:
      loc - 音符盒的位置.
      instrument - 乐器ID
      note - 音符ID.
    • playNote

      void playNote(Location loc, Instrument instrument, Note note)
      Play a note for a player at a location. This requires a note block at the particular location (as far as the client is concerned). This will not work without a note block. This will not work with cake.

      译注:貌似就是让一个音符盒播放指定乐器的指定声音..没试过...

      参数:
      loc - 音符盒的位置
      instrument - 乐器ID
      note - 音符
    • playSound

      void playSound(Location location, Sound sound, float volume, float pitch)
      向玩家在某个位置播放一个声音.

      当位置或声音为null或玩家的客户端没开启声音时,这个方法无效.

      原文:Play a sound for a player at the location.

      This function will fail silently if Location or Sound are null.

      参数:
      location - 要播放声音的位置
      sound - 要播放的声音
      volume - 音量 默认 1F
      pitch - 音高 默认 0F
    • playSound

      void playSound(Location location, String sound, float volume, float pitch)
      向玩家在某个位置播放一个声音.

      当位置或声音为null或玩家的客户端没开启声音时,这个方法无效.

      原文:Play a sound for a player at the location.

      This function will fail silently if Location or Sound are null. No sound will be heard by the player if their client does not have the respective sound for the value passed.

      参数:
      location - 要播放声音的位置
      sound - 要播放的声音
      volume - 音量 默认 1F
      pitch - 音高 默认 0F
    • playSound

      void playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch)
      Play a sound for a player at the location.

      This function will fail silently if Location or Sound are null.

      参数:
      location - The location to play the sound
      sound - The sound to play
      category - The category of the sound
      volume - The volume of the sound
      pitch - The pitch of the sound
    • playSound

      void playSound(Location location, String sound, SoundCategory category, float volume, float pitch)
      Play a sound for a player at the location.

      This function will fail silently if Location or Sound are null. No sound will be heard by the player if their client does not have the respective sound for the value passed.

      参数:
      location - the location to play the sound
      sound - the internal sound name to play
      category - The category of the sound
      volume - the volume of the sound
      pitch - the pitch of the sound
    • stopSound

      void stopSound(Sound sound)
      停止播放某个指定的声音.

      原文:Stop the specified sound from playing.

      参数:
      sound - 指定声音
    • stopSound

      void stopSound(String sound)
      Stop the specified sound from playing.
      参数:
      sound - the sound to stop
    • stopSound

      void stopSound(Sound sound, SoundCategory category)
      Stop the specified sound from playing.
      参数:
      sound - the sound to stop
      category - 声音类别
    • stopSound

      void stopSound(String sound, SoundCategory category)
      Stop the specified sound from playing.
      参数:
      sound - the sound to stop
      category - the category of the sound
    • playEffect

      @Deprecated void playEffect(Location loc, Effect effect, int data)
      已过时。
      不安全的参数
      在某个位置(Location)向玩家播放一个粒子效果(Effect).

      原文:Plays an effect to just this player.

      参数:
      loc - 要播放粒子效果的位置
      effect - 要播放的粒子效果
      data - 某些效果需要的附加值.
    • playEffect

      <T> void playEffect(Location loc, Effect effect, T data)
      在某个位置(Location)向玩家播放一个粒子效果(Effect).

      原文:Plays an effect to just this player.

      译注1:data参数一般为0就行,但是如果要播放的效果为

      Effect.StepSound(方块被打破时的粒子效果),data就为Material类型.

      例:playEffect(loc, Effect.StepSound, Material.REDSTONE_BLOCK)将 在loc的位置播放一个红石块(REDSTONE_BLOCK)被打破的粒子效果.

      译注2:Material只能表示主ID,不能表示副ID,所以播放绿色羊毛的打破效果貌似是不可能的, 但是由于data是泛型,我们猜测会不会data也可以是能表示任何方块类型?由于时间关系不能测试,请谅解.

      类型参数:
      T - Material
      参数:
      loc - 要播放粒子效果的位置
      effect - 要播放的粒子效果
      data - Effect.StepSound所需的附加值,一般为Material
    • sendBlockChange

      @Deprecated void sendBlockChange(Location loc, Material material, byte data)
      已过时。
      不安全的参数
      向该玩家发送一个伪造的指定位置的方块(Block)更改数据包.这不会改变世界中的方块.

      原文:Send a block change. This fakes a block change packet for a user at a certain location. This will not actually change the world in any way.

      译注:意思就是,向玩家发送一个伪造的,更新方块的数据包,那个位置本来是石头的,这个玩家看起来那里就变成了钻石矿.

      但是这并没有真的在世界中放置一个钻石矿.其他玩家看到的还是石头.挖掉后也不会真的掉钻石.(我想还是举例说明比较好..)

      例1:sendBlockChange(loc,Material.DIAMOND_ORE,(byte)0)将让玩家的客户端认为loc的位置是一个钻石矿石(DIAMOND_ORE) 但其实并没有改变.

      例2:sendBlockChange(loc,Material.WOOL,(byte)14)将让玩家的客户端认为loc的位置是一个红色羊毛(附加值为14的WOOL).

      参数:
      loc - 要改变的方块
      material - 要改变成的方块的类型
      data - 要改变成的方块的副ID
    • sendChunkChange

      @Deprecated boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data)
      已过时。
      不安全的参数
      向该玩家发送一个伪造的指定位置的长方体的更改数据包.这不会改变世界中的方块.

      原文:Send a chunk change. This fakes a chunk change packet for a user at a certain location. The updated cuboid must be entirely within a single chunk. This will not actually change the world in any way.

      At least one of the dimensions of the cuboid must be even. The size of the data buffer must be 2.5*sx*sy*sz and formatted in accordance with the Packet51 format.

      译注:这..很难解释耶,就是说,这个方法可以让玩家的客户端显示这个长方体内全是钻石矿石233~

      具体请看sendBlockChange(org.bukkit.Location, org.bukkit.Material, byte)方法. 它其实就是sendBlockChange方法的简单变体.sendBlockChange是伪装一个方块,而这个方法是伪装一堆方块.

      例:

      byte data = new Byte[27]; //由于我们要发送的是3*3*3的立方体,所以为27

      for(int i=0;i<data.lenth;i++) data[i] = (byte)11 //由于我们想把这个立方体里填满岩浆,所以都为11

      player.sendBlockChange(player.getLocation(),3,3,3,data); //完成~上帝保佑那个玩家233

      参数:
      loc - The location of the cuboid
      sx - The x size of the cuboid
      sy - The y size of the cuboid
      sz - The z size of the cuboid
      data - The data to be sent
      返回:
      true if the chunk change packet was sent
    • sendBlockChange

      @Deprecated void sendBlockChange(Location loc, int material, byte data)
      已过时。
      不安全的参数
      类似于 sendBlockChange(Location loc, Material material, byte data)方法.

      Send a block change. This fakes a block change packet for a user at a certain location. This will not actually change the world in any way.

      参数:
      loc - 要改变的方块的位置
      material - 要改变成的方块的ID
      data - 要改变成的方块的副ID
    • sendSignChange

      void sendSignChange(Location loc, String[] lines) throws IllegalArgumentException
      向该玩家发送一个伪造的牌子(Sign)上的字的更改数据包.这不会改变世界中的任何方块.

      如果那个位置没有牌子,这个方法将用sendBlockChange(org.bukkit.Location, org.bukkit.Material, byte) 方法在那个位置伪造一个牌子然后更改它.

      如果客户端认为在指定的位置没有牌子,则会显示一个错误给玩家.

      原文:Send a sign change. This fakes a sign change packet for a user at a certain location. This will not actually change the world in any way. This method will use a sign at the location's block or a faked sign sent via sendBlockChange(org.bukkit.Location, int, byte) or sendBlockChange(org.bukkit.Location, org.bukkit.Material, byte).

      If the client does not have a sign at the given location it will display an error message to the user.

      译注:该方法类似于sendBlockChange(org.bukkit.Location, org.bukkit.Material, byte), 只不过sendBlockChange是伪装一个方块成其他方块,而它只是伪装牌子上的字.

      参数:
      loc - 要让玩家看起来改变了的牌子的位置
      lines - null或大小等于4的String数组;数组中每个元素都代表一行
      抛出:
      IllegalArgumentException - 如果该位置没有牌子
      IllegalArgumentException - 如果lines的长度大于4或小于1
    • sendMap

      void sendMap(MapView map)
      Render a map and send it to the player in its entirety. This may be used when streaming the map in the normal manner is not desirable.

      译注:额...没搞懂...不过一般用不上吧?

      参数:
      map - 要发送的地图
    • updateInventory

      @Deprecated void updateInventory()
      已过时。
      不需要调用(谁知道呢..保险起见..反正不会报错).
      刷新玩家的背包.确保玩家的背包和服务器内存中玩家的背包一致.

      译注:在以前的版本(好吧我也不知道是什么版本)中假如不调用该方法当更改背包时会出现莫名其妙的事情,比如 背包看起来是空的,点一下空的格突然出现了东西之类的....

      原文:Forces an update of the player's entire inventory.

    • awardAchievement

      @Deprecated void awardAchievement(Achievement achievement)
      已过时。
      未来版本的Minecraft将不会有成就(取而代之的是进度).
      给予玩家一个成就Achievement和这个成就所需的父成就.

      原文:Awards the given achievement and any parent achievements that the player does not have.

      译注:比如,给玩家"这是?工作台!"成就,这个方法就会先给玩家它的父成就"获得木头!"

      参数:
      achievement - 要给玩家的成就(不包括父成就)
      抛出:
      IllegalArgumentException - 当成就为null时抛出.
    • removeAchievement

      @Deprecated void removeAchievement(Achievement achievement)
      已过时。
      未来的Minecraft将不会有成就(取而代之的是进度).
      删除玩家的一个成就及其子成就.

      原文:Removes the given achievement and any children achievements that the player has.

      译注:假如移除玩家的"获得木头!"成就,同时也会移除"这是?工作台"和后面的所有成就.因为没有"获得木头!"成就,就没后面的成就.

      参数:
      achievement - 要移除的成就
      抛出:
      IllegalArgumentException - 当成就为null时抛出.
    • hasAchievement

      boolean hasAchievement(Achievement achievement)
      判断玩家是否有该成就.

      原文:Gets whether this player has the given achievement.

      参数:
      achievement - 被判断的成就
      返回:
      玩家是否有该成就
      抛出:
      IllegalArgumentException - 当成就为null时抛出.
    • incrementStatistic

      void incrementStatistic(Statistic statistic) throws IllegalArgumentException
      把该玩家的统计信息里的某项+1.

      这相当于下面的代码:

      incrementStatistic(Statistic, 1)

      原文:Increments the given statistic for this player.

      This is equivalent to the following code:

      incrementStatistic(Statistic, 1)

      参数:
      statistic - 要+1的统计项
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果这个statictic需要一个额外的参数??
    • decrementStatistic

      void decrementStatistic(Statistic statistic) throws IllegalArgumentException
      把该玩家的统计信息里的某项-1.

      这相当于下面的代码:

      decrementStatistic(Statistic, 1) 原文:Decrements the given statistic for this player.

      This is equivalent to the following code: decrementStatistic(Statistic, 1)

      参数:
      statistic - 要减少的统计项目
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果这个统计需要一个额外的参数??
    • incrementStatistic

      void incrementStatistic(Statistic statistic, int amount) throws IllegalArgumentException
      把该玩家的统计信息里的某项加上指定的值.

      原文:Increments the given statistic for this player.

      参数:
      statistic - 要增加的统计项
      amount - 要增加多少
      抛出:
      IllegalArgumentException - 当statistic为null
      IllegalArgumentException - 当amount无效
      IllegalArgumentException - 如果这个统计需要一个额外的参数?
    • decrementStatistic

      void decrementStatistic(Statistic statistic, int amount) throws IllegalArgumentException
      把该玩家的统计信息里的某项减少指定的值.

      原文:Decrements the given statistic for this player.

      参数:
      statistic - 要减少的统计项
      amount - 要减少多少
      抛出:
      IllegalArgumentException - 当statistic为null
      IllegalArgumentException - 当amount无效
      IllegalArgumentException - 如果这个统计需要一个额外的参数??
    • setStatistic

      void setStatistic(Statistic statistic, int newValue) throws IllegalArgumentException
      设置该玩家的统计信息里的某项的值.

      原文:Sets the given statistic for this player.

      参数:
      statistic - 要设置的统计项
      newValue - 要把statistic设置成的值
      抛出:
      IllegalArgumentException - 当statistic为null
      IllegalArgumentException - 当amount无效
      IllegalArgumentException - 如果这个统计需要一个额外的参数??
    • getStatistic

      int getStatistic(Statistic statistic) throws IllegalArgumentException
      得到该玩家的统计信息中某项的值.

      原文:Gets the value of the given statistic for this player.

      参数:
      statistic - 要获取值的统计项
      返回:
      statistic的值
      抛出:
      IllegalArgumentException - 当statistic为null
      IllegalArgumentException - 当amount无效
      IllegalArgumentException - 如果这个统计需要一个额外的参数??
    • incrementStatistic

      void incrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException
      把该玩家的统计信息中跟方块/物品有关的统计项加上一个Material.

      这相当于下面的代码: incrementStatistic(Statistic, Material, 1) 原文:Increments the given statistic for this player for the given material.

      This is equivalent to the following code: incrementStatistic(Statistic, Material, 1) 译注:比如,要想给玩家的"已破坏过的方块数量"统计里增加一个石头,就用incrementStatistic(统计, Material.STONE)

      参数:
      statistic - 要操纵的统计
      material - 要给statistic增加的Material
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果material为null
      IllegalArgumentException - 如果这个成就项使用的不是Material
    • decrementStatistic

      void decrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException
      把该玩家的统计信息中跟方块/物品有关的统计项减少一个Material.

      原文:Decrements the given statistic for this player for the given material.

      This is equivalent to the following code: decrementStatistic(Statistic, Material, 1) 译注:比如,要想给玩家的"已破坏过的方块数量"统计里减少一个石头,就用decrementStatistic(统计, Material.STONE);

      参数:
      statistic - 要操纵的统计
      material - 要给statistic减少的Material
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果material为null
      IllegalArgumentException - 如果这个成就项使用的不是Material
    • getStatistic

      int getStatistic(Statistic statistic, Material material) throws IllegalArgumentException
      获取该玩家的统计信息中跟方块/物品有关的统计项的某Material有多少.

      原文:Gets the value of the given statistic for this player.

      译注:译注:比如,要想获得玩家的"已破坏过的方块数量"统计里有多少石头,就用getStatistic(统计,Material.STONE);

      参数:
      statistic - 要获取的统计项
      material - statistic中,要获取值的Material
      返回:
      statistic中,material的数量
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果material为null
      IllegalArgumentException - 如果这个成就项使用的不是Material
    • incrementStatistic

      void incrementStatistic(Statistic statistic, Material material, int amount) throws IllegalArgumentException
      把该玩家的统计信息中跟方块/物品有关的统计项中的某Material加上指定的值.

      原文:Increments the given statistic for this player for the given material.

      译注:比如,要想给玩家的"已破坏过的方块数量"统计里增加指定数量的石头,就用incrementStatistic(统计, Material.STONE, 数量);

      参数:
      statistic - 要操作的统计项
      material - statistic里要操作的某个Material
      amount - 要把statistic中的material增加多少
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果material为null
      IllegalArgumentException - 如果amount无效
      IllegalArgumentException - 如果statistic跟方块/物品无关
    • decrementStatistic

      void decrementStatistic(Statistic statistic, Material material, int amount) throws IllegalArgumentException
      把该玩家的统计信息中跟方块/物品有关的统计项中的某Material减少指定的值.

      原文:Decrements the given statistic for this player for the given material.

      译注:该方法与incrementStatistic(org.bukkit.Statistic, org.bukkit.Material, int)相反.

      参数:
      statistic - 要减少的统计项
      material - statistic中要操作的某个Material
      amount - 要把statistic中的material减少多少
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果material为null
      IllegalArgumentException - 如果amount无效
      IllegalArgumentException - 如果这个statistic的值不是Material
    • setStatistic

      void setStatistic(Statistic statistic, Material material, int newValue) throws IllegalArgumentException
      把该玩家的统计信息中的某个跟方块/物品有关的统计项中的某Material的数量设定为某值.

      原文:Sets the given statistic for this player for the given material.

      译注:比如,要想给玩家的"已破坏过的方块数量"统计里的石头破坏数设定为指定数量,就用setStatistic(统计, Material.STONE, 数量);

      参数:
      statistic - 要设置的统计项
      material - statistic中的某个Material
      newValue - 要把statistic中的material设置的值
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果material为null
      IllegalArgumentException - 如果newVaule无效
      IllegalArgumentException - 如果statistic跟方块/物品无关
    • incrementStatistic

      void incrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException
      把该玩家的统计信息中跟实体有关的统计项中的某种实体(EntityType)的数量+1.

      这相当于下面的代码:

      incrementStatistic(Statistic, EntityType, 1)

      原文:Increments the given statistic for this player for the given entity.

      This is equivalent to the following code: incrementStatistic(Statistic, EntityType, 1)

      译注:比如,要项给玩家的"已杀过的生物数量"统计里的僵尸数量加上1,就用incrementStatistic(Statistic,EntityType.Zombie);

      参数:
      statistic - 要更改的统计项
      entityType - statistic中的某种实体
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果entityType为null
      IllegalArgumentException - 如果statistic与实体无关
    • decrementStatistic

      void decrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException
      把该玩家的统计信息中跟实体有关的统计项中的某种实体(EntityType)的数量-1.

      这相当于下面的代码:

      decrementStatistic(Statistic, EntityType, 1)

      原文:Decrements the given statistic for this player for the given entity.

      This is equivalent to the following code: decrementStatistic(Statistic, EntityType, 1)

      译注:该方法与incrementStatistic(org.bukkit.Statistic, org.bukkit.entity.EntityType)相反,可以参见该方法.

      参数:
      statistic - 要更改的统计项
      entityType - statistic中的某种实体
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果entityType为null
      IllegalArgumentException - 如果statistic与实体无关
    • getStatistic

      int getStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException
      获得该玩家的统计信息中跟实体有关的统计项中的某实体(EntityType)数量.

      原文:Gets the value of the given statistic for this player.

      译注:比如,要获得玩家杀过多少僵尸,就用getStatistic(记录玩家杀实体的统计项,EntityType.Zombie);

      参数:
      statistic - 要获得某实体数的统计项
      entityType - 要获取数量的statistic的某实体
      返回:
      statistic中entitytype中的值
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果entitytype为null
      IllegalArgumentException - 如果statistic与实体无关
    • incrementStatistic

      void incrementStatistic(Statistic statistic, EntityType entityType, int amount) throws IllegalArgumentException
      将该玩家的统计信息中的某个跟实体有关的统计项的某实体类型(EntityType)加上指定的数值.

      原文:Increments the given statistic for this player for the given entity.

      译注:跟incrementStatistic(org.bukkit.Statistic, org.bukkit.entity.EntityType)类似.只不过这个方法可以指定每次加多少.

      参数:
      statistic - 要操作的统计项
      entityType - 要增加的statistic中的某实体
      amount - 要增加的数量
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果entitytype为null
      IllegalArgumentException - 如果amount无效
      IllegalArgumentException - 如果statistic与实体无关
    • decrementStatistic

      void decrementStatistic(Statistic statistic, EntityType entityType, int amount)
      将该玩家的统计信息中某个跟实体有关的统计项中的某实体类型(EntityType)减少指定的值.

      原文:Decrements the given statistic for this player for the given entity.

      译注:与incrementStatistic(org.bukkit.Statistic, org.bukkit.entity.EntityType, int)相反.

      参数:
      statistic - 要操作的统计项
      entityType - 要减少的statistic中的某实体
      amount - 要减少的数量
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果entitytype为null
      IllegalArgumentException - 如果amount无效
      IllegalArgumentException - 如果statistic与实体无关
    • setStatistic

      void setStatistic(Statistic statistic, EntityType entityType, int newValue)
      设置该玩家的统计信息中某个跟实体有关的统计项的某实体类型(EntityType)为某个数值.

      原文:Sets the given statistic for this player for the given entity.

      参数:
      statistic - 要设置的统计项
      entityType - 要设置的statistic中的某实体类型
      newValue - 要把statistic中entitytype的数量设置成的值
      抛出:
      IllegalArgumentException - 如果statistic为null
      IllegalArgumentException - 如果entitytype为null
      IllegalArgumentException - 如果newValue无效
      IllegalArgumentException - 如果statistic与实体无关
    • setPlayerTime

      void setPlayerTime(long time, boolean relative)
      设置该玩家客户端的时间,单位为tick.

      假如relative为true则玩家时间会随着世界时间变动而变动,并且保持一个差值,反之客户端时间固定不动.

      注意!如果relative为true,那么time表示的就是客户端的时间与世界的时间之差(相对于世界的时间),而如果为false 那么time表示的就是一个绝对的时间.

      原文:Sets the current time on the player's client. When relative is true the player's time will be kept synchronized to its world time with the specified offset.

      When using non relative time the player's time will stay fixed at the specified time parameter. It's up to the caller to continue updating the player's time. To restore player time to normal use resetPlayerTime().

      参数:
      time - 绝对时间或与世界的时间之差,单位为tick
      relative - 是否让玩家的时间和世界的时间保持一个差值
    • getPlayerTime

      long getPlayerTime()
      得到玩家的客户端的当前时间,单位为tick.

      原文:Returns the player's current timestamp.

      返回:
      玩家客户端的时间,单位为tick
    • getPlayerTimeOffset

      long getPlayerTimeOffset()
      返回玩家的客户端的当前时间与玩家当前世界时间的差值.

      如玩家时间是固定的,则返回玩家时间. 原文:Returns the player's current time offset relative to server time, or the current player's fixed time if the player's time is absolute.

      返回:
      玩家当前时间与当前世界时间的差或玩家当前时间.单位为tick
    • isPlayerTimeRelative

      boolean isPlayerTimeRelative()
      如果玩家时间于当前世界时间保持了一定的差值则返回true.

      原文:Returns true if the player's time is relative to the server time, otherwise the player's time is absolute and will not change its current time unless done so with setPlayerTime().

      返回:
      true if the player's time is relative to the server time.
    • resetPlayerTime

      void resetPlayerTime()
      将玩家时间变为当前世界时间并与世界时间保持同步.

      原文 Restores the normal condition where the player's time is synchronized with the server time.

      Equivalent to calling setPlayerTime(0, true).

    • setPlayerWeather

      void setPlayerWeather(WeatherType type)
      设置玩家的客户端的天气.

      使用resetPlayerWeather()来恢复正常.

      原文:Sets the type of weather the player will see. When used, the weather status of the player is locked until resetPlayerWeather() is used.

      参数:
      type - 要让玩家看到的天气
    • getPlayerWeather

      WeatherType getPlayerWeather()
      得到玩家所看到的天气.如果返回null,玩家的天气跟世界的天气一致.

      原文:Returns the type of weather the player is currently experiencing.

      返回:
      玩家所看到的天气或null
    • resetPlayerWeather

      void resetPlayerWeather()
      恢复玩家所看到的天气为世界的天气.

      原文:Restores the normal condition where the player's weather is controlled by server conditions.

    • giveExp

      void giveExp(int amount)
      给玩家指定经验.

      原文:Gives the player the amount of experience specified.

      参数:
      amount - 要给的经验
    • giveExpLevels

      void giveExpLevels(int amount)
      增加玩家的等级.

      支持负数(减少等级).

      原文:Gives the player the amount of experience levels specified. Levels can be taken by specifying a negative amount.

      参数:
      amount - 要增加的等级(正数)或要减少的等级(负数)
    • getExp

      float getExp()
      得到当前级别升到下一级别经验进度的百分比.

      0表示毫无进展(0%), 0.99表示差一点点(99%), 1表示要升级了(100%).

      原文:Gets the players current experience points towards the next level.

      This is a percentage value. 0 is "no progress" and 1 is "next level".

      返回:
      离下一级的小数形式百分比
    • setExp

      void setExp(float exp)
      设置当前级别升到下一级别经验进度的百分比.

      0表示毫无进展(0%), 0.99表示差一点点(99%), 1表示要升级了(100%).

      Sets the players current experience points towards the next level

      This is a percentage value. 0 is "no progress" and 1 is "next level".

      参数:
      exp - 新的离下一级的小数形式百分比
    • getLevel

      int getLevel()
      得到玩家的等级.

      原文:Gets the players current experience level

      返回:
      玩家的经验等级
    • setLevel

      void setLevel(int level)
      设置玩家的等级

      . 原文:Sets the players current experience level

      参数:
      level - 新的等级
    • getTotalExperience

      int getTotalExperience()
      得到玩家总共获得了多少经验(等级和经验).
      这个数值指玩家随着时间的推移收集的全部经验,并只在玩家死亡时显示为玩家的"得分".

      原文:Gets the players total experience points
      This refers to the total amount of experience the player has collected over time and is only displayed as the player's "score" upon dying.

      返回:
      玩家总共有多少经验
    • setTotalExperience

      void setTotalExperience(int exp)
      设置玩家的总经验值(等级和经验).
      这个数值指玩家随着时间的推移收集的全部经验,并只在玩家死亡时显示为玩家的"得分".

      原文: Sets the players current experience points.
      This refers to the total amount of experience the player has collected over time and is only displayed as the player's "score" upon dying.

      参数:
      exp - 总经验值
    • getExhaustion

      float getExhaustion()
      得到玩家的疲劳度.

      疲劳度控制者玩家的饥饿消耗.当玩家达到一定的疲劳度时,你的饱食度就会下降,并且疲劳度归零.

      译注:如果饱食度为0,那么就扣饥饿度.

      注释2:运动会产生疲劳度.

      原文:Gets the players current exhaustion level.

      Exhaustion controls how fast the food level drops. While you have a certain amount of exhaustion, your saturation will drop to zero, and then your food will drop to zero.

      返回:
      疲劳度
    • setExhaustion

      void setExhaustion(float value)
      设置玩家的疲劳度.

      关于疲劳度,请参见getExhaustion().

      原文:Sets the players current exhaustion level

      参数:
      value - 新的疲劳度
    • getSaturation

      float getSaturation()
      得到玩家的饱食度(不是饥饿度).

      饱食度是一个饥饿度的缓存.当你的饱食度 >0的时候,饥饿度是不会下降的.

      译注:就是说,吃东西的时候,你的饥饿度被填满了,而多出来的部分就是隐藏的饱食度.当你的疲劳值(见getExhaustion()) 达到一定程度时,如果饱食度不为0,那么先扣饱食度.只有当没饱食度时,才会扣饥饿度.其实饱食度就是饥饿度,只不过是隐藏的.

      原文:Gets the players current saturation level.

      Saturation is a buffer for food level. Your food level will not drop if you are saturated > 0.

      返回:
      饱食度
    • setSaturation

      void setSaturation(float value)
      设置玩家的饱食度(不是饥饿度).

      关于饱食度,请参见getSaturation().

      原文:Sets the players current saturation level

      参数:
      value - 要设置成的饱食度
    • getFoodLevel

      int getFoodLevel()
      得到玩家的饥饿度(不是饱食度).

      原文:Gets the players current food level

      返回:
      饥饿度
    • setFoodLevel

      void setFoodLevel(int value)
      设置玩家的饥饿度(不是饱食度).

      原文:Sets the players current food level

      参数:
      value - 新的饥饿度
    • getBedSpawnLocation

      Location getBedSpawnLocation()
      得到玩家上一次睡觉的床的位置(Location).

      如果玩家没有睡过觉或床已被拆除则返回null.

      原文:Gets the Location where the player will spawn at their bed, null if they have not slept in one or their current bed spawn is invalid.

      指定者:
      getBedSpawnLocation 在接口中 OfflinePlayer
      返回:
      玩家上一次睡觉的床的位置,或null
    • setBedSpawnLocation

      void setBedSpawnLocation(Location location)
      设置玩家上一次睡觉的床的位置(Location).

      原文:Sets the Location where the player will spawn at their bed.

      参数:
      location - 要设置成的位置
    • setBedSpawnLocation

      void setBedSpawnLocation(Location location, boolean force)
      设置玩家上一次睡觉的床的位置.

      原文:Sets the Location where the player will spawn at their bed.

      参数:
      location - 要设置成的位置
      force - true为强制设置,不管那个位置有没有床.
    • getAllowFlight

      boolean getAllowFlight()
      判断玩家是否能飞起来

      译注:如果玩家确实在创造模式,那么一般返回true,除非被setAllowFlight(false); 原文:Determines if the Player is allowed to fly via jump key double-tap like in creative mode.

      返回:
      玩家能不能飞起来
    • setAllowFlight

      void setAllowFlight(boolean flight)
      设置玩家是否能够飞起来(就像创造模式).

      译注:如果被设置为false,即便是创造模式也不能飞. 原文:Sets if the Player is allowed to fly via jump key double-tap like in creative mode.

      参数:
      flight - 是否允许该玩家飞行.
    • hidePlayer

      @Deprecated void hidePlayer(Player player)
      已过时。
      让该玩家看不见某玩家.

      原文:Hides a player from this player

      参数:
      player - 要让该玩家看不见的玩家.
    • hidePlayer

      void hidePlayer(Plugin plugin, Player player)
      让该玩家看不见某玩家.

      原文:Hides a player from this player

      参数:
      plugin - Plugin 要隐藏该玩家的插件
      player - Player 要让该玩家看不见的玩家.
    • showPlayer

      @Deprecated void showPlayer(Player player)
      已过时。
      让该玩家能看到某玩家.

      原文:Allows this player to see a player that was previously hidden

      参数:
      player - 要让该玩家看得见的玩家.
    • showPlayer

      void showPlayer(Plugin plugin, Player player)
      让该玩家能看到之前被隐藏的玩家. 如果另一个插件也隐藏了这个玩家, 那么玩家将继续处于隐藏状态直至其他插件也调用了此方法.

      原文:Allows this player to see a player that was previously hidden. If another another plugin had hidden the player too, then the player will remain hidden until the other plugin calls this method too.

      参数:
      plugin - Plugin 要使某玩家现身的插件
      player - Player 使某玩家现身
    • canSee

      boolean canSee(Player player)
      检查该玩家是否能看到某玩家.

      原文:Checks to see if a player has been hidden from this player

      参数:
      player - 要检查该玩家是否能看到的玩家
      返回:
      true表示能看到,false反之.
    • isFlying

      boolean isFlying()
      检查玩家是否在飞.

      原文:Checks to see if this player is currently flying or not.

      返回:
      true表示该玩家在飞,false反之.
    • setFlying

      void setFlying(boolean value)
      设置该玩家飞行状态.

      原文:Makes this player start or stop flying.

      参数:
      value - true表示正在飞
    • setFlySpeed

      void setFlySpeed(float value) throws IllegalArgumentException
      设置该玩家飞行速度.

      速度为-1~1之间,负数代表玩家会反着飞...

      译注:不代表行走的速度!.

      原文:Sets the speed at which a client will fly. Negative values indicate reverse directions.

      参数:
      value - 新的飞行速度,在-1~1之间.
      抛出:
      IllegalArgumentException - 如果速度不在-1~1之间则抛出.
    • setWalkSpeed

      void setWalkSpeed(float value) throws IllegalArgumentException
      设置该玩家行走速度.

      速度在-1~1之间,负数代表玩家会倒着走(整人专用233~)...

      译注:不代表飞行的速度! 原文:Sets the speed at which a client will walk. Negative values indicate reverse directions.

      参数:
      value - 新的行走速度.
      抛出:
      IllegalArgumentException - 当速度不在-1~1时间则抛出
    • getFlySpeed

      float getFlySpeed()
      得到该玩家飞行速度.

      译注:不代表行走速度! 原文:Gets the current allowed speed that a client can fly.

      返回:
      飞行速度.取值-1~1.
    • getWalkSpeed

      float getWalkSpeed()
      得到行走速度.

      译注:不代表飞行速度! 原文:Gets the current allowed speed that a client can walk.

      返回:
      行走速度,取值-1~1
    • setTexturePack

      @Deprecated void setTexturePack(String url)
      已过时。
      Minecraft已经不使用材质包了,应该用setResourcePack(String)设置资源包(额这不是一个意思么..).
      设置服务器材质包.(因为已过时所以不详解了).

      介绍同setResourcePack(java.lang.String) Request that the player's client download and switch texture packs.

      The player's client will download the new texture pack asynchronously in the background, and will automatically switch to it once the download is complete. If the client has downloaded and cached the same texture pack in the past, it will perform a file size check against the response content to determine if the texture pack has changed and needs to be downloaded again. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download.

      Notes:

      • Players can disable server textures on their client, in which case this method will have no affect on them. Use the PlayerResourcePackStatusEvent to figure out whether or not the player loaded the pack!
      • There is no concept of resetting texture packs back to default within Minecraft, so players will have to relog to do so or you have to send an empty pack.
      • The request is send with "null" as the hash. This might result in newer versions not loading the pack correctly.
        参数:
        url - The URL from which the client will download the texture pack. The string must contain only US-ASCII characters and should be encoded as per RFC 1738.
        抛出:
        IllegalArgumentException - Thrown if the URL is null.
        IllegalArgumentException - Thrown if the URL is too long.
      • setResourcePack

        void setResourcePack(String url)
        请求玩家的客户端下载并且使用指定资源包.

        玩家的客户端将在后台异步下载新的资源包,并且下载完成后会自动使用那个资源包.如果 这个资源包已经下载好了,客户端先会检查给定URL的资源包跟已经下载的资源包是否一样. 如果不一样就会重新下载,一样就直接使用.

        在开始下载之前,客户端会显示一个GUI确定界面,提示要不要下载资源包.如果玩家选择不要, 就不能下载.

        注意:

        • 如果玩家的客户端没有开启"使用服务器资源包"这个方法将失效. 使用 PlayerResourcePackStatusEvent 方法以推断玩家是否加载了你设置的资源包!
        • 在Minecraft中没有将资源包重置为默认的概念,所以玩家必须重新登陆才能这么做,或者你必须发送一个空白的资源包.
        • 请求以"null"作hash发送. 这可能导致较新版本的客户端不能正确加载资源包.

        原文:Request that the player's client download and switch texture packs.

        The player's client will download the new texture pack asynchronously in the background, and will automatically switch to it once the download is complete. If the client has downloaded and cached the same texture pack in the past, it will perform a file size check against the response content to determine if the texture pack has changed and needs to be downloaded again. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download.

        Notes:

        • Players can disable server textures on their client, in which case this method will have no affect on them. Use the PlayerResourcePackStatusEvent to figure out whether or not the player loaded the pack!
        • There is no concept of resetting texture packs back to default within Minecraft, so players will have to relog to do so or you have to send an empty pack.
        • The request is send with "null" as the hash. This might result in newer versions not loading the pack correctly.
        参数:
        url - 资源包的URL地址.只能包含US-ASCII字符并且使用RFC 1738编码.
        抛出:
        IllegalArgumentException - 当URL为null时抛出
        IllegalArgumentException - 当URL太长或者不符合规范时抛出
      • setResourcePack

        void setResourcePack(String url, byte[] hash)
        请求玩家的客户端下载并且使用指定资源包.

        玩家的客户端将在后台异步下载新的资源包,并且下载完成后会自动使用那个资源包.如果 这个资源包已经下载好了,客户端先会检查给定URL的资源包跟已经下载的资源包是否一样. 如果不一样就会重新下载,一样就直接使用.

        在开始下载之前,客户端会显示一个GUI确定界面,提示要不要下载资源包.如果玩家选择不要, 就不能下载.

        注意:

        • 如果玩家的客户端没有开启"使用服务器资源包"这个方法将失效. 使用 PlayerResourcePackStatusEvent 方法以推断玩家是否加载了你设置的资源包!
        • 在Minecraft中没有将资源包重置为默认的概念,所以玩家必须重新登陆才能这么做,或者你必须发送一个空白的资源包.

        原文:Request that the player's client download and switch resource packs.

        The player's client will download the new resource pack asynchronously in the background, and will automatically switch to it once the download is complete. If the client has downloaded and cached a resource pack with the same hash in the past it will not download but directly apply the cached pack. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download.

        Notes:

        • Players can disable server resources on their client, in which case this method will have no affect on them. Use the PlayerResourcePackStatusEvent to figure out whether or not the player loaded the pack!
        • There is no concept of resetting resource packs back to default within Minecraft, so players will have to relog to do so or you have to send an empty pack.
        参数:
        url - 资源包的URL地址.只能包含US-ASCII字符并且使用RFC 1738编码.
        hash - 资源包文件的sha1哈希值,被用于正确地应用缓存版本的资源包而不需再重新下载(如果之前下载过).必须是20字节长!
        抛出:
        IllegalArgumentException - 当URL为null时抛出
        IllegalArgumentException - 当URL太长或者不符合规范时抛出
        IllegalArgumentException - 当hash为null时抛出Thrown if the hash is null.
        IllegalArgumentException - 当hash不是20字节长时抛出 long.
      • getScoreboard

        Scoreboard getScoreboard()
        获取玩家的计分板.

        原文:Gets the Scoreboard displayed to this player

        返回:
        The current scoreboard seen by this player
      • setScoreboard

        void setScoreboard(Scoreboard scoreboard) throws IllegalArgumentException, IllegalStateException
        设置玩家的计分板.

        原文:Sets the player's visible Scoreboard.

        参数:
        scoreboard - 要设置成的计分板
        抛出:
        IllegalArgumentException - 如果计分板为null则抛出
        IllegalArgumentException - 如果计分板不是由 scoreboard manager创建的 则抛出.
        IllegalStateException - 如果没有该玩家的数据,即该玩家没有进入过服务器则抛出.
      • isHealthScaled

        boolean isHealthScaled()
        获取客户端显示的玩家血量是否被"压缩"了.

        译注:当玩家的最大血量过多时(Damageable.setMaxHealth(double)),每一排血量将会被 挤在一起,以免挡住玩家的视线,这就是"压缩".这个方法就是判断血量是否被压缩了.(完全没用的说..).

        原文:Gets if the client is displayed a 'scaled' health, that is, health on a scale from 0-getHealthScale().

        返回:
        客户端显示的血量是否被压缩了
        另请参阅:
      • setHealthScaled

        void setHealthScaled(boolean scale)
        设置客户端是否要显示一个"压缩"了的血量.

        显示的血量遵循一个规则: 显示的血量 = getHealth() / getMaxHealth() * getHealthScale().

        译注:当玩家的最大血量过多时(Damageable.setMaxHealth(double)),每一排血量将会被 挤在一起,以免挡住玩家的视线,这就是"压缩".这个方法就是设置血量是否要被"压缩".(完全没用的说..).

        原文:Sets if the client is displayed a 'scaled' health, that is, health on a scale from 0-getHealthScale().

        Displayed health follows a simple formula displayedHealth = getHealth() / getMaxHealth() * getHealthScale().

        参数:
        scale - 血量是否要被压缩
      • setHealthScale

        void setHealthScale(double scale) throws IllegalArgumentException
        设置客户端显示的血量的"压缩率".

        显示的血量遵循一个规则: 显示的血量 = getHealth() / getMaxHealth() * getHealthScale().

        译注:当玩家的最大血量过多时(Damageable.setMaxHealth(double)),每一排血量将会被 挤在一起,以免挡住玩家的视线,这就是"压缩".这个方法就是设置血量的"压缩率".(完全没用的说..).

        原文:Sets the number to scale health to for the client; this will also setHealthScaled(true).

        Displayed health follows a simple formula displayedHealth = getHealth() / getMaxHealth() * getHealthScale().

        参数:
        scale - 血量的"压缩率"
        抛出:
        IllegalArgumentException - 如果scale <0
        IllegalArgumentException - 如果scale为Double.NaN
        IllegalArgumentException - 如果scale太大了
      • getHealthScale

        double getHealthScale()
        获取客户端显示的血量的"压缩率".

        详见setHealthScale(double) 原文:Gets the number that health is scaled to for the client.

        返回:
        客户端显示的血量条的"压缩率"
        另请参阅:
      • getSpectatorTarget

        Entity getSpectatorTarget()
        Gets the entity which is followed by the camera when in GameMode.SPECTATOR.
        返回:
        the followed entity, or null if not in spectator mode or not following a specific entity.
      • setSpectatorTarget

        void setSpectatorTarget(Entity entity)
        Sets the entity which is followed by the camera when in GameMode.SPECTATOR.
        参数:
        entity - the entity to follow or null to reset
        抛出:
        IllegalStateException - if the player is not in GameMode.SPECTATOR
      • sendTitle

        @Deprecated void sendTitle(String title, String subtitle)
        已过时。
        API behavior subject to change
        Sends a title and a subtitle message to the player. If either of these values are null, they will not be sent and the display will remain unchanged. If they are empty strings, the display will be updated as such. If the strings contain a new line, only the first line will be sent. The titles will be displayed with the client's default timings.
        参数:
        title - Title text
        subtitle - Subtitle text
      • sendTitle

        void sendTitle(String title, String subtitle, int fadeIn, int stay, int fadeOut)
        Sends a title and a subtitle message to the player. If either of these values are null, they will not be sent and the display will remain unchanged. If they are empty strings, the display will be updated as such. If the strings contain a new line, only the first line will be sent. All timings values may take a value of -1 to indicate that they will use the last value sent (or the defaults if no title has been displayed).
        参数:
        title - Title text
        subtitle - Subtitle text
        fadeIn - time in ticks for titles to fade in. Defaults to 10.
        stay - time in ticks for titles to stay. Defaults to 70.
        fadeOut - time in ticks for titles to fade out. Defaults to 20.
      • resetTitle

        void resetTitle()
        Resets the title displayed to the player. This will clear the displayed title / subtitle and reset timings to their default values.
      • spawnParticle

        void spawnParticle(Particle particle, Location location, int count)
        Spawns the particle (the number of times specified by count) at the target location.
        参数:
        particle - the particle to spawn
        location - the location to spawn at
        count - the number of particles
      • spawnParticle

        void spawnParticle(Particle particle, double x, double y, double z, int count)
        Spawns the particle (the number of times specified by count) at the target location.
        参数:
        particle - the particle to spawn
        x - the position on the x axis to spawn at
        y - the position on the y axis to spawn at
        z - the position on the z axis to spawn at
        count - the number of particles
      • spawnParticle

        <T> void spawnParticle(Particle particle, Location location, int count, T data)
        Spawns the particle (the number of times specified by count) at the target location.
        参数:
        particle - the particle to spawn
        location - the location to spawn at
        count - the number of particles
        data - the data to use for the particle or null, the type of this depends on Particle.getDataType()
      • spawnParticle

        <T> void spawnParticle(Particle particle, double x, double y, double z, int count, T data)
        Spawns the particle (the number of times specified by count) at the target location.
        参数:
        particle - the particle to spawn
        x - the position on the x axis to spawn at
        y - the position on the y axis to spawn at
        z - the position on the z axis to spawn at
        count - the number of particles
        data - the data to use for the particle or null, the type of this depends on Particle.getDataType()
      • spawnParticle

        void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ)
        Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.
        参数:
        particle - the particle to spawn
        location - the location to spawn at
        count - the number of particles
        offsetX - the maximum random offset on the X axis
        offsetY - the maximum random offset on the Y axis
        offsetZ - the maximum random offset on the Z axis
      • spawnParticle

        void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ)
        Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.
        参数:
        particle - the particle to spawn
        x - the position on the x axis to spawn at
        y - the position on the y axis to spawn at
        z - the position on the z axis to spawn at
        count - the number of particles
        offsetX - the maximum random offset on the X axis
        offsetY - the maximum random offset on the Y axis
        offsetZ - the maximum random offset on the Z axis
      • spawnParticle

        <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data)
        Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.
        参数:
        particle - the particle to spawn
        location - the location to spawn at
        count - the number of particles
        offsetX - the maximum random offset on the X axis
        offsetY - the maximum random offset on the Y axis
        offsetZ - the maximum random offset on the Z axis
        data - the data to use for the particle or null, the type of this depends on Particle.getDataType()
      • spawnParticle

        <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data)
        Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.
        参数:
        particle - the particle to spawn
        x - the position on the x axis to spawn at
        y - the position on the y axis to spawn at
        z - the position on the z axis to spawn at
        count - the number of particles
        offsetX - the maximum random offset on the X axis
        offsetY - the maximum random offset on the Y axis
        offsetZ - the maximum random offset on the Z axis
        data - the data to use for the particle or null, the type of this depends on Particle.getDataType()
      • spawnParticle

        void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra)
        Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.
        参数:
        particle - the particle to spawn
        location - the location to spawn at
        count - the number of particles
        offsetX - the maximum random offset on the X axis
        offsetY - the maximum random offset on the Y axis
        offsetZ - the maximum random offset on the Z axis
        extra - the extra data for this particle, depends on the particle used (normally speed)
      • spawnParticle

        void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra)
        Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.
        参数:
        particle - the particle to spawn
        x - the position on the x axis to spawn at
        y - the position on the y axis to spawn at
        z - the position on the z axis to spawn at
        count - the number of particles
        offsetX - the maximum random offset on the X axis
        offsetY - the maximum random offset on the Y axis
        offsetZ - the maximum random offset on the Z axis
        extra - the extra data for this particle, depends on the particle used (normally speed)
      • spawnParticle

        <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data)
        Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.
        参数:
        particle - the particle to spawn
        location - the location to spawn at
        count - the number of particles
        offsetX - the maximum random offset on the X axis
        offsetY - the maximum random offset on the Y axis
        offsetZ - the maximum random offset on the Z axis
        extra - the extra data for this particle, depends on the particle used (normally speed)
        data - the data to use for the particle or null, the type of this depends on Particle.getDataType()
      • spawnParticle

        <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data)
        Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.
        参数:
        particle - the particle to spawn
        x - the position on the x axis to spawn at
        y - the position on the y axis to spawn at
        z - the position on the z axis to spawn at
        count - the number of particles
        offsetX - the maximum random offset on the X axis
        offsetY - the maximum random offset on the Y axis
        offsetZ - the maximum random offset on the Z axis
        extra - the extra data for this particle, depends on the particle used (normally speed)
        data - the data to use for the particle or null, the type of this depends on Particle.getDataType()
      • getAdvancementProgress

        AdvancementProgress getAdvancementProgress(Advancement advancement)
        Return the player's progression on the specified advancement.
        参数:
        advancement - advancement
        返回:
        object detailing the player's progress
      • getLocale

        String getLocale()
        Gets the player's current locale. The value of the locale String is not defined properly.
        The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.
        返回:
        the player's locale