Class DelayedTeleportEvent

java.lang.Object
com.datdeveloper.datmoddingapi.delayedEvents.TimeDelayedEvent
com.datdeveloper.datmoddingapi.delayedEvents.DelayedTeleportEvent
All Implemented Interfaces:
IDelayedEvent

public class DelayedTeleportEvent extends TimeDelayedEvent
A Delayed Event to teleport the player to a specific location after a set amount of time Cancels if the player moves
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    net.minecraft.core.BlockPos
    The position the player will teleport to
    net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>
    The level the player will teleport to
    net.minecraft.server.level.ServerPlayer
    The Player being teleported
    net.minecraft.core.BlockPos
    The starting position of the player Used to calculate if the event should cancel for the player moving

    Fields inherited from class com.datdeveloper.datmoddingapi.delayedEvents.TimeDelayedEvent

    exeTime
  • Constructor Summary

    Constructors
    Constructor
    Description
    DelayedTeleportEvent(net.minecraft.core.BlockPos destinationPos, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> destinationWorld, net.minecraft.server.level.ServerPlayer player, int Delay)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The code that will execute when the delay has passed
    boolean
    shouldRequeue(boolean hasFinished)
    Checks to see if the code should be requeued to continue waiting to be executed Can be used to restart the delay for the event

    Methods inherited from class com.datdeveloper.datmoddingapi.delayedEvents.TimeDelayedEvent

    canExecute

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • destinationPos

      public net.minecraft.core.BlockPos destinationPos
      The position the player will teleport to
    • destinationWorld

      public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> destinationWorld
      The level the player will teleport to
    • player

      public net.minecraft.server.level.ServerPlayer player
      The Player being teleported
    • startingPos

      public net.minecraft.core.BlockPos startingPos
      The starting position of the player Used to calculate if the event should cancel for the player moving
  • Constructor Details

    • DelayedTeleportEvent

      public DelayedTeleportEvent(net.minecraft.core.BlockPos destinationPos, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> destinationWorld, net.minecraft.server.level.ServerPlayer player, int Delay)
  • Method Details

    • execute

      public void execute()
      Description copied from interface: IDelayedEvent
      The code that will execute when the delay has passed
    • shouldRequeue

      public boolean shouldRequeue(boolean hasFinished)
      Description copied from interface: IDelayedEvent
      Checks to see if the code should be requeued to continue waiting to be executed Can be used to restart the delay for the event
      Specified by:
      shouldRequeue in interface IDelayedEvent
      Overrides:
      shouldRequeue in class TimeDelayedEvent
      Parameters:
      hasFinished - True if the event has executed
      Returns:
      True if the event should be requeued