LivingDropsEvent
Link to livingdropsevent
The event is cancelable.
If the event is canceled, the entity does not drop anything.
The event does not have a result.
Importare la Classe
Link to importare-la-classe
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.event.entity.living.LivingDropsEvent;
Extending LivingEvent
Link to extending-livingevent
LivingDropsEvent extends LivingEvent. That means all methods available in LivingEvent are also available in LivingDropsEvent
Metodi
Link to metodi
Name: addDrop
Adds an item to the drops.
Return Type: void
ZenScript CopyLivingDropsEvent.addDrop(stack as IItemStack) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro stack | Tipo IItemStack | Descrizione No Description Provided |
Name: getDrops
Returns the list of items will be dropped. The list is read-only, modifying this list does not change the drops.
You should use the drops
setter, addDrop
or removeDrop
method to change the drops.
Return Type: stdlib.List<IItemStack>
ZenScript Copy// LivingDropsEvent.getDrops() as stdlib.List<IItemStack>
myLivingDropsEvent.getDrops();
Name: getLootingLevel
Return Type: int
ZenScript Copy// LivingDropsEvent.getLootingLevel() as int
myLivingDropsEvent.getLootingLevel();
Name: getSource
Return Type: DamageSource
ZenScript Copy// LivingDropsEvent.getSource() as DamageSource
myLivingDropsEvent.getSource();
Name: isRecentlyHit
Whether the Entity doing the drop has recently been damaged.
Return Type: boolean
ZenScript Copy// LivingDropsEvent.isRecentlyHit() as boolean
myLivingDropsEvent.isRecentlyHit();
Name: removeDrop
Removes items that match the given ingredient from drops.
Return Type: void
ZenScript CopyLivingDropsEvent.removeDrop(ingredient as IIngredient) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro ingredient | Tipo IIngredient | Descrizione No Description Provided |
Name: setDrops
Sets which items will be dropped.
Return Type: void
ZenScript CopyLivingDropsEvent.setDrops(drops as stdlib.List<IItemStack>) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro drops | Tipo stdlib.List<IItemStack> | Descrizione No Description Provided |
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter | Descrizione |
---|---|---|---|---|
Nome drops | Tipo stdlib.List<IItemStack> | Ha Getter sì | Ha Setter sì | Descrizione Returns the list of items will be dropped. The list is read-only, modifying this list does not change the drops. You should use the drops setter, addDrop or removeDrop method to change the drops. |
Nome isRecentlyHit | Tipo boolean | Ha Getter sì | Ha Setter no | Descrizione Whether the Entity doing the drop has recently been damaged. |
Nome lootingLevel | Tipo int | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome sorgente | Tipo DamageSource | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |