BetaPrivateconstructorThe namespaced identifier for the custom dimension (e.g., 'mypack:my_dimension'). Must include a namespace and use only valid identifier characters.
Registers a new custom dimension type. Must be called during the system startup event. The dimension will be created using the void generator.
This function can be called in early-execution mode.
This function can throw errors.
CustomDimensionAlreadyRegisteredError
CustomDimensionInvalidRegistryError
import { system } from "@minecraft/server";
const VOID_ARENA_ID = "custom_dim:void_arena";
const SKY_LOUNGE_ID = "custom_dim:sky_lounge";
// Register custom dimensions during startup.
// This is the only phase where DimensionRegistry is available.
system.beforeEvents.startup.subscribe((event) => {
event.dimensionRegistry.registerCustomDimension(VOID_ARENA_ID);
event.dimensionRegistry.registerCustomDimension(SKY_LOUNGE_ID);
});
Provides the functionality for registering custom dimensions. Custom dimensions can only be registered during the system startup event.
Example: buildPlatformsOnWorldLoad.ts
Example: dimensionTravelMenu.ts
Example: registerDimensionsWithCommand.ts
Example: teleportToCustomDimension.ts
Some notes that might be relevant:
Most infomation found in this section is based on Minecraft Preview 26.20.26, which is still in Beta APIs and may be subject to change.
namespace:name.Check out this video for a quick demo:
Examples in this folder are adapted from:
Files:
Source