Class EntityTeleportEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.EntityTeleportEvent
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
Direct Known Subclasses:
EntityTeleportEvent.ChorusFruit, EntityTeleportEvent.EnderEntity, EntityTeleportEvent.EnderPearl, EntityTeleportEvent.SpreadPlayersCommand, EntityTeleportEvent.TeleportCommand

public class EntityTeleportEvent extends EntityEvent implements net.neoforged.bus.api.ICancellableEvent
EntityTeleportEvent is fired when an event involving any teleportation of an Entity occurs.
If a method utilizes this Event as its parameter, the method will receive every child event of this class.

getTarget() contains the target destination.
getPrev() contains the entity's current position.

All children of this event are fired on the NeoForge.EVENT_BUS.
  • Field Details

    • targetX

      protected double targetX
    • targetY

      protected double targetY
    • targetZ

      protected double targetZ
  • Constructor Details

    • EntityTeleportEvent

      public EntityTeleportEvent(Entity entity, double targetX, double targetY, double targetZ)
  • Method Details

    • getTargetX

      public double getTargetX()
    • setTargetX

      public void setTargetX(double targetX)
    • getTargetY

      public double getTargetY()
    • setTargetY

      public void setTargetY(double targetY)
    • getTargetZ

      public double getTargetZ()
    • setTargetZ

      public void setTargetZ(double targetZ)
    • getTarget

      public Vec3 getTarget()
    • getPrevX

      public double getPrevX()
    • getPrevY

      public double getPrevY()
    • getPrevZ

      public double getPrevZ()
    • getPrev

      public Vec3 getPrev()