Class PlayerInteractEvent.EntityInteractSpecific
- 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.EntityInteractSpecific
-
- Enclosing class:
- PlayerInteractEvent
public static class PlayerInteractEvent.EntityInteractSpecific extends PlayerInteractEvent
This event is fired on both sides whenever a player right clicks an entity. "Interact at" is an interact where the local vector (which part of the entity you clicked) is known. The state of this event affects whetherEntity#applyPlayerInteraction
is called. Let result be the return value ofEntity#applyPlayerInteraction
, orPlayerInteractEvent.cancellationResult
if the event is cancelled. If we are on the client and result is notEnumActionResult#SUCCESS
, the client will then tryPlayerInteractEvent.EntityInteract
.
-
-
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 EntityInteractSpecific(PlayerEntity player, Hand hand, Entity target, Vector3d localPos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector3d
getLocalPos()
Returns the local interaction position.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
-
-
-
-
Constructor Detail
-
EntityInteractSpecific
public EntityInteractSpecific(PlayerEntity player, Hand hand, Entity target, Vector3d localPos)
-
-
Method Detail
-
getLocalPos
public Vector3d getLocalPos()
Returns the local interaction position. This is a 3D vector, where (0, 0, 0) is centered exactly at the center of the entity's bounding box at their feet. This means the X and Z values will be in the range [-width / 2, width / 2] while Y values will be in the range [0, height]- Returns:
- The local position
-
getTarget
public Entity getTarget()
-
-