Class InstanceWorldPositionChangeEvent
java.lang.Object
net.minestom.server.event.instance.InstanceWorldPositionChangeEvent
- All Implemented Interfaces:
Event
,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 Summary
ConstructorDescriptionInstanceWorldPositionChangeEvent
(@NotNull Instance instance, @NotNull Pos oldPosition) Constructs a newInstanceWorldPositionChangeEvent
with the specified parameters. -
Method Summary
-
Constructor Details
-
InstanceWorldPositionChangeEvent
public InstanceWorldPositionChangeEvent(@NotNull @NotNull Instance instance, @NotNull @NotNull Pos oldPosition) Constructs a newInstanceWorldPositionChangeEvent
with the specified parameters.- Parameters:
instance
- the involved instanceoldPosition
- the old position of the instance before the change
-
-
Method Details
-
getNewPosition
Gets the new position of the instance after the change.- Returns:
- the new position
-
getOldPosition
Gets the old position of the instance before the change.- Returns:
- the old position
-
getInstance
Gets the instance which received a world position change.- Specified by:
getInstance
in interfaceInstanceEvent
- Returns:
- the involved instance
-