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
All children of this event are fired on the
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
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
EntityTeleportEvent.ChorusFruit is fired before a LivingEntity is teleported due to consuming Chorus Fruit.static class
EntityTeleportEvent.EnderEntity is fired before an Enderman or Shulker randomly teleports.static class
EntityTeleportEvent.EnderPearl is fired before an Entity is teleported from an EnderPearlEntity.static class
EntityTeleportEvent.SpreadPlayersCommand is fired before a living entity is teleported from use ofSpreadPlayersCommand
.static class
EntityTeleportEvent.TeleportCommand is fired before a living entity is teleported from use ofTeleportCommand
.Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
Field Summary
-
Constructor Summary
ConstructorDescriptionEntityTeleportEvent
(Entity entity, double targetX, double targetY, double targetZ) -
Method Summary
Modifier and TypeMethodDescriptiongetPrev()
double
getPrevX()
double
getPrevY()
double
getPrevZ()
double
double
double
void
setTargetX
(double targetX) void
setTargetY
(double targetY) void
setTargetZ
(double targetZ) Methods inherited from class net.neoforged.neoforge.event.entity.EntityEvent
getEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
targetX
protected double targetX -
targetY
protected double targetY -
targetZ
protected double targetZ
-
-
Constructor Details
-
EntityTeleportEvent
-
-
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
-
getPrevX
public double getPrevX() -
getPrevY
public double getPrevY() -
getPrevZ
public double getPrevZ() -
getPrev
-