public class ItemFishedEvent extends PlayerEvent
Cancelable
Canceling the event will cause the player to receive no items at all.
The hook will still take the damage specifiedPlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.ItemCraftedEvent, PlayerEvent.ItemPickupEvent, PlayerEvent.ItemSmeltedEvent, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.PlayerChangedDimensionEvent, PlayerEvent.PlayerLoggedInEvent, PlayerEvent.PlayerLoggedOutEvent, PlayerEvent.PlayerRespawnEvent, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.Visibility
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.EyeHeight
Modifier and Type | Field and Description |
---|---|
private FishingBobberEntity |
hook |
private int |
rodDamage |
private NonNullList<ItemStack> |
stacks |
Constructor and Description |
---|
ItemFishedEvent(java.util.List<ItemStack> stacks,
int rodDamage,
FishingBobberEntity hook) |
Modifier and Type | Method and 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.
|
getPlayer
getEntityLiving
getEntity
private final NonNullList<ItemStack> stacks
private final FishingBobberEntity hook
private int rodDamage
public ItemFishedEvent(java.util.List<ItemStack> stacks, int rodDamage, FishingBobberEntity hook)
public int getRodDamage()
public void damageRodBy(@Nonnegative int rodDamage)
rodDamage
- The damage the rod will take. Must be nonnegativepublic NonNullList<ItemStack> getDrops()
public FishingBobberEntity getHookEntity()