DeathItemLoss
Package: com.hypixel.hytale.server.core.modules.entity.damage
public class DeathItemLossEncapsulates the item loss configuration for a death event: which loss mode is active, the specific items lost, and the percentage-based loss values for item amounts and durability. Serializable via BuilderCodec. Used by DeathComponent to pass loss data to the death/respawn screen.
Static Fields
Section titled “Static Fields”| Field | Type | Description |
|---|---|---|
CODEC | BuilderCodec<DeathItemLoss> | Builder codec for JSON serialization. |
Static Methods
Section titled “Static Methods”public static DeathItemLoss noLossMode()Returns a singleton DeathItemLoss configured for no item loss (mode NONE, empty items, 0% loss).
Constructor
Section titled “Constructor”public DeathItemLoss(DeathConfig.ItemsLossMode lossMode, ItemStack[] itemsLost, double amountLossPercentage, double durabilityLossPercentage)Creates a death item loss configuration with the given parameters.
Methods
Section titled “Methods”public DeathConfig.ItemsLossMode getLossMode()Returns the items loss mode (ALL, CONFIGURED, or NONE).
public ItemStack[] getItemsLost()Returns the array of items lost. Returns ItemStack.EMPTY_ARRAY if null.
public double getAmountLossPercentage()Returns the percentage of item quantities lost.
public double getDurabilityLossPercentage()Returns the percentage of item durability lost.
Related Types
Section titled “Related Types”- DeathComponent — creates
DeathItemLossinstances viagetDeathItemLoss() - DeathSystems.DropPlayerDeathItems — system that processes item drops
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.