public class PlayerDeathEvent extends EntityDeathEvent
玩家
死亡时触发本事件Event.Result
entity
构造器和说明 |
---|
PlayerDeathEvent(Player player,
java.util.List<ItemStack> drops,
int droppedExp,
int newExp,
int newTotalExp,
int newLevel,
java.lang.String deathMessage) |
PlayerDeathEvent(Player player,
java.util.List<ItemStack> drops,
int droppedExp,
int newExp,
java.lang.String deathMessage) |
PlayerDeathEvent(Player player,
java.util.List<ItemStack> drops,
int droppedExp,
java.lang.String deathMessage) |
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getDeathMessage()
获取广播给所有人的死亡提示.
|
Player |
getEntity()
返回这个事件所涉及的实体.
|
boolean |
getKeepInventory()
Gets if the Player keeps inventory on death.
|
boolean |
getKeepLevel()
Gets if the Player should keep all EXP at respawn.
|
int |
getNewExp()
获取玩家重生时有多少经验.
|
int |
getNewLevel()
Gets the Level the Player should have at respawn.
|
int |
getNewTotalExp()
Gets the Total EXP the Player should have at respawn.
|
void |
setDeathMessage(java.lang.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.
|
getDroppedExp, getDrops, getHandlerList, getHandlers, setDroppedExp
getEntityType
getEventName, isAsynchronous
public PlayerDeathEvent(Player player, java.util.List<ItemStack> drops, int droppedExp, java.lang.String deathMessage)
public PlayerDeathEvent(Player player, java.util.List<ItemStack> drops, int droppedExp, int newExp, java.lang.String deathMessage)
public Player getEntity()
EntityEvent
原文: Returns the Entity involved in this event
getEntity
在类中 EntityDeathEvent
public void setDeathMessage(java.lang.String deathMessage)
原文: Set the death message that will appear to everyone on the server.
deathMessage
- 死亡提示public java.lang.String getDeathMessage()
原文:Get the death message that will appear to everyone on the server.
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.
public void setNewExp(int exp)
This does not indicate how much EXP should be dropped, please see
EntityDeathEvent.setDroppedExp(int)
for that.
exp
- New EXP of the respawned playerpublic int getNewLevel()
public void setNewLevel(int level)
level
- New Level of the respawned playerpublic int getNewTotalExp()
public void setNewTotalExp(int totalExp)
totalExp
- New Total EXP of the respawned playerpublic boolean getKeepLevel()
This flag overrides other EXP settings
public void setKeepLevel(boolean keepLevel)
This overrides all other EXP settings
This doesn't prevent prevent the EXP from dropping.
EntityDeathEvent.setDroppedExp(int)
should be used stop the
EXP from dropping.
keepLevel
- True to keep all current value levelspublic void setKeepInventory(boolean keepInventory)
keepInventory
- True to keep the inventorypublic boolean getKeepInventory()