Class ItemFishedEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.entity.EntityEvent
-
- net.minecraftforge.event.entity.living.LivingEvent
-
- net.minecraftforge.event.entity.player.PlayerEvent
-
- net.minecraftforge.event.entity.player.ItemFishedEvent
-
public class ItemFishedEvent extends PlayerEvent
This event is called when a player fishes an item. This event isCancelable
Canceling the event will cause the player to receive no items at all. The hook will still take the damage specified
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.player.PlayerEvent
PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemPickupEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerChangeGameModeEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.TabListNameFormat, PlayerEvent.Visibility
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent, LivingEvent.LivingVisibilityEvent
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
-
-
Field Summary
Fields Modifier and Type Field Description private FishingBobberEntity
hook
private int
rodDamage
private NonNullList<ItemStack>
stacks
-
Constructor Summary
Constructors Constructor Description ItemFishedEvent(java.util.List<ItemStack> stacks, int rodDamage, FishingBobberEntity hook)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
damageRodBy(int rodDamage)
Specifies the amount of damage that the fishing rod should take.NonNullList<ItemStack>
getDrops()
Use this to get the items the player will receive.FishingBobberEntity
getHookEntity()
Use this to stuff related to the hook itself, like the position of the bobber.int
getRodDamage()
Get the damage the rod will take.-
Methods inherited from class net.minecraftforge.event.entity.player.PlayerEvent
getPlayer
-
Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntityLiving
-
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
-
-
-
-
Field Detail
-
stacks
private final NonNullList<ItemStack> stacks
-
hook
private final FishingBobberEntity hook
-
rodDamage
private int rodDamage
-
-
Constructor Detail
-
ItemFishedEvent
public ItemFishedEvent(java.util.List<ItemStack> stacks, int rodDamage, FishingBobberEntity hook)
-
-
Method Detail
-
getRodDamage
public int getRodDamage()
Get the damage the rod will take.- Returns:
- The damage the rod will take
-
damageRodBy
public void damageRodBy(@Nonnegative int rodDamage)
Specifies the amount of damage that the fishing rod should take. This is not added to the pre-existing damage to be taken.- Parameters:
rodDamage
- The damage the rod will take. Must be nonnegative
-
getDrops
public NonNullList<ItemStack> getDrops()
Use this to get the items the player will receive. You cannot use this to modify the drops the player will get. If you want to affect the loot, you should use LootTables.
-
getHookEntity
public FishingBobberEntity getHookEntity()
Use this to stuff related to the hook itself, like the position of the bobber.
-
-