类 PlayerDeathEvent
玩家
死亡时触发本事件-
嵌套类概要
从类继承的嵌套类/接口 org.bukkit.event.Event
Event.Result
-
字段概要
从类继承的字段 org.bukkit.event.entity.EntityEvent
entity
-
构造器概要
构造器说明PlayerDeathEvent
(@NotNull Player player, @NotNull List<ItemStack> drops, int droppedExp, int newExp, int newTotalExp, int newLevel, @Nullable String deathMessage) PlayerDeathEvent
(@NotNull Player player, @NotNull List<ItemStack> drops, int droppedExp, int newExp, @Nullable String deathMessage) PlayerDeathEvent
(@NotNull Player player, @NotNull List<ItemStack> drops, int droppedExp, @Nullable String deathMessage) -
方法概要
修饰符和类型方法说明获取广播给所有人的死亡提示.返回这个事件所涉及的实体.boolean
Gets if the Player keeps inventory on death.boolean
Gets if the Player should keep all EXP at respawn.int
获取玩家重生时有多少经验.int
Gets the Level the Player should have at respawn.int
Gets the Total EXP the Player should have at respawn.void
setDeathMessage
(@Nullable String deathMessage) 设置广播给所有人的死亡提示.void
setKeepInventory
(boolean keepInventory) Sets if the Player keeps inventory on death.void
setKeepLevel
(boolean keepLevel) Sets if the Player should keep all EXP at respawn.void
setNewExp
(int exp) Sets how much EXP the Player should have at respawn.void
setNewLevel
(int level) Sets the Level the Player should have at respawn.void
setNewTotalExp
(int totalExp) Sets the Total EXP the Player should have at respawn.从类继承的方法 org.bukkit.event.entity.EntityDeathEvent
getDroppedExp, getDrops, getHandlerList, getHandlers, setDroppedExp
从类继承的方法 org.bukkit.event.entity.EntityEvent
getEntityType
从类继承的方法 org.bukkit.event.Event
getEventName, isAsynchronous
-
构造器详细资料
-
PlayerDeathEvent
-
PlayerDeathEvent
-
PlayerDeathEvent
-
-
方法详细资料
-
getEntity
从类复制的说明:EntityEvent
返回这个事件所涉及的实体.原文: Returns the Entity involved in this event
- 覆盖:
getEntity
在类中EntityDeathEvent
- 返回:
- 涉及这个事件的实体
-
setDeathMessage
设置广播给所有人的死亡提示.原文: Set the death message that will appear to everyone on the server.
- 参数:
deathMessage
- 死亡提示
-
getDeathMessage
获取广播给所有人的死亡提示.原文:Get the death message that will appear to everyone on the server.
- 返回:
- 死亡提示
-
getNewExp
public int getNewExp()获取玩家重生时有多少经验.不包含多少经验会掉落,要做到这点请看
EntityDeathEvent.getDroppedExp()
.原文:Gets how much EXP the Player should have at respawn.
This does not indicate how much EXP should be dropped, please see
EntityDeathEvent.getDroppedExp()
for that.- 返回:
- 重生后的玩家有多少经验
-
setNewExp
public void setNewExp(int exp) Sets how much EXP the Player should have at respawn.This does not indicate how much EXP should be dropped, please see
EntityDeathEvent.setDroppedExp(int)
for that.- 参数:
exp
- New EXP of the respawned player
-
getNewLevel
public int getNewLevel()Gets the Level the Player should have at respawn.- 返回:
- New Level of the respawned player
-
setNewLevel
public void setNewLevel(int level) Sets the Level the Player should have at respawn.- 参数:
level
- New Level of the respawned player
-
getNewTotalExp
public int getNewTotalExp()Gets the Total EXP the Player should have at respawn.- 返回:
- New Total EXP of the respawned player
-
setNewTotalExp
public void setNewTotalExp(int totalExp) Sets the Total EXP the Player should have at respawn.- 参数:
totalExp
- New Total EXP of the respawned player
-
getKeepLevel
public boolean getKeepLevel()Gets if the Player should keep all EXP at respawn.This flag overrides other EXP settings
- 返回:
- True if Player should keep all pre-death exp
-
setKeepLevel
public void setKeepLevel(boolean keepLevel) Sets if the Player should keep all EXP at respawn.This overrides all other EXP settings
This doesn't prevent the EXP from dropping.
EntityDeathEvent.setDroppedExp(int)
should be used stop the EXP from dropping.- 参数:
keepLevel
- True to keep all current value levels
-
setKeepInventory
public void setKeepInventory(boolean keepInventory) Sets if the Player keeps inventory on death.This doesn't prevent the items from dropping.
getDrops().clear()
should be used stop the items from dropping.- 参数:
keepInventory
- True to keep the inventory
-
getKeepInventory
public boolean getKeepInventory()Gets if the Player keeps inventory on death.- 返回:
- True if the player keeps inventory on death
-