MCItemFishedEvent

Link to mcitemfishedevent

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.

Импорт класса

Link to импорт-класса

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
Copy
import crafttweaker.api.event.entity.player.MCItemFishedEvent;

Extending MCPlayerEvent

Link to extending-mcplayerevent

MCItemFishedEvent extends MCPlayerEvent. That means all methods available in MCPlayerEvent are also available in MCItemFishedEvent

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
// MCItemFishedEvent.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
// MCItemFishedEvent.getItemDamage() as int

event.getItemDamage();

Name: setItemDamage

Sets the amount of durability damage to inflict on the fishing rod.

Return Type: void

ZenScript
Copy
// MCItemFishedEvent.setItemDamage(damage as int) as void

event.setItemDamage(5);
ПараметрТипОписание
Параметр
damage
Тип
int
Описание
The amount of durability damage.

Свойства

Link to свойства

НазваниеТипИмеет GetterИмеет SetterОписание
Название
drops
Тип
stdlib.List<ItemStack>
Имеет Getter
true
Имеет Setter
false
Описание
Gets the list of items being fished up by the player.
Название
itemDamage
Тип
int
Имеет Getter
true
Имеет Setter
true
Описание
Gets the amount of durability damage to inflict on the fishing rod.