DeathComponent

public class DeathComponent implements Component

Component for tracking death state. Attach this component to entities that need to track death data.

java.lang.Object > DeathComponent

Field Summary

deathCause

private String deathCause

Field deathCause.

deathMessage

private Message deathMessage

Field deathMessage.

showDeathMenu

private boolean showDeathMenu

Field showDeathMenu.

itemsLostOnDeath

private ItemStack[] itemsLostOnDeath

Field itemsLostOnDeath.

itemsAmountLossPercentage

private double itemsAmountLossPercentage

Field itemsAmountLossPercentage.

itemsDurabilityLossPercentage

private double itemsDurabilityLossPercentage

Field itemsDurabilityLossPercentage.

displayDataOnDeathScreen

private boolean displayDataOnDeathScreen

Field displayDataOnDeathScreen.

deathInfo

private Damage deathInfo

Field deathInfo.

itemsLossMode

private DeathConfig.ItemsLossMode itemsLossMode

Field itemsLossMode.

interactionChain

private InteractionChain interactionChain

Field interactionChain.

death

final DeathComponent death

Field death.

Method Detail

getComponentType

public DeathComponent> getComponentType ()

Method getComponentType.

DeathComponent

public protected DeathComponent (@Nonnull final Damage deathInfo)

Method DeathComponent.

Parameters:
@Nonnull final Damage deathInfo

getDeathCause

public DamageCause getDeathCause ()

Method getDeathCause.

getDeathMessage

public Message getDeathMessage ()

Method getDeathMessage.

setDeathMessage

public void setDeathMessage (@Nullable final Message deathMessage)

Method setDeathMessage.

Parameters:
@Nullable final Message deathMessage

isShowDeathMenu

public boolean isShowDeathMenu ()

Method isShowDeathMenu.

setShowDeathMenu

public void setShowDeathMenu (final boolean showDeathMenu)

Method setShowDeathMenu.

Parameters:
final boolean showDeathMenu

getItemsLostOnDeath

public ItemStack[] getItemsLostOnDeath ()

Method getItemsLostOnDeath.

setItemsLostOnDeath

public void setItemsLostOnDeath (final List itemsLostOnDeath)

Method setItemsLostOnDeath.

Parameters:
final List itemsLostOnDeath

getItemsAmountLossPercentage

public double getItemsAmountLossPercentage ()

Method getItemsAmountLossPercentage.

setItemsAmountLossPercentage

public void setItemsAmountLossPercentage (final double itemsAmountLossPercentage)

Method setItemsAmountLossPercentage.

Parameters:
final double itemsAmountLossPercentage

getItemsDurabilityLossPercentage

public double getItemsDurabilityLossPercentage ()

Method getItemsDurabilityLossPercentage.

setItemsDurabilityLossPercentage

public void setItemsDurabilityLossPercentage (final double itemsDurabilityLossPercentage)

Method setItemsDurabilityLossPercentage.

Parameters:
final double itemsDurabilityLossPercentage

displayDataOnDeathScreen

public boolean displayDataOnDeathScreen ()

Method displayDataOnDeathScreen.

setDisplayDataOnDeathScreen

public void setDisplayDataOnDeathScreen (final boolean displayDataOnDeathScreen)

Method setDisplayDataOnDeathScreen.

Parameters:
final boolean displayDataOnDeathScreen

getDeathInfo

public Damage getDeathInfo ()

Method getDeathInfo.

getItemsLossMode

public DeathConfig.ItemsLossMode getItemsLossMode ()

Method getItemsLossMode.

setItemsLossMode

public void setItemsLossMode (final DeathConfig.ItemsLossMode itemsLossMode)

Method setItemsLossMode.

Parameters:
final DeathConfig.ItemsLossMode itemsLossMode

getDeathItemLoss

public DeathItemLoss getDeathItemLoss ()

Method getDeathItemLoss.

getInteractionChain

public InteractionChain getInteractionChain ()

Method getInteractionChain.

setInteractionChain

public void setInteractionChain (@Nullable final InteractionChain interactionChain)

Method setInteractionChain.

Parameters:
@Nullable final InteractionChain interactionChain

clone

public Component clone ()

Method clone.

tryAddComponent

static void tryAddComponent (@Nonnull final CommandBuffer commandBuffer, @Nonnull final Ref ref, @Nonnull final Damage damage)

Method tryAddComponent.

Parameters:
@Nonnull final CommandBuffer commandBuffer
@Nonnull final Ref ref
@Nonnull final Damage damage