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.

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.

script.zs
import crafttweaker.api.event.entity.player.ItemFishedEvent;

Extending PlayerEvent

ItemFishedEvent extends PlayerEvent. That means all methods available in PlayerEvent are also available in ItemFishedEvent

Methods

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

script.zs
// ItemFishedEvent.damageRodBy(damage as int)
event.damageRodBy(5);
ParameterTypeDescription
Parameter
damage
Type
int
Description
The amount of durability damage.

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>

script.zs
// ItemFishedEvent.getDrops() as stdlib.List<ItemStack>
event.getDrops();

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

script.zs
// ItemFishedEvent.getItemDamage() as int
event.getItemDamage();

Properties

NameTypeHas GetterHas SetterDescription
Name
damageRodBy
Type
ItemFishedEvent
Has Getter
false
Has Setter
true
Description
Sets the amount of durability damage to inflict on the fishing rod.
Name
drops
Type
stdlib.List<ItemStack>
Has Getter
true
Has Setter
false
Description
Gets the list of items being fished up by the player.
Name
itemDamage
Type
int
Has Getter
true
Has Setter
false
Description
Gets the amount of durability damage to inflict on the fishing rod.