Class EnterInstanceTeleporterEvent

java.lang.Object
com.hypixel.hytale.component.system.EcsEvent
com.hypixel.hytale.builtin.instances.event.EnterInstanceTeleporterEvent

public final class EnterInstanceTeleporterEvent extends EcsEvent
Fired when a player uses a teleporter to enter an instance. Block teleporters dispatch this event on the block entity. Teleporters with an instance key dispatch this event through the entity store. The destination world may still be loading when the event is fired.
  • Constructor Details

  • Method Details

    • context

      @Nonnull public InteractionContext context()
      The interaction context associated with the event.
      Returns:
      the interaction context of the event
    • destination

      @Nonnull public CompletableFuture<World> destination()
      Returns the future for the destination world, which may still be loading.
      Returns:
      the future for the teleport destination world
    • of

      public static EnterInstanceTeleporterEvent of(@Nonnull InteractionContext context, @Nullable World world, @Nullable CompletableFuture<World> worldFuture)
      Creates an event from a destination world or a future for that world. If world is supplied, it takes precedence over worldFuture. Otherwise, the event uses worldFuture if supplied. If both are null, the completed future contains null.
      Parameters:
      context - the interaction context of the event
      world - the destination world, or null if unavailable
      worldFuture - the future used when world is null, or null if unavailable
      Returns:
      the event with the selected destination future