Class PlayerInteractEvent.EntityInteract
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.PlayerInteractEvent
net.minecraftforge.event.entity.player.PlayerInteractEvent.EntityInteract
- Enclosing class:
- PlayerInteractEvent
This event is fired on both sides when the player right clicks an entity.
It is responsible for all general entity interactions.
This event is fired only if the result of the above
PlayerInteractEvent.EntityInteractSpecific
is not InteractionResult.SUCCESS
.
This event's state affects whether Entity.interact(Player, InteractionHand)
and
Item.interactLivingEntity(ItemStack, Player, LivingEntity, InteractionHand)
are called.
Let result be InteractionResult.SUCCESS
if Entity.interact(Player, InteractionHand)
or
Item.interactLivingEntity(ItemStack, Player, LivingEntity, InteractionHand)
return true,
or PlayerInteractEvent.cancellationResult
if the event is cancelled.
If we are on the client and result is not InteractionResult.SUCCESS
, the client will then try PlayerInteractEvent.RightClickItem
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.player.PlayerInteractEvent
PlayerInteractEvent.EntityInteract, PlayerInteractEvent.EntityInteractSpecific, PlayerInteractEvent.LeftClickBlock, PlayerInteractEvent.LeftClickEmpty, PlayerInteractEvent.RightClickBlock, PlayerInteractEvent.RightClickEmpty, PlayerInteractEvent.RightClickItem
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
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.EyeHeight, EntityEvent.Size
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class net.minecraftforge.event.entity.player.PlayerInteractEvent
getCancellationResult, getFace, getHand, getItemStack, getLevel, getPos, getSide, setCancellationResult
Methods inherited from class net.minecraftforge.event.entity.player.PlayerEvent
getEntity
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
target
-
-
Constructor Details
-
EntityInteract
-
-
Method Details
-
getTarget
-