Added PlayerDeathEvent->setKeepXp(), closes #4002 (#4015)

This commit is contained in:
TheNewHEROBRINEX
2022-05-21 17:41:14 +02:00
committed by GitHub
parent a38a5c67f1
commit 02cf6ae46c
2 changed files with 17 additions and 2 deletions

View File

@ -40,6 +40,7 @@ class PlayerDeathEvent extends EntityDeathEvent{
private Translatable|string $deathMessage;
private bool $keepInventory = false;
private bool $keepXp = false;
/**
* @param Item[] $drops
@ -78,6 +79,14 @@ class PlayerDeathEvent extends EntityDeathEvent{
$this->keepInventory = $keepInventory;
}
public function getKeepXp() : bool{
return $this->keepXp;
}
public function setKeepXp(bool $keepXp) : void{
$this->keepXp = $keepXp;
}
/**
* Returns the vanilla death message for the given death cause.
*/