ItemFishedEvent
Link to itemfishedevent
This event is fired every time the player fishes up an item. It can be used to add or remove drops, change the durability damage, do other effects, and even prevent the fishing by canceling the event.
The event is cancelable.
If the event is canceled, will cause the player to receive no items at all
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.player.ItemFishedEvent;
Extending PlayerEvent
Link to extending-playerevent
ItemFishedEvent extends PlayerEvent. That means all methods available in PlayerEvent are also available in ItemFishedEvent
Metodi
Link to metodi
Name: damageRodBy
Sets the amount of durability damage to inflict on the fishing rod.
Return Type: void
ZenScript Copy// ItemFishedEvent.damageRodBy(damage as int) as void
event.damageRodBy(5);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro damage | Tipo int | Descrizione The amount of durability damage. |
Name: getDrops
Gets the list of items being fished up by the player.
Returns: The list of items being fished up by the player.
Return Type: stdlib.List<ItemStack>
ZenScript Copy// ItemFishedEvent.getDrops() as stdlib.List<ItemStack>
event.getDrops();
Name: getItemDamage
Gets the amount of durability damage to inflict on the fishing rod.
Returns: The amount of durability damage to inflict on the fishing rod.
Return Type: int
ZenScript Copy// ItemFishedEvent.getItemDamage() as int
event.getItemDamage();
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter | Descrizione |
---|---|---|---|---|
Nome damageRodBy | Tipo ItemFishedEvent | Ha Getter no | Ha Setter sì | Descrizione Sets the amount of durability damage to inflict on the fishing rod. |
Nome drops | Tipo stdlib.List<ItemStack> | Ha Getter sì | Ha Setter no | Descrizione Gets the list of items being fished up by the player. |
Nome itemDamage | Tipo int | Ha Getter sì | Ha Setter no | Descrizione Gets the amount of durability damage to inflict on the fishing rod. |