Class DelayedTeleportEvent
java.lang.Object
com.datdeveloper.datmoddingapi.delayedEvents.TimeDelayedEvent
com.datdeveloper.datmoddingapi.delayedEvents.DelayedTeleportEvent
- All Implemented Interfaces:
IDelayedEvent
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
Modifier and TypeFieldDescriptionnet.minecraft.core.BlockPos
The position the player will teleport tonet.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>
The level the player will teleport tonet.minecraft.server.level.ServerPlayer
The Player being teleportednet.minecraft.core.BlockPos
The starting position of the player Used to calculate if the event should cancel for the player movingFields inherited from class com.datdeveloper.datmoddingapi.delayedEvents.TimeDelayedEvent
exeTime
-
Constructor Summary
ConstructorDescriptionDelayedTeleportEvent
(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 TypeMethodDescriptionvoid
execute()
The code that will execute when the delay has passedboolean
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 eventMethods inherited from class com.datdeveloper.datmoddingapi.delayedEvents.TimeDelayedEvent
canExecute
-
Field Details
-
destinationPos
public net.minecraft.core.BlockPos destinationPosThe position the player will teleport to -
destinationWorld
public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> destinationWorldThe level the player will teleport to -
player
public net.minecraft.server.level.ServerPlayer playerThe Player being teleported -
startingPos
public net.minecraft.core.BlockPos startingPosThe 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 interfaceIDelayedEvent
- Overrides:
shouldRequeue
in classTimeDelayedEvent
- Parameters:
hasFinished
- True if the event has executed- Returns:
- True if the event should be requeued
-