Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Caution
This module is still in pre-release. It may change or it may be removed in future releases.
Changelog
Manifest Details
{
"module_name": "@minecraft/server-editor",
"version": "0.1.0-beta"
}
This is version 0.x.x of this module, which is the latest as of version 1.21.100-beta.23 of Minecraft.
Available Versions
0.1.0-beta
Enumerations
- ActionTypes
- AudioSettingsProperty
- Axis
- BlockMaskListType
- BlockPaletteItemType
- BlockTableOperationType
- BoolPropertyItemVariant
- BrushDirectionalPlacementMode
- ButtonPropertyItemVariant
- ColorPickerPropertyItemVariant
- ComboBoxPropertyItemDataType
- ContiguousSelectionType
- ContinuousActionState
- CoreActionBarItemType
- CoreBrushShapeType
- CoreMenuType
- CursorControlMode
- CursorTargetMode
- DaylightCycle
- EditorInputContext
- EditorMode
- EntityOperationType
- ExportResult
- GamePublishSetting
- GraphicsSettingsProperty
- ImageResourceType
- InputModifier
- KeyboardKey
- KeyProcessingState
- LayoutAlignment
- LayoutDirection
- LogChannel
- MouseActionCategory
- MouseActionType
- MouseInputType
- NumberPropertyItemVariant
- PaintCompletionState
- PaintMode
- Plane
- PlaytestSessionResult
- PrimitiveType
- ProgressIndicatorPropertyItemVariant
- ProjectExportType
- PropertyItemType
- SelectionVolumeEventType
- SpeedSettingsProperty
- SplineType
- StatusBarAlignment
- StructureSource
- ThemeSettingsColorKey
- WidgetComponentType
- WidgetGizmoEventType
- WidgetGroupSelectionMode
- WidgetMouseButtonActionType
- WorldGeneratorType
Type Aliases
- Action
- ActionID
- ActivationFunctionType
- AudioSettingsPropertyTypeMap
- BasicTooltipContent
- ButtonPropertyItemSupportedActionTypes
- ContinuousAction
- EventHandler
- GraphicsSettingsPropertyTypeMap
- ImageAnimationData
- ImageResourceData
- IObservableProp
- IPlayerUISession
- KeyBinding
- KeyBindingInfo
- LocalizedString
- ModalToolLifecycleEventPayload
- MouseModifiers
- MouseProps
- MouseRayCastAction
- NoArgsAction
- PropertyBag
- PropertyPaneVisibilityUpdate
- Ray
- RegisteredAction
- ShutdownFunctionType
- SpeedSettingsPropertyTypeMap
- StatefulAction
- SupportedKeyboardActionTypes
- SupportedMouseActionTypes
- TooltipContent
- TooltipInteractiveContent
- TooltipInteractiveContentDescription
- TooltipLink
- UnregisterInputBindingCallback
Classes
- AudioSettings
- BedrockEventSubscriptionCache
- BlockIdentifierListObservableValidator
- BlockIdentifierObservableValidator
- BlockPalette
- BlockPaletteManager
- BlockUtilities
- BrushShape
- BrushShapeManager
- ClipboardChangeAfterEvent
- ClipboardChangeAfterEventSignal
- ClipboardItem
- ClipboardManager
- ConeBrushShape
- CuboidBrushShape
- CurrentThemeChangeAfterEvent
- CurrentThemeChangeAfterEventSignal
- CurrentThemeColorChangeAfterEvent
- CurrentThemeColorChangeAfterEventSignal
- Cursor
- CursorPropertiesChangeAfterEvent
- CursorPropertyChangeAfterEventSignal
- CylinderBrushShape
- EditorConstants
- EditorStructure
- EditorStructureManager
- EllipsoidBrushShape
- EntityIdentifierObservableValidator
- ExportManager
- Extension
- ExtensionContext
- ExtensionContextAfterEvents
- GraphicsSettings
- IBlockPaletteItem
- Logger
- MinecraftEditor
- ModeChangeAfterEvent
- ModeChangeAfterEventSignal
- NumberLimitObservableValidator
- ObservableValidator
- PlaytestManager
- ProbabilityBlockPaletteItem
- PyramidBrushShape
- RelativeVolumeListBlockVolume
- SelectionChangeAfterEventSignal
- SelectionContainerBase
- SelectionContainerEntity
- SelectionContainerVolume
- SelectionContainerVolumeEvent
- SelectionEventAfterEvent
- SelectionManager
- SettingsManager
- SimpleBlockPaletteItem
- SimulationState
- SingleBlockBrushShape
- SpeedSettings
- ThemeSettings
- TransactionManager
- UserDefinedTransactionHandle
- UserDefinedTransactionHandlerId
- Vector3LimitObservableValidator
- Widget
- WidgetComponentBase
- WidgetComponentBoundingBox
- WidgetComponentBoundingBoxStateChangeEventParameters
- WidgetComponentClipboard
- WidgetComponentEntity
- WidgetComponentGizmo
- WidgetComponentGizmoStateChangeEventParameters
- WidgetComponentGuide
- WidgetComponentRenderPrimitive
- WidgetComponentRenderPrimitiveTypeAxialSphere
- WidgetComponentRenderPrimitiveTypeBase
- WidgetComponentRenderPrimitiveTypeBox
- WidgetComponentRenderPrimitiveTypeDisc
- WidgetComponentRenderPrimitiveTypeLine
- WidgetComponentSpline
- WidgetComponentText
- WidgetComponentVolumeOutline
- WidgetGroup
- WidgetManager
- WidgetMouseButtonEventData
- WidgetStateChangeEventData
Interfaces
- ActionManager
- BlockMaskList
- BuiltInUIManager
- ClipboardWriteOptions
- ContiguousSelectionProperties
- CursorPosition
- CursorProperties
- CursorRay
- EditorStructureSearchOptions
- EventSink
- ExtensionOptionalParameters
- GameOptions
- IActionBar
- IActionBarItem
- IActionBarItemCreationParams
- IBlockListPropertyItem
- IBlockListPropertyItemOptions
- IBlockTableEntryInfo
- IBlockTablePropertyItem
- IBlockTablePropertyItemOptions
- IBoolPropertyItem
- IBoolPropertyItemOptions
- IButtonPanePropertyItem
- IButtonPanePropertyItemOptions
- IButtonPropertyItem
- IButtonPropertyItemOptions
- IColorPickerPropertyItem
- IColorPickerPropertyItemOptions
- IColorTimelinePropertyItem
- IColorTimelinePropertyItemEntry
- IColorTimelinePropertyItemOptions
- IComboBoxPropertyItem
- IComboBoxPropertyItemOptions
- IDataTablePropertyItem
- IDataTablePropertyItemEntry
- IDataTablePropertyItemOptions
- IDisposable
- IDropdownPropertyItem
- IDropdownPropertyItemEntry
- IDropdownPropertyItemOptions
- IEventToken
- IGlobalInputManager
- IImagePropertyItem
- IImagePropertyItemOptions
- ILinkPropertyItem
- ILinkPropertyItemOptions
- IMenu
- IMenuContainer
- IMenuCreationParams
- IModalControlPane
- IModalOverlayPane
- IModalOverlayPaneOptions
- IModalTool
- IModalToolContainer
- INumberPropertyItem
- INumberPropertyItemOptions
- INumberTimelinePropertyItem
- INumberTimelinePropertyItemEntry
- INumberTimelinePropertyItemOptions
- IObservable
- IPane
- IPlayerLogger
- IPlayerLoggerProperties
- IProgressIndicatorPropertyItem
- IProgressIndicatorPropertyItemOptions
- IPropertyItemBase
- IPropertyItemOptionsBase
- IPropertyPane
- IPropertyPaneOptions
- IRegisteredKeyBinding
- IRegisterExtensionOptionalParameters
- IRootPropertyPane
- IRootPropertyPaneHeaderAction
- IRootPropertyPaneOptions
- IStatusBar
- IStatusBarItem
- IStatusBarItemCreationParams
- IStringPropertyItem
- IStringPropertyItemOptions
- ISubPanePropertyItem
- ISubPanePropertyItemOptions
- ITextPropertyItem
- ITextPropertyItemOptions
- IToggleGroupPropertyItem
- IToggleGroupPropertyItemEntry
- IToggleGroupPropertyItemOptions
- IVector3PropertyItem
- IVector3PropertyItemOptions
- LogProperties
- ModalToolCreationParameters
- ProjectExportOptions
- QuickExtrudeProperties
- WeightedBlock
- WidgetComponentBaseOptions
- WidgetComponentBoundingBoxOptions
- WidgetComponentClipboardOptions
- WidgetComponentEntityOptions
- WidgetComponentGizmoOptions
- WidgetComponentGuideOptions
- WidgetComponentRenderPrimitiveOptions
- WidgetComponentSplineOptions
- WidgetComponentTextOptions
- WidgetComponentVolumeOutlineOptions
- WidgetCreateOptions
- WidgetGroupCreateOptions
Errors
Functions
deserialize
deserialize(s: string): unknown
Deserialize anything, defaults to the same behavior as JSON.parse but will use custom deserializers passed into {@link registerSerializationForType}.
Parameters
- s: string
Returns unknown
executeLargeOperation
executeLargeOperation(volume: RelativeVolumeListBlockVolume, operation: (blockLocation: minecraftserver.Vector3) => void): Promise<void>
Executes an operation over a selection via chunks to allow splitting operation over multiple game ticks
Parameters
volume: RelativeVolumeListBlockVolume
operation: (blockLocation: minecraftserver.Vector3) => void
the operation to apply over each block location
Returns Promise<void>
executeLargeOperationFromIterator
executeLargeOperationFromIterator(blockLocationIterator: minecraftserver.BlockLocationIterator, operation: (blockLocation: minecraftserver.Vector3) => void): Promise<void>
Executes an operation over a BlockLocationIterator via chunks to allow splitting operation over multiple game ticks
Parameters
blockLocationIterator: minecraftserver.BlockLocationIterator
the selection to iterator over
operation: (blockLocation: minecraftserver.Vector3) => void
the operation to apply over each block location
Returns Promise<void>
getDefaultAllowBlockList
getDefaultAllowBlockList(): string[]
Returns a string array of the default block types for editor operations. Can be used to further filter blocks. This will throw if called in early execution.
Returns string[] - Default allowed block list
getDefaultBrushShapes
getDefaultBrushShapes(excludeList: CoreBrushShapeType[]): BrushShape[]
Returns a list of default core brush shapes
Parameters
excludeList: CoreBrushShapeType[]
List of shape types to exclude
Returns BrushShape[]
makeObservable
makeObservable(initialValue: T, validator: ObservableValidator<T>): IObservable<T>
Creates an observable object that stores a value state.
Parameters
initialValue: T
Initial value of the observable.
validator: ObservableValidator<T>
Optional validator to use for the setter.
Returns IObservable<T>
registerEditorExtension
registerEditorExtension(extensionName: string, activationFunction: ActivationFunctionType<PerPlayerStorageType>, shutdownFunction: ShutdownFunctionType<PerPlayerStorageType>, options: IRegisterExtensionOptionalParameters): Extension
Registers an editor extension into Minecraft. This function calls underlying functionality to register an extension but provides helpful and contextual wrappers for individual client lifetimes. The onActivation function is called whenever a client joins a session, while the shutdown is called when a client leaves. There may be other circumstances in which these are called as well based on client state that is an implementation detail of the system.
Parameters
- extensionName: string
- activationFunction: ActivationFunctionType<PerPlayerStorageType>
- shutdownFunction: ShutdownFunctionType<PerPlayerStorageType>
- options: IRegisterExtensionOptionalParameters
Returns Extension
registerSerializationForType
registerSerializationForType(typeConstructor: Function, name: string, serializer: (obj: T) => Record<string, unknown>, deserializer: (vals: Record<string, unknown>) => T): void
Register a type to have custom serialization/deserialization when using {@link serialize} and {@link deserialize}.
Parameters
- typeConstructor: Function
- name: string
- serializer: (obj: T) => Record<string, unknown>
- deserializer: (vals: Record<string, unknown>) => T
Returns void
registerUserDefinedTransactionHandler
registerUserDefinedTransactionHandler(transactionManager: TransactionManager, undoHandler: (payload: T) => void, redoHandler: (payload: T) => void): UserDefinedTransactionHandle<T>
Creates a strongly typed transaction handle to enforce type safety when adding user defined transactions. This function is a wrapper around the more generalized transaction manager API for script based transactions. Any Editor Extension that needs to insert data into the transaction log for undo/redo should use this function to create a handler for the specific type of data that needs to be inserted. When a transaction is undone/redone, the associated handler function will be invoked with a copy of the payload data that was inserted into the log. As a general rule, transaction data should contain 2 things:
1. The data that will be used to perform the operation we're trying to record
2. The data that will be used to restore the state of the program to what it was before the operation.
NOTE/WARNING:
The payload data is serialized to JSON before being inserted into the transaction log and the underlying implementation uses the JSON.stringify() function to serialize the data. Any non-primitive data, such as classes or minecraft native objects will not serialize to JSON properly, so you should avoid using them as payload data.
Parameters
transactionManager: TransactionManager
A reference to the TransactionManager (from the extension context for your extension)
undoHandler: (payload: T) => void
A function that will be invoked when the transaction is undone. The function will be passed a copy of the payload data that was inserted into the transaction log.
redoHandler: (payload: T) => void
A function that will be invoked when the transaction is redone. The function will be passed a copy of the payload data that was inserted into the transaction log.
Returns UserDefinedTransactionHandle<T> - - {@link UserDefinedTransactionHandle} - A strongly typed transaction handle that can be used to add transactions to the transaction manager.
serialize
serialize(obj: unknown): string
Serialize anything, defaults to the same behavior as JSON.stringify but will use custom serializers passed into {@link registerSerializationForType}.
Parameters
- obj: unknown
Returns string
stringFromException
stringFromException(e: unknown): string
Small utility for getting a string from an unknown exception type
Parameters
- e: unknown
Returns string
Objects
editor
static read-only editor: MinecraftEditor;
Type: MinecraftEditor