Skip to content

DimensionChange ​

com.jsmacrosce.jsmacros.client.api.event.impl.world.EventDimensionChange

Since1.2.7Not cancellable

Fires when the client begins setting a non-null world, such as when joining or changing dimensions. It does not fire when leaving a world; use Disconnect instead.

js
JsMacros.on("DimensionChange", JavaWrapper.methodToJava(function (event) {
 Chat.log(`Dimension changed to ${event.dimension}`);  
}))

Constructors ​

new EventDimensionChange ​

new EventDimensionChange(String dimension)#
Stores the supplied dimension label in this event without validating or normalizing it.

Parameters:

  • dimension: dimension identifier label, conventionally in namespace:path form; may be null or any string

Fields ​

dimension ​

dimension: Stringread-only#
The new world's dimension ID in namespace:path form; script type definitions narrow this value to a Dimension union.

Methods ​

toString ​

toString(): String#
Returns a diagnostic representation containing the event name and stored dimension label. The label is quoted but not escaped, so this is not guaranteed to be valid JSON; a null label appears as the quoted text "null".
Returns: the event name followed by :{"dimension": "label"}, with the stored label substituted verbatim