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.
导入类
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 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
使用方式
Link to 使用方式
Name: damageRodBy
Sets the amount of durability damage to inflict on the fishing rod.
ZenScript Copy// ItemFishedEvent.damageRodBy(damage as int)
event.damageRodBy(5);
参数 | 类型 | 描述 |
---|---|---|
参数 damage | 类型 int | 描述 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();
名称 | 类型 | 可获得 | 可设置 | 描述 |
---|---|---|---|---|
名称 damageRodBy | 类型 ItemFishedEvent | 可获得 false | 可设置 true | 描述 Sets the amount of durability damage to inflict on the fishing rod. |
名称 drops | 类型 stdlib.List<ItemStack> | 可获得 true | 可设置 false | 描述 Gets the list of items being fished up by the player. |
名称 itemDamage | 类型 int | 可获得 true | 可设置 false | 描述 Gets the amount of durability damage to inflict on the fishing rod. |