LivingDropsEvent
The event is cancelable.
If the event is canceled, the entity does not drop anything.
The event does not have a result.
Importing the class
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.
Extending LivingEvent
LivingDropsEvent extends LivingEvent. That means all methods available in LivingEvent are also available in LivingDropsEvent
Methods
Adds an item to the drops.
Parameter | Type |
---|---|
Parameter stack | Type IItemStack |
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>
Return Type: int
Return Type: DamageSource
Whether the Entity doing the drop has recently been damaged.
Return Type: boolean
Removes items that match the given ingredient from drops.
Parameter | Type |
---|---|
Parameter ingredient | Type IIngredient |
Sets which items will be dropped.
Parameter | Type |
---|---|
Parameter drops | Type stdlib.List<IItemStack> |
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name drops | Type stdlib.List<IItemStack> | Has Getter true | Has Setter true | Description 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. |
Name isRecentlyHit | Type boolean | Has Getter true | Has Setter false | Description Whether the Entity doing the drop has recently been damaged. |
Name lootingLevel | Type int | Has Getter true | Has Setter false | Description |
Name source | Type DamageSource | Has Getter true | Has Setter false | Description |