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
public static class PlayerInteractEvent.EntityInteract extends 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 abovePlayerInteractEvent.EntityInteractSpecific
is notEnumActionResult#SUCCESS
. This event's state affects whetherEntity#processInitialInteract
andnet.minecraft.item.Item#itemInteractionForEntity
are called. Let result beEnumActionResult#SUCCESS
ifEntity#processInitialInteract
ornet.minecraft.item.Item#itemInteractionForEntity
return true, orPlayerInteractEvent.cancellationResult
if the event is cancelled. If we are on the client and result is notEnumActionResult#SUCCESS
, the client will then tryPlayerInteractEvent.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, 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
-
-
Constructor Summary
Constructors Constructor Description EntityInteract(PlayerEntity player, Hand hand, Entity target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Entity
getTarget()
-
Methods inherited from class net.minecraftforge.event.entity.player.PlayerInteractEvent
getCancellationResult, getFace, getHand, getItemStack, getPos, getSide, getWorld, setCancellationResult
-
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
-
target
private final Entity target
-
-
Constructor Detail
-
EntityInteract
public EntityInteract(PlayerEntity player, Hand hand, Entity target)
-
-
Method Detail
-
getTarget
public Entity getTarget()
-
-