public static class PlayerInteractEvent.EntityInteract extends PlayerInteractEvent
PlayerInteractEvent.EntityInteractSpecific
is not EnumActionResult.SUCCESS
.
This event's state affects whether Entity.processInitialInteract(net.minecraft.entity.player.EntityPlayer, net.minecraft.util.EnumHand)
and Item.itemInteractionForEntity(net.minecraft.item.ItemStack, net.minecraft.entity.player.EntityPlayer, net.minecraft.entity.EntityLivingBase, net.minecraft.util.EnumHand)
are called.
Let result be EnumActionResult.SUCCESS
if Entity.processInitialInteract(net.minecraft.entity.player.EntityPlayer, net.minecraft.util.EnumHand)
or Item.itemInteractionForEntity(net.minecraft.item.ItemStack, net.minecraft.entity.player.EntityPlayer, net.minecraft.entity.EntityLivingBase, net.minecraft.util.EnumHand)
return true,
or PlayerInteractEvent.cancellationResult
if the event is cancelled.
If we are on the client and result is not EnumActionResult.SUCCESS
, the client will then try PlayerInteractEvent.RightClickItem
.PlayerInteractEvent.EntityInteract, PlayerInteractEvent.EntityInteractSpecific, PlayerInteractEvent.LeftClickBlock, PlayerInteractEvent.LeftClickEmpty, PlayerInteractEvent.RightClickBlock, PlayerInteractEvent.RightClickEmpty, PlayerInteractEvent.RightClickItem
PlayerEvent.BreakSpeed, PlayerEvent.Clone, PlayerEvent.HarvestCheck, PlayerEvent.LoadFromFile, PlayerEvent.NameFormat, PlayerEvent.SaveToFile, PlayerEvent.StartTracking, PlayerEvent.StopTracking, PlayerEvent.Visibility
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing
Event.HasResult, Event.Result
Constructor and Description |
---|
EntityInteract(EntityPlayer player,
EnumHand hand,
Entity target) |
Modifier and Type | Method and Description |
---|---|
Entity |
getTarget() |
getCancellationResult, getFace, getHand, getItemStack, getPos, getSide, getWorld, setCancellationResult
getEntityPlayer
getEntityLiving
getEntity
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
public EntityInteract(EntityPlayer player, EnumHand hand, Entity target)
public Entity getTarget()