Class InstanceWorldPositionChangeEvent

java.lang.Object
net.minestom.server.event.instance.InstanceWorldPositionChangeEvent
All Implemented Interfaces:
Event, InstanceEvent

public class InstanceWorldPositionChangeEvent extends Object implements InstanceEvent
The event is triggered by the server when an instance successfully changes its world spawn position. By implementing a listener for this event, developers can track changes to a world's spawn position initiated by instances during runtime.
Since:
1.1.3
  • Constructor Details

    • InstanceWorldPositionChangeEvent

      public InstanceWorldPositionChangeEvent(@NotNull @NotNull Instance instance, @NotNull @NotNull Pos oldPosition)
      Constructs a new InstanceWorldPositionChangeEvent with the specified parameters.
      Parameters:
      instance - the involved instance
      oldPosition - the old position of the instance before the change
  • Method Details

    • getNewPosition

      @NotNull public @NotNull Pos getNewPosition()
      Gets the new position of the instance after the change.
      Returns:
      the new position
    • getOldPosition

      @NotNull public @NotNull Pos getOldPosition()
      Gets the old position of the instance before the change.
      Returns:
      the old position
    • getInstance

      @NotNull public @NotNull Instance getInstance()
      Gets the instance which received a world position change.
      Specified by:
      getInstance in interface InstanceEvent
      Returns:
      the involved instance