Added keep on death methods for items (#5395)

This commit is contained in:
Javier León
2022-12-15 17:10:20 -03:00
committed by GitHub
parent 95d0a3bf41
commit c5d716dc9d
3 changed files with 29 additions and 4 deletions

View File

@ -391,7 +391,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
$this->inventory !== null ? array_values($this->inventory->getContents()) : [],
$this->armorInventory !== null ? array_values($this->armorInventory->getContents()) : [],
$this->offHandInventory !== null ? array_values($this->offHandInventory->getContents()) : [],
), function(Item $item) : bool{ return !$item->hasEnchantment(VanillaEnchantments::VANISHING()); });
), function(Item $item) : bool{ return !$item->hasEnchantment(VanillaEnchantments::VANISHING()) && !$item->keepOnDeath(); });
}
public function saveNBT() : CompoundTag{