### startBuild Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer Starts the build action for the simulated player. ```APIDOC ## startBuild ### Description Starts the build action for the simulated player. ### Method `startBuild(slot?: number): void` ### Parameters #### Path Parameters - **slot** (number) - Optional - The slot to use for building. Defaults to 0. ### Notes - This function can't be called in restricted-execution mode. - This function can throw errors. ``` -------------------------------- ### Example: Give a Damaged Diamond Sword Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/itemstack This example demonstrates how to create a diamond sword, set its durability to half, and add it to a player's inventory. It requires importing several components from '@minecraft/server' and '@minecraft/vanilla-data'. ```typescript import { world, ItemStack, EntityInventoryComponent, EntityComponentTypes, ItemComponentTypes, ItemDurabilityComponent, DimensionLocation, } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function giveHurtDiamondSword(targetLocation: DimensionLocation) { const hurtDiamondSword = new ItemStack(MinecraftItemTypes.DiamondSword); const durabilityComponent = hurtDiamondSword.getComponent(ItemComponentTypes.Durability) as ItemDurabilityComponent; if (durabilityComponent !== undefined) { durabilityComponent.damage = durabilityComponent.maxDurability / 2; } for (const player of world.getAllPlayers()) { const inventory = player.getComponent(EntityComponentTypes.Inventory) as EntityInventoryComponent; if (inventory && inventory.container) { inventory.container.addItem(hurtDiamondSword); } } } ``` -------------------------------- ### addGuideComponent Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/widget Adds a guide component to a widget, which can be used for visual guides or markers. ```APIDOC ## addGuideComponent ### Description Adds a guide component to a widget, which can be used for visual guides or markers. ### Method `addGuideComponent(componentName: string, options?: WidgetComponentGuideOptions): WidgetComponentGuide` ### Parameters #### Path Parameters * **componentName** (string) - Required - The name of the component. * **options** (WidgetComponentGuideOptions) - Optional - Additional options for the guide component. ### Returns WidgetComponentGuide ### Notes * This function can't be called in restricted-execution mode. * This function can throw errors. ``` -------------------------------- ### tripWireTripEvent.ts Example Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/tripwiretripafterevent This TypeScript example demonstrates how to subscribe to the `world.afterEvents.tripWireTrip` event and access the `TripWireTripAfterEvent` object to log information about the trip wire event. ```TypeScript import { world, system, BlockPermutation, TripWireTripAfterEvent, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function tripWireTripEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // set up a tripwire const redstone = targetLocation.dimension.getBlock({ x: targetLocation.x, y: targetLocation.y - 1, z: targetLocation.z, }); const tripwire = targetLocation.dimension.getBlock(targetLocation); if (redstone === undefined || tripwire === undefined) { log('Could not find block at location.'); return -1; } redstone.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.RedstoneBlock)); tripwire.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.TripWire)); world.afterEvents.tripWireTrip.subscribe((tripWireTripEvent: TripWireTripAfterEvent) => { const eventLoc = tripWireTripEvent.block.location; if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y && eventLoc.z === targetLocation.z) { log( 'Tripwire trip event at tick ' + system.currentTick + (tripWireTripEvent.sources.length > 0 ? ' by entity ' + tripWireTripEvent.sources[0].id : '') ); } }); } ``` -------------------------------- ### getPresets Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/aimassistregistry Gets all available presets in the registry. ```APIDOC ## getPresets ### Description Gets all available presets in the registry. ### Method `getPresets(): AimAssistPreset[]` ### Returns _AimAssistPreset_[] - An array of all available preset objects. ``` -------------------------------- ### ItemDurabilityComponent Example Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/itemdurabilitycomponent Example of how to use the ItemDurabilityComponent to set an item's damage. ```APIDOC ## Examples ##### _**giveHurtDiamondSword.ts**_ TypeScript Copy ```typescript import { world, ItemStack, EntityInventoryComponent, EntityComponentTypes, ItemComponentTypes, ItemDurabilityComponent, DimensionLocation, } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function giveHurtDiamondSword(targetLocation: DimensionLocation) { const hurtDiamondSword = new ItemStack(MinecraftItemTypes.DiamondSword); const durabilityComponent = hurtDiamondSword.getComponent(ItemComponentTypes.Durability) as ItemDurabilityComponent; if (durabilityComponent !== undefined) { durabilityComponent.damage = durabilityComponent.maxDurability / 2; } for (const player of world.getAllPlayers()) { const inventory = player.getComponent(EntityComponentTypes.Inventory) as EntityInventoryComponent; if (inventory && inventory.container) { inventory.container.addItem(hurtDiamondSword); } } } ``` ``` -------------------------------- ### Minibiomes Test Example - TypeScript Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/test An example demonstrating spawning entities, setting block types, and adding riders to a minecart within a GameTest. It includes registering the test and specifying its structure and maximum tick count. ```typescript import { EntityComponentTypes } from '@minecraft/server'; import { Test, register } from '@minecraft/server-gametest'; import { MinecraftBlockTypes, MinecraftEntityTypes } from '@minecraft/vanilla-data'; function minibiomes(test: Test) { const minecart = test.spawn(MinecraftEntityTypes.Minecart, { x: 9, y: 7, z: 7 }); const pig = test.spawn(MinecraftEntityTypes.Pig, { x: 9, y: 7, z: 7 }); test.setBlockType(MinecraftBlockTypes.Cobblestone, { x: 10, y: 7, z: 7 }); const minecartRideableComp = minecart.getComponent(EntityComponentTypes.Rideable); minecartRideableComp?.addRider(pig); test.succeedWhenEntityPresent(MinecraftEntityTypes.Pig, { x: 8, y: 3, z: 1 }, true); } register('ChallengeTests', 'minibiomes', minibiomes).structureName('gametests:minibiomes').maxTicks(160); ``` -------------------------------- ### startup Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/systembeforeevents Fires before the server starts up. This event can be used to potentially cancel or modify the startup process. ```APIDOC ## startup ### Description Fires before the server starts up. This event can be used to potentially cancel or modify the startup process. ### Type `StartupBeforeEventSignal` ### Notes * This property can be read in early-execution mode. ``` -------------------------------- ### Get All Speed Settings Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/speedsettings Retrieves all available speed settings. Use this to get a snapshot of all current speed configurations. ```typescript getAll(): SpeedSettingsPropertyTypeMap; ``` -------------------------------- ### Show Favorite Month Form Example Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-ui/actionformresponse An example of creating an Action Form to ask the player about their favorite month and logging a specific response if they select 'April'. This showcases conditional logic based on player selection. ```TypeScript import { world, DimensionLocation } from '@minecraft/server'; import { ActionFormData, ActionFormResponse } from '@minecraft/server-ui'; function showFavoriteMonth(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); if (players.length >= 1) { const form = new ActionFormData() .title('Months') .body('Choose your favorite month!') .button('January') .button('February') .button('March') .button('April') .button('May'); form.show(players[0]).then((response: ActionFormResponse) => { if (response.selection === 3) { log('I like April too!'); return -1; } }); } } ``` -------------------------------- ### getTotalXp Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/player Gets the total experience points of the player. ```APIDOC ## getTotalXp ### Description Gets the total experience of the Player. ### Method `getTotalXp(): number` ### Response #### Success Response (number) - **Returns** (number) ### Notes - This function can throw errors. ``` -------------------------------- ### get Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/audiosettings Retrieves the value of a specific audio setting property. ```APIDOC ## get ### Description Retrieves the value of a specific audio setting property. ### Method `get(property: T): AudioSettingsPropertyTypeMap[T] | undefined` ### Parameters #### Path Parameters * **property** (T) - Required - The name of the audio setting property to retrieve. ### Response #### Success Response - **(AudioSettingsPropertyTypeMap[T] | undefined)** - The value of the specified audio setting property, or undefined if the property does not exist. ``` -------------------------------- ### setSpawnPoint Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/player Sets the current starting spawn point for a specific player. ```APIDOC ## setSpawnPoint ### Description Sets the current starting spawn point for this particular player. ### Method `setSpawnPoint(spawnPoint?: DimensionLocation): void` ### Parameters #### Path Parameters * **spawnPoint** (DimensionLocation) - Optional. The location to set as the spawn point. ### Notes * This function can't be called in restricted-execution mode. * This function can throw errors, including `LocationOutOfWorldBoundariesError`. ``` -------------------------------- ### itemStartUse Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/worldafterevents This event fires when a chargeable item starts charging. It can be read in early-execution mode. ```APIDOC ## itemStartUse ### Description This event fires when a chargeable item starts charging. ### Type `ItemStartUseAfterEventSignal` ### Notes * This property can be read in early-execution mode. ``` -------------------------------- ### get Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/structuremanager Gets a Structure that is saved to memory or the world. ```APIDOC ## get ### Description Gets a Structure that is saved to memory or the world. ### Method `get(identifier: string): Structure | undefined` ### Parameters #### Path Parameters * **identifier** (string) - Required - The name of the structure to get. ### Returns * **Structure | undefined** - Returns a Structure if it exists, otherwise undefined. ### Notes * This function can't be called in restricted-execution mode. ``` -------------------------------- ### activateTutorial Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/builtinuimanager Activates the tutorial overlay for the player's UI session. ```APIDOC ## activateTutorial ### Description Activates tutorial overlay. ### Method `activateTutorial(): void` ### Returns _void_ ``` -------------------------------- ### navigateToSamples Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/builtinuimanager Navigates the player's UI session to the GitHub samples site. ```APIDOC ## navigateToSamples ### Description Navigates to the github-samples site. ### Method `navigateToSamples(): void` ### Returns _void_ ``` -------------------------------- ### Start Alignment Constant Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/layoutalignment Represents the starting edge for UI element alignment. ```javascript Start = 0 ``` -------------------------------- ### Show Action Form Example Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-ui/actionformresponse Demonstrates how to create and display an Action Form to a player and log their selection or if they canceled the form. This is useful for creating interactive menus or prompts for players. ```TypeScript import { world, DimensionLocation } from '@minecraft/server'; import { ActionFormData, ActionFormResponse } from '@minecraft/server-ui'; function showActionForm(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const playerList = world.getPlayers(); if (playerList.length >= 1) { const form = new ActionFormData() .title('Test Title') .body('Body text here!') .button('btn 1') .button('btn 2') .button('btn 3') .button('btn 4') .button('btn 5'); form.show(playerList[0]).then((result: ActionFormResponse) => { if (result.canceled) { log('Player exited out of the dialog. Note that if the chat window is up, dialogs are automatically canceled.'); return -1; } else { log('Your result was: ' + result.selection); } }); } } ``` -------------------------------- ### getAll Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/audiosettings Retrieves all audio setting properties and their values. ```APIDOC ## getAll ### Description Retrieves all audio setting properties and their values. ### Method `getAll(): AudioSettingsPropertyTypeMap` ### Response #### Success Response - **(AudioSettingsPropertyTypeMap)** - An object containing all audio setting properties and their current values. ``` -------------------------------- ### Get a Specific Block State Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/blockstates Use the `get` static method to retrieve a specific block state instance by its name. Returns undefined if the state is not found. ```typescript static get(stateName: string): BlockStateType | undefined; ``` -------------------------------- ### constructor Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/aimassistpresetsettings Initializes a new AimAssistPresetSettings object with a unique identifier. The identifier must include a namespace. ```APIDOC ## constructor ### Description Constructor that takes a unique Id to associate with the created AimAssistPreset. Must have a namespace. ### Parameters * **identifier** (string) - The unique identifier for the AimAssistPreset. ### Returns AimAssistPresetSettings ``` -------------------------------- ### Logging Entity Spawns Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/entityspawnafterevent This example demonstrates how to subscribe to the entitySpawn event and log information about newly spawned entities. It also includes a timeout to spawn a horse entity for testing purposes. ```TypeScript import { world, system, EntitySpawnAfterEvent, DimensionLocation } from '@minecraft/server'; import { Vector3Utils } from '@minecraft/math'; function logEntitySpawnEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // register a new function that is called when a new entity is created. world.afterEvents.entitySpawn.subscribe((entityEvent: EntitySpawnAfterEvent) => { if (entityEvent && entityEvent.entity) { log(`New entity of type ${entityEvent.entity.typeId} created!`, 1); } else { log(`The entity event did not work as expected.`, -1); } }); system.runTimeout(() => { targetLocation.dimension.spawnEntity( 'minecraft:horse', Vector3Utils.add(targetLocation, { x: 0, y: 1, z: 0 }) ); }, 20); } ``` -------------------------------- ### Get First Hotbar Item Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/container Retrieves the first item from a player's hotbar. This function iterates through players and accesses their inventory container to get the item at slot 0. ```typescript import { world, EntityInventoryComponent, DimensionLocation } from '@minecraft/server'; function getFirstHotbarItem(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { for (const player of world.getAllPlayers()) { const inventory = player.getComponent(EntityInventoryComponent.componentId) as EntityInventoryComponent; if (inventory && inventory.container) { const firstItem = inventory.container.getItem(0); if (firstItem) { log('First item in hotbar is: ' + firstItem.typeId); } return inventory.container.getItem(0); } return undefined; } } ``` -------------------------------- ### createIntroductionPane Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/ipanemanager Creates a pane to be shown on the introduction window. It takes an IIntroductionPaneOptions object and returns an IIntroductionPane. ```APIDOC ## createIntroductionPane ### Description Create a pane to be shown on the introduction window. ### Method createIntroductionPane ### Parameters #### Path Parameters * **options** (IIntroductionPaneOptions) - Required - The options for the introduction pane. ### Response #### Success Response * **IIntroductionPane** - The created introduction pane. ``` -------------------------------- ### beginPlaytest Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/playtestmanager Initiates a playtest session with the specified game options. This method returns a promise that resolves with the result of the playtest session. It cannot be called in restricted-execution mode and may throw errors. ```APIDOC ## beginPlaytest ### Description Initiates a playtest session with the specified game options. This method returns a promise that resolves with the result of the playtest session. It cannot be called in restricted-execution mode and may throw errors. ### Method `beginPlaytest(options: GameOptions): Promise` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **options** (GameOptions) - Required - The game options for the playtest session. ### Request Example ```json { "options": { ... } } ``` ### Response #### Success Response (Promise) * **PlaytestSessionResult** - The result of the playtest session. #### Response Example ```json { "result": "..." } ``` ``` -------------------------------- ### getDifficulty Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/world Gets the difficulty from the world. ```APIDOC ## getDifficulty getDifficulty(): Difficulty ### Description Gets the difficulty from the world. ### Returns - Difficulty - Returns the world difficulty. ``` -------------------------------- ### playerSwingStart Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/worldafterevents This signal can be read in early-execution mode. ```APIDOC ## playerSwingStart ### Type PlayerSwingStartAfterEventSignal ### Notes * This property can be read in early-execution mode. ``` -------------------------------- ### ItemStartUseAfterEvent Properties Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/itemstartuseafterevent This class contains properties that describe the event of a chargeable item starting its use cycle. ```APIDOC ## Class: ItemStartUseAfterEvent ### Description Contains information related to a chargeable item starting to be charged. ### Properties #### itemStack `read-only itemStack: ItemStack;` - **Description**: The impacted item stack that is starting to be charged. - **Type**: ItemStack #### source `read-only source: Player;` - **Description**: Returns the source entity that triggered this item event. - **Type**: Player #### useDuration `read-only useDuration: number;` - **Description**: Returns the time, in ticks, for the remaining duration left before the charge completes its cycle. - **Type**: number ``` -------------------------------- ### constructor Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/aimassistcategorysettings Initializes a new AimAssistCategorySettings object with a unique identifier. ```APIDOC ## constructor AimAssistCategorySettings ### Description Constructor that takes a unique Id to associate with the created AimAssistCategory. Must have a namespace. ### Parameters * **identifier** (string) - Description of the identifier parameter. ### Returns AimAssistCategorySettings ``` -------------------------------- ### undoSize Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/transactionmanager Gets the number of operations that can be undone. ```APIDOC ## undoSize ### Description Gets the number of operations that can be undone. ### Method `undoSize(): number` ### Returns * **number** - The number of undoable operations. ### Notes * This function can't be called in restricted-execution mode. * This function can throw errors. ``` -------------------------------- ### beginExportProject Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/exportmanager Initiates the export of the current project with specified game options. This function cannot be called in restricted-execution mode and may throw errors. ```APIDOC ## beginExportProject ### Description Initiates the export of the current project with specified game options. ### Method `beginExportProject(options: GameOptions): Promise` ### Parameters #### Path Parameters - **options** (GameOptions) - Required - The game options to use for the export. ### Returns Promise<_ExportResult_> ### Notes - This function can't be called in restricted-execution mode. - This function can throw errors. ``` -------------------------------- ### redoSize Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/transactionmanager Gets the number of operations that can be redone. ```APIDOC ## redoSize ### Description Gets the number of operations that can be redone. ### Method `redoSize(): number` ### Returns * **number** - The number of redoable operations. ### Notes * This function can't be called in restricted-execution mode. * This function can throw errors. ``` -------------------------------- ### IntroductionPaneTabProps Interface Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/introductionpanetabprops Defines the properties for configuring an introduction pane tab, including its label, icon, content, and unique identifier. ```APIDOC ## Interface: IntroductionPaneTabProps ### Description Properties for introduction pane tabs. ### Properties #### **contentHeader** - **Type**: LocalizedString - **Optional**: Yes - **Description**: Optional header for the tab content. #### **contentImage** - **Type**: string - **Optional**: Yes - **Description**: Optional image for the tab content. #### **icon** - **Type**: string - **Optional**: Yes - **Description**: Icon for the tab. #### **id** - **Type**: string - **Required**: Yes - **Description**: Unique identifier for the tab. #### **label** - **Type**: LocalizedString - **Required**: Yes - **Description**: Localized title of the tab. ``` -------------------------------- ### name Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/player Gets the player's name. ```APIDOC ## name ### Description Read-only property for the name of the player. ### Type string ### Notes This property can throw errors when used. ``` -------------------------------- ### addExperience Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/player Adds or removes experience from the player and returns their current experience. ```APIDOC ## addExperience ### Description Adds/removes experience to/from the Player and returns the current experience of the Player. ### Method `addExperience(amount: number): number` ### Parameters #### Path Parameters - **amount** (number) - Required - Amount of experience to add. Note that this can be negative. Min/max bounds at -2^24 ~ 2^24 ### Response #### Success Response (number) - **Returns** (number) - Returns the current experience of the Player. ### Notes - This function can't be called in restricted-execution mode. - This function can throw errors. ``` -------------------------------- ### showKeyboardSettings Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/builtinuimanager Displays the Keyboard Settings modal to the player. ```APIDOC ## showKeyboardSettings ### Description Shows the Keyboard Settings modal. ### Method `showKeyboardSettings(): void` ### Returns _void_ ``` -------------------------------- ### createSettingsPane Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/pyramidbrushshape Creates a settings pane for the PyramidBrushShape, allowing users to adjust its properties. ```APIDOC ## createSettingsPane `createSettingsPane(parentPane: IPropertyPane, onSettingsChange?: () => void, flatLayout?: boolean): ISubPanePropertyItem` ### Parameters * **parentPane** : _IPropertyPane_ * **onSettingsChange**?: () => _void_ * **flatLayout**?: _boolean_ ``` -------------------------------- ### getCategories Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/aimassistregistry Gets all available categories in the registry. ```APIDOC ## getCategories ### Description Gets all available categories in the registry. ### Method `getCategories(): AimAssistCategory[]` ### Returns _AimAssistCategory_[] - An array of all available category objects. ``` -------------------------------- ### getItemByIndex Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/icollectiontreeentry Gets the tree entry item by index. ```APIDOC ## getItemByIndex `getItemByIndex(index: number): ICollectionTreeEntryItem | undefined` Gets the tree entry item by index #### **Parameters** * **index** : _number_ Index of the entry item **Returns** _ICollectionTreeEntryItem_ | _undefined_ ``` -------------------------------- ### navigateToDocumentation Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/builtinuimanager Navigates the player's UI session to the official documentation site. ```APIDOC ## navigateToDocumentation ### Description Navigates to the documentation site. ### Method `navigateToDocumentation(): void` ### Returns _void_ ``` -------------------------------- ### getSelectedBlockType Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/blockpalettemanager Gets the type of the currently selected block. ```APIDOC ## getSelectedBlockType ### Description Gets the type of the currently selected block. ### Method `getSelectedBlockType(): minecraftserver.BlockType` ### Returns - @minecraft/server.BlockType - The BlockType of the selected block. ### Notes - This function can throw errors. ``` -------------------------------- ### getAll Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/speedsettings Retrieves all available speed setting properties and their values. ```APIDOC ## getAll ### Description Retrieves all available speed setting properties and their values. ### Method `getAll(): SpeedSettingsPropertyTypeMap` ### Response #### Success Response - **all properties** (SpeedSettingsPropertyTypeMap) - An object containing all speed settings and their values. ### Response Example ```json { "example": "{\"property1\": \"value1\", \"property2\": \"value2\"}" } ``` ``` -------------------------------- ### Play Music and Sound in Minecraft Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/player Demonstrates playing music and sounds for a specific player and the world. Includes options for music looping, fading, volume, and sound pitch. Requires importing necessary modules from '@minecraft/server'. ```TypeScript import { world, MusicOptions, WorldSoundOptions, PlayerSoundOptions, DimensionLocation } from '@minecraft/server'; function playMusicAndSound(targetLocation: DimensionLocation) { const players = world.getPlayers(); const musicOptions: MusicOptions = { fade: 0.5, loop: true, volume: 1.0, }; world.playMusic('music.menu', musicOptions); const worldSoundOptions: WorldSoundOptions = { pitch: 0.5, volume: 4.0, }; world.playSound('ambient.weather.thunder', targetLocation, worldSoundOptions); const playerSoundOptions: PlayerSoundOptions = { pitch: 1.0, volume: 1.0, }; players[0].playSound('bucket.fill_water', playerSoundOptions); } ``` -------------------------------- ### getPaletteIdList Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/blockpalettemanager Gets a list of all available palette IDs. ```APIDOC ## getPaletteIdList ### Description Gets a list of all available palette IDs. ### Method `getPaletteIdList(): string[]` ### Returns - string[] - An array of strings, where each string is a palette ID. ``` -------------------------------- ### createSettingsPane Method Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/brushshape Creates a settings pane for the brush shape, allowing users to configure its properties. It can optionally take a callback for when settings change. ```APIDOC ## createSettingsPane(parentPane: IPropertyPane, onSettingsChange?: () => void, flatLayout?: boolean) ### Description Creates a settings pane for the brush shape. ### Parameters * **parentPane** (IPropertyPane) - The parent pane to which this settings pane will be attached. * **onSettingsChange**? (function) - Optional callback function to be executed when settings change. * **flatLayout**? (boolean) - Optional flag to determine if the layout should be flat. ### Returns * **ISubPanePropertyItem | undefined** - The created settings pane item or undefined if it could not be created. ``` -------------------------------- ### AimAssistPreset Class Methods Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/aimassistpreset This section details the methods available on the AimAssistPreset class for retrieving various aim-assist targeting configurations. ```APIDOC ## AimAssistPreset Class Methods ### getExcludedBlockTagTargets Gets the list of block tags to exclude from aim assist targeting. **Returns** `string[]` - The array of block tags. ### getExcludedBlockTargets Gets the list of block Ids to exclude from aim assist targeting. **Returns** `string[]` - The array of block Ids. ### getExcludedEntityTargets Gets the list of entity Ids to exclude from aim assist targeting. **Returns** `string[]` - The array of entity Ids. ### getExcludedEntityTypeFamilyTargets Gets the list of entity type families to exclude from aim assist targeting. **Returns** `string[]` - The array of entity type families. ### getItemSettings Gets the per-item aim-assist category Ids. **Returns** `Record` - The record mapping item Ids to aim-assist category Ids. ### getLiquidTargetingItems Gets the list of item Ids that will target liquid blocks with aim-assist when being held. **Returns** `string[]` - The array of item Ids. ``` -------------------------------- ### getPing Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/player Gets the player's ping in milliseconds. ```APIDOC ## getPing ### Description Gets the player's ping in milliseconds. ### Method `getPing(): number` ### Response #### Success Response (number) - **Returns** (number) - The player's ping in milliseconds. ### Caution This function is still in pre-release. Its signature may change or it may be removed in future releases. ### Notes - This function can throw errors. * Throws _@minecraft/common.EngineError_, _InvalidEntityError_ ``` -------------------------------- ### beginPainting Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/brushshapemanager Begins the painting operation. This function cannot be called in restricted-execution mode and can throw errors. ```APIDOC ## beginPainting ### Description Begins the painting operation. ### Method `beginPainting(onComplete: (arg0: PaintCompletionState) => void): void` ### Parameters #### Callback * **onComplete** : (arg0: _PaintCompletionState_) => _void_ ### Notes This function can't be called in restricted-execution mode. This function can throw errors. ``` -------------------------------- ### getState Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/blockpermutation Gets a specific block state for the permutation. ```APIDOC ## getState `getState(stateName: T): minecraftvanilladata.BlockStateSuperset[T] | undefined` Gets a state for the permutation. ### Parameters * **stateName** : _T_ Name of the block state who's value is to be returned. **Returns** _minecraftvanilladata.BlockStateSuperset[T]_ | _undefined_ - Returns the state if the permutation has it, else `undefined`. ``` -------------------------------- ### swim Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer Causes the simulated player to start swimming. ```APIDOC ## swim ### Description Causes the simulated player to start swimming. ### Method `swim(): void` ### Parameters None ### Response None ### Notes * This function can't be called in restricted-execution mode. * This function can throw errors. ``` -------------------------------- ### getSettings Method Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/cuboidbrushshape Retrieves the current settings of the CuboidBrushShape. ```APIDOC ## getSettings `getSettings(): CuboidBrushShapeSettings` ### Description Retrieves the current settings of the CuboidBrushShape. ### Returns _CuboidBrushShapeSettings_ ``` -------------------------------- ### isMeMarkerShown Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/iminimappropertyitem Gets the visibility status of the 'me' marker on the minimap. ```APIDOC ## isMeMarkerShown ### Description Get me marker visibility. ### Method `isMeMarkerShown(): boolean` ### Returns _boolean_ ``` -------------------------------- ### StartupEvent Properties Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/startupevent This class has several read-only properties that provide access to different registries. ```APIDOC ## StartupEvent Class ### Properties #### blockComponentRegistry `read-only blockComponentRegistry: BlockComponentRegistry;` Type: _BlockComponentRegistry_ Notes: * This property can be read in early-execution mode. #### customCommandRegistry `read-only customCommandRegistry: CustomCommandRegistry;` Type: _CustomCommandRegistry_ Notes: * This property can be read in early-execution mode. #### dimensionRegistry `read-only dimensionRegistry: DimensionRegistry;` Type: _DimensionRegistry_ Notes: * This property can be read in early-execution mode. #### itemComponentRegistry `read-only itemComponentRegistry: ItemComponentRegistry;` Type: _ItemComponentRegistry_ Notes: * This property can be read in early-execution mode. ``` -------------------------------- ### subscribe Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/startupbeforeeventsignal Subscribes a callback function to be executed when the startup event is triggered. The callback receives a StartupEvent object and is executed with early-execution privilege. This method cannot be called in restricted-execution mode. ```APIDOC ## subscribe ### Description Subscribes a callback function to be executed when the startup event is triggered. The callback receives a StartupEvent object and is executed with early-execution privilege. This method cannot be called in restricted-execution mode. ### Method Signature `subscribe(callback: (arg0: StartupEvent) => void): (arg0: StartupEvent) => void` ### Parameters #### callback - **callback** : `(arg0: StartupEvent) => void` - This closure is called with early-execution privilege. ### Returns - `(arg0: StartupEvent) => void` - The returned closure is called with early-execution privilege. ### Notes - This function can't be called in restricted-execution mode. - This function can be called in early-execution mode. ``` -------------------------------- ### getRay Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/cursor Gets the raycast information from the 3D block cursor. ```APIDOC ### **getRay** `getRay(): CursorRay` **Returns** _CursorRay_ Notes: * This function can't be called in restricted-execution mode. * This function can throw errors. ``` -------------------------------- ### getPosition Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/cursor Gets the world position of the 3D block cursor. ```APIDOC ### **getPosition** `getPosition(): minecraftserver.Vector3` Get the world position of the 3D block cursor **Returns** _@minecraft/server.Vector3_ Notes: * This function can't be called in restricted-execution mode. * This function can throw errors. ``` -------------------------------- ### createSettingsPane Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/ellipsoidbrushshape Creates a settings pane for the EllipsoidBrushShape, allowing for UI-based configuration. ```APIDOC ## createSettingsPane ### Description Creates a settings pane for the EllipsoidBrushShape, allowing for UI-based configuration. ### Signature `createSettingsPane(parentPane: IPropertyPane, onSettingsChange?: () => void, flatLayout?: boolean): ISubPanePropertyItem` ### Parameters #### parentPane - **parentPane** (IPropertyPane) - Required #### onSettingsChange - **onSettingsChange** (function) - Optional #### flatLayout - **flatLayout** (boolean) - Optional ### Returns - **ISubPanePropertyItem** ``` -------------------------------- ### getEntity Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/world Gets an entity from the world. This function can throw errors. ```APIDOC ## getEntity getEntity(entityId: string): Entity ### Description Gets an entity from the world. ### Parameters #### Parameters - **entityId** (string) - Required - The ID of the entity. ### Returns - Entity - The entity with the given ID. ### Notes - This function can throw errors. ``` -------------------------------- ### forEachFolder Method Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/icollectiontreepropertyitem Iterates over the first layer of folders. ```APIDOC ## forEachFolder `forEachFolder(callback: (arg0: ICollectionTreeFolder) => boolean): void` Iterates over the first layer of folders #### Parameters * **callback** : (arg0: _ICollectionTreeFolder_) => _boolean_ Returning false will stop the iteration **Returns** _void_ ``` -------------------------------- ### getSelectedItem Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/blockpalettemanager Gets the currently selected item in the block palette. ```APIDOC ## getSelectedItem ### Description Gets the currently selected item in the block palette. ### Method `getSelectedItem(): IBlockPaletteItem` ### Returns - IBlockPaletteItem - The currently selected IBlockPaletteItem. ``` -------------------------------- ### createRootPane Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/ipanemanager Creates a root pane. It takes an IRootPropertyPaneOptions object and returns an IRootPropertyPane. ```APIDOC ## createRootPane ### Description Create a root pane. ### Method createRootPane ### Parameters #### Path Parameters * **options** (IRootPropertyPaneOptions) - Required - The options for the root pane. ### Response #### Success Response * **IRootPropertyPane** - The created root pane. ``` -------------------------------- ### getPrimaryPalette Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/blockpalettemanager Gets the currently set primary block palette. ```APIDOC ## getPrimaryPalette ### Description Gets the currently set primary block palette. ### Method `getPrimaryPalette(): BlockPalette` ### Returns - BlockPalette - The primary BlockPalette object. ``` -------------------------------- ### getSettings Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/pyramidbrushshape Retrieves the current settings of the PyramidBrushShape. ```APIDOC ## getSettings `getSettings(): PyramidBrushShapeSettings` ``` -------------------------------- ### getSpawnPoint Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/player Gets the player's current spawn point. ```APIDOC ## getSpawnPoint ### Description Gets the current spawn point of the player. ### Method `getSpawnPoint(): DimensionLocation | undefined` ### Response #### Success Response (DimensionLocation | undefined) - **Returns** (DimensionLocation | undefined) ### Notes - This function can throw errors. ``` -------------------------------- ### Show Basic Modal Form with Various Controls Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-ui/modalformresponse Demonstrates how to create a modal form with different control types (toggle, slider, dropdown, text field) and display it to a player. Handles the form submission and logs the results or any errors. ```TypeScript import { world, DimensionLocation } from '@minecraft/server'; import { ModalFormData } from '@minecraft/server-ui'; function showBasicModalForm(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); const modalForm = new ModalFormData().title('Example Modal Controls for §o§7ModalFormData§r'); modalForm.toggle('Toggle w/o default'); modalForm.toggle('Toggle w/ default', true); modalForm.slider('Slider w/o default', 0, 50, 5); modalForm.slider('Slider w/ default', 0, 50, 5, 30); modalForm.dropdown('Dropdown w/o default', ['option 1', 'option 2', 'option 3']); modalForm.dropdown('Dropdown w/ default', ['option 1', 'option 2', 'option 3'], 2); modalForm.textField('Input w/o default', 'type text here'); modalForm.textField('Input w/ default', 'type text here', 'this is default'); modalForm .show(players[0]) .then(formData => { players[0].sendMessage(`Modal form results: ${JSON.stringify(formData.formValues, undefined, 2)}`); }) .catch((error: Error) => { log('Failed to show form: ' + error); return -1; }); } ``` -------------------------------- ### playerPermissionLevel Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/player Gets the player's current permission level. ```APIDOC ## playerPermissionLevel ### Description Read-only property for the player's permission level. ### Type PlayerPermissionLevel ### Notes This property can throw errors when used. * Throws _InvalidEntityError_ ``` -------------------------------- ### Show Form Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-ui/modalformdata Displays the constructed modal form to a player and returns the response. ```APIDOC ## show `show(player: minecraftserver.Player): Promise` Creates and shows this modal popup form. Returns asynchronously when the player confirms or cancels the dialog. #### **Parameters** * **player** : _@minecraft/server.Player_ Player to show this dialog to. **Returns** Promise<_ModalFormResponse_> Notes: * This function can't be called in restricted-execution mode. * This function can throw errors. * Throws _@minecraft/common.EngineError_, _@minecraft/server.InvalidEntityError_, _@minecraft/server.RawMessageError_ ``` -------------------------------- ### getRiders Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/entityrideablecomponent Gets a list of all the entities currently riding this entity. ```APIDOC ## getRiders ### Description Gets a list of the all the entities currently riding this entity. ### Method `getRiders(): Entity[]` ### Returns * **Entity[]** ### Notes * This function can throw errors. ``` -------------------------------- ### Place Items in Chest - TypeScript Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/blockinventorycomponent This example demonstrates how to place items into a chest's inventory. It fetches a block, sets its type to Chest, retrieves the BlockInventoryComponent, and then places a stack of apples into the first slot (index 0) of the inventory container. ```typescript import { ItemStack, BlockInventoryComponent, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes, MinecraftItemTypes } from '@minecraft/vanilla-data'; function placeItemsInChest(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // Fetch block const block = targetLocation.dimension.getBlock(targetLocation); if (!block) { log('Could not find block. Maybe it is not loaded?', -1); return; } // Make it a chest block.setType(MinecraftBlockTypes.Chest); // Get the inventory const inventoryComponent = block.getComponent('inventory') as BlockInventoryComponent; if (!inventoryComponent || !inventoryComponent.container) { log('Could not find inventory component.', -1); return; } const inventoryContainer = inventoryComponent.container; // Set slot 0 to a stack of 10 apples inventoryContainer.setItem(0, new ItemStack(MinecraftItemTypes.Apple, 10)); } ``` -------------------------------- ### getAbsoluteTime Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/world Returns the absolute time since the start of the world. ```APIDOC ## getAbsoluteTime getAbsoluteTime(): number ### Description Returns the absolute time since the start of the world. ### Returns - number - The absolute time since the start of the world. ``` -------------------------------- ### setAll Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/audiosettings Sets multiple audio setting properties to specified values. ```APIDOC ## setAll ### Description Sets multiple audio setting properties to specified values. ### Method `setAll(properties: AudioSettingsPropertyTypeMap): void` ### Parameters #### Path Parameters * **properties** (AudioSettingsPropertyTypeMap) - Required - An object containing the audio setting properties to set and their new values. ### Notes * This function can't be called in restricted-execution mode. * This function can throw errors. ``` -------------------------------- ### getDimension Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/test Gets the dimension of this test. This function can throw GameTestCompletedError or GameTestError. ```APIDOC ## getDimension ### Description Gets the dimension of this test. ### Method `getDimension` ### Returns * **@minecraft/server.Dimension** ### Notes * This function can throw errors (GameTestCompletedError, GameTestError). ``` -------------------------------- ### stringFromException Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/minecraft-server-editor Small utility for getting a string from an unknown exception type. ```APIDOC ## stringFromException ### Description Small utility for getting a string from an unknown exception type. ### Method Signature `stringFromException(e: unknown): string` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **e** : _unknown_ - The exception to convert to a string. ### Returns * **string** - A string representation of the exception. ``` -------------------------------- ### IIntroductionPaneOptions Interface Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/iintroductionpaneoptions Defines the structure for options used to create an introduction pane. It includes a localized title and a unique identifier. ```APIDOC ## IIntroductionPaneOptions Interface ### Description The options to create introduction pane. ### Extends * _IPropertyPaneOptions_ ### Properties #### title `title?: LocalizedString;` Localized title of the property pane Type: _LocalizedString_ #### uniqueId `uniqueId?: string;` Unique identifier for the pane Type: _string_ ``` -------------------------------- ### applySetting Method Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/cuboidbrushshape Applies a set of brush settings to the CuboidBrushShape instance. ```APIDOC ## applySetting `applySetting(brushSettings: CuboidBrushShapeSettings): void` ### Description Applies a set of brush settings to the CuboidBrushShape instance. ### Parameters * **brushSettings** : _CuboidBrushShapeSettings_ ### Returns _void_ ``` -------------------------------- ### isMarkerTypeVisible Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/iminimappropertyitem Gets the visibility status for a specific marker type on the minimap. ```APIDOC ## isMarkerTypeVisible ### Description Get visibility for a specific marker type. ### Method `isMarkerTypeVisible(type: MinimapMarkerType): boolean` ### Parameters #### Path Parameters - **type** (MinimapMarkerType) - Required - The marker type to query. ### Returns _boolean_ ``` -------------------------------- ### getTime Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/icolortimelinepropertyitem Gets the current time value of the color timeline slider. ```APIDOC ## getTime ### Description Retrieves the current time value displayed on the color timeline slider. ### Method `getTime(): number` ### Parameters #### Path Parameters * None #### Query Parameters * None ### Request Example ```json // No request body needed for GET operation ``` ### Response #### Success Response (200) * **number** - The current time value. #### Response Example ```json 10.5 ``` ``` -------------------------------- ### subscribe Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/worldinitializebeforeeventsignal Adds a callback function that will be executed when the world's scripting environment is initialized. The callback receives a WorldInitializeBeforeEvent argument. ```APIDOC ## subscribe ### Description Adds a callback that will be called when the scripting environment is initialized for a World. ### Method subscribe ### Parameters #### callback - **callback** (_WorldInitializeBeforeEvent_) => _void_ - This closure is called with restricted-execution privilege. ### Returns - (_WorldInitializeBeforeEvent_) => _void_ - The returned closure is called with restricted-execution privilege. ### Notes - This function can't be called in restricted-execution mode. - This function can be called in early-execution mode. ``` -------------------------------- ### Get Item Tags Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/itemstack Retrieves all tags associated with this item stack. ```typescript getTags(): string[] ``` -------------------------------- ### Add Tab to Introduction Pane Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/iintroductionpane Use the addTab method to add a new tab to the introduction pane. This method requires IntroductionPaneTabProps and returns an IPropertyPane. ```typescript addTab(props: IntroductionPaneTabProps): IPropertyPane ``` -------------------------------- ### getSelectedKeyframeId Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/ivector3timelineplayerentry Gets the identifier of the currently selected keyframe, or undefined if none is selected. ```APIDOC ## getSelectedKeyframeId ### Description Get the currently selected keyframe identifier for this entry, or undefined if no keyframe in this entry is selected. ### Method getSelectedKeyframeId ### Returns - string | undefined ``` -------------------------------- ### getSettings Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/conebrushshape Retrieves the current settings of the ConeBrushShape. ```APIDOC ## getSettings `getSettings(): ConeBrushShapeSettings` ``` -------------------------------- ### getItemCooldown Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/player Gets the current item cooldown time for a specific cooldown category. ```APIDOC ## getItemCooldown ### Description Gets the current item cooldown time for a particular cooldown category. ### Method `getItemCooldown(cooldownCategory: string): number` ### Parameters #### Path Parameters - **cooldownCategory** (string) - Required - Specifies the cooldown category to retrieve the current cooldown for. ### Response #### Success Response (number) - **Returns** (number) ### Notes - This function can throw errors. ``` -------------------------------- ### ProjectileHitBlockAfterEvent Properties Source: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/projectilehitblockafterevent Access properties of the ProjectileHitBlockAfterEvent to get details about the projectile hit. ```typescript dimension: Dimension; read-only hitVector: Vector3; read-only location: Vector3; read-only projectile: Entity; read-only source?: Entity; ```