Class EntityTeleportEvent

java.lang.Object
net.minestom.server.event.entity.EntityTeleportEvent
All Implemented Interfaces:
Event, EntityEvent

public class EntityTeleportEvent extends Object implements EntityEvent
Called with Entity.teleport(Pos) and its overloads.
  • Constructor Details

    • EntityTeleportEvent

      public EntityTeleportEvent(@NotNull @NotNull Entity entity, @NotNull @NotNull Pos teleportPosition, @MagicConstant(flagsFromClass=RelativeFlags.class) int relativeFlags)
  • Method Details

    • getEntity

      @NotNull public @NotNull Entity getEntity()
      Description copied from interface: EntityEvent
      Gets the entity of this event.
      Specified by:
      getEntity in interface EntityEvent
      Returns:
      The Entity that teleported.
    • getNewPosition

      @NotNull public @NotNull Pos getNewPosition()
      Returns:
      The position that the Entity is about to teleport to. This is an absolute position.
    • getTeleportPosition

      @NotNull public @NotNull Pos getTeleportPosition()
      Returns:
      The position that the Entity is about to teleport to. This may be (partially) relative depending on the flags.
    • getRelativeFlags

      @MagicConstant(flagsFromClass=RelativeFlags.class) public int getRelativeFlags()
      Returns:
      The flags that determine which fields of the position are relative.