--- > AI / 爬虫:本站允许抓取、索引与模型训练(本站原创编排与中文译文,MIT)。引用请保留来源 https://sapi.dogelake.cn/ 。上游 Microsoft / Minecraft 权利仍归原权利人。完整说明:https://sapi.dogelake.cn/ai-use/ url: /server/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/index.md. # Module: server **`Beta`** 包含了大量用于修改 Minecraft 世界(实体、方块、维度等)的类型。 Contains many types related to manipulating a Minecraft world, including entities, blocks, dimensions, and more. Manifest Details ```json { "module_name": "@minecraft/server", "version": "2.10.0-beta" } ``` ## Enumerations - [AimAssistTargetMode](/server/enums/AimAssistTargetMode.md) - [BlockComponentTypes](/server/enums/BlockComponentTypes.md) - [BlockPistonState](/server/enums/BlockPistonState.md) - [BlockVolumeIntersection](/server/enums/BlockVolumeIntersection.md) - [BookErrorReason](/server/enums/BookErrorReason.md) - [ButtonState](/server/enums/ButtonState.md) - [CameraShakeType](/server/enums/CameraShakeType.md) - [CloneMode](/server/enums/CloneMode.md) - [CommandPermissionLevel](/server/enums/CommandPermissionLevel.md) - [ContainerRulesErrorReason](/server/enums/ContainerRulesErrorReason.md) - [ControlScheme](/server/enums/ControlScheme.md) - [CustomCommandErrorReason](/server/enums/CustomCommandErrorReason.md) - [CustomCommandParamType](/server/enums/CustomCommandParamType.md) - [CustomCommandSource](/server/enums/CustomCommandSource.md) - [CustomCommandStatus](/server/enums/CustomCommandStatus.md) - [CustomComponentNameErrorReason](/server/enums/CustomComponentNameErrorReason.md) - [Difficulty](/server/enums/Difficulty.md) - [Direction](/server/enums/Direction.md) - [DisplaySlotId](/server/enums/DisplaySlotId.md) - [DyeColor](/server/enums/DyeColor.md) - [EasingType](/server/enums/EasingType.md) - [EnchantmentSlot](/server/enums/EnchantmentSlot.md) - [EntityAttachPoint](/server/enums/EntityAttachPoint.md) - [EntityComponentTypes](/server/enums/EntityComponentTypes.md) - [EntityDamageCause](/server/enums/EntityDamageCause.md) - [EntityHealCause](/server/enums/EntityHealCause.md) - [EntityInitializationCause](/server/enums/EntityInitializationCause.md) - [EntitySwingSource](/server/enums/EntitySwingSource.md) - [EquipmentSlot](/server/enums/EquipmentSlot.md) - [FluidType](/server/enums/FluidType.md) - [GameMode](/server/enums/GameMode.md) - [GameRule](/server/enums/GameRule.md) - [GraphicsMode](/server/enums/GraphicsMode.md) - [HeldItemOption](/server/enums/HeldItemOption.md) - [HudElement](/server/enums/HudElement.md) - [HudVisibility](/server/enums/HudVisibility.md) - [InputButton](/server/enums/InputButton.md) - [InputMode](/server/enums/InputMode.md) - [InputPermissionCategory](/server/enums/InputPermissionCategory.md) - [ItemComponentTypes](/server/enums/ItemComponentTypes.md) - [ItemLockMode](/server/enums/ItemLockMode.md) - [LiquidSettings](/server/enums/LiquidSettings.md) - [LiquidType](/server/enums/LiquidType.md) - [LocatorBarErrorReason](/server/enums/LocatorBarErrorReason.md) - [MemoryTier](/server/enums/MemoryTier.md) - [MoonPhase](/server/enums/MoonPhase.md) - [MovementType](/server/enums/MovementType.md) - [NamespaceNameErrorReason](/server/enums/NamespaceNameErrorReason.md) - [ObjectiveSortOrder](/server/enums/ObjectiveSortOrder.md) - [PaletteColor](/server/enums/PaletteColor.md) - [PlatformType](/server/enums/PlatformType.md) - [PlayerInventoryType](/server/enums/PlayerInventoryType.md) - [PlayerPermissionLevel](/server/enums/PlayerPermissionLevel.md) - [PlayerSplitScreenSlot](/server/enums/PlayerSplitScreenSlot.md) - [PlayerWaypointsMode](/server/enums/PlayerWaypointsMode.md) - [ScoreboardIdentityType](/server/enums/ScoreboardIdentityType.md) - [ScriptEventSource](/server/enums/ScriptEventSource.md) - [SignSide](/server/enums/SignSide.md) - [StickyType](/server/enums/StickyType.md) - [StructureAnimationMode](/server/enums/StructureAnimationMode.md) - [StructureMirrorAxis](/server/enums/StructureMirrorAxis.md) - [StructureRotation](/server/enums/StructureRotation.md) - [StructureSaveMode](/server/enums/StructureSaveMode.md) - [TickingAreaErrorReason](/server/enums/TickingAreaErrorReason.md) - [TimeOfDay](/server/enums/TimeOfDay.md) - [TintMethod](/server/enums/TintMethod.md) - [WatchdogTerminateReason](/server/enums/WatchdogTerminateReason.md) - [WaypointTexture](/server/enums/WaypointTexture.md) - [WeatherType](/server/enums/WeatherType.md) ## Classes - [AimAssistCategory](/server/classes/AimAssistCategory.md) - [AimAssistCategorySettings](/server/classes/AimAssistCategorySettings.md) - [AimAssistPreset](/server/classes/AimAssistPreset.md) - [AimAssistPresetSettings](/server/classes/AimAssistPresetSettings.md) - [AimAssistRegistry](/server/classes/AimAssistRegistry.md) - [BannerPattern](/server/classes/BannerPattern.md) - [BiomeType](/server/classes/BiomeType.md) - [BiomeTypes](/server/classes/BiomeTypes.md) - [Block](/server/classes/Block.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockComponentRandomTickEvent](/server/classes/BlockComponentRandomTickEvent.md) - [BlockComponentRedstoneUpdateEvent](/server/classes/BlockComponentRedstoneUpdateEvent.md) - [BlockComponentRegistry](/server/classes/BlockComponentRegistry.md) - [BlockComponentStepOffEvent](/server/classes/BlockComponentStepOffEvent.md) - [BlockComponentStepOnEvent](/server/classes/BlockComponentStepOnEvent.md) - [BlockComponentTickEvent](/server/classes/BlockComponentTickEvent.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentInstance](/server/classes/BlockCustomComponentInstance.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BlockDynamicPropertiesComponent](/server/classes/BlockDynamicPropertiesComponent.md) - [BlockEvent](/server/classes/BlockEvent.md) - [BlockExplodeAfterEvent](/server/classes/BlockExplodeAfterEvent.md) - [BlockExplodeAfterEventSignal](/server/classes/BlockExplodeAfterEventSignal.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) - [BlockInstrumentComponent](/server/classes/BlockInstrumentComponent.md) - [BlockInventoryComponent](/server/classes/BlockInventoryComponent.md) - [BlockLocationIterator](/server/classes/BlockLocationIterator.md) - [BlockMapColorComponent](/server/classes/BlockMapColorComponent.md) - [BlockMovableComponent](/server/classes/BlockMovableComponent.md) - [BlockPermutation](/server/classes/BlockPermutation.md) - [BlockPistonComponent](/server/classes/BlockPistonComponent.md) - [BlockPrecipitationInteractionsComponent](/server/classes/BlockPrecipitationInteractionsComponent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [BlockRedstoneProducerComponent](/server/classes/BlockRedstoneProducerComponent.md) - [BlockSignComponent](/server/classes/BlockSignComponent.md) - [BlockStates](/server/classes/BlockStates.md) - [BlockStateType](/server/classes/BlockStateType.md) - [BlockType](/server/classes/BlockType.md) - [BlockTypes](/server/classes/BlockTypes.md) - [BlockVolume](/server/classes/BlockVolume.md) - [BlockVolumeBase](/server/classes/BlockVolumeBase.md) - [BookError](/server/classes/BookError.md) - [BookPageContentError](/server/classes/BookPageContentError.md) - [ButtonPushAfterEvent](/server/classes/ButtonPushAfterEvent.md) - [ButtonPushAfterEventSignal](/server/classes/ButtonPushAfterEventSignal.md) - [Camera](/server/classes/Camera.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [CatmullRomSpline](/server/classes/CatmullRomSpline.md) - [ChatSendAfterEvent](/server/classes/ChatSendAfterEvent.md) - [ChatSendAfterEventSignal](/server/classes/ChatSendAfterEventSignal.md) - [ChatSendBeforeEvent](/server/classes/ChatSendBeforeEvent.md) - [ChatSendBeforeEventSignal](/server/classes/ChatSendBeforeEventSignal.md) - [ClientSystemInfo](/server/classes/ClientSystemInfo.md) - [CommandError](/server/classes/CommandError.md) - [CommandResult](/server/classes/CommandResult.md) - [Component](/server/classes/Component.md) - [Container](/server/classes/Container.md) - [ContainerRulesError](/server/classes/ContainerRulesError.md) - [ContainerSlot](/server/classes/ContainerSlot.md) - [CustomCommandError](/server/classes/CustomCommandError.md) - [CustomCommandOrigin](/server/classes/CustomCommandOrigin.md) - [CustomCommandRegistry](/server/classes/CustomCommandRegistry.md) - [CustomComponentInvalidRegistryError](/server/classes/CustomComponentInvalidRegistryError.md) - [CustomComponentNameError](/server/classes/CustomComponentNameError.md) - [CustomComponentParameters](/server/classes/CustomComponentParameters.md) - [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError.md) - [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError.md) - [CustomDimensionNameError](/server/classes/CustomDimensionNameError.md) - [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [Dimension](/server/classes/Dimension.md) - [DimensionRegistry](/server/classes/DimensionRegistry.md) - [DimensionType](/server/classes/DimensionType.md) - [DimensionTypes](/server/classes/DimensionTypes.md) - [Effect](/server/classes/Effect.md) - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent.md) - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal.md) - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent.md) - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal.md) - [EffectType](/server/classes/EffectType.md) - [EffectTypes](/server/classes/EffectTypes.md) - [EmptyLootItem](/server/classes/EmptyLootItem.md) - [EnchantInfo](/server/classes/EnchantInfo.md) - [EnchantmentLevelOutOfBoundsError](/server/classes/EnchantmentLevelOutOfBoundsError.md) - [EnchantmentType](/server/classes/EnchantmentType.md) - [EnchantmentTypeNotCompatibleError](/server/classes/EnchantmentTypeNotCompatibleError.md) - [EnchantmentTypes](/server/classes/EnchantmentTypes.md) - [EnchantmentTypeUnknownIdError](/server/classes/EnchantmentTypeUnknownIdError.md) - [EnchantRandomEquipmentFunction](/server/classes/EnchantRandomEquipmentFunction.md) - [EnchantRandomlyFunction](/server/classes/EnchantRandomlyFunction.md) - [EnchantWithLevelsFunction](/server/classes/EnchantWithLevelsFunction.md) - [Entity](/server/classes/Entity.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) - [EntityBreathableComponent](/server/classes/EntityBreathableComponent.md) - [EntityCanClimbComponent](/server/classes/EntityCanClimbComponent.md) - [EntityCanFlyComponent](/server/classes/EntityCanFlyComponent.md) - [EntityCanPowerJumpComponent](/server/classes/EntityCanPowerJumpComponent.md) - [EntityColor2Component](/server/classes/EntityColor2Component.md) - [EntityColorComponent](/server/classes/EntityColorComponent.md) - [EntityComponent](/server/classes/EntityComponent.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) - [EntityContainerClosedAfterEventSignal](/server/classes/EntityContainerClosedAfterEventSignal.md) - [EntityContainerOpenedAfterEvent](/server/classes/EntityContainerOpenedAfterEvent.md) - [EntityContainerOpenedAfterEventSignal](/server/classes/EntityContainerOpenedAfterEventSignal.md) - [EntityDefinitionFeedItem](/server/classes/EntityDefinitionFeedItem.md) - [EntityDieAfterEvent](/server/classes/EntityDieAfterEvent.md) - [EntityDieAfterEventSignal](/server/classes/EntityDieAfterEventSignal.md) - [EntityEnderInventoryComponent](/server/classes/EntityEnderInventoryComponent.md) - [EntityEquippableComponent](/server/classes/EntityEquippableComponent.md) - [EntityExhaustionComponent](/server/classes/EntityExhaustionComponent.md) - [EntityFireImmuneComponent](/server/classes/EntityFireImmuneComponent.md) - [EntityFloatsInLiquidComponent](/server/classes/EntityFloatsInLiquidComponent.md) - [EntityFlyingSpeedComponent](/server/classes/EntityFlyingSpeedComponent.md) - [EntityFrictionModifierComponent](/server/classes/EntityFrictionModifierComponent.md) - [EntityHasMarkVariantCondition](/server/classes/EntityHasMarkVariantCondition.md) - [EntityHasVariantCondition](/server/classes/EntityHasVariantCondition.md) - [EntityHealableComponent](/server/classes/EntityHealableComponent.md) - [EntityHealAfterEvent](/server/classes/EntityHealAfterEvent.md) - [EntityHealAfterEventSignal](/server/classes/EntityHealAfterEventSignal.md) - [EntityHealBeforeEvent](/server/classes/EntityHealBeforeEvent.md) - [EntityHealBeforeEventSignal](/server/classes/EntityHealBeforeEventSignal.md) - [EntityHealSource](/server/classes/EntityHealSource.md) - [EntityHealthChangedAfterEvent](/server/classes/EntityHealthChangedAfterEvent.md) - [EntityHealthChangedAfterEventSignal](/server/classes/EntityHealthChangedAfterEventSignal.md) - [EntityHealthComponent](/server/classes/EntityHealthComponent.md) - [EntityHitBlockAfterEvent](/server/classes/EntityHitBlockAfterEvent.md) - [EntityHitBlockAfterEventSignal](/server/classes/EntityHitBlockAfterEventSignal.md) - [EntityHitEntityAfterEvent](/server/classes/EntityHitEntityAfterEvent.md) - [EntityHitEntityAfterEventSignal](/server/classes/EntityHitEntityAfterEventSignal.md) - [EntityHungerComponent](/server/classes/EntityHungerComponent.md) - [EntityHurtAfterEvent](/server/classes/EntityHurtAfterEvent.md) - [EntityHurtAfterEventSignal](/server/classes/EntityHurtAfterEventSignal.md) - [EntityHurtBeforeEvent](/server/classes/EntityHurtBeforeEvent.md) - [EntityHurtBeforeEventSignal](/server/classes/EntityHurtBeforeEventSignal.md) - [EntityInventoryComponent](/server/classes/EntityInventoryComponent.md) - [EntityIsBabyComponent](/server/classes/EntityIsBabyComponent.md) - [EntityIsChargedComponent](/server/classes/EntityIsChargedComponent.md) - [EntityIsChestedComponent](/server/classes/EntityIsChestedComponent.md) - [EntityIsDyeableComponent](/server/classes/EntityIsDyeableComponent.md) - [EntityIsHiddenWhenInvisibleComponent](/server/classes/EntityIsHiddenWhenInvisibleComponent.md) - [EntityIsIgnitedComponent](/server/classes/EntityIsIgnitedComponent.md) - [EntityIsIllagerCaptainComponent](/server/classes/EntityIsIllagerCaptainComponent.md) - [EntityIsSaddledComponent](/server/classes/EntityIsSaddledComponent.md) - [EntityIsShakingComponent](/server/classes/EntityIsShakingComponent.md) - [EntityIsShearedComponent](/server/classes/EntityIsShearedComponent.md) - [EntityIsStackableComponent](/server/classes/EntityIsStackableComponent.md) - [EntityIsStunnedComponent](/server/classes/EntityIsStunnedComponent.md) - [EntityIsTamedComponent](/server/classes/EntityIsTamedComponent.md) - [EntityItemComponent](/server/classes/EntityItemComponent.md) - [EntityItemDropAfterEvent](/server/classes/EntityItemDropAfterEvent.md) - [EntityItemDropAfterEventSignal](/server/classes/EntityItemDropAfterEventSignal.md) - [EntityItemPickupAfterEvent](/server/classes/EntityItemPickupAfterEvent.md) - [EntityItemPickupAfterEventSignal](/server/classes/EntityItemPickupAfterEventSignal.md) - [EntityItemPickupBeforeEvent](/server/classes/EntityItemPickupBeforeEvent.md) - [EntityItemPickupBeforeEventSignal](/server/classes/EntityItemPickupBeforeEventSignal.md) - [EntityKilledCondition](/server/classes/EntityKilledCondition.md) - [EntityLavaMovementComponent](/server/classes/EntityLavaMovementComponent.md) - [EntityLeashableComponent](/server/classes/EntityLeashableComponent.md) - [EntityLoadAfterEvent](/server/classes/EntityLoadAfterEvent.md) - [EntityLoadAfterEventSignal](/server/classes/EntityLoadAfterEventSignal.md) - [EntityMarkVariantComponent](/server/classes/EntityMarkVariantComponent.md) - [EntityMovementAmphibiousComponent](/server/classes/EntityMovementAmphibiousComponent.md) - [EntityMovementBasicComponent](/server/classes/EntityMovementBasicComponent.md) - [EntityMovementComponent](/server/classes/EntityMovementComponent.md) - [EntityMovementFlyComponent](/server/classes/EntityMovementFlyComponent.md) - [EntityMovementGenericComponent](/server/classes/EntityMovementGenericComponent.md) - [EntityMovementGlideComponent](/server/classes/EntityMovementGlideComponent.md) - [EntityMovementHoverComponent](/server/classes/EntityMovementHoverComponent.md) - [EntityMovementJumpComponent](/server/classes/EntityMovementJumpComponent.md) - [EntityMovementSkipComponent](/server/classes/EntityMovementSkipComponent.md) - [EntityMovementSwayComponent](/server/classes/EntityMovementSwayComponent.md) - [EntityNavigationClimbComponent](/server/classes/EntityNavigationClimbComponent.md) - [EntityNavigationComponent](/server/classes/EntityNavigationComponent.md) - [EntityNavigationFloatComponent](/server/classes/EntityNavigationFloatComponent.md) - [EntityNavigationFlyComponent](/server/classes/EntityNavigationFlyComponent.md) - [EntityNavigationGenericComponent](/server/classes/EntityNavigationGenericComponent.md) - [EntityNavigationHoverComponent](/server/classes/EntityNavigationHoverComponent.md) - [EntityNavigationWalkComponent](/server/classes/EntityNavigationWalkComponent.md) - [EntityNpcComponent](/server/classes/EntityNpcComponent.md) - [EntityOnFireComponent](/server/classes/EntityOnFireComponent.md) - [EntityProjectileComponent](/server/classes/EntityProjectileComponent.md) - [EntityPushThroughComponent](/server/classes/EntityPushThroughComponent.md) - [EntityRemoveAfterEvent](/server/classes/EntityRemoveAfterEvent.md) - [EntityRemoveAfterEventSignal](/server/classes/EntityRemoveAfterEventSignal.md) - [EntityRemoveBeforeEvent](/server/classes/EntityRemoveBeforeEvent.md) - [EntityRemoveBeforeEventSignal](/server/classes/EntityRemoveBeforeEventSignal.md) - [EntityRideableComponent](/server/classes/EntityRideableComponent.md) - [EntityRidingComponent](/server/classes/EntityRidingComponent.md) - [EntitySaturationComponent](/server/classes/EntitySaturationComponent.md) - [EntityScaleComponent](/server/classes/EntityScaleComponent.md) - [EntitySkinIdComponent](/server/classes/EntitySkinIdComponent.md) - [EntitySpawnAfterEvent](/server/classes/EntitySpawnAfterEvent.md) - [EntitySpawnAfterEventSignal](/server/classes/EntitySpawnAfterEventSignal.md) - [EntitySpawnError](/server/classes/EntitySpawnError.md) - [EntityStartSneakingAfterEvent](/server/classes/EntityStartSneakingAfterEvent.md) - [EntityStartSneakingAfterEventSignal](/server/classes/EntityStartSneakingAfterEventSignal.md) - [EntityStopSneakingAfterEvent](/server/classes/EntityStopSneakingAfterEvent.md) - [EntityStopSneakingAfterEventSignal](/server/classes/EntityStopSneakingAfterEventSignal.md) - [EntityStrengthComponent](/server/classes/EntityStrengthComponent.md) - [EntityTameableComponent](/server/classes/EntityTameableComponent.md) - [EntityTamedAfterEvent](/server/classes/EntityTamedAfterEvent.md) - [EntityTamedAfterEventSignal](/server/classes/EntityTamedAfterEventSignal.md) - [EntityTamedBeforeEvent](/server/classes/EntityTamedBeforeEvent.md) - [EntityTamedBeforeEventSignal](/server/classes/EntityTamedBeforeEventSignal.md) - [EntityTameMountComponent](/server/classes/EntityTameMountComponent.md) - [EntityType](/server/classes/EntityType.md) - [EntityTypeFamilyComponent](/server/classes/EntityTypeFamilyComponent.md) - [EntityTypes](/server/classes/EntityTypes.md) - [EntityUnderwaterMovementComponent](/server/classes/EntityUnderwaterMovementComponent.md) - [EntityUpgradeAfterEvent](/server/classes/EntityUpgradeAfterEvent.md) - [EntityUpgradeAfterEventSignal](/server/classes/EntityUpgradeAfterEventSignal.md) - [EntityVariantComponent](/server/classes/EntityVariantComponent.md) - [EntityWantsJockeyComponent](/server/classes/EntityWantsJockeyComponent.md) - [EntityWaypoint](/server/classes/EntityWaypoint.md) - [ExplorationMapFunction](/server/classes/ExplorationMapFunction.md) - [ExplosionAfterEvent](/server/classes/ExplosionAfterEvent.md) - [ExplosionAfterEventSignal](/server/classes/ExplosionAfterEventSignal.md) - [ExplosionBeforeEvent](/server/classes/ExplosionBeforeEvent.md) - [ExplosionBeforeEventSignal](/server/classes/ExplosionBeforeEventSignal.md) - [ExplosionDecayFunction](/server/classes/ExplosionDecayFunction.md) - [FeedItem](/server/classes/FeedItem.md) - [FeedItemEffect](/server/classes/FeedItemEffect.md) - [FillContainerFunction](/server/classes/FillContainerFunction.md) - [FluidContainer](/server/classes/FluidContainer.md) - [FogSettings](/server/classes/FogSettings.md) - [FogSettingsError](/server/classes/FogSettingsError.md) - [GameRuleChangeAfterEvent](/server/classes/GameRuleChangeAfterEvent.md) - [GameRuleChangeAfterEventSignal](/server/classes/GameRuleChangeAfterEventSignal.md) - [GameRules](/server/classes/GameRules.md) - [InputInfo](/server/classes/InputInfo.md) - [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError.md) - [InvalidContainerError](/server/classes/InvalidContainerError.md) - [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) - [InvalidEntityComponentError](/server/classes/InvalidEntityComponentError.md) - [InvalidEntityError](/server/classes/InvalidEntityError.md) - [InvalidItemStackError](/server/classes/InvalidItemStackError.md) - [InvalidIteratorError](/server/classes/InvalidIteratorError.md) - [InvalidPotionDeliveryTypeError](/server/classes/InvalidPotionDeliveryTypeError.md) - [InvalidPotionEffectTypeError](/server/classes/InvalidPotionEffectTypeError.md) - [InvalidStructureError](/server/classes/InvalidStructureError.md) - [InvalidWaypointError](/server/classes/InvalidWaypointError.md) - [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) - [IsBabyCondition](/server/classes/IsBabyCondition.md) - [ISerializable](/server/classes/ISerializable.md) - [ItemBlockDynamicPropertiesComponent](/server/classes/ItemBlockDynamicPropertiesComponent.md) - [ItemBookComponent](/server/classes/ItemBookComponent.md) - [ItemCompleteUseAfterEvent](/server/classes/ItemCompleteUseAfterEvent.md) - [ItemCompleteUseAfterEventSignal](/server/classes/ItemCompleteUseAfterEventSignal.md) - [ItemCompleteUseEvent](/server/classes/ItemCompleteUseEvent.md) - [ItemComponent](/server/classes/ItemComponent.md) - [ItemComponentBeforeDurabilityDamageEvent](/server/classes/ItemComponentBeforeDurabilityDamageEvent.md) - [ItemComponentCompleteUseEvent](/server/classes/ItemComponentCompleteUseEvent.md) - [ItemComponentConsumeEvent](/server/classes/ItemComponentConsumeEvent.md) - [ItemComponentHitEntityEvent](/server/classes/ItemComponentHitEntityEvent.md) - [ItemComponentMineBlockEvent](/server/classes/ItemComponentMineBlockEvent.md) - [ItemComponentRegistry](/server/classes/ItemComponentRegistry.md) - [ItemComponentUseEvent](/server/classes/ItemComponentUseEvent.md) - [ItemComponentUseOnEvent](/server/classes/ItemComponentUseOnEvent.md) - [ItemCompostableComponent](/server/classes/ItemCompostableComponent.md) - [ItemCooldownComponent](/server/classes/ItemCooldownComponent.md) - [ItemCustomComponentAlreadyRegisteredError](/server/classes/ItemCustomComponentAlreadyRegisteredError.md) - [ItemCustomComponentInstance](/server/classes/ItemCustomComponentInstance.md) - [ItemCustomComponentReloadNewComponentError](/server/classes/ItemCustomComponentReloadNewComponentError.md) - [ItemCustomComponentReloadNewEventError](/server/classes/ItemCustomComponentReloadNewEventError.md) - [ItemCustomComponentReloadVersionError](/server/classes/ItemCustomComponentReloadVersionError.md) - [ItemDurabilityComponent](/server/classes/ItemDurabilityComponent.md) - [ItemDyeableComponent](/server/classes/ItemDyeableComponent.md) - [ItemEnchantableComponent](/server/classes/ItemEnchantableComponent.md) - [ItemFoodComponent](/server/classes/ItemFoodComponent.md) - [ItemInventoryComponent](/server/classes/ItemInventoryComponent.md) - [ItemPotionComponent](/server/classes/ItemPotionComponent.md) - [ItemReleaseUseAfterEvent](/server/classes/ItemReleaseUseAfterEvent.md) - [ItemReleaseUseAfterEventSignal](/server/classes/ItemReleaseUseAfterEventSignal.md) - [ItemStack](/server/classes/ItemStack.md) - [ItemStartUseAfterEvent](/server/classes/ItemStartUseAfterEvent.md) - [ItemStartUseAfterEventSignal](/server/classes/ItemStartUseAfterEventSignal.md) - [ItemStartUseOnAfterEvent](/server/classes/ItemStartUseOnAfterEvent.md) - [ItemStartUseOnAfterEventSignal](/server/classes/ItemStartUseOnAfterEventSignal.md) - [ItemStopUseAfterEvent](/server/classes/ItemStopUseAfterEvent.md) - [ItemStopUseAfterEventSignal](/server/classes/ItemStopUseAfterEventSignal.md) - [ItemStopUseOnAfterEvent](/server/classes/ItemStopUseOnAfterEvent.md) - [ItemStopUseOnAfterEventSignal](/server/classes/ItemStopUseOnAfterEventSignal.md) - [ItemType](/server/classes/ItemType.md) - [ItemTypes](/server/classes/ItemTypes.md) - [ItemUseAfterEvent](/server/classes/ItemUseAfterEvent.md) - [ItemUseAfterEventSignal](/server/classes/ItemUseAfterEventSignal.md) - [ItemUseBeforeEvent](/server/classes/ItemUseBeforeEvent.md) - [ItemUseBeforeEventSignal](/server/classes/ItemUseBeforeEventSignal.md) - [ItemUseOnEvent](/server/classes/ItemUseOnEvent.md) - [KilledByEntityCondition](/server/classes/KilledByEntityCondition.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) - [LeverActionAfterEvent](/server/classes/LeverActionAfterEvent.md) - [LeverActionAfterEventSignal](/server/classes/LeverActionAfterEventSignal.md) - [LinearSpline](/server/classes/LinearSpline.md) - [ListBlockVolume](/server/classes/ListBlockVolume.md) - [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) - [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) - [LocationWaypoint](/server/classes/LocationWaypoint.md) - [LocatorBar](/server/classes/LocatorBar.md) - [LocatorBarError](/server/classes/LocatorBarError.md) - [LootingEnchantFunction](/server/classes/LootingEnchantFunction.md) - [LootItem](/server/classes/LootItem.md) - [LootItemCondition](/server/classes/LootItemCondition.md) - [LootItemFunction](/server/classes/LootItemFunction.md) - [LootPool](/server/classes/LootPool.md) - [LootPoolEntry](/server/classes/LootPoolEntry.md) - [LootPoolTiers](/server/classes/LootPoolTiers.md) - [LootTable](/server/classes/LootTable.md) - [LootTableEntry](/server/classes/LootTableEntry.md) - [LootTableManager](/server/classes/LootTableManager.md) - [LootTableReference](/server/classes/LootTableReference.md) - [MatchToolCondition](/server/classes/MatchToolCondition.md) - [MessageReceiveAfterEvent](/server/classes/MessageReceiveAfterEvent.md) - [MolangVariableMap](/server/classes/MolangVariableMap.md) - [NamespaceNameError](/server/classes/NamespaceNameError.md) - [PackSettingChangeAfterEvent](/server/classes/PackSettingChangeAfterEvent.md) - [PackSettingChangeAfterEventSignal](/server/classes/PackSettingChangeAfterEventSignal.md) - [PassengerOfEntityCondition](/server/classes/PassengerOfEntityCondition.md) - [PistonActivateAfterEvent](/server/classes/PistonActivateAfterEvent.md) - [PistonActivateAfterEventSignal](/server/classes/PistonActivateAfterEventSignal.md) - [PlaceJigsawError](/server/classes/PlaceJigsawError.md) - [Player](/server/classes/Player.md) - [PlayerAimAssist](/server/classes/PlayerAimAssist.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) - [PlayerBreakBlockBeforeEventSignal](/server/classes/PlayerBreakBlockBeforeEventSignal.md) - [PlayerButtonInputAfterEvent](/server/classes/PlayerButtonInputAfterEvent.md) - [PlayerButtonInputAfterEventSignal](/server/classes/PlayerButtonInputAfterEventSignal.md) - [PlayerCancelBreakingBlockAfterEvent](/server/classes/PlayerCancelBreakingBlockAfterEvent.md) - [PlayerCancelBreakingBlockAfterEventSignal](/server/classes/PlayerCancelBreakingBlockAfterEventSignal.md) - [PlayerCursorInventoryComponent](/server/classes/PlayerCursorInventoryComponent.md) - [PlayerDimensionChangeAfterEvent](/server/classes/PlayerDimensionChangeAfterEvent.md) - [PlayerDimensionChangeAfterEventSignal](/server/classes/PlayerDimensionChangeAfterEventSignal.md) - [PlayerEmoteAfterEvent](/server/classes/PlayerEmoteAfterEvent.md) - [PlayerEmoteAfterEventSignal](/server/classes/PlayerEmoteAfterEventSignal.md) - [PlayerGameModeChangeAfterEvent](/server/classes/PlayerGameModeChangeAfterEvent.md) - [PlayerGameModeChangeAfterEventSignal](/server/classes/PlayerGameModeChangeAfterEventSignal.md) - [PlayerGameModeChangeBeforeEvent](/server/classes/PlayerGameModeChangeBeforeEvent.md) - [PlayerGameModeChangeBeforeEventSignal](/server/classes/PlayerGameModeChangeBeforeEventSignal.md) - [PlayerHotbarSelectedSlotChangeAfterEvent](/server/classes/PlayerHotbarSelectedSlotChangeAfterEvent.md) - [PlayerHotbarSelectedSlotChangeAfterEventSignal](/server/classes/PlayerHotbarSelectedSlotChangeAfterEventSignal.md) - [PlayerInputModeChangeAfterEvent](/server/classes/PlayerInputModeChangeAfterEvent.md) - [PlayerInputModeChangeAfterEventSignal](/server/classes/PlayerInputModeChangeAfterEventSignal.md) - [PlayerInputPermissionCategoryChangeAfterEvent](/server/classes/PlayerInputPermissionCategoryChangeAfterEvent.md) - [PlayerInputPermissionCategoryChangeAfterEventSignal](/server/classes/PlayerInputPermissionCategoryChangeAfterEventSignal.md) - [PlayerInputPermissions](/server/classes/PlayerInputPermissions.md) - [PlayerInteractWithBlockAfterEvent](/server/classes/PlayerInteractWithBlockAfterEvent.md) - [PlayerInteractWithBlockAfterEventSignal](/server/classes/PlayerInteractWithBlockAfterEventSignal.md) - [PlayerInteractWithBlockBeforeEvent](/server/classes/PlayerInteractWithBlockBeforeEvent.md) - [PlayerInteractWithBlockBeforeEventSignal](/server/classes/PlayerInteractWithBlockBeforeEventSignal.md) - [PlayerInteractWithEntityAfterEvent](/server/classes/PlayerInteractWithEntityAfterEvent.md) - [PlayerInteractWithEntityAfterEventSignal](/server/classes/PlayerInteractWithEntityAfterEventSignal.md) - [PlayerInteractWithEntityBeforeEvent](/server/classes/PlayerInteractWithEntityBeforeEvent.md) - [PlayerInteractWithEntityBeforeEventSignal](/server/classes/PlayerInteractWithEntityBeforeEventSignal.md) - [PlayerInventoryItemChangeAfterEvent](/server/classes/PlayerInventoryItemChangeAfterEvent.md) - [PlayerInventoryItemChangeAfterEventSignal](/server/classes/PlayerInventoryItemChangeAfterEventSignal.md) - [PlayerJoinAfterEvent](/server/classes/PlayerJoinAfterEvent.md) - [PlayerJoinAfterEventSignal](/server/classes/PlayerJoinAfterEventSignal.md) - [PlayerLeaveAfterEvent](/server/classes/PlayerLeaveAfterEvent.md) - [PlayerLeaveAfterEventSignal](/server/classes/PlayerLeaveAfterEventSignal.md) - [PlayerLeaveBeforeEvent](/server/classes/PlayerLeaveBeforeEvent.md) - [PlayerLeaveBeforeEventSignal](/server/classes/PlayerLeaveBeforeEventSignal.md) - [PlayerPlaceBlockAfterEvent](/server/classes/PlayerPlaceBlockAfterEvent.md) - [PlayerPlaceBlockAfterEventSignal](/server/classes/PlayerPlaceBlockAfterEventSignal.md) - [PlayerPlaceBlockBeforeEvent](/server/classes/PlayerPlaceBlockBeforeEvent.md) - [PlayerPlaceBlockBeforeEventSignal](/server/classes/PlayerPlaceBlockBeforeEventSignal.md) - [PlayerSpawnAfterEvent](/server/classes/PlayerSpawnAfterEvent.md) - [PlayerSpawnAfterEventSignal](/server/classes/PlayerSpawnAfterEventSignal.md) - [PlayerStartBreakingBlockAfterEvent](/server/classes/PlayerStartBreakingBlockAfterEvent.md) - [PlayerStartBreakingBlockAfterEventSignal](/server/classes/PlayerStartBreakingBlockAfterEventSignal.md) - [PlayerSwingStartAfterEvent](/server/classes/PlayerSwingStartAfterEvent.md) - [PlayerSwingStartAfterEventSignal](/server/classes/PlayerSwingStartAfterEventSignal.md) - [PlayerUseNameTagAfterEvent](/server/classes/PlayerUseNameTagAfterEvent.md) - [PlayerUseNameTagAfterEventSignal](/server/classes/PlayerUseNameTagAfterEventSignal.md) - [PlayerWaypoint](/server/classes/PlayerWaypoint.md) - [PotionDeliveryType](/server/classes/PotionDeliveryType.md) - [PotionEffectType](/server/classes/PotionEffectType.md) - [Potions](/server/classes/Potions.md) - [PressurePlatePopAfterEvent](/server/classes/PressurePlatePopAfterEvent.md) - [PressurePlatePopAfterEventSignal](/server/classes/PressurePlatePopAfterEventSignal.md) - [PressurePlatePushAfterEvent](/server/classes/PressurePlatePushAfterEvent.md) - [PressurePlatePushAfterEventSignal](/server/classes/PressurePlatePushAfterEventSignal.md) - [PrimitiveShape](/server/classes/PrimitiveShape.md) - [PrimitiveShapeError](/server/classes/PrimitiveShapeError.md) - [PrimitiveShapesManager](/server/classes/PrimitiveShapesManager.md) - [ProjectileHitBlockAfterEvent](/server/classes/ProjectileHitBlockAfterEvent.md) - [ProjectileHitBlockAfterEventSignal](/server/classes/ProjectileHitBlockAfterEventSignal.md) - [ProjectileHitEntityAfterEvent](/server/classes/ProjectileHitEntityAfterEvent.md) - [ProjectileHitEntityAfterEventSignal](/server/classes/ProjectileHitEntityAfterEventSignal.md) - [RandomAuxValueFunction](/server/classes/RandomAuxValueFunction.md) - [RandomBlockStateFunction](/server/classes/RandomBlockStateFunction.md) - [RandomChanceCondition](/server/classes/RandomChanceCondition.md) - [RandomChanceWithLootingCondition](/server/classes/RandomChanceWithLootingCondition.md) - [RandomDifficultyChanceCondition](/server/classes/RandomDifficultyChanceCondition.md) - [RandomDyeFunction](/server/classes/RandomDyeFunction.md) - [RandomRegionalDifficultyChanceCondition](/server/classes/RandomRegionalDifficultyChanceCondition.md) - [RawMessageError](/server/classes/RawMessageError.md) - [Scoreboard](/server/classes/Scoreboard.md) - [ScoreboardIdentity](/server/classes/ScoreboardIdentity.md) - [ScoreboardObjective](/server/classes/ScoreboardObjective.md) - [ScoreboardScoreInfo](/server/classes/ScoreboardScoreInfo.md) - [ScreenDisplay](/server/classes/ScreenDisplay.md) - [ScriptEventCommandMessageAfterEvent](/server/classes/ScriptEventCommandMessageAfterEvent.md) - [ScriptEventCommandMessageAfterEventSignal](/server/classes/ScriptEventCommandMessageAfterEventSignal.md) - [Seat](/server/classes/Seat.md) - [ServerMessageAfterEventSignal](/server/classes/ServerMessageAfterEventSignal.md) - [SetArmorTrimFunction](/server/classes/SetArmorTrimFunction.md) - [SetBannerDetailsFunction](/server/classes/SetBannerDetailsFunction.md) - [SetBookContentsFunction](/server/classes/SetBookContentsFunction.md) - [SetDataFromColorIndexFunction](/server/classes/SetDataFromColorIndexFunction.md) - [SetItemCountFunction](/server/classes/SetItemCountFunction.md) - [SetItemDamageFunction](/server/classes/SetItemDamageFunction.md) - [SetItemDataFunction](/server/classes/SetItemDataFunction.md) - [SetItemLoreFunction](/server/classes/SetItemLoreFunction.md) - [SetItemNameFunction](/server/classes/SetItemNameFunction.md) - [SetOminousBottleFunction](/server/classes/SetOminousBottleFunction.md) - [SetPotionFunction](/server/classes/SetPotionFunction.md) - [SetSpawnEggFunction](/server/classes/SetSpawnEggFunction.md) - [SetStewEffectFunction](/server/classes/SetStewEffectFunction.md) - [ShutdownBeforeEventSignal](/server/classes/ShutdownBeforeEventSignal.md) - [ShutdownEvent](/server/classes/ShutdownEvent.md) - [SmeltItemFunction](/server/classes/SmeltItemFunction.md) - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent.md) - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal.md) - [SoundDefinition](/server/classes/SoundDefinition.md) - [SoundDefinitionRegistry](/server/classes/SoundDefinitionRegistry.md) - [SoundDurationInfo](/server/classes/SoundDurationInfo.md) - [SoundInstance](/server/classes/SoundInstance.md) - [SpecificEnchantFunction](/server/classes/SpecificEnchantFunction.md) - [StartupBeforeEventSignal](/server/classes/StartupBeforeEventSignal.md) - [StartupEvent](/server/classes/StartupEvent.md) - [Structure](/server/classes/Structure.md) - [StructureManager](/server/classes/StructureManager.md) - [System](/server/classes/System.md) - [SystemAfterEvents](/server/classes/SystemAfterEvents.md) - [SystemBeforeEvents](/server/classes/SystemBeforeEvents.md) - [SystemInfo](/server/classes/SystemInfo.md) - [TargetBlockHitAfterEvent](/server/classes/TargetBlockHitAfterEvent.md) - [TargetBlockHitAfterEventSignal](/server/classes/TargetBlockHitAfterEventSignal.md) - [TextPrimitive](/server/classes/TextPrimitive.md) - [TickingAreaError](/server/classes/TickingAreaError.md) - [TickingAreaManager](/server/classes/TickingAreaManager.md) - [Trigger](/server/classes/Trigger.md) - [TripWireTripAfterEvent](/server/classes/TripWireTripAfterEvent.md) - [TripWireTripAfterEventSignal](/server/classes/TripWireTripAfterEventSignal.md) - [UnloadedChunksError](/server/classes/UnloadedChunksError.md) - [WatchdogTerminateBeforeEvent](/server/classes/WatchdogTerminateBeforeEvent.md) - [WatchdogTerminateBeforeEventSignal](/server/classes/WatchdogTerminateBeforeEventSignal.md) - [Waypoint](/server/classes/Waypoint.md) - [WeatherChangeAfterEvent](/server/classes/WeatherChangeAfterEvent.md) - [WeatherChangeAfterEventSignal](/server/classes/WeatherChangeAfterEventSignal.md) - [WeatherChangeBeforeEvent](/server/classes/WeatherChangeBeforeEvent.md) - [WeatherChangeBeforeEventSignal](/server/classes/WeatherChangeBeforeEventSignal.md) - [World](/server/classes/World.md) - [WorldAfterEvents](/server/classes/WorldAfterEvents.md) - [WorldBeforeEvents](/server/classes/WorldBeforeEvents.md) - [WorldLoadAfterEvent](/server/classes/WorldLoadAfterEvent.md) - [WorldLoadAfterEventSignal](/server/classes/WorldLoadAfterEventSignal.md) ## Interfaces - [AABB](/server/interfaces/AABB.md) - [AnimationOptions](/server/interfaces/AnimationOptions.md) - [BiomeFilter](/server/interfaces/BiomeFilter.md) - [BiomeSearchOptions](/server/interfaces/BiomeSearchOptions.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockCustomComponent](/server/interfaces/BlockCustomComponent.md) - [BlockEventOptions](/server/interfaces/BlockEventOptions.md) - [BlockFillOptions](/server/interfaces/BlockFillOptions.md) - [BlockFilter](/server/interfaces/BlockFilter.md) - [BlockHitInformation](/server/interfaces/BlockHitInformation.md) - [BlockQueryOptions](/server/interfaces/BlockQueryOptions.md) - [BlockRaycastHit](/server/interfaces/BlockRaycastHit.md) - [BlockRaycastOptions](/server/interfaces/BlockRaycastOptions.md) - [CameraAttachOptions](/server/interfaces/CameraAttachOptions.md) - [CameraFadeOptions](/server/interfaces/CameraFadeOptions.md) - [CameraFadeTimeOptions](/server/interfaces/CameraFadeTimeOptions.md) - [CameraFixedBoomOptions](/server/interfaces/CameraFixedBoomOptions.md) - [CameraFovOptions](/server/interfaces/CameraFovOptions.md) - [CameraSetFacingOptions](/server/interfaces/CameraSetFacingOptions.md) - [CameraSetLocationOptions](/server/interfaces/CameraSetLocationOptions.md) - [CameraSetPosOptions](/server/interfaces/CameraSetPosOptions.md) - [CameraSetRotOptions](/server/interfaces/CameraSetRotOptions.md) - [CameraShakeOptions](/server/interfaces/CameraShakeOptions.md) - [CameraTargetOptions](/server/interfaces/CameraTargetOptions.md) - [ContainerAccessSource](/server/interfaces/ContainerAccessSource.md) - [ContainerAccessSourceFilter](/server/interfaces/ContainerAccessSourceFilter.md) - [ContainerRules](/server/interfaces/ContainerRules.md) - [CustomCommand](/server/interfaces/CustomCommand.md) - [CustomCommandParameter](/server/interfaces/CustomCommandParameter.md) - [CustomCommandResult](/server/interfaces/CustomCommandResult.md) - [CustomTexture](/server/interfaces/CustomTexture.md) - [DefinitionModifier](/server/interfaces/DefinitionModifier.md) - [DimensionLocation](/server/interfaces/DimensionLocation.md) - [EaseOptions](/server/interfaces/EaseOptions.md) - [Enchantment](/server/interfaces/Enchantment.md) - [EntityApplyDamageByProjectileOptions](/server/interfaces/EntityApplyDamageByProjectileOptions.md) - [EntityApplyDamageOptions](/server/interfaces/EntityApplyDamageOptions.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityDamageSource](/server/interfaces/EntityDamageSource.md) - [EntityDataDrivenTriggerEventOptions](/server/interfaces/EntityDataDrivenTriggerEventOptions.md) - [EntityEffectOptions](/server/interfaces/EntityEffectOptions.md) - [EntityEventOptions](/server/interfaces/EntityEventOptions.md) - [EntityFilter](/server/interfaces/EntityFilter.md) - [EntityHealEventOptions](/server/interfaces/EntityHealEventOptions.md) - [EntityHitInformation](/server/interfaces/EntityHitInformation.md) - [EntityHurtAfterEventOptions](/server/interfaces/EntityHurtAfterEventOptions.md) - [EntityHurtBeforeEventOptions](/server/interfaces/EntityHurtBeforeEventOptions.md) - [EntityItemDropEventOptions](/server/interfaces/EntityItemDropEventOptions.md) - [EntityItemPickupEventOptions](/server/interfaces/EntityItemPickupEventOptions.md) - [EntityQueryOptions](/server/interfaces/EntityQueryOptions.md) - [EntityQueryPropertyOptions](/server/interfaces/EntityQueryPropertyOptions.md) - [EntityQueryScoreOptions](/server/interfaces/EntityQueryScoreOptions.md) - [EntityRaycastHit](/server/interfaces/EntityRaycastHit.md) - [EntityRaycastOptions](/server/interfaces/EntityRaycastOptions.md) - [EntitySneakingChangedEventOptions](/server/interfaces/EntitySneakingChangedEventOptions.md) - [EntityTamedEventOptions](/server/interfaces/EntityTamedEventOptions.md) - [EntityVisibilityRules](/server/interfaces/EntityVisibilityRules.md) - [EqualsComparison](/server/interfaces/EqualsComparison.md) - [ExplosionOptions](/server/interfaces/ExplosionOptions.md) - [GetBlocksStandingOnOptions](/server/interfaces/GetBlocksStandingOnOptions.md) - [GreaterThanComparison](/server/interfaces/GreaterThanComparison.md) - [GreaterThanOrEqualsComparison](/server/interfaces/GreaterThanOrEqualsComparison.md) - [HotbarEventOptions](/server/interfaces/HotbarEventOptions.md) - [InputEventOptions](/server/interfaces/InputEventOptions.md) - [InventoryItemEventOptions](/server/interfaces/InventoryItemEventOptions.md) - [ItemCustomComponent](/server/interfaces/ItemCustomComponent.md) - [ItemFilter](/server/interfaces/ItemFilter.md) - [JigsawPlaceOptions](/server/interfaces/JigsawPlaceOptions.md) - [JigsawStructurePlaceOptions](/server/interfaces/JigsawStructurePlaceOptions.md) - [LessThanComparison](/server/interfaces/LessThanComparison.md) - [LessThanOrEqualsComparison](/server/interfaces/LessThanOrEqualsComparison.md) - [MusicOptions](/server/interfaces/MusicOptions.md) - [NotEqualsComparison](/server/interfaces/NotEqualsComparison.md) - [PlayAnimationOptions](/server/interfaces/PlayAnimationOptions.md) - [PlayerAimAssistSettings](/server/interfaces/PlayerAimAssistSettings.md) - [PlayerBreakingBlockEventOptions](/server/interfaces/PlayerBreakingBlockEventOptions.md) - [PlayerSoundOptions](/server/interfaces/PlayerSoundOptions.md) - [PlayerSwingEventOptions](/server/interfaces/PlayerSwingEventOptions.md) - [PlayerVisibilityRules](/server/interfaces/PlayerVisibilityRules.md) - [PrimitiveShapeQueryOptions](/server/interfaces/PrimitiveShapeQueryOptions.md) - [ProgressKeyFrame](/server/interfaces/ProgressKeyFrame.md) - [ProjectileShootOptions](/server/interfaces/ProjectileShootOptions.md) - [RangeComparison](/server/interfaces/RangeComparison.md) - [RawMessage](/server/interfaces/RawMessage.md) - [RawMessageScore](/server/interfaces/RawMessageScore.md) - [RawText](/server/interfaces/RawText.md) - [RGB](/server/interfaces/RGB.md) - [RGBA](/server/interfaces/RGBA.md) - [RotationKeyFrame](/server/interfaces/RotationKeyFrame.md) - [ScoreboardObjectiveDisplayOptions](/server/interfaces/ScoreboardObjectiveDisplayOptions.md) - [ScriptEventMessageFilterOptions](/server/interfaces/ScriptEventMessageFilterOptions.md) - [SoundDefinitionDurationInfo](/server/interfaces/SoundDefinitionDurationInfo.md) - [SoundDefinitionFilter](/server/interfaces/SoundDefinitionFilter.md) - [SoundDefinitionMusicInfo](/server/interfaces/SoundDefinitionMusicInfo.md) - [SpawnEntityOptions](/server/interfaces/SpawnEntityOptions.md) - [SplineAnimation](/server/interfaces/SplineAnimation.md) - [StructureCreateOptions](/server/interfaces/StructureCreateOptions.md) - [StructurePlaceOptions](/server/interfaces/StructurePlaceOptions.md) - [TeleportOptions](/server/interfaces/TeleportOptions.md) - [TickingArea](/server/interfaces/TickingArea.md) - [TickingAreaOptions](/server/interfaces/TickingAreaOptions.md) - [TitleDisplayOptions](/server/interfaces/TitleDisplayOptions.md) - [Vector2](/server/interfaces/Vector2.md) - [Vector3](/server/interfaces/Vector3.md) - [VectorXZ](/server/interfaces/VectorXZ.md) - [WaypointTextureBounds](/server/interfaces/WaypointTextureBounds.md) - [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md) - [WorldSoundOptions](/server/interfaces/WorldSoundOptions.md) ## Type Aliases - [BlockComponentReturnType](/server/types/BlockComponentReturnType.md) - [BlockComponentTypeMap](/server/types/BlockComponentTypeMap.md) - [BlockStateArg](/server/types/BlockStateArg.md) - [EntityComponentReturnType](/server/types/EntityComponentReturnType.md) - [EntityComponentTypeMap](/server/types/EntityComponentTypeMap.md) - [EntityIdentifierType](/server/types/EntityIdentifierType.md) - [ItemComponentReturnType](/server/types/ItemComponentReturnType.md) - [ItemComponentTypeMap](/server/types/ItemComponentTypeMap.md) - [VanillaEntityIdentifier](/server/types/VanillaEntityIdentifier.md) ## Variables - [HudElementsCount](/server/variables/HudElementsCount.md) - [HudVisibilityCount](/server/variables/HudVisibilityCount.md) - [MoonPhaseCount](/server/variables/MoonPhaseCount.md) - [system](/server/variables/system.md) - [TicksPerDay](/server/variables/TicksPerDay.md) - [TicksPerSecond](/server/variables/TicksPerSecond.md) - [world](/server/variables/world.md) --- url: /server/classes/BlockEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockEvent.md. # Class: BlockEvent event block **`Beta`** 包含有关影响特定方块的事件的信息。 Contains information regarding an event that impacts a specific block. ## Extended by - [`BlockComponentBlockBreakEvent`](/server/classes/BlockComponentBlockBreakEvent.md) - [`BlockComponentBlockStateChangeEvent`](/server/classes/BlockComponentBlockStateChangeEvent.md) - [`BlockComponentEntityEvent`](/server/classes/BlockComponentEntityEvent.md) - [`BlockComponentEntityFallOnEvent`](/server/classes/BlockComponentEntityFallOnEvent.md) - [`BlockComponentOnPlaceEvent`](/server/classes/BlockComponentOnPlaceEvent.md) - [`BlockComponentPlayerBreakEvent`](/server/classes/BlockComponentPlayerBreakEvent.md) - [`BlockComponentPlayerInteractEvent`](/server/classes/BlockComponentPlayerInteractEvent.md) - [`BlockComponentPlayerPlaceBeforeEvent`](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [`BlockComponentRandomTickEvent`](/server/classes/BlockComponentRandomTickEvent.md) - [`BlockComponentRedstoneUpdateEvent`](/server/classes/BlockComponentRedstoneUpdateEvent.md) - [`BlockComponentStepOffEvent`](/server/classes/BlockComponentStepOffEvent.md) - [`BlockComponentStepOnEvent`](/server/classes/BlockComponentStepOnEvent.md) - [`BlockComponentTickEvent`](/server/classes/BlockComponentTickEvent.md) - [`BlockContainerClosedAfterEvent`](/server/classes/BlockContainerClosedAfterEvent.md) - [`BlockContainerOpenedAfterEvent`](/server/classes/BlockContainerOpenedAfterEvent.md) - [`BlockExplodeAfterEvent`](/server/classes/BlockExplodeAfterEvent.md) - [`ButtonPushAfterEvent`](/server/classes/ButtonPushAfterEvent.md) - [`LeverActionAfterEvent`](/server/classes/LeverActionAfterEvent.md) - [`PistonActivateAfterEvent`](/server/classes/PistonActivateAfterEvent.md) - [`PlayerBreakBlockAfterEvent`](/server/classes/PlayerBreakBlockAfterEvent.md) - [`PlayerBreakBlockBeforeEvent`](/server/classes/PlayerBreakBlockBeforeEvent.md) - [`PlayerCancelBreakingBlockAfterEvent`](/server/classes/PlayerCancelBreakingBlockAfterEvent.md) - [`PlayerPlaceBlockAfterEvent`](/server/classes/PlayerPlaceBlockAfterEvent.md) - [`PlayerPlaceBlockBeforeEvent`](/server/classes/PlayerPlaceBlockBeforeEvent.md) - [`PlayerStartBreakingBlockAfterEvent`](/server/classes/PlayerStartBreakingBlockAfterEvent.md) - [`PressurePlatePopAfterEvent`](/server/classes/PressurePlatePopAfterEvent.md) - [`PressurePlatePushAfterEvent`](/server/classes/PressurePlatePushAfterEvent.md) - [`TargetBlockHitAfterEvent`](/server/classes/TargetBlockHitAfterEvent.md) - [`TripWireTripAfterEvent`](/server/classes/TripWireTripAfterEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentBlockBreakEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentBlockBreakEvent.md. # Class: BlockComponentBlockBreakEvent event block component **`Beta`** 包含有关特定方块被破坏的信息。 Contains information regarding a specific block being broken. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### blockDestructionSource? > `readonly` `optional` **blockDestructionSource?**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 导致破坏的方块。 The block that caused destruction. *** ### brokenBlockPermutation > `readonly` **brokenBlockPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks 返回此方块在被破坏之前的置换信息。 Returns permutation information about this block before it was broken. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### entitySource? > `readonly` `optional` **entitySource?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 导致破坏的 Actor(引擎对象)。 The Actor that caused destruction. ## 同领域相关 - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentBlockStateChangeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentBlockStateChangeEvent.md. # Class: BlockComponentBlockStateChangeEvent event block component **`Beta`** 包含有关特定方块置换从之前置换更改的信息。 Contains information regarding a specific block permutation that was changed from a previous permutation. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### previousPermutation > `readonly` **previousPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks 先前的 BlockPermutation。 The previous BlockPermutation. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentEntityEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentEntityEvent.md. # Class: BlockComponentEntityEvent event entity block component **`Beta`** 包含有关实体向世界中此方块发送事件的信息。 Contains information regarding an event sent by an entity to this block in the world. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### blockPermutation > `readonly` **blockPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks 返回接收事件的方块的置换信息。 Returns permutation information about the block receiving the event. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### entitySource > `readonly` **entitySource**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 发送事件的实体。 The entity that sent the event. *** ### name > `readonly` **name**: `string` **`Beta`** #### Remarks 实体触发的事件的名称。 Name of the event fired by the entity. ## 同领域相关 - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentEntityFallOnEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentEntityFallOnEvent.md. # Class: BlockComponentEntityFallOnEvent event entity block component **`Beta`** 包含有关实体摔落到特定方块上的信息。 Contains information regarding an entity falling onto a specific block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### entity? > `readonly` `optional` **entity?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 摔落到方块上的实体。 The entity that fell onto the block. *** ### fallDistance > `readonly` **fallDistance**: `number` **`Beta`** #### Remarks 实体摔落到此方块上的距离。 The distance that the entity fell onto this block with. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentOnPlaceEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentOnPlaceEvent.md. # Class: BlockComponentOnPlaceEvent event block component **`Beta`** 包含有关特定方块被放置的信息。 Contains information regarding a specific block that was placed. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### previousBlock > `readonly` **previousBlock**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks 在此位置被替换的先前方块。 Previous block at this location that was replaced. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentPlayerBreakEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentPlayerBreakEvent.md. # Class: BlockComponentPlayerBreakEvent event player block component **`Beta`** 包含有关玩家破坏特定方块的信息。 Contains information regarding a specific block being broken by a player. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### brokenBlockPermutation > `readonly` **brokenBlockPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks 返回此方块在被破坏之前的置换信息。 Returns permutation information about this block before it was broken. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### player? > `readonly` `optional` **player?**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 破坏此方块的玩家。 The player that broke this block. ## 同领域相关 - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentPlayerInteractEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentPlayerInteractEvent.md. # Class: BlockComponentPlayerInteractEvent event player block component **`Beta`** 包含有关特定方块被交互的信息。 Contains information regarding a specific block being interacted with. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### face > `readonly` **face**: [`Direction`](/server/enums/Direction.md) **`Beta`** #### Remarks 被交互的方块面。 The block face that was interacted with. *** ### faceLocation? > `readonly` `optional` **faceLocation?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 玩家交互的位置,相对于方块的西北下角。 Location relative to the bottom north-west corner of the block that the player interacted with. *** ### player? > `readonly` `optional` **player?**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 与此方块交互的玩家。 The player that interacted with this block. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentPlayerPlaceBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentPlayerPlaceBeforeEvent.md. # Class: BlockComponentPlayerPlaceBeforeEvent event player block component **`Beta`** 包含有关玩家放置方块之前的事件信息。 Contains information regarding an event before a player places a block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### cancel > **cancel**: `boolean` **`Beta`** #### Remarks 如果设置为 `true`,则取消方块放置事件。 If set to true, cancels the block place event. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### face > `readonly` **face**: [`Direction`](/server/enums/Direction.md) **`Beta`** #### Remarks 放置时所朝向的方块面。 The block face that was placed onto. *** ### permutationToPlace > **permutationToPlace**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks 如果事件未被取消,将放置的方块置换。如果设置为不同的方块置换,则将放置该置换。 The block permutation that will be placed if the event is not cancelled. If set to a different block permutation, that permutation will be placed instead. *** ### player? > `readonly` `optional` **player?**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 正在放置此方块的玩家。 The player that is placing this block. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentRandomTickEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentRandomTickEvent.md. # Class: BlockComponentRandomTickEvent event block tick component **`Beta`** 包含有关特定方块随机刻更新的信息。 Contains information regarding a specific block randomly ticking. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) ## 同领域相关 - [BlockComponentTickEvent](/server/classes/BlockComponentTickEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentRedstoneUpdateEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentRedstoneUpdateEvent.md. # Class: BlockComponentRedstoneUpdateEvent event block component **`Beta`** 包含有关特定方块红石更新事件的信息。 Contains information regarding a specific block redstone update event. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### firstUpdate 实验性 > `readonly` **firstUpdate**: `boolean` **`Beta`** #### Remarks 红石组件的第一个更新事件。 The first update event for the redstone component. *** ### powerLevel > `readonly` **powerLevel**: `number` **`Beta`** #### Remarks 通过此方块的红石信号强度。保证不小于该方块的 `minecraft:redstone_consumer` 组件的 `min_power` 值。 The redstone signal strength passing through this block. It is guaranteed to be >= the `min_power` of the block's 'minecraft:redstone\_consumer' component. *** ### previousPowerLevel > `readonly` **previousPowerLevel**: `number` **`Beta`** #### Remarks 上一刻通过此方块的红石信号强度。保证不小于该方块的 `minecraft:redstone_consumer` 组件的 `min_power` 值。 The redstone signal strength from the last tick that was passing through this block. It is guaranteed to be >= the `min_power` of the block's 'minecraft:redstone\_consumer' component. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentStepOffEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentStepOffEvent.md. # Class: BlockComponentStepOffEvent event block component **`Beta`** 包含有关实体离开特定方块的信息。 Contains information regarding an entity stepping off a specific block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### entity? > `readonly` `optional` **entity?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 离开方块的实体。 The entity that stepped off the block. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentStepOnEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentStepOnEvent.md. # Class: BlockComponentStepOnEvent event block component **`Beta`** 包含有关实体踩上特定方块的信息。 Contains information regarding an entity stepping onto a specific block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### entity? > `readonly` `optional` **entity?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 踩上方块的实体。 The entity that stepped on the block. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentTickEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentTickEvent.md. # Class: BlockComponentTickEvent event block tick component **`Beta`** 包含有关特定方块刻更新的信息。 Contains information regarding a specific block ticking. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) ## 同领域相关 - [BlockComponentRandomTickEvent](/server/classes/BlockComponentRandomTickEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockContainerClosedAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockContainerClosedAfterEvent.md. # Class: BlockContainerClosedAfterEvent event block inventory **`Beta`** 包含有关特定容器方块被关闭的信息。 Contains information regarding a specific container block being closed. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### closeSource > **closeSource**: [`ContainerAccessSource`](/server/interfaces/ContainerAccessSource.md) **`World Mutation`** **`Beta`** #### Remarks 被关闭的方块容器的来源。 The source of the block container being closed. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockContainerOpenedAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockContainerOpenedAfterEvent.md. # Class: BlockContainerOpenedAfterEvent event block inventory **`Beta`** 包含有关特定容器方块被打开的信息。 Contains information regarding a specific container block being opened. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### openSource > **openSource**: [`ContainerAccessSource`](/server/interfaces/ContainerAccessSource.md) **`World Mutation`** **`Beta`** #### Remarks 被打开的方块容器的来源。 The source of the block container being opened. ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockExplodeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockExplodeAfterEvent.md. # Class: BlockExplodeAfterEvent event block **`Beta`** 包含有关特定方块发生爆炸的信息。 Contains information regarding an explosion that has occurred for a specific block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### explodedBlockPermutation > `readonly` **explodedBlockPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks 已爆炸的方块的描述。 Description of the block that has exploded. *** ### source? > `readonly` `optional` **source?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 爆炸的可选来源。 Optional source of the explosion. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ButtonPushAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ButtonPushAfterEvent.md. # Class: ButtonPushAfterEvent event **`Beta`** 包含与按钮按压变化相关的信息。 ## Example **buttonPushEvent.ts** ```typescript import { world, system, BlockPermutation, ButtonPushAfterEvent, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function buttonPushEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // set up a button on cobblestone const cobblestone = targetLocation.dimension.getBlock(targetLocation); const button = targetLocation.dimension.getBlock({ x: targetLocation.x, y: targetLocation.y + 1, z: targetLocation.z, }); if (cobblestone === undefined || button === undefined) { log('Could not find block at location.'); return -1; } cobblestone.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.Cobblestone)); button.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.AcaciaButton).withState('facing_direction', 1)); world.afterEvents.buttonPush.subscribe((buttonPushEvent: ButtonPushAfterEvent) => { const eventLoc = buttonPushEvent.block.location; if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y + 1 && eventLoc.z === targetLocation.z) { log('Button push event at tick ' + system.currentTick); } }); } ``` ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### source > `readonly` **source**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 触发按钮按压的可选来源。 Optional source that triggered the button push. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LeverActionAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LeverActionAfterEvent.md. # Class: LeverActionAfterEvent event **`Beta`** 包含与拉杆激活或停用相关的信息。 Contains information related to changes to a lever activating or deactivating. ## Example **leverActionEvent.ts** ```typescript import { world, system, BlockPermutation, LeverActionAfterEvent, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function leverActionEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // set up a lever const cobblestone = targetLocation.dimension.getBlock(targetLocation); const lever = targetLocation.dimension.getBlock({ x: targetLocation.x, y: targetLocation.y + 1, z: targetLocation.z, }); if (cobblestone === undefined || lever === undefined) { log('Could not find block at location.'); return -1; } cobblestone.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.Cobblestone)); lever.setPermutation( BlockPermutation.resolve(MinecraftBlockTypes.Lever).withState('lever_direction', 'up_north_south') ); world.afterEvents.leverAction.subscribe((leverActionEvent: LeverActionAfterEvent) => { const eventLoc = leverActionEvent.block.location; if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y + 1 && eventLoc.z === targetLocation.z) { log('Lever activate event at tick ' + system.currentTick); } }); } ``` ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### isPowered > `readonly` **isPowered**: `boolean` **`Beta`** #### Remarks 如果拉杆已激活(即正在传输电力),则为 `true`。 True if the lever is activated (that is, transmitting power). *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 触发拉杆激活的可选玩家。 Optional player that triggered the lever activation. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PistonActivateAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PistonActivateAfterEvent.md. # Class: PistonActivateAfterEvent event **`Beta`** 包含与活塞伸出或缩回相关的信息。 Contains information related to changes to a piston expanding or retracting. ## Example **pistonAfterEvent.ts** ```typescript import { world, system, BlockPermutation, BlockPistonState, PistonActivateAfterEvent, DimensionLocation, } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function pistonAfterEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // set up a couple of piston blocks const piston = targetLocation.dimension.getBlock(targetLocation); const button = targetLocation.dimension.getBlock({ x: targetLocation.x, y: targetLocation.y + 1, z: targetLocation.z, }); if (piston === undefined || button === undefined) { log('Could not find block at location.'); return -1; } piston.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.Piston).withState('facing_direction', 3)); button.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.AcaciaButton).withState('facing_direction', 1)); world.afterEvents.pistonActivate.subscribe((pistonEvent: PistonActivateAfterEvent) => { const eventLoc = pistonEvent.piston.block.location; if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y && eventLoc.z === targetLocation.z) { log( 'Piston event at ' + system.currentTick + (pistonEvent.piston.isMoving ? ' Moving' : '') + (pistonEvent.piston.state === BlockPistonState.Expanding ? ' Expanding' : '') + (pistonEvent.piston.state === BlockPistonState.Expanded ? ' Expanded' : '') + (pistonEvent.piston.state === BlockPistonState.Retracting ? ' Retracting' : '') + (pistonEvent.piston.state === BlockPistonState.Retracted ? ' Retracted' : '') ); } }); } ``` ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### isExpanding > `readonly` **isExpanding**: `boolean` **`Beta`** 如果活塞正在伸出过程中,则为 `true`。 #### Remarks True if the piston is the process of expanding. *** ### piston > `readonly` **piston**: [`BlockPistonComponent`](/server/classes/BlockPistonComponent.md) **`Beta`** 包含活塞的附加属性和详细信息。 #### Remarks Contains additional properties and details of the piston. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerBreakBlockAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerBreakBlockAfterEvent.md. # Class: PlayerBreakBlockAfterEvent event player block **`Beta`** 包含玩家破坏方块后的事件相关信息。 Contains information regarding an event after a player breaks a block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### brokenBlockPermutation > `readonly` **brokenBlockPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** 返回该方块被破坏前的排列信息。 #### Remarks Returns permutation information about this block before it was broken. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### itemStackAfterBreak? > `readonly` `optional` **itemStackAfterBreak?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 用于破坏方块后手中的物品堆,如果为空手则为 `undefined`。 #### Remarks The item stack that was used to break the block after the block was broken, or undefined if empty hand. *** ### itemStackBeforeBreak? > `readonly` `optional` **itemStackBeforeBreak?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 用于破坏方块前手中的物品堆,如果为空手则为 `undefined`。 #### Remarks The item stack that was used to break the block before the block was broken, or undefined if empty hand. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 破坏该方块的玩家。 #### Remarks Player that broke the block for this event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) - [PlayerBreakBlockBeforeEventSignal](/server/classes/PlayerBreakBlockBeforeEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerBreakBlockBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerBreakBlockBeforeEvent.md. # Class: PlayerBreakBlockBeforeEvent event player block **`Beta`** 包含玩家破坏方块前的事件相关信息。 Contains information regarding an event before a player breaks a block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### cancel > **cancel**: `boolean` **`Beta`** 如果设置为 `true`,则取消方块破坏事件。 #### Remarks If set to true, cancels the block break event. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### itemStack? > `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 用于破坏方块的物品堆,如果为空手则为 `undefined`。 #### Remarks The item stack that is being used to break the block, or undefined if empty hand. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 破坏此方块的玩家。 #### Remarks Player breaking the block for this event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEventSignal](/server/classes/PlayerBreakBlockBeforeEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerCancelBreakingBlockAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerCancelBreakingBlockAfterEvent.md. # Class: PlayerCancelBreakingBlockAfterEvent event player block **`Beta`** ## Preview 包含玩家取消方块破坏时触发事件的相关信息。 Contains information regarding an event after a player cancels breaking a block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### blockPermutation > `readonly` **blockPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** 玩家取消破坏的方块的排列。 #### Remarks The permutation of the block that the player cancelled breaking. *** ### breakProgress > `readonly` **breakProgress**: `number` **`Beta`** 玩家取消时破坏方块的进度,范围为 (0, 1)。 #### Remarks The progress of breaking the block when the player cancelled in the exclusive range (0, 1). *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### face > `readonly` **face**: [`Direction`](/server/enums/Direction.md) **`Beta`** 正在被破坏的方块的面。 #### Remarks The face of the block that was being broken. *** ### heldItemStack? > `readonly` `optional` **heldItemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 玩家用于破坏方块的物品堆,如果为空手则为 `undefined`。 #### Remarks The item stack that the player was using to break the block, or undefined if empty hand. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 取消破坏此方块的玩家。 #### Remarks Player that cancelled breaking the block for this event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerPlaceBlockAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerPlaceBlockAfterEvent.md. # Class: PlayerPlaceBlockAfterEvent event player block **`Beta`** 包含有关玩家放置方块的事件信息。 Contains information regarding an event where a player places a block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 放置此事件方块的玩家。 #### Remarks Player that placed the block for this event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerPlaceBlockBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerPlaceBlockBeforeEvent.md. # Class: PlayerPlaceBlockBeforeEvent event player block **`Beta`** 包含有关玩家放置方块之前的事件信息。 Contains information regarding an event before a player places a block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### cancel > **cancel**: `boolean` **`Beta`** 如果设置为 `true`,则取消方块放置事件。 #### Remarks If set to true, cancels the block place event. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### face > `readonly` **face**: [`Direction`](/server/enums/Direction.md) **`Beta`** 新方块所放置的方块面。 #### Remarks The face of the block that the new block is being placed on. *** ### faceLocation > `readonly` **faceLocation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** 相对于方块底部西北角的新方块放置位置。 #### Remarks Location relative to the bottom north-west corner of the block where the new block is being placed onto. *** ### permutationToPlace > `readonly` **permutationToPlace**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** 如果事件未被取消,将放置的方块排列。 #### Remarks The block permutation that will be placed if the event is not cancelled. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 放置此事件方块的玩家。 #### Remarks Player that is placing the block for this event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerStartBreakingBlockAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerStartBreakingBlockAfterEvent.md. # Class: PlayerStartBreakingBlockAfterEvent event player block **`Beta`** ## Preview 包含有关玩家开始破坏方块之后的事件信息。 Contains information regarding an event after a player starts breaking a block. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### blockPermutation > `readonly` **blockPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** 玩家开始破坏的方块的排列。 #### Remarks The permutation of the block that the player is starting to break. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### face > `readonly` **face**: [`Direction`](/server/enums/Direction.md) **`Beta`** 被破坏的方块面。 #### Remarks The face of the block being broken. *** ### heldItemStack? > `readonly` `optional` **heldItemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 玩家用来破坏方块的物品堆,如果为空手则为 `undefined`。 #### Remarks The item stack that the player is using to break the block, or undefined if empty hand. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 开始破坏此事件方块的玩家。 #### Remarks Player that started breaking the block for this event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PressurePlatePopAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PressurePlatePopAfterEvent.md. # Class: PressurePlatePopAfterEvent event **`Beta`** 包含与压力板复位相关的信息。 Contains information related to changes to a pressure plate pop. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### previousRedstonePower > `readonly` **previousRedstonePower**: `number` **`Beta`** 压力板复位之前的红石信号强度。 #### Remarks The redstone power of the pressure plate before it was popped. *** ### redstonePower > `readonly` **redstonePower**: `number` **`Beta`** 弹起时压力板的红石信号强度。 #### Remarks The redstone power of the pressure plate at the time of the pop. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PressurePlatePushAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PressurePlatePushAfterEvent.md. # Class: PressurePlatePushAfterEvent event **`Beta`** 包含与压力板被触发相关的信息。 Contains information related to changes to a pressure plate push. ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### previousRedstonePower > `readonly` **previousRedstonePower**: `number` **`Beta`** #### Remarks 压力板触发前的红石信号强度。 The redstone power of the pressure plate before it was pushed. *** ### redstonePower > `readonly` **redstonePower**: `number` **`Beta`** #### Remarks 按下时压力板的红石信号强度。 The redstone power of the pressure plate at the time of the push. *** ### source > `readonly` **source**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 触发压力板的源实体。 Source that triggered the pressure plate push. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/TargetBlockHitAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/TargetBlockHitAfterEvent.md. # Class: TargetBlockHitAfterEvent event block **`Beta`** Contains information related to changes to a target block hit. 包含与标靶方块被击中时的变化相关的信息。 ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### hitVector > `readonly` **hitVector**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks The position where the source hit the block. 击中方块时的源位置。 *** ### previousRedstonePower > `readonly` **previousRedstonePower**: `number` **`Beta`** #### Remarks The redstone power before the block is hit. 方块被击中前的红石信号强度。 *** ### redstonePower > `readonly` **redstonePower**: `number` **`Beta`** #### Remarks The redstone power at the time the block is hit. 方块被击中时的红石信号强度。 *** ### source > `readonly` **source**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks Optional source that hit the target block. 击中目标方块的来源(可选)。 ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/TripWireTripAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/TripWireTripAfterEvent.md. # Class: TripWireTripAfterEvent event **`Beta`** Contains information related to changes to a trip wire trip. 包含与绊线被触发相关的信息。 ## Example **tripWireTripEvent.ts** ```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 : '') ); } }); } ``` ## Extends - [`BlockEvent`](/server/classes/BlockEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 当前世界中此事件所在位置的方块。 Block currently in the world at the location of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`block`](/server/classes/BlockEvent.md#block) *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 包含此事件主体方块的维度。 Dimension that contains the block that is the subject of this event. #### Inherited from [`BlockEvent`](/server/classes/BlockEvent.md).[`dimension`](/server/classes/BlockEvent.md#dimension) *** ### isPowered > `readonly` **isPowered**: `boolean` **`Beta`** #### Remarks Whether or not the block has redstone power. 该方块是否具有红石信号。 *** ### sources > `readonly` **sources**: [`Entity`](/server/classes/Entity.md)\[] **`Beta`** #### Remarks The sources that triggered the trip wire to trip. 触发绊线的来源。 ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockVolumeBase.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockVolumeBase.md. # Class: BlockVolumeBase block **`Beta`** BlockVolume 的基础类型。 Base type for BlockVolumes. ## Extended by - [`BlockVolume`](/server/classes/BlockVolume.md) - [`ListBlockVolume`](/server/classes/ListBlockVolume.md) ## Methods ### getBlockLocationIterator() > **getBlockLocationIterator**(): [`BlockLocationIterator`](/server/classes/BlockLocationIterator.md) **`Beta`** #### Returns [`BlockLocationIterator`](/server/classes/BlockLocationIterator.md) #### Remarks 获取一个 [BlockLocationIterator](/server/classes/BlockLocationIterator.md),表示指定体积内的所有方块世界位置。 Fetch a [BlockLocationIterator](/server/classes/BlockLocationIterator.md) that represents all of the block world locations within the specified volume *** ### getBoundingBox() > **getBoundingBox**(): [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) **`Beta`** #### Returns [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Remarks 返回一个 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象,表示体积的有效最小和最大坐标。 Return a [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) object which represents the validated min and max coordinates of the volume #### Throws This function can throw errors. *** ### getCapacity() > **getCapacity**(): `number` **`Beta`** #### Returns `number` #### Remarks 返回 BlockVolume 的容量(体积)(W_D_H)。 Return the capacity (volume) of the BlockVolume (W_D_H) *** ### getClosest() > **getClosest**(`count`, `location`): [`Vector3`](/server/interfaces/Vector3.md)\[] **`Beta`** #### Parameters ##### count `number` 要返回的最接近位置的数量。 Number of closest positions to return ##### location [`Vector3`](/server/interfaces/Vector3.md) 测量距离的位置。 Position to measure distance from #### Returns [`Vector3`](/server/interfaces/Vector3.md)\[] #### Remarks 返回体积内最接近给定位置的方块位置列表,按距离排序(最近优先)。 Returns a list of block positions within the volume that are closest to a given location, sorted by distance (nearest first) #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) *** ### getFarthest() > **getFarthest**(`count`, `location`): [`Vector3`](/server/interfaces/Vector3.md)\[] **`Beta`** #### Parameters ##### count `number` 要返回的最远位置的数量。 Number of farthest positions to return ##### location [`Vector3`](/server/interfaces/Vector3.md) 测量距离的位置。 Position to measure distance from #### Returns [`Vector3`](/server/interfaces/Vector3.md)\[] #### Remarks 返回体积内距离给定位置最远的方块位置列表,按距离排序(最远优先)。 Returns a list of block positions within the volume that are farthest from a given location, sorted by distance (farthest first) #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) *** ### getMax() > **getMax**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks 获取体积的最大角点位置(保证 >= min)。 Get the largest corner position of the volume (guaranteed to be >= min) #### Throws This function can throw errors. *** ### getMin() > **getMin**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks 获取体积的最小角点位置(保证 \<= max)。 Get the smallest corner position of the volume (guaranteed to be \<= max) #### Throws This function can throw errors. *** ### getSpan() > **getSpan**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks 获取一个 [Vector3](/server/interfaces/Vector3.md) 对象,其中每个分量表示沿该轴的方块数量。 Get a [Vector3](/server/interfaces/Vector3.md) object where each component represents the number of blocks along that axis *** ### isInside() > **isInside**(`location`): `boolean` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) #### Returns `boolean` #### Remarks 检查给定的世界方块位置是否在 BlockVolume 内部。 Check to see if a given world block location is inside a BlockVolume *** ### translate() > **translate**(`delta`): `void` **`Beta`** #### Parameters ##### delta [`Vector3`](/server/interfaces/Vector3.md) 移动的方块数量。 Amount of blocks to move by #### Returns `void` #### Remarks 按指定量移动 BlockVolume。 Move a BlockVolume by a specified amount ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockVolume.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockVolume.md. # Class: BlockVolume block **`Beta`** BlockVolume 是一个简单对象,描述世界中位于方块坐标处的给定大小(以方块计)的 3D 矩形区域。 注意这些向量分量不保证按任何顺序排列,因此不等同于「min」与「max」值。 此外,这些向量位置不可与 BlockLocation 互换。 如需将此体积表示为 BlockLocation 范围,可使用 getBoundingBox 实用函数。 此体积类保留初始设置的角点索引顺序。 类比编辑器中分配每个角点的场景——当你移动角点时(可能反转边界的 min/max 关系), 原本位于顶部/左侧的角点就会变成底部/右侧。 因此手动编辑此类体积时,需在编辑过程中维持角点的标识——BlockVolume 实用函数正是为此而设计。 另请注意:此处测量的是「方块大小」(端点到端点)。普通 AABB (0,0,0) 到 (0,0,0) 大小通常为 (0,0,0); 但因为按方块计数,BlockVolume 的大小或跨度实际为 (1,1,1)。 A BlockVolume is a simple interface to an object which represents a 3D rectangle of a given size (in blocks) at a world block location. Note that these are not analogous to "min" and "max" values, in that the vector components are not guaranteed to be in any order. In addition, these vector positions are not interchangeable with BlockLocation. If you want to get this volume represented as range of of BlockLocations, you can use the getBoundingBox utility function. This volume class will maintain the ordering of the corner indexes as initially set. imagine that each corner is assigned in Editor - as you move the corner around (potentially inverting the min/max relationship of the bounds) - what you had originally selected as the top/left corner would traditionally become the bottom/right. When manually editing these kinds of volumes, you need to maintain the identity of the corner as you edit - the BlockVolume utility functions do this. Important to note that this measures block sizes (to/from) - a normal AABB (0,0,0) to (0,0,0) would traditionally be of size (0,0,0) However, because we're measuring blocks - the size or span of a BlockVolume would actually be (1,1,1) ## Extends - [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new BlockVolume**(`from`, `to`): `BlockVolume` **`Beta`** #### Parameters ##### from [`Vector3`](/server/interfaces/Vector3.md) ##### to [`Vector3`](/server/interfaces/Vector3.md) #### Returns `BlockVolume` #### Overrides `BlockVolumeBase.constructor` ## Properties ### from > **from**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 表示 3D 矩形中一个角点的世界方块位置。 A world block location that represents a corner in a 3D rectangle *** ### to > **to**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 表示 3D 矩形中对角角点的世界方块位置。 A world block location that represents the opposite corner in a 3D rectangle ## Methods ### doesLocationTouchFaces() > **doesLocationTouchFaces**(`pos`): `boolean` **`Beta`** #### Parameters ##### pos [`Vector3`](/server/interfaces/Vector3.md) 要测试的世界方块位置。 The world block location to test #### Returns `boolean` 如果该位置在内部或距离超过 0 个方块,则返回 `false`。 如果该位置直接接触 BlockVolume 的外表面,则返回 `true`。 If the location is either inside or more than 0 blocks away, the function will return false. If the location is directly contacting the outer surface of the BlockVolume, the function will return true. #### Remarks 检查给定位置是否直接与 BlockVolume 的外表面相邻。 Check to see if the given location is directly adjacent to the outer surface of a BlockVolume. *** ### doesVolumeTouchFaces() > **doesVolumeTouchFaces**(`other`): `boolean` **`Beta`** #### Parameters ##### other `BlockVolume` 要测试的体积。 The volume to test #### Returns `boolean` 如果两个方块体积的外表面在任何点接触且直接相邻,返回 `true`。 If the outer faces of both block volumes touch and are directly adjacent at any point, return true. #### Remarks 检查两个方块体积是否直接相邻且两个面接触。 Check to see if a two block volumes are directly adjacent and two faces touch. *** ### getBlockLocationIterator() > **getBlockLocationIterator**(): [`BlockLocationIterator`](/server/classes/BlockLocationIterator.md) **`Beta`** #### Returns [`BlockLocationIterator`](/server/classes/BlockLocationIterator.md) #### Remarks 获取一个 [BlockLocationIterator](/server/classes/BlockLocationIterator.md),表示指定体积内的所有方块世界位置。 Fetch a [BlockLocationIterator](/server/classes/BlockLocationIterator.md) that represents all of the block world locations within the specified volume #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getBlockLocationIterator`](/server/classes/BlockVolumeBase.md#getblocklocationiterator) *** ### getBoundingBox() > **getBoundingBox**(): [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) **`Beta`** #### Returns [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Remarks 返回一个 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象,表示体积的有效最小和最大坐标。 Return a [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) object which represents the validated min and max coordinates of the volume #### Throws This function can throw errors. #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getBoundingBox`](/server/classes/BlockVolumeBase.md#getboundingbox) *** ### getCapacity() > **getCapacity**(): `number` **`Beta`** #### Returns `number` #### Remarks 返回 BlockVolume 的容量(体积)(W_D_H)。 Return the capacity (volume) of the BlockVolume (W_D_H) #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getCapacity`](/server/classes/BlockVolumeBase.md#getcapacity) *** ### getClosest() > **getClosest**(`count`, `location`): [`Vector3`](/server/interfaces/Vector3.md)\[] **`Beta`** #### Parameters ##### count `number` 要返回的最接近位置的数量。 Number of closest positions to return ##### location [`Vector3`](/server/interfaces/Vector3.md) 测量距离的位置。 Position to measure distance from #### Returns [`Vector3`](/server/interfaces/Vector3.md)\[] #### Remarks 返回体积内最接近给定位置的方块位置列表,按距离排序(最近优先)。 Returns a list of block positions within the volume that are closest to a given location, sorted by distance (nearest first) #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getClosest`](/server/classes/BlockVolumeBase.md#getclosest) *** ### getFarthest() > **getFarthest**(`count`, `location`): [`Vector3`](/server/interfaces/Vector3.md)\[] **`Beta`** #### Parameters ##### count `number` 要返回的最远位置的数量。 Number of farthest positions to return ##### location [`Vector3`](/server/interfaces/Vector3.md) 测量距离的位置。 Position to measure distance from #### Returns [`Vector3`](/server/interfaces/Vector3.md)\[] #### Remarks 返回体积内距离给定位置最远的方块位置列表,按距离排序(最远优先)。 Returns a list of block positions within the volume that are farthest from a given location, sorted by distance (farthest first) #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getFarthest`](/server/classes/BlockVolumeBase.md#getfarthest) *** ### getMax() > **getMax**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks 获取体积的最大角点位置(保证 >= min)。 Get the largest corner position of the volume (guaranteed to be >= min) #### Throws This function can throw errors. #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getMax`](/server/classes/BlockVolumeBase.md#getmax) *** ### getMin() > **getMin**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks 获取体积的最小角点位置(保证 \<= max)。 Get the smallest corner position of the volume (guaranteed to be \<= max) #### Throws This function can throw errors. #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getMin`](/server/classes/BlockVolumeBase.md#getmin) *** ### getSpan() > **getSpan**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks 获取一个 [Vector3](/server/interfaces/Vector3.md) 对象,其中每个分量表示沿该轴的方块数量。 Get a [Vector3](/server/interfaces/Vector3.md) object where each component represents the number of blocks along that axis #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getSpan`](/server/classes/BlockVolumeBase.md#getspan) *** ### intersects() > **intersects**(`other`): [`BlockVolumeIntersection`](/server/enums/BlockVolumeIntersection.md) **`Beta`** #### Parameters ##### other `BlockVolume` #### Returns [`BlockVolumeIntersection`](/server/enums/BlockVolumeIntersection.md) #### Remarks 返回表示两个 BlockVolume 对象之间交集的枚举。 Return an enumeration which represents the intersection between two BlockVolume objects *** ### isInside() > **isInside**(`location`): `boolean` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) #### Returns `boolean` #### Remarks 检查给定的世界方块位置是否在 BlockVolume 内部。 Check to see if a given world block location is inside a BlockVolume #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`isInside`](/server/classes/BlockVolumeBase.md#isinside) *** ### translate() > **translate**(`delta`): `void` **`Beta`** #### Parameters ##### delta [`Vector3`](/server/interfaces/Vector3.md) 移动的方块数量。 Amount of blocks to move by #### Returns `void` #### Remarks 按指定量移动 BlockVolume。 Move a BlockVolume by a specified amount #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`translate`](/server/classes/BlockVolumeBase.md#translate) ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ListBlockVolume.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ListBlockVolume.md. # Class: ListBlockVolume block **`Beta`** 由唯一方块位置的无序容器组成的体积。 Volume composed of an unordered container of unique block locations. ## Extends - [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ListBlockVolume**(`locations`): `ListBlockVolume` **`Beta`** #### Parameters ##### locations [`Vector3`](/server/interfaces/Vector3.md)\[] 用于构造 `ListBlockVolume` 的初始方块位置数组。 Initial array of block locations that ListBlockVolume will be constructed with. #### Returns `ListBlockVolume` #### Remarks 创建 `ListBlockVolume` 的新实例。 Creates a new instance of ListBlockVolume. #### Overrides `BlockVolumeBase.constructor` ## Methods ### add() > **add**(`locations`): `void` **`Beta`** #### Parameters ##### locations [`Vector3`](/server/interfaces/Vector3.md)\[] 要添加到容器中的方块位置数组。 Array of block locations to be inserted into container. #### Returns `void` #### Remarks 将方块位置插入容器中。 Insert block locations into container. *** ### getBlockLocationIterator() > **getBlockLocationIterator**(): [`BlockLocationIterator`](/server/classes/BlockLocationIterator.md) **`Beta`** #### Returns [`BlockLocationIterator`](/server/classes/BlockLocationIterator.md) #### Remarks 获取一个 [BlockLocationIterator](/server/classes/BlockLocationIterator.md),表示指定体积内的所有方块世界位置。 Fetch a [BlockLocationIterator](/server/classes/BlockLocationIterator.md) that represents all of the block world locations within the specified volume #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getBlockLocationIterator`](/server/classes/BlockVolumeBase.md#getblocklocationiterator) *** ### getBoundingBox() > **getBoundingBox**(): [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) **`Beta`** #### Returns [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Remarks 返回一个 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象,表示体积的有效最小和最大坐标。 Return a [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) object which represents the validated min and max coordinates of the volume #### Throws This function can throw errors. #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getBoundingBox`](/server/classes/BlockVolumeBase.md#getboundingbox) *** ### getCapacity() > **getCapacity**(): `number` **`Beta`** #### Returns `number` #### Remarks 返回 BlockVolume 的容量(体积)(W_D_H)。 Return the capacity (volume) of the BlockVolume (W_D_H) #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getCapacity`](/server/classes/BlockVolumeBase.md#getcapacity) *** ### getClosest() > **getClosest**(`count`, `location`): [`Vector3`](/server/interfaces/Vector3.md)\[] **`Beta`** #### Parameters ##### count `number` 要返回的最接近位置的数量。 Number of closest positions to return ##### location [`Vector3`](/server/interfaces/Vector3.md) 测量距离的位置。 Position to measure distance from #### Returns [`Vector3`](/server/interfaces/Vector3.md)\[] #### Remarks 返回体积内最接近给定位置的方块位置列表,按距离排序(最近优先)。 Returns a list of block positions within the volume that are closest to a given location, sorted by distance (nearest first) #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getClosest`](/server/classes/BlockVolumeBase.md#getclosest) *** ### getFarthest() > **getFarthest**(`count`, `location`): [`Vector3`](/server/interfaces/Vector3.md)\[] **`Beta`** #### Parameters ##### count `number` 要返回的最远位置的数量。 Number of farthest positions to return ##### location [`Vector3`](/server/interfaces/Vector3.md) 测量距离的位置。 Position to measure distance from #### Returns [`Vector3`](/server/interfaces/Vector3.md)\[] #### Remarks 返回体积内距离给定位置最远的方块位置列表,按距离排序(最远优先)。 Returns a list of block positions within the volume that are farthest from a given location, sorted by distance (farthest first) #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getFarthest`](/server/classes/BlockVolumeBase.md#getfarthest) *** ### getMax() > **getMax**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks 获取体积的最大角点位置(保证 >= min)。 Get the largest corner position of the volume (guaranteed to be >= min) #### Throws This function can throw errors. #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getMax`](/server/classes/BlockVolumeBase.md#getmax) *** ### getMin() > **getMin**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks 获取体积的最小角点位置(保证 \<= max)。 Get the smallest corner position of the volume (guaranteed to be \<= max) #### Throws This function can throw errors. #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getMin`](/server/classes/BlockVolumeBase.md#getmin) *** ### getSpan() > **getSpan**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks 获取一个 [Vector3](/server/interfaces/Vector3.md) 对象,其中每个分量表示沿该轴的方块数量。 Get a [Vector3](/server/interfaces/Vector3.md) object where each component represents the number of blocks along that axis #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`getSpan`](/server/classes/BlockVolumeBase.md#getspan) *** ### isInside() > **isInside**(`location`): `boolean` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) #### Returns `boolean` #### Remarks 检查给定的世界方块位置是否在 BlockVolume 内部。 Check to see if a given world block location is inside a BlockVolume #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`isInside`](/server/classes/BlockVolumeBase.md#isinside) *** ### remove() > **remove**(`locations`): `void` **`Beta`** #### Parameters ##### locations [`Vector3`](/server/interfaces/Vector3.md)\[] 要从容器中移除的方块位置数组。 Array of block locations to be removed from container. #### Returns `void` #### Remarks 从容器中移除方块位置。 Remove block locations from container. *** ### translate() > **translate**(`delta`): `void` **`Beta`** #### Parameters ##### delta [`Vector3`](/server/interfaces/Vector3.md) 移动的方块数量。 Amount of blocks to move by #### Returns `void` #### Remarks 按指定量移动 BlockVolume。 Move a BlockVolume by a specified amount #### Inherited from [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md).[`translate`](/server/classes/BlockVolumeBase.md#translate) ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Component.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Component.md. # Class: Component component **`Beta`** 下游 Component 实现的基类。 Base class for downstream Component implementations. ## Extended by - [`BlockComponent`](/server/classes/BlockComponent.md) - [`EntityComponent`](/server/classes/EntityComponent.md) - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponent.md. # Class: BlockComponent block component **`Beta`** 与方块相关联的组件的基础类型。 Base type for components associated with blocks. ## Extends - [`Component`](/server/classes/Component.md) ## Extended by - [`BlockCustomComponentInstance`](/server/classes/BlockCustomComponentInstance.md) - [`BlockDynamicPropertiesComponent`](/server/classes/BlockDynamicPropertiesComponent.md) - [`BlockFluidContainerComponent`](/server/classes/BlockFluidContainerComponent.md) - [`BlockInstrumentComponent`](/server/classes/BlockInstrumentComponent.md) - [`BlockInventoryComponent`](/server/classes/BlockInventoryComponent.md) - [`BlockMapColorComponent`](/server/classes/BlockMapColorComponent.md) - [`BlockMovableComponent`](/server/classes/BlockMovableComponent.md) - [`BlockPistonComponent`](/server/classes/BlockPistonComponent.md) - [`BlockPrecipitationInteractionsComponent`](/server/classes/BlockPrecipitationInteractionsComponent.md) - [`BlockRecordPlayerComponent`](/server/classes/BlockRecordPlayerComponent.md) - [`BlockRedstoneProducerComponent`](/server/classes/BlockRedstoneProducerComponent.md) - [`BlockSignComponent`](/server/classes/BlockSignComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`Component`](/server/classes/Component.md).[`isValid`](/server/classes/Component.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`Component`](/server/classes/Component.md).[`typeId`](/server/classes/Component.md#typeid) ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockCustomComponentInstance.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockCustomComponentInstance.md. # Class: BlockCustomComponentInstance block component **`Beta`** 方块上自定义组件的一个实例。 An instance of a custom component on a block. ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### customComponentParameters > `readonly` **customComponentParameters**: [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) **`Beta`** *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockDynamicPropertiesComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockDynamicPropertiesComponent.md. # Class: BlockDynamicPropertiesComponent block component **`Beta`** 表示世界中方块的动态属性。仅适用于方块实体。每个内容包、每个方块实体在其动态属性存储中最多 1KB。 ## Example **rememberPlayerInteraction.ts** ```typescript import { system } from '@minecraft/server-wrapper'; system.beforeEvents.startup.subscribe(initEvent => { initEvent.blockComponentRegistry.registerCustomComponent('scripting_demo_pack:block_entity_onPlayerInteract', { onPlayerInteract: e => { if (e.player === undefined) { return; } const dynamicProperties = e.block.getComponent('minecraft:dynamic_properties'); if (!dynamicProperties) { return; } const lastInteractorValue = dynamicProperties.get('last_interactor'); const lastVisitor = typeof lastInteractorValue === 'string' ? lastInteractorValue : 'unknown'; const lastTick = Number(dynamicProperties.get('last_interact_tick') ?? system.currentTick); const ticksAgo = Math.max(0, system.currentTick - lastTick); if (lastVisitor === e.player.name) { e.player.sendMessage("do you remember that player? I 'member, it was here " + String(ticksAgo) + ' ticks ago!'); } else { e.player.sendMessage("oh, I don't remember that player"); } dynamicProperties.set('last_interactor', e.player.name); dynamicProperties.set('last_interact_tick', system.currentTick); }, }); }); ``` ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:dynamic_properties"` = `'minecraft:dynamic_properties'` **`Beta`** ## Methods ### get() > **get**(`key`): `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` **`Beta`** #### Parameters ##### key `string` #### Returns `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` #### Remarks 返回使用提供的键存储的动态属性。键对于每个内容包是唯一的,不能用于检索从其他内容包设置的动态属性。 如果未找到键,则返回 `undefined`。 Returns a DynamicProperty that was stored with the provided key. Keys are unique to each content pack and cannot be used to retrieve dynamic properties set from other content packs. Returns undefined if the key was not found. #### Throws This function can throw errors. Error [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### set() > **set**(`key`, `value?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### key `string` ##### value? `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) #### Returns `void` #### Remarks 使用提供的键和值设置动态属性。键对于每个内容包是唯一的,不能用于为其他内容包设置动态属性。 值可以是 Number、String 或 Vector3。使用 `undefined` 值设置属性将将其从存储中移除。 存储大小使用计入每个内容包 1KB 的限制。 Sets a dynamic property with the provided key and value. Keys are unique to each content pack and cannot be used to set dynamic properties for other content packs. Values can be either a Number, a String or a Vector3. Setting a property with an undefined value will remove it from the storage. Storage size usage is counted towards the 1KBytes limit per content pack. #### Throws This function can throw errors. Error [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### totalByteCount() > **totalByteCount**(): `number` **`Beta`** #### Returns `number` #### Remarks 返回此方块实体动态属性存储的当前大小(以字节为单位)。字节计数仅计算由您的内容包设置的属性。 1KB 限制是每个内容包的。 Returns the current size, in bytes, of the dynamic properties storage for this block entity. The byte count only accounts for properties set by your content pack. The 1KBytes limit is per content pack. #### Throws This function can throw errors. Error [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockFluidContainerComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockFluidContainerComponent.md. # Class: BlockFluidContainerComponent block inventory component **`Beta`** 表示世界中方块的流体容器。用于像炼药锅这样的方块。 Represents the fluid container of a block in the world. Used with blocks like cauldrons. ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### fillLevel > **fillLevel**: `number` **`World Mutation`** **`Beta`** #### Remarks 流体容器的相对填充液位。 Relative fill level of the fluid container. *** ### fluidColor > **fluidColor**: [`RGBA`](/server/interfaces/RGBA.md) **`World Mutation`** **`Beta`** #### Remarks 容器中流体的自定义颜色。 Custom color of the fluid in the container. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:fluid_container"` = `'minecraft:fluid_container'` **`Beta`** ## Methods ### addDye() > **addDye**(`dye`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### dye [`ItemType`](/server/classes/ItemType.md) #### Returns `void` #### Remarks 向流体中添加染料。染料颜色将与任何现有的自定义颜色合并。 Adds a dye to the fluid. The dye color is combined with any existing custom color. #### Throws This function can throw errors. *** ### getFluidType() > **getFluidType**(): [`FluidType`](/server/enums/FluidType.md) **`World Mutation`** **`Beta`** #### Returns [`FluidType`](/server/enums/FluidType.md) #### Remarks 获取容器中当前的流体类型。 Gets the current fluid type in the container. #### Throws This function can throw errors. *** ### setFluidType() > **setFluidType**(`fluidType`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### fluidType [`FluidType`](/server/enums/FluidType.md) #### Returns `void` #### Remarks 设置容器中当前的流体类型。 Sets the current fluid type in the container. #### Throws This function can throw errors. *** ### setPotion() > **setPotion**(`itemStack`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### itemStack [`ItemStack`](/server/classes/ItemStack.md) #### Returns `void` #### Remarks 在容器中设置一个药水物品。将容器的流体类型更改为药水。 Sets a potion item in the container. Changes the container's fluid type to potion. #### Throws This function can throw errors. ## 同领域相关 - [BlockInventoryComponent](/server/classes/BlockInventoryComponent.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockInstrumentComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockInstrumentComponent.md. # Class: BlockInstrumentComponent block component **`Beta`** 表示方块可在上表面与下表面分别设置的乐器。 Represents the instruments a block can have assigned to it's up and down faces. ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:instrument_sound"` = `'minecraft:instrument_sound'` **`Beta`** ## Methods ### getInstrumentName() > **getInstrumentName**(`face`): `string` **`Beta`** #### Parameters ##### face [`Direction`](/server/enums/Direction.md) 要获取乐器名称的面 Direction。 the face Direction to get the instrument name for. #### Returns `string` 返回给定有效面 Direction 的乐器名称。 Returns the name of the instrument for a given valid face Direction. #### Remarks 获取方法,用于获取给定有效面 Direction 的乐器名称。 A getter method to get the name of an instrument for a given valid face Direction. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### playInstrumentSound() > **playInstrumentSound**(`face`, `soundOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### face [`Direction`](/server/enums/Direction.md) 要播放乐器声音的面 Direction。 the face Direction for which instrument sound to play. ##### soundOptions? [`WorldSoundOptions`](/server/interfaces/WorldSoundOptions.md) 播放乐器声音时使用的可选 WorldSoundOptions;如果省略,则使用默认值。 optional WorldSoundOptions to use when playing the insturment sound; if omitted the default values are used. #### Returns `void` #### Remarks 在组件的方块位置播放给定有效面 Direction 的乐器声音,使用可选的 WorldSoundOptions。 plays the instrument sound for a given valid face Direction at the components block location using optional WorldSoundOptions. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockInventoryComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockInventoryComponent.md. # Class: BlockInventoryComponent block inventory component **`Beta`** 表示世界中方块的库存。用于像箱子这样的方块。 ## Example **placeItemsInChest.ts** ```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)); } ``` ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### container? > `readonly` `optional` **container?**: [`Container`](/server/classes/Container.md) **`Beta`** #### Remarks 持有 [ItemStack](/server/classes/ItemStack.md) 的容器。 #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:inventory"` = `'minecraft:inventory'` **`Beta`** ## 同领域相关 - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockMapColorComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockMapColorComponent.md. # Class: BlockMapColorComponent block component **`Beta`** 表示方块在地图上显示时的颜色。 Represents the color of a block when displayed on a map. ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### color > `readonly` **color**: [`RGBA`](/server/interfaces/RGBA.md) **`Beta`** #### Remarks 为该方块定义的底色(地图显示色)。 Base map color defined for that block. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### tintedColor > `readonly` **tintedColor**: [`RGBA`](/server/interfaces/RGBA.md) **`Beta`** #### Remarks 返回底色乘以在给定位置评估的着色值的结果。 Returns the base color multiplied to the evaluated tint at the given position. *** ### tintMethod > `readonly` **tintMethod**: [`TintMethod`](/server/enums/TintMethod.md) **`Beta`** #### Remarks 应用于颜色的着色类型。 Type of tint applied to the color. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:map_color"` = `'minecraft:map_color'` **`Beta`** ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockMovableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockMovableComponent.md. # Class: BlockMovableComponent block component **`Beta`** 表示可以移动的方块(例如活塞)。 Represents a block that can move (such as a piston). ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### movementType > `readonly` **movementType**: [`MovementType`](/server/enums/MovementType.md) **`Beta`** #### Throws This property can throw when used. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### stickyType > `readonly` **stickyType**: [`StickyType`](/server/enums/StickyType.md) **`Beta`** #### Throws This property can throw when used. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movable"` = `'minecraft:movable'` **`Beta`** ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockPistonComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockPistonComponent.md. # Class: BlockPistonComponent block component **`Beta`** 当存在时,此方块具有活塞般的行为。包含用于发现方块活塞状态的附加属性。 When present, this block has piston-like behavior. Contains additional properties for discovering block piston state. ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### isMoving > `readonly` **isMoving**: `boolean` **`Beta`** #### Remarks 活塞是否正在伸出或缩回的过程中。 Whether the piston is in the process of expanding or retracting. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### state > `readonly` **state**: [`BlockPistonState`](/server/enums/BlockPistonState.md) **`Beta`** #### Remarks 活塞的当前状态。 The current state of the piston. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:piston"` = `'minecraft:piston'` **`Beta`** ## Methods ### getAttachedBlocks() > **getAttachedBlocks**(): [`Block`](/server/classes/Block.md)\[] **`Beta`** #### Returns [`Block`](/server/classes/Block.md)\[] #### Remarks 检索此活塞连接的一组方块。 Retrieves a set of blocks that this piston is connected with. #### Throws This function can throw errors. *** ### getAttachedBlocksLocations() > **getAttachedBlocksLocations**(): [`Vector3`](/server/interfaces/Vector3.md)\[] **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md)\[] #### Remarks 检索此活塞连接的一组方块位置。 Retrieves a set of block locations that this piston is connected with. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockPrecipitationInteractionsComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockPrecipitationInteractionsComponent.md. # Class: BlockPrecipitationInteractionsComponent block component **`Beta`** 表示方块如何与降水(例如雨或雪)交互。 Represents a how a block interacts with precipitation (such as rain or snow). ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:precipitation_interactions"` = `'minecraft:precipitation_interactions'` **`Beta`** ## Methods ### accumulatesSnow() > **accumulatesSnow**(): `boolean` **`Beta`** #### Returns `boolean` #### Remarks 如果降雪会在方块上自然积累,则返回 `true`。如果雪不会在方块上积累,则返回 `false`。 Returns `true` if falling snow will accumulate naturally on the block. Returns `false` if snow will not accumulate on the block. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### isSnowLoggable() > **isSnowLoggable**(): `boolean` **`Beta`** #### Returns `boolean` #### Remarks 如果此方块内部可以容纳雪(如被雪淹没的花朵),则返回 `true`。如果此方块内部不能容纳雪,则返回 `false`。 Returns `true` if this block can have snow within it, like a flower submerged in snow. Returns `false` if this block cannot have snow within it. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### obstructsRain() > **obstructsRain**(): `boolean` **`Beta`** #### Returns `boolean` #### Remarks 如果雨水不会穿过方块,则返回 `true`。如果雨水应穿过方块,则返回 `false`。 Returns `true` if rain will not go through the block. Returns `false` if rain should go through the block. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockRecordPlayerComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockRecordPlayerComponent.md. # Class: BlockRecordPlayerComponent player block component **`Beta`** 表示可以播放唱片的方块。 Represents a block that can play a record. ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:record_player"` = `'minecraft:record_player'` **`Beta`** ## Methods ### ejectRecord() > **ejectRecord**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 弹出此唱片播放方块当前设置的唱片。 Ejects the currently set record of this record-playing block. #### Throws This function can throw errors. *** ### getRecord() > **getRecord**(): [`ItemStack`](/server/classes/ItemStack.md) | `undefined` **`Beta`** #### Returns [`ItemStack`](/server/classes/ItemStack.md) | `undefined` #### Remarks 获取此唱片播放方块当前设置的唱片。 Gets the currently set record of this record-playing block. #### Throws This function can throw errors. *** ### isPlaying() > **isPlaying**(): `boolean` **`Beta`** #### Returns `boolean` #### Remarks 返回唱片播放方块当前是否正在播放唱片。 Returns true if the record-playing block is currently playing a record. #### Throws This function can throw errors. *** ### pauseRecord() > **pauseRecord**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 暂停此唱片播放方块当前正在播放的唱片。 Pauses the currently playing record of this record-playing block. #### Throws This function can throw errors. *** ### playRecord() > **playRecord**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 播放此唱片播放方块当前设置的唱片。 Plays the currently set record of this record-playing block. #### Throws This function can throw errors. *** ### setRecord() > **setRecord**(`recordItemType?`, `startPlaying?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### recordItemType? `string` | [`ItemType`](/server/classes/ItemType.md) ##### startPlaying? `boolean` 默认为:`true`。 Defaults to: true #### Returns `void` #### Remarks 设置并基于物品类型播放唱片。 Sets and plays a record based on an item type. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockRedstoneProducerComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockRedstoneProducerComponent.md. # Class: BlockRedstoneProducerComponent block component **`Beta`** 表示可以输出红石信号的方块。 Represents a block that can output a redstone signal. ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### power > `readonly` **power**: `number` **`Beta`** #### Remarks 获取此方块向电路系统输出的红石信号强度。如果方块不再有效或不具有 `minecraft:redstone_producer` 组件,则返回错误。 Gets the power that this block outputs to circuit system. Returns error if block is no longer valid or if block doesn't have a 'minecraft:redstone\_producer' component. #### Throws This property can throw when used. [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError.md) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:redstone_producer"` = `'minecraft:redstone_producer'` **`Beta`** ## Methods ### getConnectedFaces() > **getConnectedFaces**(): [`Direction`](/server/enums/Direction.md)\[] **`Beta`** #### Returns [`Direction`](/server/enums/Direction.md)\[] #### Remarks 获取此方块可以连接到电路并输出红石信号强度的面。如果方块不再有效或不具有 `minecraft:redstone_producer` 组件,则返回错误。 Gets the faces of this block that can connect to the circuit and output power. Returns error if block is no longer valid or if block doesn't have a 'minecraft:redstone\_producer' component. #### Throws This function can throw errors. [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError.md) *** ### getStronglyPoweredFace() > **getStronglyPoweredFace**(): [`Direction`](/server/enums/Direction.md) | `undefined` **`Beta`** #### Returns [`Direction`](/server/enums/Direction.md) | `undefined` #### Remarks 获取对方块进行强充能的方块面。如果 `minecraft:redstone_producer` 方块组件未定义 `strongly_powered_face`,则此方法返回 `undefined`。如果方块不再有效或不具有 `minecraft:redstone_producer` 组件,则返回错误。 Gets the block face that strongly powers the block touching it. If the 'minecraft:redstone\_producer' block component hasn't defined a 'strongly\_powered\_face' then this method returns 'undefined'. Returns error if block is no longer valid or if block doesn't have a 'minecraft:redstone\_producer' component. #### Throws This function can throw errors. [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError.md) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockSignComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockSignComponent.md. # Class: BlockSignComponent block component **`Beta`** 表示可以在上面显示文字的方块。 ## Examples **addSign.ts** ```typescript import { world, BlockPermutation, BlockSignComponent, BlockComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function addSign(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); const dim = players[0].dimension; const signBlock = dim.getBlock(targetLocation); if (!signBlock) { log('Could not find a block at specified location.'); return -1; } const signPerm = BlockPermutation.resolve(MinecraftBlockTypes.StandingSign, { ground_sign_direction: 8 }); signBlock.setPermutation(signPerm); const signComponent = signBlock.getComponent(BlockComponentTypes.Sign) as BlockSignComponent; signComponent?.setText(`Basic sign!\nThis is green on the front.`); } ``` **addTwoSidedSign.ts** ```typescript import { BlockPermutation, BlockSignComponent, SignSide, DyeColor, BlockComponentTypes, DimensionLocation, } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function addTwoSidedSign(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const signBlock = targetLocation.dimension.getBlock(targetLocation); if (!signBlock) { log('Could not find a block at specified location.'); return -1; } const signPerm = BlockPermutation.resolve(MinecraftBlockTypes.StandingSign, { ground_sign_direction: 8 }); signBlock.setPermutation(signPerm); const signComponent = signBlock.getComponent(BlockComponentTypes.Sign) as BlockSignComponent; if (signComponent) { signComponent.setText(`Party Sign!\nThis is green on the front.`); signComponent.setText(`Party Sign!\nThis is red on the back.`, SignSide.Back); signComponent.setTextDyeColor(DyeColor.Green); signComponent.setTextDyeColor(DyeColor.Red, SignSide.Back); // players cannot edit sign! signComponent.setWaxed(true); } else { log('Could not find sign component.'); } } ``` **updateSignText.ts** ```typescript import { BlockSignComponent, BlockComponentTypes, DimensionLocation, RawMessage, RawText } from '@minecraft/server'; function updateSignText(targetLocation: DimensionLocation) { const block = targetLocation.dimension.getBlock(targetLocation); if (!block) { console.warn('Could not find a block at specified location.'); return; } const sign = block.getComponent(BlockComponentTypes.Sign) as BlockSignComponent; if (sign) { // RawMessage const helloWorldMessage: RawMessage = { text: 'Hello World' }; sign.setText(helloWorldMessage); // RawText const helloWorldText: RawText = { rawtext: [{ text: 'Hello World' }] }; sign.setText(helloWorldText); // Regular string sign.setText('Hello World'); } else { console.warn('Could not find a sign component on the block.'); } } ``` **addTranslatedSign.ts** ```typescript import { world, BlockPermutation, BlockSignComponent, BlockComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function addTranslatedSign(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); const dim = players[0].dimension; const signBlock = dim.getBlock(targetLocation); if (!signBlock) { log('Could not find a block at specified location.'); return -1; } const signPerm = BlockPermutation.resolve(MinecraftBlockTypes.StandingSign, { ground_sign_direction: 8 }); signBlock.setPermutation(signPerm); const signComponent = signBlock.getComponent(BlockComponentTypes.Sign) as BlockSignComponent; signComponent?.setText({ translate: 'item.skull.player.name', with: [players[0].name] }); } ``` ## Extends - [`BlockComponent`](/server/classes/BlockComponent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此组件所属的方块。 Block instance that this component pertains to. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`block`](/server/classes/BlockComponent.md#block) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`isValid`](/server/classes/BlockComponent.md#isvalid) *** ### isWaxed > `readonly` **isWaxed**: `boolean` **`Beta`** #### Remarks 玩家是否可以编辑告示牌。如果告示牌被使用过蜂巢或调用了 `setWaxed`,则会发生这种情况。 Whether or not players can edit the sign. This happens if a sign has had a honeycomb used on it or `setWaxed` was called on the sign. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`BlockComponent`](/server/classes/BlockComponent.md).[`typeId`](/server/classes/BlockComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:sign"` = `'minecraft:sign'` **`Beta`** ## Methods ### getRawText() > **getRawText**(`side?`): [`RawText`](/server/interfaces/RawText.md) | `undefined` **`Beta`** #### Parameters ##### side? [`SignSide`](/server/enums/SignSide.md) 要读取消息的告示牌面。如果未提供,则将返回告示牌正面的消息。 默认为:0 The side of the sign to read the message from. If not provided, this will return the message from the front side of the sign. Defaults to: 0 #### Returns [`RawText`](/server/interfaces/RawText.md) | `undefined` #### Remarks 如果使用 RawMessage 或 RawText 对象调用了 `setText`,则返回告示牌的 RawText,否则返回 `undefined`。 Returns the RawText of the sign if `setText` was called with a RawMessage or a RawText object, otherwise returns undefined. #### Throws This function can throw errors. *** ### getText() > **getText**(`side?`): `string` | `undefined` **`Beta`** #### Parameters ##### side? [`SignSide`](/server/enums/SignSide.md) 要读取消息的告示牌面。如果未提供,则将返回告示牌正面的消息。 默认为:0 The side of the sign to read the message from. If not provided, this will return the message from the front side of the sign. Defaults to: 0 #### Returns `string` | `undefined` #### Remarks 如果使用字符串调用了 `setText`,则返回告示牌的文本,否则返回 `undefined`。 Returns the text of the sign if `setText` was called with a string, otherwise returns undefined. #### Throws This function can throw errors. *** ### getTextDyeColor() > **getTextDyeColor**(`side?`): [`DyeColor`](/server/enums/DyeColor.md) | `undefined` **`Beta`** #### Parameters ##### side? [`SignSide`](/server/enums/SignSide.md) 要读取染料的告示牌面。如果未提供,则将返回告示牌正面的染料。 默认为:0 The side of the sign to read the dye from. If not provided, this will return the dye on the front side of the sign. Defaults to: 0 #### Returns [`DyeColor`](/server/enums/DyeColor.md) | `undefined` #### Remarks 获取文字上的染料,如果告示牌未被染色,则返回 `undefined`。 Gets the dye that is on the text or undefined if the sign has not been dyed. #### Throws This function can throw errors. *** ### setText() > **setText**(`message`, `side?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### message `string` | [`RawMessage`](/server/interfaces/RawMessage.md) 要在告示牌上设置的消息。如果设置为字符串,则调用 `getText` 来读取该字符串。如果设置为 RawMessage,则调用 `getRawText` 将返回 RawText。 The message to set on the sign. If set to a string, then call `getText` to read that string. If set to a RawMessage, then calling `getRawText` will return a RawText. ##### side? [`SignSide`](/server/enums/SignSide.md) 消息将被设置到的告示牌面。如果未提供,消息将设置在告示牌的正面。 默认为:0 The side of the sign the message will be set on. If not provided, the message will be set on the front side of the sign. Defaults to: 0 #### Returns `void` #### Remarks 设置告示牌组件的文本。 Sets the text of the sign component. #### Throws 如果提供的消息长度超过 512 个字符,则抛出错误。 Throws if the provided message is greater than 512 characters in length. *** ### setTextDyeColor() > **setTextDyeColor**(`color?`, `side?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### color? [`DyeColor`](/server/enums/DyeColor.md) 要应用于告示牌的染料颜色,或 `undefined` 以清除告示牌上的染料。 默认为:null The dye color to apply to the sign or undefined to clear the dye on the sign. Defaults to: null ##### side? [`SignSide`](/server/enums/SignSide.md) 颜色将被设置到的告示牌面。如果未提供,颜色将设置在告示牌的正面。 默认为:0 The side of the sign the color will be set on. If not provided, the color will be set on the front side of the sign. Defaults to: 0 #### Returns `void` #### Remarks 设置文字的染料颜色。 Sets the dye color of the text. #### Throws This function can throw errors. *** ### setWaxed() > **setWaxed**(`waxed`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### waxed `boolean` #### Returns `void` #### Remarks 使玩家无法编辑此告示牌。 Makes it so players cannot edit this sign. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityComponent.md. # Class: EntityComponent entity component **`Beta`** 下游实体组件的基类。 Base class for downstream entity components. ## Extends - [`Component`](/server/classes/Component.md) ## Extended by - [`EntityAddRiderComponent`](/server/classes/EntityAddRiderComponent.md) - [`EntityAgeableComponent`](/server/classes/EntityAgeableComponent.md) - [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md) - [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md) - [`EntityBreathableComponent`](/server/classes/EntityBreathableComponent.md) - [`EntityCanClimbComponent`](/server/classes/EntityCanClimbComponent.md) - [`EntityCanFlyComponent`](/server/classes/EntityCanFlyComponent.md) - [`EntityCanPowerJumpComponent`](/server/classes/EntityCanPowerJumpComponent.md) - [`EntityColor2Component`](/server/classes/EntityColor2Component.md) - [`EntityColorComponent`](/server/classes/EntityColorComponent.md) - [`EntityEnderInventoryComponent`](/server/classes/EntityEnderInventoryComponent.md) - [`EntityEquippableComponent`](/server/classes/EntityEquippableComponent.md) - [`EntityFireImmuneComponent`](/server/classes/EntityFireImmuneComponent.md) - [`EntityFloatsInLiquidComponent`](/server/classes/EntityFloatsInLiquidComponent.md) - [`EntityFlyingSpeedComponent`](/server/classes/EntityFlyingSpeedComponent.md) - [`EntityFrictionModifierComponent`](/server/classes/EntityFrictionModifierComponent.md) - [`EntityHealableComponent`](/server/classes/EntityHealableComponent.md) - [`EntityInventoryComponent`](/server/classes/EntityInventoryComponent.md) - [`EntityIsBabyComponent`](/server/classes/EntityIsBabyComponent.md) - [`EntityIsChargedComponent`](/server/classes/EntityIsChargedComponent.md) - [`EntityIsChestedComponent`](/server/classes/EntityIsChestedComponent.md) - [`EntityIsDyeableComponent`](/server/classes/EntityIsDyeableComponent.md) - [`EntityIsHiddenWhenInvisibleComponent`](/server/classes/EntityIsHiddenWhenInvisibleComponent.md) - [`EntityIsIgnitedComponent`](/server/classes/EntityIsIgnitedComponent.md) - [`EntityIsIllagerCaptainComponent`](/server/classes/EntityIsIllagerCaptainComponent.md) - [`EntityIsSaddledComponent`](/server/classes/EntityIsSaddledComponent.md) - [`EntityIsShakingComponent`](/server/classes/EntityIsShakingComponent.md) - [`EntityIsShearedComponent`](/server/classes/EntityIsShearedComponent.md) - [`EntityIsStackableComponent`](/server/classes/EntityIsStackableComponent.md) - [`EntityIsStunnedComponent`](/server/classes/EntityIsStunnedComponent.md) - [`EntityIsTamedComponent`](/server/classes/EntityIsTamedComponent.md) - [`EntityItemComponent`](/server/classes/EntityItemComponent.md) - [`EntityLeashableComponent`](/server/classes/EntityLeashableComponent.md) - [`EntityMarkVariantComponent`](/server/classes/EntityMarkVariantComponent.md) - [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md) - [`EntityNpcComponent`](/server/classes/EntityNpcComponent.md) - [`EntityOnFireComponent`](/server/classes/EntityOnFireComponent.md) - [`EntityProjectileComponent`](/server/classes/EntityProjectileComponent.md) - [`EntityPushThroughComponent`](/server/classes/EntityPushThroughComponent.md) - [`EntityRideableComponent`](/server/classes/EntityRideableComponent.md) - [`EntityRidingComponent`](/server/classes/EntityRidingComponent.md) - [`EntityScaleComponent`](/server/classes/EntityScaleComponent.md) - [`EntitySkinIdComponent`](/server/classes/EntitySkinIdComponent.md) - [`EntityStrengthComponent`](/server/classes/EntityStrengthComponent.md) - [`EntityTameableComponent`](/server/classes/EntityTameableComponent.md) - [`EntityTameMountComponent`](/server/classes/EntityTameMountComponent.md) - [`EntityTypeFamilyComponent`](/server/classes/EntityTypeFamilyComponent.md) - [`EntityVariantComponent`](/server/classes/EntityVariantComponent.md) - [`EntityWantsJockeyComponent`](/server/classes/EntityWantsJockeyComponent.md) - [`PlayerCursorInventoryComponent`](/server/classes/PlayerCursorInventoryComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`Component`](/server/classes/Component.md).[`isValid`](/server/classes/Component.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`Component`](/server/classes/Component.md).[`typeId`](/server/classes/Component.md#typeid) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityAttributeComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityAttributeComponent.md. # Class: EntityAttributeComponent entity component **`Beta`** 这是任何以数字为中心、可以定义最小值、最大值和默认值的实体组件的基类抽象类。 This is a base abstract class for any entity component that centers around a number and can have a minimum, maximum, and default defined value. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Extended by - [`EntityExhaustionComponent`](/server/classes/EntityExhaustionComponent.md) - [`EntityHealthComponent`](/server/classes/EntityHealthComponent.md) - [`EntityHungerComponent`](/server/classes/EntityHungerComponent.md) - [`EntityLavaMovementComponent`](/server/classes/EntityLavaMovementComponent.md) - [`EntityMovementComponent`](/server/classes/EntityMovementComponent.md) - [`EntitySaturationComponent`](/server/classes/EntitySaturationComponent.md) - [`EntityUnderwaterMovementComponent`](/server/classes/EntityUnderwaterMovementComponent.md) ## Properties ### currentValue > `readonly` **currentValue**: `number` **`Beta`** #### Remarks 此实例当前属性的值。 Current value of this attribute for this instance. #### Throws This property can throw when used. *** ### defaultValue > `readonly` **defaultValue**: `number` **`Beta`** #### Remarks 返回此属性的默认定义值。 Returns the default defined value for this attribute. #### Throws This property can throw when used. *** ### effectiveMax > `readonly` **effectiveMax**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最大值。 Returns the effective max of this attribute given any other ambient components or factors. #### Throws This property can throw when used. *** ### effectiveMin > `readonly` **effectiveMin**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最小值。 Returns the effective min of this attribute given any other ambient components or factors. #### Throws This property can throw when used. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) ## Methods ### resetToDefaultValue() > **resetToDefaultValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的默认值。 Resets the current value of this attribute to the defined default value. #### Throws This function can throw errors. *** ### resetToMaxValue() > **resetToMaxValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最大值。 Resets the current value of this attribute to the maximum defined value. #### Throws This function can throw errors. *** ### resetToMinValue() > **resetToMinValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最小值。 Resets the current value of this attribute to the minimum defined value. #### Throws This function can throw errors. *** ### setCurrentValue() > **setCurrentValue**(`value`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### value `number` #### Returns `boolean` #### Remarks 设置此属性的当前值。 Sets the current value of this attribute. #### Throws 如果值超出范围,将抛出 ArgumentOutOfBounds Error。 If the value is out of bounds, an ArgumentOutOfBounds Error is thrown. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) - [EntityBreathableComponent](/server/classes/EntityBreathableComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityExhaustionComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityExhaustionComponent.md. # Class: EntityExhaustionComponent entity component **`Beta`** 定义与此实体的 exhaustion(疲劳度)交互方式。封装了 `minecraft:player.exhaustion` 属性。 Defines the interactions with this entity for Exhaustion. Wraps the `minecraft.player.exhaustion` attribute. ## Extends - [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md) ## Properties ### currentValue > `readonly` **currentValue**: `number` **`Beta`** #### Remarks 此实例当前属性的值。 Current value of this attribute for this instance. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`currentValue`](/server/classes/EntityAttributeComponent.md#currentvalue) *** ### defaultValue > `readonly` **defaultValue**: `number` **`Beta`** #### Remarks 返回此属性的默认定义值。 Returns the default defined value for this attribute. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`defaultValue`](/server/classes/EntityAttributeComponent.md#defaultvalue) *** ### effectiveMax > `readonly` **effectiveMax**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最大值。 Returns the effective max of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMax`](/server/classes/EntityAttributeComponent.md#effectivemax) *** ### effectiveMin > `readonly` **effectiveMin**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最小值。 Returns the effective min of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMin`](/server/classes/EntityAttributeComponent.md#effectivemin) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`entity`](/server/classes/EntityAttributeComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`isValid`](/server/classes/EntityAttributeComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`typeId`](/server/classes/EntityAttributeComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:player.exhaustion"` = `'minecraft:player.exhaustion'` **`Beta`** ## Methods ### resetToDefaultValue() > **resetToDefaultValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的默认值。 Resets the current value of this attribute to the defined default value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToDefaultValue`](/server/classes/EntityAttributeComponent.md#resettodefaultvalue) *** ### resetToMaxValue() > **resetToMaxValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最大值。 Resets the current value of this attribute to the maximum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMaxValue`](/server/classes/EntityAttributeComponent.md#resettomaxvalue) *** ### resetToMinValue() > **resetToMinValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最小值。 Resets the current value of this attribute to the minimum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMinValue`](/server/classes/EntityAttributeComponent.md#resettominvalue) *** ### setCurrentValue() > **setCurrentValue**(`value`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### value `number` #### Returns `boolean` #### Remarks 设置此属性的当前值。 Sets the current value of this attribute. #### Throws 如果值超出范围,将抛出 ArgumentOutOfBounds Error。 If the value is out of bounds, an ArgumentOutOfBounds Error is thrown. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`setCurrentValue`](/server/classes/EntityAttributeComponent.md#setcurrentvalue) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHealthComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHealthComponent.md. # Class: EntityHealthComponent entity damage component **`Beta`** 定义实体的生命值属性。 Defines the health properties of an entity. ## Example **applyDamageThenHeal.ts** ```typescript import { system, EntityHealthComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function applyDamageThenHeal(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const skelly = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Skeleton, targetLocation); skelly.applyDamage(19); // skeletons have max damage of 20 so this is a near-death skeleton system.runTimeout(() => { const health = skelly.getComponent(EntityComponentTypes.Health) as EntityHealthComponent; log('Skeleton health before heal: ' + health?.currentValue); health?.resetToMaxValue(); log('Skeleton health after heal: ' + health?.currentValue); }, 20); } ``` ## Extends - [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md) ## Properties ### currentValue > `readonly` **currentValue**: `number` **`Beta`** #### Remarks 此实例当前属性的值。 Current value of this attribute for this instance. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`currentValue`](/server/classes/EntityAttributeComponent.md#currentvalue) *** ### defaultValue > `readonly` **defaultValue**: `number` **`Beta`** #### Remarks 返回此属性的默认定义值。 Returns the default defined value for this attribute. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`defaultValue`](/server/classes/EntityAttributeComponent.md#defaultvalue) *** ### effectiveMax > `readonly` **effectiveMax**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最大值。 Returns the effective max of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMax`](/server/classes/EntityAttributeComponent.md#effectivemax) *** ### effectiveMin > `readonly` **effectiveMin**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最小值。 Returns the effective min of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMin`](/server/classes/EntityAttributeComponent.md#effectivemin) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`entity`](/server/classes/EntityAttributeComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`isValid`](/server/classes/EntityAttributeComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`typeId`](/server/classes/EntityAttributeComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:health"` = `'minecraft:health'` **`Beta`** ## Methods ### resetToDefaultValue() > **resetToDefaultValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的默认值。 Resets the current value of this attribute to the defined default value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToDefaultValue`](/server/classes/EntityAttributeComponent.md#resettodefaultvalue) *** ### resetToMaxValue() > **resetToMaxValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最大值。 Resets the current value of this attribute to the maximum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMaxValue`](/server/classes/EntityAttributeComponent.md#resettomaxvalue) *** ### resetToMinValue() > **resetToMinValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最小值。 Resets the current value of this attribute to the minimum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMinValue`](/server/classes/EntityAttributeComponent.md#resettominvalue) *** ### setCurrentValue() > **setCurrentValue**(`value`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### value `number` #### Returns `boolean` #### Remarks 设置此属性的当前值。 Sets the current value of this attribute. #### Throws 如果值超出范围,将抛出 ArgumentOutOfBounds Error。 If the value is out of bounds, an ArgumentOutOfBounds Error is thrown. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`setCurrentValue`](/server/classes/EntityAttributeComponent.md#setcurrentvalue) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityApplyDamageByProjectileOptions](/server/interfaces/EntityApplyDamageByProjectileOptions.md) - [EntityApplyDamageOptions](/server/interfaces/EntityApplyDamageOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHungerComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHungerComponent.md. # Class: EntityHungerComponent entity component **`Beta`** 定义此实体与饥饿值的交互方式。封装了 `minecraft:player.hunger` 属性。 Defines the interactions with this entity for hunger. Wraps the `minecraft:player.hunger` attribute. ## Extends - [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md) ## Properties ### currentValue > `readonly` **currentValue**: `number` **`Beta`** #### Remarks 此实例当前属性的值。 Current value of this attribute for this instance. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`currentValue`](/server/classes/EntityAttributeComponent.md#currentvalue) *** ### defaultValue > `readonly` **defaultValue**: `number` **`Beta`** #### Remarks 返回此属性的默认定义值。 Returns the default defined value for this attribute. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`defaultValue`](/server/classes/EntityAttributeComponent.md#defaultvalue) *** ### effectiveMax > `readonly` **effectiveMax**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最大值。 Returns the effective max of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMax`](/server/classes/EntityAttributeComponent.md#effectivemax) *** ### effectiveMin > `readonly` **effectiveMin**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最小值。 Returns the effective min of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMin`](/server/classes/EntityAttributeComponent.md#effectivemin) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`entity`](/server/classes/EntityAttributeComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`isValid`](/server/classes/EntityAttributeComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`typeId`](/server/classes/EntityAttributeComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:player.hunger"` = `'minecraft:player.hunger'` **`Beta`** ## Methods ### resetToDefaultValue() > **resetToDefaultValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的默认值。 Resets the current value of this attribute to the defined default value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToDefaultValue`](/server/classes/EntityAttributeComponent.md#resettodefaultvalue) *** ### resetToMaxValue() > **resetToMaxValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最大值。 Resets the current value of this attribute to the maximum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMaxValue`](/server/classes/EntityAttributeComponent.md#resettomaxvalue) *** ### resetToMinValue() > **resetToMinValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最小值。 Resets the current value of this attribute to the minimum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMinValue`](/server/classes/EntityAttributeComponent.md#resettominvalue) *** ### setCurrentValue() > **setCurrentValue**(`value`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### value `number` #### Returns `boolean` #### Remarks 设置此属性的当前值。 Sets the current value of this attribute. #### Throws 如果值超出范围,将抛出 ArgumentOutOfBounds Error。 If the value is out of bounds, an ArgumentOutOfBounds Error is thrown. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`setCurrentValue`](/server/classes/EntityAttributeComponent.md#setcurrentvalue) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityLavaMovementComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityLavaMovementComponent.md. # Class: EntityLavaMovementComponent entity component **`Beta`** Defines the base movement speed in lava of this entity. ## Extends - [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md) ## Properties ### currentValue > `readonly` **currentValue**: `number` **`Beta`** #### Remarks 此实例当前属性的值。 Current value of this attribute for this instance. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`currentValue`](/server/classes/EntityAttributeComponent.md#currentvalue) *** ### defaultValue > `readonly` **defaultValue**: `number` **`Beta`** #### Remarks 返回此属性的默认定义值。 Returns the default defined value for this attribute. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`defaultValue`](/server/classes/EntityAttributeComponent.md#defaultvalue) *** ### effectiveMax > `readonly` **effectiveMax**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最大值。 Returns the effective max of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMax`](/server/classes/EntityAttributeComponent.md#effectivemax) *** ### effectiveMin > `readonly` **effectiveMin**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最小值。 Returns the effective min of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMin`](/server/classes/EntityAttributeComponent.md#effectivemin) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`entity`](/server/classes/EntityAttributeComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`isValid`](/server/classes/EntityAttributeComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`typeId`](/server/classes/EntityAttributeComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:lava_movement"` = `'minecraft:lava_movement'` **`Beta`** ## Methods ### resetToDefaultValue() > **resetToDefaultValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的默认值。 Resets the current value of this attribute to the defined default value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToDefaultValue`](/server/classes/EntityAttributeComponent.md#resettodefaultvalue) *** ### resetToMaxValue() > **resetToMaxValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最大值。 Resets the current value of this attribute to the maximum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMaxValue`](/server/classes/EntityAttributeComponent.md#resettomaxvalue) *** ### resetToMinValue() > **resetToMinValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最小值。 Resets the current value of this attribute to the minimum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMinValue`](/server/classes/EntityAttributeComponent.md#resettominvalue) *** ### setCurrentValue() > **setCurrentValue**(`value`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### value `number` #### Returns `boolean` #### Remarks 设置此属性的当前值。 Sets the current value of this attribute. #### Throws 如果值超出范围,将抛出 ArgumentOutOfBounds Error。 If the value is out of bounds, an ArgumentOutOfBounds Error is thrown. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`setCurrentValue`](/server/classes/EntityAttributeComponent.md#setcurrentvalue) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMovementComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMovementComponent.md. # Class: EntityMovementComponent entity component **`Beta`** Defines the general movement speed of this entity. ## Extends - [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md) ## Properties ### currentValue > `readonly` **currentValue**: `number` **`Beta`** #### Remarks 此实例当前属性的值。 Current value of this attribute for this instance. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`currentValue`](/server/classes/EntityAttributeComponent.md#currentvalue) *** ### defaultValue > `readonly` **defaultValue**: `number` **`Beta`** #### Remarks 返回此属性的默认定义值。 Returns the default defined value for this attribute. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`defaultValue`](/server/classes/EntityAttributeComponent.md#defaultvalue) *** ### effectiveMax > `readonly` **effectiveMax**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最大值。 Returns the effective max of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMax`](/server/classes/EntityAttributeComponent.md#effectivemax) *** ### effectiveMin > `readonly` **effectiveMin**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最小值。 Returns the effective min of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMin`](/server/classes/EntityAttributeComponent.md#effectivemin) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`entity`](/server/classes/EntityAttributeComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`isValid`](/server/classes/EntityAttributeComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`typeId`](/server/classes/EntityAttributeComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movement"` = `'minecraft:movement'` **`Beta`** ## Methods ### resetToDefaultValue() > **resetToDefaultValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的默认值。 Resets the current value of this attribute to the defined default value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToDefaultValue`](/server/classes/EntityAttributeComponent.md#resettodefaultvalue) *** ### resetToMaxValue() > **resetToMaxValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最大值。 Resets the current value of this attribute to the maximum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMaxValue`](/server/classes/EntityAttributeComponent.md#resettomaxvalue) *** ### resetToMinValue() > **resetToMinValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最小值。 Resets the current value of this attribute to the minimum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMinValue`](/server/classes/EntityAttributeComponent.md#resettominvalue) *** ### setCurrentValue() > **setCurrentValue**(`value`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### value `number` #### Returns `boolean` #### Remarks 设置此属性的当前值。 Sets the current value of this attribute. #### Throws 如果值超出范围,将抛出 ArgumentOutOfBounds Error。 If the value is out of bounds, an ArgumentOutOfBounds Error is thrown. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`setCurrentValue`](/server/classes/EntityAttributeComponent.md#setcurrentvalue) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntitySaturationComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntitySaturationComponent.md. # Class: EntitySaturationComponent entity component **`Beta`** 定义此实体与饱和度的交互方式。封装了 `minecraft:player.saturation` 属性。 Defines the interactions with this entity for saturation. Wraps the `minecraft:player.saturation` attribute. ## Extends - [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md) ## Properties ### currentValue > `readonly` **currentValue**: `number` **`Beta`** #### Remarks 此实例当前属性的值。 Current value of this attribute for this instance. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`currentValue`](/server/classes/EntityAttributeComponent.md#currentvalue) *** ### defaultValue > `readonly` **defaultValue**: `number` **`Beta`** #### Remarks 返回此属性的默认定义值。 Returns the default defined value for this attribute. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`defaultValue`](/server/classes/EntityAttributeComponent.md#defaultvalue) *** ### effectiveMax > `readonly` **effectiveMax**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最大值。 Returns the effective max of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMax`](/server/classes/EntityAttributeComponent.md#effectivemax) *** ### effectiveMin > `readonly` **effectiveMin**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最小值。 Returns the effective min of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMin`](/server/classes/EntityAttributeComponent.md#effectivemin) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`entity`](/server/classes/EntityAttributeComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`isValid`](/server/classes/EntityAttributeComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`typeId`](/server/classes/EntityAttributeComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:player.saturation"` = `'minecraft:player.saturation'` **`Beta`** ## Methods ### resetToDefaultValue() > **resetToDefaultValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的默认值。 Resets the current value of this attribute to the defined default value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToDefaultValue`](/server/classes/EntityAttributeComponent.md#resettodefaultvalue) *** ### resetToMaxValue() > **resetToMaxValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最大值。 Resets the current value of this attribute to the maximum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMaxValue`](/server/classes/EntityAttributeComponent.md#resettomaxvalue) *** ### resetToMinValue() > **resetToMinValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最小值。 Resets the current value of this attribute to the minimum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMinValue`](/server/classes/EntityAttributeComponent.md#resettominvalue) *** ### setCurrentValue() > **setCurrentValue**(`value`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### value `number` #### Returns `boolean` #### Remarks 设置此属性的当前值。 Sets the current value of this attribute. #### Throws 如果值超出范围,将抛出 ArgumentOutOfBounds Error。 If the value is out of bounds, an ArgumentOutOfBounds Error is thrown. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`setCurrentValue`](/server/classes/EntityAttributeComponent.md#setcurrentvalue) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityUnderwaterMovementComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityUnderwaterMovementComponent.md. # Class: EntityUnderwaterMovementComponent entity component **`Beta`** Defines the general movement speed underwater of this entity. ## Extends - [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md) ## Properties ### currentValue > `readonly` **currentValue**: `number` **`Beta`** #### Remarks 此实例当前属性的值。 Current value of this attribute for this instance. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`currentValue`](/server/classes/EntityAttributeComponent.md#currentvalue) *** ### defaultValue > `readonly` **defaultValue**: `number` **`Beta`** #### Remarks 返回此属性的默认定义值。 Returns the default defined value for this attribute. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`defaultValue`](/server/classes/EntityAttributeComponent.md#defaultvalue) *** ### effectiveMax > `readonly` **effectiveMax**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最大值。 Returns the effective max of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMax`](/server/classes/EntityAttributeComponent.md#effectivemax) *** ### effectiveMin > `readonly` **effectiveMin**: `number` **`Beta`** #### Remarks 返回给定任何其他环境组件或因素后此属性的有效最小值。 Returns the effective min of this attribute given any other ambient components or factors. #### Throws This property can throw when used. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`effectiveMin`](/server/classes/EntityAttributeComponent.md#effectivemin) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`entity`](/server/classes/EntityAttributeComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`isValid`](/server/classes/EntityAttributeComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`typeId`](/server/classes/EntityAttributeComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:underwater_movement"` = `'minecraft:underwater_movement'` **`Beta`** ## Methods ### resetToDefaultValue() > **resetToDefaultValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的默认值。 Resets the current value of this attribute to the defined default value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToDefaultValue`](/server/classes/EntityAttributeComponent.md#resettodefaultvalue) *** ### resetToMaxValue() > **resetToMaxValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最大值。 Resets the current value of this attribute to the maximum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMaxValue`](/server/classes/EntityAttributeComponent.md#resettomaxvalue) *** ### resetToMinValue() > **resetToMinValue**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将此属性的当前值重置为定义的最小值。 Resets the current value of this attribute to the minimum defined value. #### Throws This function can throw errors. #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`resetToMinValue`](/server/classes/EntityAttributeComponent.md#resettominvalue) *** ### setCurrentValue() > **setCurrentValue**(`value`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### value `number` #### Returns `boolean` #### Remarks 设置此属性的当前值。 Sets the current value of this attribute. #### Throws 如果值超出范围,将抛出 ArgumentOutOfBounds Error。 If the value is out of bounds, an ArgumentOutOfBounds Error is thrown. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityAttributeComponent`](/server/classes/EntityAttributeComponent.md).[`setCurrentValue`](/server/classes/EntityAttributeComponent.md#setcurrentvalue) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityBaseMovementComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityBaseMovementComponent.md. # Class: EntityBaseMovementComponent entity component **`Beta`** 实体移动事件系列的基类。 Base class for a family of entity movement events. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Extended by - [`EntityMovementAmphibiousComponent`](/server/classes/EntityMovementAmphibiousComponent.md) - [`EntityMovementBasicComponent`](/server/classes/EntityMovementBasicComponent.md) - [`EntityMovementFlyComponent`](/server/classes/EntityMovementFlyComponent.md) - [`EntityMovementGenericComponent`](/server/classes/EntityMovementGenericComponent.md) - [`EntityMovementGlideComponent`](/server/classes/EntityMovementGlideComponent.md) - [`EntityMovementHoverComponent`](/server/classes/EntityMovementHoverComponent.md) - [`EntityMovementJumpComponent`](/server/classes/EntityMovementJumpComponent.md) - [`EntityMovementSkipComponent`](/server/classes/EntityMovementSkipComponent.md) - [`EntityMovementSwayComponent`](/server/classes/EntityMovementSwayComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### maxTurn > `readonly` **maxTurn**: `number` **`Beta`** #### Remarks 该生物此移动模式的最大转弯速率。 Maximum turn rate for this movement modality of the mob. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBreathableComponent](/server/classes/EntityBreathableComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMovementAmphibiousComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMovementAmphibiousComponent.md. # Class: EntityMovementAmphibiousComponent entity component **`Beta`** 允许该实体在两栖环境中移动。 Allows this entity to move in amphibious environments. ## Extends - [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`entity`](/server/classes/EntityBaseMovementComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`isValid`](/server/classes/EntityBaseMovementComponent.md#isvalid) *** ### maxTurn > `readonly` **maxTurn**: `number` **`Beta`** #### Remarks 该生物此移动模式的最大转弯速率。 Maximum turn rate for this movement modality of the mob. #### Throws This property can throw when used. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`maxTurn`](/server/classes/EntityBaseMovementComponent.md#maxturn) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`typeId`](/server/classes/EntityBaseMovementComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movement.amphibious"` = `'minecraft:movement.amphibious'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMovementBasicComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMovementBasicComponent.md. # Class: EntityMovementBasicComponent entity component **`Beta`** 允许该实体在平面上基本移动。 Allows this entity to move basically on a plane. ## Extends - [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`entity`](/server/classes/EntityBaseMovementComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`isValid`](/server/classes/EntityBaseMovementComponent.md#isvalid) *** ### maxTurn > `readonly` **maxTurn**: `number` **`Beta`** #### Remarks 该生物此移动模式的最大转弯速率。 Maximum turn rate for this movement modality of the mob. #### Throws This property can throw when used. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`maxTurn`](/server/classes/EntityBaseMovementComponent.md#maxturn) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`typeId`](/server/classes/EntityBaseMovementComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movement.basic"` = `'minecraft:movement.basic'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMovementFlyComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMovementFlyComponent.md. # Class: EntityMovementFlyComponent entity component **`Beta`** 允许该实体在空中飞行移动。 Allows this entity to move by flying through the air. ## Extends - [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`entity`](/server/classes/EntityBaseMovementComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`isValid`](/server/classes/EntityBaseMovementComponent.md#isvalid) *** ### maxTurn > `readonly` **maxTurn**: `number` **`Beta`** #### Remarks 该生物此移动模式的最大转弯速率。 Maximum turn rate for this movement modality of the mob. #### Throws This property can throw when used. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`maxTurn`](/server/classes/EntityBaseMovementComponent.md#maxturn) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`typeId`](/server/classes/EntityBaseMovementComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movement.fly"` = `'minecraft:movement.fly'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMovementGenericComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMovementGenericComponent.md. # Class: EntityMovementGenericComponent entity component **`Beta`** 允许该实体通用移动。 Allows this entity to move generically. ## Extends - [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`entity`](/server/classes/EntityBaseMovementComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`isValid`](/server/classes/EntityBaseMovementComponent.md#isvalid) *** ### maxTurn > `readonly` **maxTurn**: `number` **`Beta`** #### Remarks 该生物此移动模式的最大转弯速率。 Maximum turn rate for this movement modality of the mob. #### Throws This property can throw when used. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`maxTurn`](/server/classes/EntityBaseMovementComponent.md#maxturn) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`typeId`](/server/classes/EntityBaseMovementComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movement.generic"` = `'minecraft:movement.generic'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMovementGlideComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMovementGlideComponent.md. # Class: EntityMovementGlideComponent entity component **`Beta`** When added, this movement control allows the mob to glide. ## Extends - [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`entity`](/server/classes/EntityBaseMovementComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`isValid`](/server/classes/EntityBaseMovementComponent.md#isvalid) *** ### maxTurn > `readonly` **maxTurn**: `number` **`Beta`** #### Remarks 该生物此移动模式的最大转弯速率。 Maximum turn rate for this movement modality of the mob. #### Throws This property can throw when used. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`maxTurn`](/server/classes/EntityBaseMovementComponent.md#maxturn) *** ### speedWhenTurning > `readonly` **speedWhenTurning**: `number` **`Beta`** #### Remarks Speed in effect when the entity is turning. #### Throws This property can throw when used. *** ### startSpeed > `readonly` **startSpeed**: `number` **`Beta`** #### Remarks Start speed during a glide. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`typeId`](/server/classes/EntityBaseMovementComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movement.glide"` = `'minecraft:movement.glide'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMovementHoverComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMovementHoverComponent.md. # Class: EntityMovementHoverComponent entity component **`Beta`** 允许该实体悬停移动。 Allows this entity to move by hovering. ## Extends - [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`entity`](/server/classes/EntityBaseMovementComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`isValid`](/server/classes/EntityBaseMovementComponent.md#isvalid) *** ### maxTurn > `readonly` **maxTurn**: `number` **`Beta`** #### Remarks 该生物此移动模式的最大转弯速率。 Maximum turn rate for this movement modality of the mob. #### Throws This property can throw when used. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`maxTurn`](/server/classes/EntityBaseMovementComponent.md#maxturn) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`typeId`](/server/classes/EntityBaseMovementComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movement.hover"` = `'minecraft:movement.hover'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMovementJumpComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMovementJumpComponent.md. # Class: EntityMovementJumpComponent entity component **`Beta`** 允许该实体跳跃移动。 Allows this entity to move by jumping. ## Extends - [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`entity`](/server/classes/EntityBaseMovementComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`isValid`](/server/classes/EntityBaseMovementComponent.md#isvalid) *** ### maxTurn > `readonly` **maxTurn**: `number` **`Beta`** #### Remarks 该生物此移动模式的最大转弯速率。 Maximum turn rate for this movement modality of the mob. #### Throws This property can throw when used. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`maxTurn`](/server/classes/EntityBaseMovementComponent.md#maxturn) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`typeId`](/server/classes/EntityBaseMovementComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movement.jump"` = `'minecraft:movement.jump'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMovementSkipComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMovementSkipComponent.md. # Class: EntityMovementSkipComponent entity component **`Beta`** 允许该实体跳跃式移动。 Allows this entity to move by skipping. ## Extends - [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`entity`](/server/classes/EntityBaseMovementComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`isValid`](/server/classes/EntityBaseMovementComponent.md#isvalid) *** ### maxTurn > `readonly` **maxTurn**: `number` **`Beta`** #### Remarks 该生物此移动模式的最大转弯速率。 Maximum turn rate for this movement modality of the mob. #### Throws This property can throw when used. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`maxTurn`](/server/classes/EntityBaseMovementComponent.md#maxturn) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`typeId`](/server/classes/EntityBaseMovementComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movement.skip"` = `'minecraft:movement.skip'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMovementSwayComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMovementSwayComponent.md. # Class: EntityMovementSwayComponent entity component **`Beta`** When added, this move control causes the mob to sway side to side giving the impression it is swimming. ## Extends - [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`entity`](/server/classes/EntityBaseMovementComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`isValid`](/server/classes/EntityBaseMovementComponent.md#isvalid) *** ### maxTurn > `readonly` **maxTurn**: `number` **`Beta`** #### Remarks 该生物此移动模式的最大转弯速率。 Maximum turn rate for this movement modality of the mob. #### Throws This property can throw when used. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`maxTurn`](/server/classes/EntityBaseMovementComponent.md#maxturn) *** ### swayAmplitude > `readonly` **swayAmplitude**: `number` **`Beta`** #### Remarks Amplitude of the sway motion. #### Throws This property can throw when used. *** ### swayFrequency > `readonly` **swayFrequency**: `number` **`Beta`** #### Remarks Amount of sway frequency. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityBaseMovementComponent`](/server/classes/EntityBaseMovementComponent.md).[`typeId`](/server/classes/EntityBaseMovementComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:movement.sway"` = `'minecraft:movement.sway'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityNavigationComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityNavigationComponent.md. # Class: EntityNavigationComponent entity component **`Beta`** Allows this entity to generate paths that include vertical walls (for example, like Minecraft spiders do.) ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Extended by - [`EntityNavigationClimbComponent`](/server/classes/EntityNavigationClimbComponent.md) - [`EntityNavigationFloatComponent`](/server/classes/EntityNavigationFloatComponent.md) - [`EntityNavigationFlyComponent`](/server/classes/EntityNavigationFlyComponent.md) - [`EntityNavigationGenericComponent`](/server/classes/EntityNavigationGenericComponent.md) - [`EntityNavigationHoverComponent`](/server/classes/EntityNavigationHoverComponent.md) - [`EntityNavigationWalkComponent`](/server/classes/EntityNavigationWalkComponent.md) ## Properties ### avoidDamageBlocks > `readonly` **avoidDamageBlocks**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid blocks that cause damage when finding a path. #### Throws This property can throw when used. *** ### avoidPortals > `readonly` **avoidPortals**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid portals (like nether portals) when finding a path. #### Throws This property can throw when used. *** ### avoidSun > `readonly` **avoidSun**: `boolean` **`Beta`** #### Remarks Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths. #### Throws This property can throw when used. *** ### avoidWater > `readonly` **avoidWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid water when creating a path. #### Throws This property can throw when used. *** ### canBreach > `readonly` **canBreach**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump out of water (like a dolphin). #### Throws This property can throw when used. *** ### canBreakDoors > `readonly` **canBreakDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door and break it. #### Throws This property can throw when used. *** ### canFloat > `readonly` **canFloat**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can float. #### Throws This property can throw when used. *** ### canJump > `readonly` **canJump**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump up blocks. #### Throws This property can throw when used. *** ### canOpenDoors > `readonly` **canOpenDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door assuming the AI will open the door. #### Throws This property can throw when used. *** ### canOpenIronDoors > `readonly` **canOpenIronDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed iron door assuming the AI will open the door. #### Throws This property can throw when used. *** ### canPassDoors > `readonly` **canPassDoors**: `boolean` **`Beta`** #### Remarks Whether a path can be created through a door. #### Throws This property can throw when used. *** ### canPathFromAir > `readonly` **canPathFromAir**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can start pathing when in the air. #### Throws This property can throw when used. *** ### canPathOverLava > `readonly` **canPathOverLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the lava. #### Throws This property can throw when used. *** ### canPathOverWater > `readonly` **canPathOverWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the water. #### Throws This property can throw when used. *** ### canSink > `readonly` **canSink**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it will be pulled down by gravity while in water. #### Throws This property can throw when used. *** ### canSwim > `readonly` **canSwim**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can path anywhere through water and plays swimming animation along that path. #### Throws This property can throw when used. *** ### canWalk > `readonly` **canWalk**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground outside water. #### Throws This property can throw when used. *** ### canWalkInLava > `readonly` **canWalkInLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel in lava like walking on ground. #### Throws This property can throw when used. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isAmphibious > `readonly` **isAmphibious**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground or go underwater. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityNavigationClimbComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityNavigationClimbComponent.md. # Class: EntityNavigationClimbComponent entity component **`Beta`** Allows this entity to generate paths that include vertical walls (for example, like Minecraft spiders do.) ## Extends - [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md) ## Properties ### avoidDamageBlocks > `readonly` **avoidDamageBlocks**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid blocks that cause damage when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidDamageBlocks`](/server/classes/EntityNavigationComponent.md#avoiddamageblocks) *** ### avoidPortals > `readonly` **avoidPortals**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid portals (like nether portals) when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidPortals`](/server/classes/EntityNavigationComponent.md#avoidportals) *** ### avoidSun > `readonly` **avoidSun**: `boolean` **`Beta`** #### Remarks Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidSun`](/server/classes/EntityNavigationComponent.md#avoidsun) *** ### avoidWater > `readonly` **avoidWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid water when creating a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidWater`](/server/classes/EntityNavigationComponent.md#avoidwater) *** ### canBreach > `readonly` **canBreach**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump out of water (like a dolphin). #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreach`](/server/classes/EntityNavigationComponent.md#canbreach) *** ### canBreakDoors > `readonly` **canBreakDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door and break it. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreakDoors`](/server/classes/EntityNavigationComponent.md#canbreakdoors) *** ### canFloat > `readonly` **canFloat**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can float. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canFloat`](/server/classes/EntityNavigationComponent.md#canfloat) *** ### canJump > `readonly` **canJump**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump up blocks. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canJump`](/server/classes/EntityNavigationComponent.md#canjump) *** ### canOpenDoors > `readonly` **canOpenDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenDoors`](/server/classes/EntityNavigationComponent.md#canopendoors) *** ### canOpenIronDoors > `readonly` **canOpenIronDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed iron door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenIronDoors`](/server/classes/EntityNavigationComponent.md#canopenirondoors) *** ### canPassDoors > `readonly` **canPassDoors**: `boolean` **`Beta`** #### Remarks Whether a path can be created through a door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPassDoors`](/server/classes/EntityNavigationComponent.md#canpassdoors) *** ### canPathFromAir > `readonly` **canPathFromAir**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can start pathing when in the air. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathFromAir`](/server/classes/EntityNavigationComponent.md#canpathfromair) *** ### canPathOverLava > `readonly` **canPathOverLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the lava. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverLava`](/server/classes/EntityNavigationComponent.md#canpathoverlava) *** ### canPathOverWater > `readonly` **canPathOverWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverWater`](/server/classes/EntityNavigationComponent.md#canpathoverwater) *** ### canSink > `readonly` **canSink**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it will be pulled down by gravity while in water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSink`](/server/classes/EntityNavigationComponent.md#cansink) *** ### canSwim > `readonly` **canSwim**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can path anywhere through water and plays swimming animation along that path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSwim`](/server/classes/EntityNavigationComponent.md#canswim) *** ### canWalk > `readonly` **canWalk**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground outside water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalk`](/server/classes/EntityNavigationComponent.md#canwalk) *** ### canWalkInLava > `readonly` **canWalkInLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel in lava like walking on ground. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalkInLava`](/server/classes/EntityNavigationComponent.md#canwalkinlava) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`entity`](/server/classes/EntityNavigationComponent.md#entity) *** ### isAmphibious > `readonly` **isAmphibious**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground or go underwater. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isAmphibious`](/server/classes/EntityNavigationComponent.md#isamphibious) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isValid`](/server/classes/EntityNavigationComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`typeId`](/server/classes/EntityNavigationComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:navigation.climb"` = `'minecraft:navigation.climb'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityNavigationFloatComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityNavigationFloatComponent.md. # Class: EntityNavigationFloatComponent entity component **`Beta`** 允许该实体像在水中浮游的生物一样导航。 Allows this entity to navigate like a floating mob in water. ## Extends - [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md) ## Properties ### avoidDamageBlocks > `readonly` **avoidDamageBlocks**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid blocks that cause damage when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidDamageBlocks`](/server/classes/EntityNavigationComponent.md#avoiddamageblocks) *** ### avoidPortals > `readonly` **avoidPortals**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid portals (like nether portals) when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidPortals`](/server/classes/EntityNavigationComponent.md#avoidportals) *** ### avoidSun > `readonly` **avoidSun**: `boolean` **`Beta`** #### Remarks Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidSun`](/server/classes/EntityNavigationComponent.md#avoidsun) *** ### avoidWater > `readonly` **avoidWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid water when creating a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidWater`](/server/classes/EntityNavigationComponent.md#avoidwater) *** ### canBreach > `readonly` **canBreach**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump out of water (like a dolphin). #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreach`](/server/classes/EntityNavigationComponent.md#canbreach) *** ### canBreakDoors > `readonly` **canBreakDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door and break it. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreakDoors`](/server/classes/EntityNavigationComponent.md#canbreakdoors) *** ### canFloat > `readonly` **canFloat**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can float. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canFloat`](/server/classes/EntityNavigationComponent.md#canfloat) *** ### canJump > `readonly` **canJump**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump up blocks. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canJump`](/server/classes/EntityNavigationComponent.md#canjump) *** ### canOpenDoors > `readonly` **canOpenDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenDoors`](/server/classes/EntityNavigationComponent.md#canopendoors) *** ### canOpenIronDoors > `readonly` **canOpenIronDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed iron door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenIronDoors`](/server/classes/EntityNavigationComponent.md#canopenirondoors) *** ### canPassDoors > `readonly` **canPassDoors**: `boolean` **`Beta`** #### Remarks Whether a path can be created through a door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPassDoors`](/server/classes/EntityNavigationComponent.md#canpassdoors) *** ### canPathFromAir > `readonly` **canPathFromAir**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can start pathing when in the air. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathFromAir`](/server/classes/EntityNavigationComponent.md#canpathfromair) *** ### canPathOverLava > `readonly` **canPathOverLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the lava. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverLava`](/server/classes/EntityNavigationComponent.md#canpathoverlava) *** ### canPathOverWater > `readonly` **canPathOverWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverWater`](/server/classes/EntityNavigationComponent.md#canpathoverwater) *** ### canSink > `readonly` **canSink**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it will be pulled down by gravity while in water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSink`](/server/classes/EntityNavigationComponent.md#cansink) *** ### canSwim > `readonly` **canSwim**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can path anywhere through water and plays swimming animation along that path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSwim`](/server/classes/EntityNavigationComponent.md#canswim) *** ### canWalk > `readonly` **canWalk**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground outside water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalk`](/server/classes/EntityNavigationComponent.md#canwalk) *** ### canWalkInLava > `readonly` **canWalkInLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel in lava like walking on ground. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalkInLava`](/server/classes/EntityNavigationComponent.md#canwalkinlava) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`entity`](/server/classes/EntityNavigationComponent.md#entity) *** ### isAmphibious > `readonly` **isAmphibious**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground or go underwater. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isAmphibious`](/server/classes/EntityNavigationComponent.md#isamphibious) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isValid`](/server/classes/EntityNavigationComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`typeId`](/server/classes/EntityNavigationComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:navigation.float"` = `'minecraft:navigation.float'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityNavigationFlyComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityNavigationFlyComponent.md. # Class: EntityNavigationFlyComponent entity component **`Beta`** 允许该实体像在空气中飞行的生物一样导航。 Allows this entity to navigate like a flying mob in the air. ## Extends - [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md) ## Properties ### avoidDamageBlocks > `readonly` **avoidDamageBlocks**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid blocks that cause damage when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidDamageBlocks`](/server/classes/EntityNavigationComponent.md#avoiddamageblocks) *** ### avoidPortals > `readonly` **avoidPortals**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid portals (like nether portals) when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidPortals`](/server/classes/EntityNavigationComponent.md#avoidportals) *** ### avoidSun > `readonly` **avoidSun**: `boolean` **`Beta`** #### Remarks Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidSun`](/server/classes/EntityNavigationComponent.md#avoidsun) *** ### avoidWater > `readonly` **avoidWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid water when creating a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidWater`](/server/classes/EntityNavigationComponent.md#avoidwater) *** ### canBreach > `readonly` **canBreach**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump out of water (like a dolphin). #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreach`](/server/classes/EntityNavigationComponent.md#canbreach) *** ### canBreakDoors > `readonly` **canBreakDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door and break it. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreakDoors`](/server/classes/EntityNavigationComponent.md#canbreakdoors) *** ### canFloat > `readonly` **canFloat**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can float. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canFloat`](/server/classes/EntityNavigationComponent.md#canfloat) *** ### canJump > `readonly` **canJump**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump up blocks. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canJump`](/server/classes/EntityNavigationComponent.md#canjump) *** ### canOpenDoors > `readonly` **canOpenDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenDoors`](/server/classes/EntityNavigationComponent.md#canopendoors) *** ### canOpenIronDoors > `readonly` **canOpenIronDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed iron door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenIronDoors`](/server/classes/EntityNavigationComponent.md#canopenirondoors) *** ### canPassDoors > `readonly` **canPassDoors**: `boolean` **`Beta`** #### Remarks Whether a path can be created through a door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPassDoors`](/server/classes/EntityNavigationComponent.md#canpassdoors) *** ### canPathFromAir > `readonly` **canPathFromAir**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can start pathing when in the air. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathFromAir`](/server/classes/EntityNavigationComponent.md#canpathfromair) *** ### canPathOverLava > `readonly` **canPathOverLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the lava. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverLava`](/server/classes/EntityNavigationComponent.md#canpathoverlava) *** ### canPathOverWater > `readonly` **canPathOverWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverWater`](/server/classes/EntityNavigationComponent.md#canpathoverwater) *** ### canSink > `readonly` **canSink**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it will be pulled down by gravity while in water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSink`](/server/classes/EntityNavigationComponent.md#cansink) *** ### canSwim > `readonly` **canSwim**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can path anywhere through water and plays swimming animation along that path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSwim`](/server/classes/EntityNavigationComponent.md#canswim) *** ### canWalk > `readonly` **canWalk**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground outside water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalk`](/server/classes/EntityNavigationComponent.md#canwalk) *** ### canWalkInLava > `readonly` **canWalkInLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel in lava like walking on ground. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalkInLava`](/server/classes/EntityNavigationComponent.md#canwalkinlava) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`entity`](/server/classes/EntityNavigationComponent.md#entity) *** ### isAmphibious > `readonly` **isAmphibious**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground or go underwater. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isAmphibious`](/server/classes/EntityNavigationComponent.md#isamphibious) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isValid`](/server/classes/EntityNavigationComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`typeId`](/server/classes/EntityNavigationComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:navigation.fly"` = `'minecraft:navigation.fly'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityNavigationGenericComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityNavigationGenericComponent.md. # Class: EntityNavigationGenericComponent entity component **`Beta`** 允许该实体进行通用导航。 Allows this entity to navigate generically. ## Extends - [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md) ## Properties ### avoidDamageBlocks > `readonly` **avoidDamageBlocks**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid blocks that cause damage when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidDamageBlocks`](/server/classes/EntityNavigationComponent.md#avoiddamageblocks) *** ### avoidPortals > `readonly` **avoidPortals**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid portals (like nether portals) when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidPortals`](/server/classes/EntityNavigationComponent.md#avoidportals) *** ### avoidSun > `readonly` **avoidSun**: `boolean` **`Beta`** #### Remarks Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidSun`](/server/classes/EntityNavigationComponent.md#avoidsun) *** ### avoidWater > `readonly` **avoidWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid water when creating a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidWater`](/server/classes/EntityNavigationComponent.md#avoidwater) *** ### canBreach > `readonly` **canBreach**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump out of water (like a dolphin). #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreach`](/server/classes/EntityNavigationComponent.md#canbreach) *** ### canBreakDoors > `readonly` **canBreakDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door and break it. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreakDoors`](/server/classes/EntityNavigationComponent.md#canbreakdoors) *** ### canFloat > `readonly` **canFloat**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can float. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canFloat`](/server/classes/EntityNavigationComponent.md#canfloat) *** ### canJump > `readonly` **canJump**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump up blocks. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canJump`](/server/classes/EntityNavigationComponent.md#canjump) *** ### canOpenDoors > `readonly` **canOpenDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenDoors`](/server/classes/EntityNavigationComponent.md#canopendoors) *** ### canOpenIronDoors > `readonly` **canOpenIronDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed iron door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenIronDoors`](/server/classes/EntityNavigationComponent.md#canopenirondoors) *** ### canPassDoors > `readonly` **canPassDoors**: `boolean` **`Beta`** #### Remarks Whether a path can be created through a door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPassDoors`](/server/classes/EntityNavigationComponent.md#canpassdoors) *** ### canPathFromAir > `readonly` **canPathFromAir**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can start pathing when in the air. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathFromAir`](/server/classes/EntityNavigationComponent.md#canpathfromair) *** ### canPathOverLava > `readonly` **canPathOverLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the lava. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverLava`](/server/classes/EntityNavigationComponent.md#canpathoverlava) *** ### canPathOverWater > `readonly` **canPathOverWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverWater`](/server/classes/EntityNavigationComponent.md#canpathoverwater) *** ### canSink > `readonly` **canSink**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it will be pulled down by gravity while in water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSink`](/server/classes/EntityNavigationComponent.md#cansink) *** ### canSwim > `readonly` **canSwim**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can path anywhere through water and plays swimming animation along that path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSwim`](/server/classes/EntityNavigationComponent.md#canswim) *** ### canWalk > `readonly` **canWalk**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground outside water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalk`](/server/classes/EntityNavigationComponent.md#canwalk) *** ### canWalkInLava > `readonly` **canWalkInLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel in lava like walking on ground. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalkInLava`](/server/classes/EntityNavigationComponent.md#canwalkinlava) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`entity`](/server/classes/EntityNavigationComponent.md#entity) *** ### isAmphibious > `readonly` **isAmphibious**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground or go underwater. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isAmphibious`](/server/classes/EntityNavigationComponent.md#isamphibious) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isValid`](/server/classes/EntityNavigationComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`typeId`](/server/classes/EntityNavigationComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:navigation.generic"` = `'minecraft:navigation.generic'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityNavigationHoverComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityNavigationHoverComponent.md. # Class: EntityNavigationHoverComponent entity component **`Beta`** 允许该实体像悬停的生物一样导航。 Allows this entity to navigate like a hovering mob. ## Extends - [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md) ## Properties ### avoidDamageBlocks > `readonly` **avoidDamageBlocks**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid blocks that cause damage when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidDamageBlocks`](/server/classes/EntityNavigationComponent.md#avoiddamageblocks) *** ### avoidPortals > `readonly` **avoidPortals**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid portals (like nether portals) when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidPortals`](/server/classes/EntityNavigationComponent.md#avoidportals) *** ### avoidSun > `readonly` **avoidSun**: `boolean` **`Beta`** #### Remarks Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidSun`](/server/classes/EntityNavigationComponent.md#avoidsun) *** ### avoidWater > `readonly` **avoidWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid water when creating a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidWater`](/server/classes/EntityNavigationComponent.md#avoidwater) *** ### canBreach > `readonly` **canBreach**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump out of water (like a dolphin). #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreach`](/server/classes/EntityNavigationComponent.md#canbreach) *** ### canBreakDoors > `readonly` **canBreakDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door and break it. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreakDoors`](/server/classes/EntityNavigationComponent.md#canbreakdoors) *** ### canFloat > `readonly` **canFloat**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can float. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canFloat`](/server/classes/EntityNavigationComponent.md#canfloat) *** ### canJump > `readonly` **canJump**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump up blocks. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canJump`](/server/classes/EntityNavigationComponent.md#canjump) *** ### canOpenDoors > `readonly` **canOpenDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenDoors`](/server/classes/EntityNavigationComponent.md#canopendoors) *** ### canOpenIronDoors > `readonly` **canOpenIronDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed iron door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenIronDoors`](/server/classes/EntityNavigationComponent.md#canopenirondoors) *** ### canPassDoors > `readonly` **canPassDoors**: `boolean` **`Beta`** #### Remarks Whether a path can be created through a door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPassDoors`](/server/classes/EntityNavigationComponent.md#canpassdoors) *** ### canPathFromAir > `readonly` **canPathFromAir**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can start pathing when in the air. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathFromAir`](/server/classes/EntityNavigationComponent.md#canpathfromair) *** ### canPathOverLava > `readonly` **canPathOverLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the lava. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverLava`](/server/classes/EntityNavigationComponent.md#canpathoverlava) *** ### canPathOverWater > `readonly` **canPathOverWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverWater`](/server/classes/EntityNavigationComponent.md#canpathoverwater) *** ### canSink > `readonly` **canSink**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it will be pulled down by gravity while in water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSink`](/server/classes/EntityNavigationComponent.md#cansink) *** ### canSwim > `readonly` **canSwim**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can path anywhere through water and plays swimming animation along that path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSwim`](/server/classes/EntityNavigationComponent.md#canswim) *** ### canWalk > `readonly` **canWalk**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground outside water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalk`](/server/classes/EntityNavigationComponent.md#canwalk) *** ### canWalkInLava > `readonly` **canWalkInLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel in lava like walking on ground. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalkInLava`](/server/classes/EntityNavigationComponent.md#canwalkinlava) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`entity`](/server/classes/EntityNavigationComponent.md#entity) *** ### isAmphibious > `readonly` **isAmphibious**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground or go underwater. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isAmphibious`](/server/classes/EntityNavigationComponent.md#isamphibious) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isValid`](/server/classes/EntityNavigationComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`typeId`](/server/classes/EntityNavigationComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:navigation.hover"` = `'minecraft:navigation.hover'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityNavigationWalkComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityNavigationWalkComponent.md. # Class: EntityNavigationWalkComponent entity component **`Beta`** 允许该实体像生物走动一样进行导航。 Allows this entity to navigate like a walking mob. ## Extends - [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md) ## Properties ### avoidDamageBlocks > `readonly` **avoidDamageBlocks**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid blocks that cause damage when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidDamageBlocks`](/server/classes/EntityNavigationComponent.md#avoiddamageblocks) *** ### avoidPortals > `readonly` **avoidPortals**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid portals (like nether portals) when finding a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidPortals`](/server/classes/EntityNavigationComponent.md#avoidportals) *** ### avoidSun > `readonly` **avoidSun**: `boolean` **`Beta`** #### Remarks Whether or not the pathfinder should avoid tiles that are exposed to the sun when creating paths. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidSun`](/server/classes/EntityNavigationComponent.md#avoidsun) *** ### avoidWater > `readonly` **avoidWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder to avoid water when creating a path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`avoidWater`](/server/classes/EntityNavigationComponent.md#avoidwater) *** ### canBreach > `readonly` **canBreach**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump out of water (like a dolphin). #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreach`](/server/classes/EntityNavigationComponent.md#canbreach) *** ### canBreakDoors > `readonly` **canBreakDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door and break it. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canBreakDoors`](/server/classes/EntityNavigationComponent.md#canbreakdoors) *** ### canFloat > `readonly` **canFloat**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can float. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canFloat`](/server/classes/EntityNavigationComponent.md#canfloat) *** ### canJump > `readonly` **canJump**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can jump up blocks. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canJump`](/server/classes/EntityNavigationComponent.md#canjump) *** ### canOpenDoors > `readonly` **canOpenDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenDoors`](/server/classes/EntityNavigationComponent.md#canopendoors) *** ### canOpenIronDoors > `readonly` **canOpenIronDoors**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can path through a closed iron door assuming the AI will open the door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canOpenIronDoors`](/server/classes/EntityNavigationComponent.md#canopenirondoors) *** ### canPassDoors > `readonly` **canPassDoors**: `boolean` **`Beta`** #### Remarks Whether a path can be created through a door. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPassDoors`](/server/classes/EntityNavigationComponent.md#canpassdoors) *** ### canPathFromAir > `readonly` **canPathFromAir**: `boolean` **`Beta`** #### Remarks Tells the pathfinder that it can start pathing when in the air. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathFromAir`](/server/classes/EntityNavigationComponent.md#canpathfromair) *** ### canPathOverLava > `readonly` **canPathOverLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the lava. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverLava`](/server/classes/EntityNavigationComponent.md#canpathoverlava) *** ### canPathOverWater > `readonly` **canPathOverWater**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel on the surface of the water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canPathOverWater`](/server/classes/EntityNavigationComponent.md#canpathoverwater) *** ### canSink > `readonly` **canSink**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it will be pulled down by gravity while in water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSink`](/server/classes/EntityNavigationComponent.md#cansink) *** ### canSwim > `readonly` **canSwim**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can path anywhere through water and plays swimming animation along that path. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canSwim`](/server/classes/EntityNavigationComponent.md#canswim) *** ### canWalk > `readonly` **canWalk**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground outside water. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalk`](/server/classes/EntityNavigationComponent.md#canwalk) *** ### canWalkInLava > `readonly` **canWalkInLava**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can travel in lava like walking on ground. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`canWalkInLava`](/server/classes/EntityNavigationComponent.md#canwalkinlava) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`entity`](/server/classes/EntityNavigationComponent.md#entity) *** ### isAmphibious > `readonly` **isAmphibious**: `boolean` **`Beta`** #### Remarks Tells the pathfinder whether or not it can walk on the ground or go underwater. #### Throws This property can throw when used. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isAmphibious`](/server/classes/EntityNavigationComponent.md#isamphibious) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`isValid`](/server/classes/EntityNavigationComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityNavigationComponent`](/server/classes/EntityNavigationComponent.md).[`typeId`](/server/classes/EntityNavigationComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:navigation.walk"` = `'minecraft:navigation.walk'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityAddRiderComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityAddRiderComponent.md. # Class: EntityAddRiderComponent entity component **`Beta`** 添加时,此组件使实体在生成时携带指定 entityType 的骑乘者。 When added, this component makes the entity spawn with a rider of the specified entityType. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### entityType > `readonly` **entityType**: `string` **`Beta`** #### Remarks 在特定条件下生成时作为此实体骑乘者添加的实体类型。 The type of entity that is added as a rider for this entity when spawned under certain conditions. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### spawnEvent > `readonly` **spawnEvent**: `string` **`Beta`** #### Remarks 可选的在骑乘者为此实体生成时触发的事件。 Optional spawn event to trigger on the rider when that rider is spawned for this entity. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:addrider"` = `'minecraft:addrider'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) - [EntityBreathableComponent](/server/classes/EntityBreathableComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityAgeableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityAgeableComponent.md. # Class: EntityAgeableComponent entity component **`Beta`** 为实体添加成长计时器。可以通过给予实体其喜好的物品(由 feedItems 定义)来加速成长。 Adds a timer for the entity to grow up. It can be accelerated by giving the entity the items it likes as defined by feedItems. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### duration > `readonly` **duration**: `number` **`Beta`** #### Remarks 实体成长前的剩余时间,-1 表示始终为幼年体。 Amount of time before the entity grows up, -1 for always a baby. #### Throws This property can throw when used. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### growUp > `readonly` **growUp**: [`Trigger`](/server/classes/Trigger.md) **`Beta`** #### Remarks 此实体成长时触发的事件。 Event that runs when this entity grows up. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### transformToItem > `readonly` **transformToItem**: `string` **`Beta`** #### Remarks 使用的饲料物品在成功交互后将转化为此物品。 The feed item used will transform into this item upon successful interaction. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:ageable"` = `'minecraft:ageable'` **`Beta`** ## Methods ### getDropItems() > **getDropItems**(): `string`\[] **`Beta`** #### Returns `string`\[] #### Remarks 实体成长时掉落的物品列表。 List of items that the entity drops when it grows up. #### Throws This function can throw errors. *** ### getFeedItems() > **getFeedItems**(): [`EntityDefinitionFeedItem`](/server/classes/EntityDefinitionFeedItem.md)\[] **`Beta`** #### Returns [`EntityDefinitionFeedItem`](/server/classes/EntityDefinitionFeedItem.md)\[] #### Remarks 可以喂给实体的物品列表。包含 `item`(物品名称)和 `growth`(定义成长多少时间)。 List of items that can be fed to the entity. Includes 'item' for the item name and 'growth' to define how much time it grows up by. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) - [EntityBreathableComponent](/server/classes/EntityBreathableComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityBreathableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityBreathableComponent.md. # Class: EntityBreathableComponent entity component **`Beta`** 定义此实体可以在哪些方块中呼吸,并赋予它们窒息的能力。 Defines what blocks this entity can breathe in and gives them the ability to suffocate. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### airSupply 实验性 > **airSupply**: `number` **`Beta`** **`World Mutation`** #### Remarks 实体的当前空气供应量。 The current air supply of the entity. #### Throws 如果空气供应超出范围 \[suffocationTime, maxAirSupply] 将抛出错误。 Will throw an error if the air supply is out of bounds \[suffocationTime, maxAirSupply]. *** ### breathesAir > `readonly` **breathesAir**: `boolean` **`Beta`** #### Remarks 如果为 `true`,此实体可以在空气中呼吸。 If true, this entity can breathe in air. #### Throws This property can throw when used. *** ### breathesLava > `readonly` **breathesLava**: `boolean` **`Beta`** #### Remarks 如果为 `true`,此实体可以在熔岩中呼吸。 If true, this entity can breathe in lava. #### Throws This property can throw when used. *** ### breathesSolids > `readonly` **breathesSolids**: `boolean` **`Beta`** #### Remarks 如果为 `true`,此实体可以在实心方块中呼吸。 If true, this entity can breathe in solid blocks. #### Throws This property can throw when used. *** ### breathesWater > `readonly` **breathesWater**: `boolean` **`Beta`** #### Remarks 如果为 `true`,此实体可以在水中呼吸。 If true, this entity can breathe in water. #### Throws This property can throw when used. *** ### canBreathe 实验性 > `readonly` **canBreathe**: `boolean` **`Beta`** #### Remarks 如果为 `true`,该实体能够呼吸。 If true, the entity is able to breathe. #### Throws This property can throw when used. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### generatesBubbles > `readonly` **generatesBubbles**: `boolean` **`Beta`** #### Remarks 如果为 `true`,此实体在水中时会显示可见的气泡。 If true, this entity will have visible bubbles while in water. #### Throws This property can throw when used. *** ### inhaleTime > `readonly` **inhaleTime**: `number` **`Beta`** #### Remarks 恢复到最大呼吸量的时间(以秒为单位)。 Time in seconds to recover breath to maximum. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### suffocateTime > `readonly` **suffocateTime**: `number` **`Beta`** #### Remarks 窒息伤害之间的时间间隔(以秒为单位)。 Time in seconds between suffocation damage. #### Throws This property can throw when used. *** ### totalSupply > `readonly` **totalSupply**: `number` **`Beta`** #### Remarks 实体可以屏住呼吸的时间(以秒为单位)。 Time in seconds the entity can hold its breath. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:breathable"` = `'minecraft:breathable'` **`Beta`** ## Methods ### getBreatheBlocks() > **getBreatheBlocks**(): [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] **`Beta`** #### Returns [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] #### Remarks 此实体可以呼吸的方块列表,除了按方块类别区分的单独属性之外。 List of blocks this entity can breathe in, in addition to the separate properties for classes of blocks. #### Throws This function can throw errors. *** ### getNonBreatheBlocks() > **getNonBreatheBlocks**(): [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] **`Beta`** #### Returns [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] #### Remarks 此实体不能呼吸的方块列表。 List of blocks this entity can't breathe in. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityCanClimbComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityCanClimbComponent.md. # Class: EntityCanClimbComponent entity component **`Beta`** 添加时,此组件表示该实体可以爬梯子。 When added, this component signifies that the entity can climb up ladders. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:can_climb"` = `'minecraft:can_climb'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityCanFlyComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityCanFlyComponent.md. # Class: EntityCanFlyComponent entity component **`Beta`** 添加时,此组件表示该实体可以飞行,且寻路器不会限制在下方需要有实心方块的路径上。 When added, this component signifies that the entity can fly, and the pathfinder won't be restricted to paths where a solid block is required underneath it. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:can_fly"` = `'minecraft:can_fly'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityCanPowerJumpComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityCanPowerJumpComponent.md. # Class: EntityCanPowerJumpComponent entity component **`Beta`** 添加时,此组件表示该实体可以像 Minecraft 中的马一样进行蓄力跳跃。 When added, this component signifies that the entity can power jump like the horse does within Minecraft. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:can_power_jump"` = `'minecraft:can_power_jump'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityColor2Component.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityColor2Component.md. # Class: EntityColor2Component entity **`Beta`** 定义实体的次要颜色。仅对具有次要预定义颜色值的特定实体(例如,热带鱼)有效。 Defines the entity's secondary color. Only works on certain entities that have secondary predefined color values (e.g., tropical fish). ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### value > `readonly` **value**: [`PaletteColor`](/server/enums/PaletteColor.md) **`Beta`** #### Remarks 此特定颜色的值。 Value of this particular color. #### Throws This property can throw when used. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:color2"` = `'minecraft:color2'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityColorComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityColorComponent.md. # Class: EntityColorComponent entity component **`Beta`** 定义实体的颜色。仅对具有预定义颜色值的特定实体(例如,羊、羊驼、潜影贝)有效。 Defines the entity's color. Only works on certain entities that have predefined color values (e.g., sheep, llama, shulker). ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### value > **value**: `number` **`World Mutation`** **`Beta`** #### Remarks 此特定颜色的值。 Value of this particular color. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:color"` = `'minecraft:color'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityEnderInventoryComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityEnderInventoryComponent.md. # Class: EntityEnderInventoryComponent entity inventory component **`Beta`** 表示此实体的末影箱物品属性。此组件始终存在于玩家身上,其容器中的任何物品在玩家打开末影箱时都会显示出来。 Represents this entity's ender inventory properties. This component is always present on players and any items in its container will display for the player when they access an ender chest. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### container > `readonly` **container**: [`Container`](/server/classes/Container.md) **`Beta`** #### Remarks 定义此实体的末影箱物品容器。如果实体已被移除,则容器将为 `undefined`。 Defines the ender inventory container for this entity. The container will be undefined if the entity has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:ender_inventory"` = `'minecraft:ender_inventory'` **`Beta`** ## 同领域相关 - [EntityInventoryComponent](/server/classes/EntityInventoryComponent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) - [BlockInventoryComponent](/server/classes/BlockInventoryComponent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityEquippableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityEquippableComponent.md. # Class: EntityEquippableComponent entity component **`Beta`** 提供对生物装备槽位的访问。此组件存在于玩家实体上。 Provides access to a mob's equipment slots. This component exists on player entities. ## Example **givePlayerElytra.ts** ```typescript // Gives the player Elytra import { EquipmentSlot, ItemStack, Player, EntityComponentTypes } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function giveEquipment(player: Player) { const equipmentCompPlayer = player.getComponent(EntityComponentTypes.Equippable); if (equipmentCompPlayer) { equipmentCompPlayer.setEquipment(EquipmentSlot.Chest, new ItemStack(MinecraftItemTypes.Elytra)); } } ``` ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### totalArmor > `readonly` **totalArmor**: `number` **`Beta`** #### Remarks 返回拥有者的总护甲等级。 Returns the total Armor level of the owner. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### totalToughness > `readonly` **totalToughness**: `number` **`Beta`** #### Remarks 返回拥有者的总韧性等级。 Returns the total Toughness level of the owner. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:equippable"` = `'minecraft:equippable'` **`Beta`** ## Methods ### getEquipment() > **getEquipment**(`equipmentSlot`): [`ItemStack`](/server/classes/ItemStack.md) | `undefined` **`Beta`** #### Parameters ##### equipmentSlot [`EquipmentSlot`](/server/enums/EquipmentSlot.md) 装备槽位,例如 `"head"`、`"chest"`、`"offhand"`。 The equipment slot. e.g. "head", "chest", "offhand" #### Returns [`ItemStack`](/server/classes/ItemStack.md) | `undefined` 返回装备到给定 EquipmentSlot 的物品。如果为空,则返回 `undefined`。 Returns the item equipped to the given EquipmentSlot. If empty, returns undefined. #### Remarks 获取给定 EquipmentSlot 的已装备物品。 Gets the equipped item for the given EquipmentSlot. #### Throws This function can throw errors. *** ### getEquipmentSlot() > **getEquipmentSlot**(`equipmentSlot`): [`ContainerSlot`](/server/classes/ContainerSlot.md) **`Beta`** #### Parameters ##### equipmentSlot [`EquipmentSlot`](/server/enums/EquipmentSlot.md) 装备槽位,例如 `"head"`、`"chest"`、`"offhand"`。 The equipment slot. e.g. "head", "chest", "offhand". #### Returns [`ContainerSlot`](/server/classes/ContainerSlot.md) 返回对应于给定 EquipmentSlot 的 ContainerSlot。 Returns the ContainerSlot corresponding to the given EquipmentSlot. #### Remarks 获取对应于给定 EquipmentSlot 的 ContainerSlot。 Gets the ContainerSlot corresponding to the given EquipmentSlot. #### Throws This function can throw errors. *** ### setEquipment() > **setEquipment**(`equipmentSlot`, `itemStack?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### equipmentSlot [`EquipmentSlot`](/server/enums/EquipmentSlot.md) 装备槽位,例如 `"head"`、`"chest"`、`"offhand"`。 The equipment slot. e.g. "head", "chest", "offhand". ##### itemStack? [`ItemStack`](/server/classes/ItemStack.md) 要装备的物品。如果为 `undefined`,则清空该槽位。 The item to equip. If undefined, clears the slot. #### Returns `boolean` #### Remarks 替换给定 EquipmentSlot 中的物品。 Replaces the item in the given EquipmentSlot. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityFireImmuneComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityFireImmuneComponent.md. # Class: EntityFireImmuneComponent entity component **`Beta`** 当添加时,此组件表示该实体不会受到火焰伤害。 When added, this component signifies that this entity doesn't take damage from fire. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:fire_immune"` = `'minecraft:fire_immune'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityFloatsInLiquidComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityFloatsInLiquidComponent.md. # Class: EntityFloatsInLiquidComponent entity component **`Beta`** 当添加时,此组件表示该实体可以在液体方块中漂浮。 When added, this component signifies that this entity can float in liquid blocks. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:floats_in_liquid"` = `'minecraft:floats_in_liquid'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityFlyingSpeedComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityFlyingSpeedComponent.md. # Class: EntityFlyingSpeedComponent entity component **`Beta`** Represents the flying speed of an entity. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### value > **value**: `number` **`World Mutation`** **`Beta`** #### Remarks Current value of the flying speed of the associated entity. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:flying_speed"` = `'minecraft:flying_speed'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityFrictionModifierComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityFrictionModifierComponent.md. # Class: EntityFrictionModifierComponent entity component **`Beta`** Defines how much friction affects this entity. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### value > `readonly` **value**: `number` **`Beta`** #### Remarks Current value of the friction modifier of the associated entity. #### Throws This property can throw when used. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:friction_modifier"` = `'minecraft:friction_modifier'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHealableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHealableComponent.md. # Class: EntityHealableComponent entity component **`Beta`** 定义与此实体进行治愈的交互方式。 Defines the interactions with this entity for healing it. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### forceUse > `readonly` **forceUse**: `boolean` **`Beta`** #### Remarks 决定是否可以在实体满生命值时使用物品。 Determines if an item can be used regardless of the entity being at full health. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:healable"` = `'minecraft:healable'` **`Beta`** ## Methods ### getFeedItems() > **getFeedItems**(): [`FeedItem`](/server/classes/FeedItem.md)\[] **`Beta`** #### Returns [`FeedItem`](/server/classes/FeedItem.md)\[] 此组件关联的实体。 Entity that this component is associated with. #### Remarks 一组可以专门治愈此实体的物品。 A set of items that can specifically heal this entity. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityInventoryComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityInventoryComponent.md. # Class: EntityInventoryComponent entity inventory component **`Beta`** 表示一个实体的物品栏属性。 Defines this entity's inventory properties. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### additionalSlotsPerStrength > `readonly` **additionalSlotsPerStrength**: `number` **`Beta`** #### Remarks 表示实体每层强度(实体组件 `minecraft:strength`)可以获得的额外槽数。 Number of slots that this entity can gain per extra strength. #### Throws This property can throw when used. *** ### canBeSiphonedFrom > `readonly` **canBeSiphonedFrom**: `boolean` **`Beta`** #### Remarks 若为 `true`,则表示实体物品栏中的物品可被漏斗或漏斗矿车转移走。 If true, the contents of this inventory can be removed by a hopper. #### Throws This property can throw when used. *** ### container > `readonly` **container**: [`Container`](/server/classes/Container.md) **`Beta`** #### Remarks 表示实体的容器。若实体已被移除则为 `undefined`。 Defines the container for this entity. The container will be undefined if the entity has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### containerType > `readonly` **containerType**: `string` **`Beta`** #### Remarks 表示实体容器的种类。 Type of container this entity has. #### Throws This property can throw when used. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### inventorySize > `readonly` **inventorySize**: `number` **`Beta`** #### Remarks 表示实体容器的槽位数量。 Number of slots the container has. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### private > `readonly` **private**: `boolean` **`Beta`** #### Remarks 若为 `true`,则表示实体死亡不会掉落物品栏的物品。 If true, the entity will not drop it's inventory on death. #### Throws This property can throw when used. *** ### restrictToOwner > `readonly` **restrictToOwner**: `boolean` **`Beta`** #### Remarks 若为 `true`,则表示实体物品栏仅能被其主人或实体自己访问和操作。 If true, the entity's inventory can only be accessed by its owner or itself. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:inventory"` = `'minecraft:inventory'` **`Beta`** ## 同领域相关 - [EntityEnderInventoryComponent](/server/classes/EntityEnderInventoryComponent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) - [BlockInventoryComponent](/server/classes/BlockInventoryComponent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsBabyComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsBabyComponent.md. # Class: EntityIsBabyComponent entity component **`Beta`** 当添加时,此组件表示该实体是幼年体。 When added, this component signifies that this entity is a baby. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_baby"` = `'minecraft:is_baby'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsChargedComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsChargedComponent.md. # Class: EntityIsChargedComponent entity component **`Beta`** 当添加时,此组件表示该实体已蓄力。 When added, this component signifies that this entity is charged. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_charged"` = `'minecraft:is_charged'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsChestedComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsChestedComponent.md. # Class: EntityIsChestedComponent entity component **`Beta`** 当添加时,此组件表示该实体带有箱子。 When added, this component signifies that this entity is chested. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_chested"` = `'minecraft:is_chested'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsDyeableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsDyeableComponent.md. # Class: EntityIsDyeableComponent entity component **`Beta`** 当添加时,此组件表示该实体可以染色。 When added, this component signifies that this entity is dyeable. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_dyeable"` = `'minecraft:is_dyeable'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsHiddenWhenInvisibleComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsHiddenWhenInvisibleComponent.md. # Class: EntityIsHiddenWhenInvisibleComponent entity component **`Beta`** 当添加时,此组件表示当实体隐身时,该实体对于其他实体隐藏。 When added, this component signifies that this entity hides from other entities when invisible. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_hidden_when_invisible"` = `'minecraft:is_hidden_when_invisible'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsIgnitedComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsIgnitedComponent.md. # Class: EntityIsIgnitedComponent entity component **`Beta`** 当添加时,此组件表示该实体当前正在着火。 When added, this component signifies that this entity this currently on fire. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_ignited"` = `'minecraft:is_ignited'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsIllagerCaptainComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsIllagerCaptainComponent.md. # Class: EntityIsIllagerCaptainComponent entity component **`Beta`** 当添加时,此组件表示该实体是一个灾厄队长。 When added, this component signifies that this entity is an illager captain. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_illager_captain"` = `'minecraft:is_illager_captain'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsSaddledComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsSaddledComponent.md. # Class: EntityIsSaddledComponent entity component **`Beta`** 当添加时,此组件表示该实体当前已上鞍。 When added, this component signifies that this entity is currently saddled. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_saddled"` = `'minecraft:is_saddled'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsShakingComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsShakingComponent.md. # Class: EntityIsShakingComponent entity component **`Beta`** 当添加时,此组件表示该实体当前正在颤抖。 When added, this component signifies that this entity is currently shaking. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_shaking"` = `'minecraft:is_shaking'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsShearedComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsShearedComponent.md. # Class: EntityIsShearedComponent entity component **`Beta`** 当添加时,此组件表示该实体已被剪过毛。 When added, this component signifies that this entity is sheared. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_sheared"` = `'minecraft:is_sheared'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsStackableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsStackableComponent.md. # Class: EntityIsStackableComponent entity component **`Beta`** 当添加时,此组件表示该实体可以被堆叠。 When added, this component signifies that this entity can be stacked. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_stackable"` = `'minecraft:is_stackable'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsStunnedComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsStunnedComponent.md. # Class: EntityIsStunnedComponent entity component **`Beta`** 当添加时,此组件表示该实体当前被击晕。 When added, this component signifies that this entity is currently stunned. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_stunned"` = `'minecraft:is_stunned'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityIsTamedComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityIsTamedComponent.md. # Class: EntityIsTamedComponent entity component **`Beta`** 当添加时,此组件表示该实体当前已被驯服。 When added, this component signifies that this entity is currently tamed. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:is_tamed"` = `'minecraft:is_tamed'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityItemComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityItemComponent.md. # Class: EntityItemComponent entity component **`Beta`** If added onto the entity, this indicates that the entity represents a free-floating item in the world. Lets you retrieve the actual item stack contents via the itemStack property. ## Example **testThatEntityIsFeatherItem.ts** ```typescript import { EntityItemComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; function testThatEntityIsFeatherItem( log: (message: string, status?: number) => void, targetLocation: DimensionLocation ) { const items = targetLocation.dimension.getEntities({ location: targetLocation, maxDistance: 20, }); for (const item of items) { const itemComp = item.getComponent(EntityComponentTypes.Item) as EntityItemComponent; if (itemComp) { if (itemComp.itemStack.typeId.endsWith('feather')) { log('Success! Found a feather', 1); } } } } ``` ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### itemStack > `readonly` **itemStack**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks Item stack represented by this entity in the world. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:item"` = `'minecraft:item'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityLeashableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityLeashableComponent.md. # Class: EntityLeashableComponent entity component **`Beta`** 允许实体被拴绳拴住。定义实体被拴绳时的条件和事件。 Allows the entity to be leashed. Defines the conditions and events for when an entity is leashed. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### canBeStolen > `readonly` **canBeStolen**: `boolean` **`Beta`** #### Remarks 如果另一个实体可以通过附加自己的拴绳来"偷走"被拴的实体,则返回 `true`。 Returns true if another entity can 'steal' the leashed entity by attaching their own leash to it. #### Throws This property can throw when used. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### hardDistance > `readonly` **hardDistance**: `number` **`Beta`** #### Remarks 拴绳变硬并限制移动的距离(以方块为单位)。 Distance in blocks at which the leash stiffens, restricting movement. #### Throws This property can throw when used. *** ### isLeashed > `readonly` **isLeashed**: `boolean` **`Beta`** #### Remarks 如果实体被拴住则返回 `true`。 Returns true if the entity is leashed. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### leashHolder? > `readonly` `optional` **leashHolder?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 牵着拴绳的实体。 Entity that is holding the leash. #### Throws This property can throw when used. *** ### leashHolderEntityId? > `readonly` `optional` **leashHolderEntityId?**: `string` **`Beta`** #### Remarks 牵着拴绳的实体的标识符。 Identifier of entity that is holding the leash. #### Throws This property can throw when used. *** ### maxDistance > `readonly` **maxDistance**: `number` **`Beta`** #### Remarks 拴绳断裂的距离(以方块为单位)。 Distance in blocks at which the leash breaks. #### Throws This property can throw when used. *** ### softDistance > `readonly` **softDistance**: `number` **`Beta`** #### Remarks "弹簧"效应开始作用以保持此实体靠近拴住它的实体的距离(以方块为单位)。 Distance in blocks at which the 'spring' effect starts acting to keep this entity close to the entity that leashed it. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:leashable"` = `'minecraft:leashable'` **`Beta`** ## Methods ### leashTo() > **leashTo**(`leashHolder`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### leashHolder [`Entity`](/server/classes/Entity.md) 要将此实体拴到的实体。 The entity to leash this entity to. #### Returns `void` #### Remarks 将此实体拴到另一个实体上。 Leashes this entity to another entity. #### Throws 如果要拴到的实体超过最大距离,或者玩家死亡或处于旁观模式,则抛出异常。 Throws if the entity to leash to is over the max distance, and if the player is dead or in spectator mode. *** ### unleash() > **unleash**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 如果此实体被拴到另一个实体上,则解开拴绳。 Unleashes this entity if it is leashed to another entity. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityMarkVariantComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityMarkVariantComponent.md. # Class: EntityMarkVariantComponent entity component **`Beta`** 定义实体的标记变体。 Defines the entity's mark variant. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### value > `readonly` **value**: `number` **`Beta`** #### Throws This property can throw when used. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:mark_variant"` = `'minecraft:mark_variant'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityNpcComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityNpcComponent.md. # Class: EntityNpcComponent entity component **`Beta`** 为实体添加 NPC 功能,如自定义皮肤、名称和对话交互。 Adds NPC capabilities to an entity such as custom skin, name, and dialogue interactions. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### defaultScene > **defaultScene**: `string` **`World Mutation`** **`Beta`** #### Remarks 当玩家首次与 NPC 交互时打开的 DialogueScene。 The DialogueScene that is opened when players first interact with the NPC. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### name > **name**: `string` **`World Mutation`** **`Beta`** #### Remarks NPC 显示给玩家的名称。 The name of the NPC as it is displayed to players. *** ### skinIndex > **skinIndex**: `number` **`World Mutation`** **`Beta`** #### Remarks NPC 将使用的皮肤索引。 The index of the skin the NPC will use. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:npc"` = `'minecraft:npc'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityOnFireComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityOnFireComponent.md. # Class: EntityOnFireComponent entity component **`Beta`** When present on an entity, this entity is on fire. ## Example **setOnFire.ts** ```typescript import { system, EntityOnFireComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function setOnFire(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const skelly = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Skeleton, targetLocation); skelly.setOnFire(20, true); system.runTimeout(() => { const onfire = skelly.getComponent(EntityComponentTypes.OnFire) as EntityOnFireComponent; log(onfire?.onFireTicksRemaining + ' fire ticks remaining.'); skelly.extinguishFire(true); log('Never mind. Fire extinguished.'); }, 20); } ``` ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### onFireTicksRemaining > `readonly` **onFireTicksRemaining**: `number` **`Beta`** #### Remarks The number of ticks remaining before the fire goes out. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:onfire"` = `'minecraft:onfire'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityProjectileComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityProjectileComponent.md. # Class: EntityProjectileComponent entity component **`Beta`** 投射物组件控制投射物实体的属性,并允许其向给定方向射出。当实体具有 `minecraft:projectile` 组件时,此组件存在。 The projectile component controls the properties of a projectile entity and allows it to be shot in a given direction. This component is present when the entity has the minecraft:projectile component. ## Example **shootArrow\.ts** ```typescript import { DimensionLocation, EntityProjectileComponent } from '@minecraft/server'; function shootArrow(targetLocation: DimensionLocation) { const velocity = { x: 0, y: 1, z: 5 }; const arrow = targetLocation.dimension.spawnEntity('minecraft:arrow', { x: targetLocation.x, y: targetLocation.y + 2, z: targetLocation.z, }); const projectileComp = arrow.getComponent('minecraft:projectile') as EntityProjectileComponent; projectileComp?.shoot(velocity); } ``` ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### airInertia > **airInertia**: `number` **`World Mutation`** **`Beta`** #### Remarks 投射物在空气中飞行时每 tick 保持的速度比例。 The fraction of the projectile's speed maintained every tick while traveling through air. *** ### catchFireOnHurt > **catchFireOnHurt**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 如果为 `true`,实体在受伤时会被点燃。默认燃烧时长为 5 秒。此持续时间可以通过 `onFireTime` 属性修改。如果实体免疫火焰或实体处于潮湿状态,则不会着火。 If true, the entity will be set on fire when hurt. The default burn duration is 5 seconds. This duration can be modified via the onFireTime property. The entity will not catch fire if immune or if the entity is wet. *** ### critParticlesOnProjectileHurt > **critParticlesOnProjectileHurt**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 如果为 `true`,投射物在被玩家击中时会生成暴击粒子。例如,玩家攻击潜影贝子弹。 If true, the projectile will spawn crit particles when hit by a player. E.g. Player attacking a Shulker bullet. *** ### destroyOnProjectileHurt > **destroyOnProjectileHurt**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 如果为 `true`,投射物在受到伤害时会被摧毁。例如,玩家攻击潜影贝子弹。 If true, the projectile will be destroyed when it takes damage. E.g. Player attacking a Shulker bullet. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### gravity > **gravity**: `number` **`World Mutation`** **`Beta`** #### Remarks 应用于投射物的重力。当实体不在地面上时,每 tick 从投射物的垂直位置变化中减去此值。值越高,投射物下落越快。如果为负值,实体将上升而不是下落。 The gravity applied to the projectile. When the entity is not on the ground, subtracts this amount from the projectile's change in vertical position every tick. The higher the value, the faster the projectile falls. If negative, the entity will rise instead of fall. *** ### hitEntitySound? > `optional` **hitEntitySound?**: `string` **`World Mutation`** **`Beta`** #### Remarks 投射物击中实体时播放的声音。 The sound that plays when the projectile hits an entity. *** ### hitGroundSound? > `optional` **hitGroundSound?**: `string` **`World Mutation`** **`Beta`** #### Remarks 投射物击中方块时播放的声音。 The sound that plays when the projectile hits a block. *** ### hitParticle? > `optional` **hitParticle?**: `string` **`World Mutation`** **`Beta`** #### Remarks 投射物击中物体时生成的粒子。 The particle that spawns when the projectile hits something. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### lightningStrikeOnHit > **lightningStrikeOnHit**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 如果为 `true`,且天气为雷暴且实体与天空之间没有遮挡,则实体在被击中时会遭雷击。例如,带有引雷附魔的投掷三叉戟。 If true and the weather is thunder and the entity has line of sight to the sky, the entity will be struck by lightning when hit. E.g. A thrown Trident with the Channeling enchantment. *** ### liquidInertia > **liquidInertia**: `number` **`World Mutation`** **`Beta`** #### Remarks 投射物在液体中飞行时每 tick 保持的速度比例。 The fraction of the projectile's speed maintained every tick while traveling through a liquid. *** ### onFireTime > **onFireTime**: `number` **`World Mutation`** **`Beta`** #### Remarks 当 `catchFireOnHurt` 设置为 `true` 时,被击中实体着火的持续时间(以秒为单位)。 Duration in seconds that the entity hit will be on fire for when catchFireOnHurt is set to true. *** ### owner? > `optional` **owner?**: [`Entity`](/server/classes/Entity.md) **`World Mutation`** **`Beta`** #### Remarks 投射物的拥有者。用于确定投射物可以与什么碰撞并造成伤害。它还确定哪个实体被指定为攻击者。 The owner of the projectile. This is used to determine what the projectile can collide with and damage. It also determines which entity is assigned as the attacker. *** ### shouldBounceOnHit > **shouldBounceOnHit**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 如果为 `true`,投射物在未造成伤害时会从生物身上弹开。例如,正在生成的凋灵。 If true, the projectile will bounce off mobs when no damage is taken. E.g. A spawning wither. *** ### stopOnHit > **stopOnHit**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 如果为 `true`,投射物在击中实体时会停止移动,如同被格挡一样。例如,投掷三叉戟的击中行为。 If true, the projectile will stop moving when an entity is hit as thought it had been blocked. E.g. Thrown trident on hit behavior. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:projectile"` = `'minecraft:projectile'` **`Beta`** ## Methods ### shoot() > **shoot**(`velocity`, `options?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### velocity [`Vector3`](/server/interfaces/Vector3.md) 发射投射物的速度。这同时控制投射物射出的速度和方向。 The velocity to fire the projectile. This controls both the speed and direction which which the projectile will be shot. ##### options? [`ProjectileShootOptions`](/server/interfaces/ProjectileShootOptions.md) 射出的可选配置。 Optional configuration for the shoot. #### Returns `void` #### Remarks 以给定速度射出投射物。投射物将从其当前位置射出。 Shoots the projectile with a given velocity. The projectile will be shot from its current location. #### Throws 如果组件或实体不再存在则抛出异常。 Throws if the component or entity no longer exist. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityPushThroughComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityPushThroughComponent.md. # Class: EntityPushThroughComponent entity component **`Beta`** 定义实体可以推开其他实体的能力。 Defines the ability of an entity to push through other entities. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### value > `readonly` **value**: `number` **`Beta`** #### Throws This property can throw when used. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:push_through"` = `'minecraft:push_through'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityRideableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityRideableComponent.md. # Class: EntityRideableComponent entity component **`Beta`** 当添加时,此组件添加了实体可以被另一个实体骑乘的能力。 When added, this component adds the capability that an entity can be ridden by another entity. ## Example **minibiomes.ts** ```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); ``` ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### controllingSeat > `readonly` **controllingSeat**: `number` **`Beta`** #### Remarks 可用于控制此实体的座位(从零开始索引)。 Zero-based index of the seat that can used to control this entity. #### Throws This property can throw when used. *** ### crouchingSkipInteract > `readonly` **crouchingSkipInteract**: `boolean` **`Beta`** #### Remarks 确定当实体蹲下时是否不支持交互。 Determines whether interactions are not supported if the entity is crouching. #### Throws This property can throw when used. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### interactText > `readonly` **interactText**: `string` **`Beta`** #### Remarks 当玩家看着要骑乘此实体时应该显示的一组文本(通常用于触摸屏控制)。 Set of text that should be displayed when a player is looking to ride on this entity (commonly with touch-screen controls). #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### passengerMaxWidth > `readonly` **passengerMaxWidth**: `number` **`Beta`** #### Remarks 可成为乘客的生物的最大宽度。 The max width a mob can be to be a passenger. #### Throws This property can throw when used. *** ### pullInEntities > `readonly` **pullInEntities**: `boolean` **`Beta`** #### Remarks 如果为 `true`,此实体将把具有正确 `family_types` 的实体拉入任何可用座位。 If true, this entity will pull in entities that are in the correct family\_types into any available seat. #### Throws This property can throw when used. *** ### riderCanInteract > `readonly` **riderCanInteract**: `boolean` **`Beta`** #### Remarks 如果为 `true`,骑乘者看着此实体时可以被拾取。 If true, this entity will be picked when looked at by the rider. #### Throws This property can throw when used. *** ### seatCount > `readonly` **seatCount**: `number` **`Beta`** #### Remarks 为此实体定义的骑乘者座位数量。 Number of seats for riders defined for this entity. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:rideable"` = `'minecraft:rideable'` **`Beta`** ## Methods ### addRider() > **addRider**(`rider`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### rider [`Entity`](/server/classes/Entity.md) 将成为此实体骑乘者的实体。 Entity that will become the rider of this entity. #### Returns `boolean` 如果骑乘者实体成功添加,则返回 `true`。 True if the rider entity was successfully added. #### Remarks 向此实体添加一个骑乘者实体。 Adds an entity to this entity as a rider. #### Throws This function can throw errors. #### Example **minibiomes.ts** ```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); ``` *** ### ejectRider() > **ejectRider**(`rider`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### rider [`Entity`](/server/classes/Entity.md) 应从此实体弹射的实体。 Entity that should be ejected from this entity. #### Returns `void` #### Remarks 弹射此实体的指定骑乘者。 Ejects the specified rider of this entity. #### Throws This function can throw errors. *** ### ejectRiders() > **ejectRiders**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 弹射此实体的所有骑乘者。 Ejects all riders of this entity. #### Throws This function can throw errors. *** ### getFamilyTypes() > **getFamilyTypes**(): `string`\[] **`Beta`** #### Returns `string`\[] #### Remarks 此实体支持的作为骑乘者的实体类型字符串列表。 A string-list of entity types that this entity can support as riders. #### Throws This function can throw errors. *** ### getRiders() > **getRiders**(): [`Entity`](/server/classes/Entity.md)\[] **`Beta`** #### Returns [`Entity`](/server/classes/Entity.md)\[] #### Remarks 获取当前骑乘此实体的所有实体列表。 Gets a list of the all the entities currently riding this entity. #### Throws This function can throw errors. *** ### getSeats() > **getSeats**(): [`Seat`](/server/classes/Seat.md)\[] **`Beta`** #### Returns [`Seat`](/server/classes/Seat.md)\[] #### Remarks 获取骑乘此实体的每个位置的位置和骑乘者数量列表。 Gets a list of positions and number of riders for each position for entities riding this entity. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityRidingComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityRidingComponent.md. # Class: EntityRidingComponent entity component **`Beta`** This component is added to any entity when it is riding another entity. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### entityRidingOn > `readonly` **entityRidingOn**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks The entity this entity is currently riding on. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:riding"` = `'minecraft:riding'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityScaleComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityScaleComponent.md. # Class: EntityScaleComponent entity component **`Beta`** 定义实体的缩放比例。 Defines the scale of an entity. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### value > `readonly` **value**: `number` **`Beta`** #### Throws This property can throw when used. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:scale"` = `'minecraft:scale'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntitySkinIdComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntitySkinIdComponent.md. # Class: EntitySkinIdComponent entity component **`Beta`** Skin Id value. Can be used to differentiate skins, such as base skins for villagers. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### value > `readonly` **value**: `number` **`Beta`** #### Remarks Returns the value of the skin Id identifier of the entity. #### Throws This property can throw when used. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:skin_id"` = `'minecraft:skin_id'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityStrengthComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityStrengthComponent.md. # Class: EntityStrengthComponent entity component **`Beta`** Defines the entity's ability to carry items. An entity with a higher strength would have higher potential carry capacity and more item slots. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### max > `readonly` **max**: `number` **`Beta`** #### Remarks Maximum strength of this entity, as defined in the entity type definition. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### value > `readonly` **value**: `number` **`Beta`** #### Remarks Current value of the strength component that has been set for entities. #### Throws This property can throw when used. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:strength"` = `'minecraft:strength'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityTameableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityTameableComponent.md. # Class: EntityTameableComponent entity component **`Beta`** Defines the rules for an entity to be tamed by the player. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### getTameItems > `readonly` **getTameItems**: [`ItemStack`](/server/classes/ItemStack.md)\[] **`Beta`** #### Remarks Returns a set of items that can be used to tame this entity. #### Throws This property can throw when used. *** ### isTamed > `readonly` **isTamed**: `boolean` **`Beta`** #### Remarks Returns true if the entity is tamed by player. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### probability > `readonly` **probability**: `number` **`Beta`** #### Remarks The chance of taming the entity with each item use between 0.0 and 1.0, where 1.0 is 100% #### Throws This property can throw when used. *** ### tamedToPlayer? > `readonly` `optional` **tamedToPlayer?**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks Returns the player that has tamed the entity, or 'undefined' if entity is not tamed. #### Throws This property can throw when used. *** ### tamedToPlayerId? > `readonly` `optional` **tamedToPlayerId?**: `string` **`Beta`** #### Remarks Returns the id of player that has tamed the entity, or 'undefined' if entity is not tamed. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:tameable"` = `'minecraft:tameable'` **`Beta`** ## Methods ### tame() > **tame**(`player`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### player [`Player`](/server/classes/Player.md) The player that this entity should be tamed by. #### Returns `boolean` Returns true if the entity was tamed. #### Remarks Set this entity as tamed by the given player. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityTameMountComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityTameMountComponent.md. # Class: EntityTameMountComponent entity component **`Beta`** 包含基于骑乘者来驯服可骑乘实体的选项。 Contains options for taming a rideable entity based on the entity that mounts it. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isTamed > `readonly` **isTamed**: `boolean` **`Beta`** #### Remarks 如果实体已被驯服,则返回 `true`。 Returns true if the entity is tamed. #### Throws This property can throw when used. *** ### isTamedToPlayer > `readonly` **isTamedToPlayer**: `boolean` **`Beta`** #### Remarks 如果实体已被玩家驯服,则返回 `true`。 Returns true if the entity is tamed by a player. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### tamedToPlayer? > `readonly` `optional` **tamedToPlayer?**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回已驯服此实体的玩家,如果实体未被玩家驯服,则返回 `undefined`。 Returns the player that has tamed the entity, or 'undefined' if entity is not tamed by a player. #### Throws This property can throw when used. *** ### tamedToPlayerId? > `readonly` `optional` **tamedToPlayerId?**: `string` **`Beta`** #### Remarks 返回已驯服此实体的玩家的 ID,如果实体未被驯服,则返回 `undefined`。 Returns the id of player that has tamed the entity, or 'undefined' if entity is not tamed. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:tamemount"` = `'minecraft:tamemount'` **`Beta`** ## Methods ### tame() > **tame**(`showParticles`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### showParticles `boolean` 此实体被驯服时是否显示效果粒子。 Whether to show effect particles when this entity is tamed. #### Returns `void` #### Remarks 将此可骑乘实体设置为已驯服。 Sets this rideable entity as tamed. #### Throws This function can throw errors. *** ### tameToPlayer() > **tameToPlayer**(`showParticles`, `player`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### showParticles `boolean` 此实体被驯服时是否显示效果粒子。 Whether to show effect particles when this entity is tamed. ##### player [`Player`](/server/classes/Player.md) 应驯服此实体的玩家。 The player that this entity should be tamed by. #### Returns `boolean` 如果实体被驯服,则返回 `true`。 Returns true if the entity was tamed. #### Remarks 将此可骑乘实体设置为已被给定玩家驯服。 Sets this rideable entity as tamed by the given player. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityTypeFamilyComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityTypeFamilyComponent.md. # Class: EntityTypeFamilyComponent entity component **`Beta`** ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:type_family"` = `'minecraft:type_family'` **`Beta`** ## Methods ### getTypeFamilies() > **getTypeFamilies**(): `string`\[] **`Beta`** #### Returns `string`\[] #### Throws This function can throw errors. *** ### hasTypeFamily() > **hasTypeFamily**(`typeFamily`): `boolean` **`Beta`** #### Parameters ##### typeFamily `string` #### Returns `boolean` #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityVariantComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityVariantComponent.md. # Class: EntityVariantComponent entity component **`Beta`** Used to differentiate the component group of a variant of an entity from others. (e.g. ocelot, villager). ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### value > `readonly` **value**: `number` **`Beta`** #### Remarks Current value for variant for this entity, as specified via components. #### Throws This property can throw when used. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:variant"` = `'minecraft:variant'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityWantsJockeyComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityWantsJockeyComponent.md. # Class: EntityWantsJockeyComponent entity component **`Beta`** 当添加时,此组件表示该实体想要成为骑乘者。 When added, this component signifies that this entity wants to become a jockey. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:wants_jockey"` = `'minecraft:wants_jockey'` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerCursorInventoryComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerCursorInventoryComponent.md. # Class: PlayerCursorInventoryComponent player inventory component **`Beta`** 表示玩家的光标背包。用于在背包 UI 中的容器之间移动物品。不适用于触屏控制。 Represents the players cursor inventory. Used when moving items between between containers in the inventory UI. Not used with touch controls. ## Extends - [`EntityComponent`](/server/classes/EntityComponent.md) ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 拥有此组件的实体。如果实体已被移除,则实体将为 `undefined`。 The entity that owns this component. The entity will be undefined if it has been removed. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`entity`](/server/classes/EntityComponent.md#entity) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`isValid`](/server/classes/EntityComponent.md#isvalid) *** ### item? > `readonly` `optional` **item?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 玩家光标背包中当前的物品堆。 #### Remarks The ItemStack currently in the players cursor inventory. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`EntityComponent`](/server/classes/EntityComponent.md).[`typeId`](/server/classes/EntityComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:cursor_inventory"` = `'minecraft:cursor_inventory'` **`Beta`** ## Methods ### clear() > **clear**(): `void` **`World Mutation`** **`Beta`** 清空玩家的光标背包。 #### Returns `void` #### Remarks Clears the players cursor inventory. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) - [BlockInventoryComponent](/server/classes/BlockInventoryComponent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemComponent.md. # Class: ItemComponent component **`Beta`** 物品组件的基类。 Base class for item components. ## Extends - [`Component`](/server/classes/Component.md) ## Extended by - [`ItemBlockDynamicPropertiesComponent`](/server/classes/ItemBlockDynamicPropertiesComponent.md) - [`ItemBookComponent`](/server/classes/ItemBookComponent.md) - [`ItemCompostableComponent`](/server/classes/ItemCompostableComponent.md) - [`ItemCooldownComponent`](/server/classes/ItemCooldownComponent.md) - [`ItemCustomComponentInstance`](/server/classes/ItemCustomComponentInstance.md) - [`ItemDurabilityComponent`](/server/classes/ItemDurabilityComponent.md) - [`ItemDyeableComponent`](/server/classes/ItemDyeableComponent.md) - [`ItemEnchantableComponent`](/server/classes/ItemEnchantableComponent.md) - [`ItemFoodComponent`](/server/classes/ItemFoodComponent.md) - [`ItemInventoryComponent`](/server/classes/ItemInventoryComponent.md) - [`ItemPotionComponent`](/server/classes/ItemPotionComponent.md) ## Properties ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`Component`](/server/classes/Component.md).[`isValid`](/server/classes/Component.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`Component`](/server/classes/Component.md).[`typeId`](/server/classes/Component.md#typeid) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemBlockDynamicPropertiesComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemBlockDynamicPropertiesComponent.md. # Class: ItemBlockDynamicPropertiesComponent block component **`Beta`** 表示方块的动态属性。仅可从方块实体获取。 每个内容包在每个方块实体的动态属性存储中 最多可以存储 1KBytes 的数据。 Represents the dynamic properties of a block. Only available from block entities. Up to 1KBytes of data can be stored per content pack per block entity in their dynamic properties storage. ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:block_actor_dynamic_properties"` = `'minecraft:block_actor_dynamic_properties'` **`Beta`** ## Methods ### get() > **get**(`key`): `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` **`Beta`** #### Parameters ##### key `string` #### Returns `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` #### Remarks 返回使用提供的键存储的 DynamicProperty。每个内容包的键是唯一的, 无法用于检索其他内容包设置的动态属性。若未找到对应键,则返回 undefined。 Returns a DynamicProperty that was stored with the provided key. Keys are unique to each content pack and cannot be used to retrieve dynamic properties set from other content packs. Returns undefined if the key was not found. #### Throws This function can throw errors. Error [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### set() > **set**(`key`, `value?`): `void` **`Beta`** #### Parameters ##### key `string` ##### value? `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) #### Returns `void` #### Remarks 设置具有提供的键和值的动态属性。每个内容包的键是唯一的, 无法用于设置其他内容包的动态属性。值可以是 Number、String 或 Vector3。 将属性设置为 undefined 会将其从存储中移除。存储大小计入每个内容包 1KBytes 的限额。 Sets a dynamic property with the provided key and value. Keys are unique to each content pack and cannot be used to set dynamic properties for other content packs. Values can be either a Number, a String or a Vector3. Setting a property with an undefined value will remove it from the storage. Storage size usage is counted towards the 1KBytes limit per content pack. #### Throws This function can throw errors. Error [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### totalByteCount() > **totalByteCount**(): `number` **`Beta`** #### Returns `number` #### Remarks 返回当前该方块动态属性存储的字节大小。字节数仅计算由你的内容包 设置的属性。1KBytes 限额是按每个内容包计算的。 Returns the current size, in bytes, of the dynamic properties storage for this block. The byte count only accounts for properties set by your content pack. The 1KBytes limit is per content pack. #### Throws This function can throw errors. [InvalidItemStackError](/server/classes/InvalidItemStackError.md) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemBookComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemBookComponent.md. # Class: ItemBookComponent component **`Beta`** 当此组件存在于物品上时,表示该物品为书本物品。可以访问和 修改书本的内容并对其进行签名。 When present on an item, this item is a book item. Can access and modify the contents of the book and sign it. ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### author? > `readonly` `optional` **author?**: `string` **`Beta`** #### Remarks 若书本已签名,则为书本作者的名字;否则为 undefined。 The name of the author of the book if it is signed, otherwise undefined. #### Throws This property can throw when used. [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### contents > `readonly` **contents**: (`string` | `undefined`)\[] **`Beta`** #### Remarks 书本中以字符串格式存储的各页内容。非字符串格式的条目将为 undefined。 The contents of pages in the book that are in string format. Entries not in string format will be undefined. #### Throws This property can throw when used. [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### isSigned > `readonly` **isSigned**: `boolean` **`Beta`** #### Remarks 判断书本是否已被签名。 Determines whether the book has been signed or not. #### Throws This property can throw when used. [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### pageCount > `readonly` **pageCount**: `number` **`Beta`** #### Remarks 书本拥有的页数。 The amount of pages the book has. #### Throws This property can throw when used. [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### rawContents > `readonly` **rawContents**: ([`RawMessage`](/server/interfaces/RawMessage.md) | `undefined`)\[] **`Beta`** #### Remarks 书本中以 [RawMessage](/server/interfaces/RawMessage.md) 格式存储的各页内容。非 [RawMessage](/server/interfaces/RawMessage.md) 格式的条目将为 undefined。 The contents of pages in the book that are in [RawMessage](/server/interfaces/RawMessage.md) format. Entries not in [RawMessage](/server/interfaces/RawMessage.md) format will be undefined. #### Throws This property can throw when used. [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### title? > `readonly` `optional` **title?**: `string` **`Beta`** #### Remarks 若书本已签名,则为书本的标题;否则为 undefined。 The title of the book if it is signed, otherwise undefined. #### Throws This property can throw when used. [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:book"` = `'minecraft:book'` **`Beta`** ## Methods ### getPageContent() > **getPageContent**(`pageIndex`): `string` | `undefined` **`Beta`** #### Parameters ##### pageIndex `number` 页面的索引。 The index of the page. #### Returns `string` | `undefined` 若提供的索引有效且该页为字符串格式,则返回该页内容;否则 返回 undefined。 The content of the page if a valid index is provided and it is in string format, otherwise returns undefined. #### Remarks 获取指定索引处页面的字符串格式内容。 Gets the string format content of a page for a given index. #### Throws This function can throw errors. [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### getRawPageContent() > **getRawPageContent**(`pageIndex`): [`RawMessage`](/server/interfaces/RawMessage.md) | `undefined` **`Beta`** #### Parameters ##### pageIndex `number` 页面的索引。 The index of the page. #### Returns [`RawMessage`](/server/interfaces/RawMessage.md) | `undefined` 若提供的索引有效且该页为 [RawMessage](/server/interfaces/RawMessage.md) 格式,则返回该 页内容;否则返回 undefined。 The content of the page if a valid index is provided and it is in [RawMessage](/server/interfaces/RawMessage.md) format, otherwise returns undefined. #### Remarks 获取指定索引处页面的 [RawMessage](/server/interfaces/RawMessage.md) 格式内容。 Gets the [RawMessage](/server/interfaces/RawMessage.md) format content of a page for a given index. #### Throws This function can throw errors. [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### insertPage() > **insertPage**(`pageIndex`, `content`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### pageIndex `number` 页面的索引。 The index of the page. ##### content `string` | [`RawMessage`](/server/interfaces/RawMessage.md) | (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[] 要为该页设置的内容。可以是单个字符串或 [RawMessage](/server/interfaces/RawMessage.md), 或字符串和/或 [RawMessage](/server/interfaces/RawMessage.md) 组成的数组。 The content to set for the page. Can be a single string or [RawMessage](/server/interfaces/RawMessage.md) or an array of strings and/or [RawMessage](/server/interfaces/RawMessage.md)s #### Returns `void` #### Remarks 在指定索引处插入一页。若索引大于当前书本大小,则会创建空 白页面。 页面对于字符串以及 [RawMessage](/server/interfaces/RawMessage.md) 的 JSON 表示均有最多 256 个字符的限制。书本最多有 50 页的限制。 Inserts a page at a given index. Empty pages will be created if the index is greater than the current book size. Pages have a maximum limit of 256 characters for strings as well as the JSON representation of a [RawMessage](/server/interfaces/RawMessage.md). Books have a maximum limit of 50 pages. #### Throws This function can throw errors. [BookError](/server/classes/BookError.md) [BookPageContentError](/server/classes/BookPageContentError.md) [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### removePage() > **removePage**(`pageIndex`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### pageIndex `number` 页面的索引。 The index of the page. #### Returns `void` #### Remarks 移除指定索引处的一页。该页之后的现有页面将向前移动以填补 空缺。 Removes a page at a given index. Existing pages following this page will be moved backward to fill the empty space. #### Throws This function can throw errors. [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### setContents() > **setContents**(`contents`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### contents (`string` | [`RawMessage`](/server/interfaces/RawMessage.md) | (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[])\[] 由各页内容组成的数组。每一页可以是单个字符串或 [RawMessage](/server/interfaces/RawMessage.md),或字符串和/或 [RawMessage](/server/interfaces/RawMessage.md) 组成的数组。 An array of each page's contents. Each page can be a single string or [RawMessage](/server/interfaces/RawMessage.md) or an array of strings and/or [RawMessage](/server/interfaces/RawMessage.md)s. #### Returns `void` #### Remarks 设置书本各页的内容。原有页面将被清除。 页面对于字符串以及 [RawMessage](/server/interfaces/RawMessage.md) 的 JSON 表示均有最多 256 个字符的限制。书本最多有 50 页的限制。 Sets the contents of the book's pages. Pre-existing pages will be cleared. Pages have a maximum limit of 256 characters for strings as well as the JSON representation of a [RawMessage](/server/interfaces/RawMessage.md). Books have a maximum limit of 50 pages. #### Throws This function can throw errors. [BookError](/server/classes/BookError.md) [BookPageContentError](/server/classes/BookPageContentError.md) [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### setPageContent() > **setPageContent**(`pageIndex`, `content`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### pageIndex `number` 页面的索引。 The index of the page. ##### content `string` | [`RawMessage`](/server/interfaces/RawMessage.md) | (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[] 要为该页设置的内容。可以是单个字符串或 [RawMessage](/server/interfaces/RawMessage.md), 或字符串和/或 [RawMessage](/server/interfaces/RawMessage.md) 组成的数组。 The content to set for the page. Can be a single string or [RawMessage](/server/interfaces/RawMessage.md) or an array of strings and/or [RawMessage](/server/interfaces/RawMessage.md)s #### Returns `void` #### Remarks 设置或创建指定页面的内容。若索引大于当前书本大小,则会创 建空白页面。 页面对于字符串以及 [RawMessage](/server/interfaces/RawMessage.md) 的 JSON 表示均有最多 256 个字符的限制。书本最多有 50 页的限制。 Sets or creates the content of a specific page. Empty pages will be created if the index is greater than the current book size. Pages have a maximum limit of 256 characters for strings as well as the JSON representation of a [RawMessage](/server/interfaces/RawMessage.md). Books have a maximum limit of 50 pages. #### Throws This function can throw errors. [BookError](/server/classes/BookError.md) [BookPageContentError](/server/classes/BookPageContentError.md) [InvalidItemStackError](/server/classes/InvalidItemStackError.md) *** ### signBook() > **signBook**(`title`, `author`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### title `string` 要赋予书本的标题。 The title to give the book. ##### author `string` 书本作者的名字。 The name of the book's author. #### Returns `void` #### Remarks 为书本签名,赋予其标题和作者名。一旦签名,玩家便无法再直 接编辑该书本。 标题最多有 16 个字符的限制。 Signs a book giving it a title and author name. Once signed players can no longer directly edit the book. Titles have a maximum character limit of 16. #### Throws This function can throw errors. [BookError](/server/classes/BookError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [InvalidItemStackError](/server/classes/InvalidItemStackError.md) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemCompostableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemCompostableComponent.md. # Class: ItemCompostableComponent component **`Beta`** 当存在此组件时,若堆肥概率处于 \[1, 100] 区间内,该物品可以在堆肥桶中进行堆肥。 When present, the item can be composted in the composter block if the composting chance is in the range \[1 - 100]. ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### compostingChance > `readonly` **compostingChance**: `number` **`Beta`** #### Remarks 该物品在堆肥桶中进行堆肥并产生堆肥层的百分比概率。注意,对于原版中可堆肥但并未使用该堆肥组件的物品,此 API 同样会返回其堆肥概率。 This is the percent chance of the item composting in the composter block and generating a compost layer. Note this api will also return the composting chance for vanilla items that are compostable but do not use the compostable item component. #### Throws Throws if value outside the range \[1 - 100] *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:compostable"` = `'minecraft:compostable'` **`Beta`** ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemCooldownComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemCooldownComponent.md. # Class: ItemCooldownComponent component **`Beta`** When present on an item, this item has a cooldown effect when used by entities. ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### cooldownCategory > `readonly` **cooldownCategory**: `string` **`Beta`** #### Remarks Represents the cooldown category that this item is associated with. #### Throws This property can throw when used. *** ### cooldownTicks > `readonly` **cooldownTicks**: `number` **`Beta`** #### Remarks Amount of time, in ticks, it will take this item to cooldown. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:cooldown"` = `'minecraft:cooldown'` **`Beta`** ## Methods ### getCooldownTicksRemaining() > **getCooldownTicksRemaining**(`player`): `number` **`World Mutation`** **`Beta`** #### Parameters ##### player [`Player`](/server/classes/Player.md) #### Returns `number` #### Remarks #### Throws This function can throw errors. *** ### isCooldownCategory() > **isCooldownCategory**(`cooldownCategory`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### cooldownCategory `string` The cooldown category that might be associated with this item. #### Returns `boolean` True if the item is the given cooldown category. #### Remarks Will return true if the item is the cooldown category passed in and false otherwise. #### Throws This function can throw errors. *** ### startCooldown() > **startCooldown**(`player`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### player [`Player`](/server/classes/Player.md) #### Returns `void` #### Remarks Starts a new cooldown period for this item. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemCustomComponentInstance.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemCustomComponentInstance.md. # Class: ItemCustomComponentInstance component **`Beta`** 物品上某一自定义组件的实例。 An instance of a custom component on an item. ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### customComponentParameters > `readonly` **customComponentParameters**: [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) **`Beta`** *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemDurabilityComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemDurabilityComponent.md. # Class: ItemDurabilityComponent component **`Beta`** 表示物品耐久组件。当出现在物品上时,表示该物品在使用过程中会损耗耐久。 注意,此组件仅对数驱物品生效。 When present on an item, this item can take damage in the process of being used. Note that this component only applies to data-driven items. ## Example **giveHurtDiamondSword.ts** ```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); } } } ``` ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### damage > **damage**: `number` **`World Mutation`** **`Beta`** #### Remarks 此物品当前的损坏值。 物品当前耐久度为 `maxDurability - damage`。 当被设置为 负数,`Infinity`,`NaN` 等值时,值为 0。 Returns the current damage level of this particular item. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### maxDurability > `readonly` **maxDurability**: `number` **`Beta`** #### Remarks 表示该物品在损坏前可以承受的损坏值。 Represents the amount of damage that this item can take before breaking. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) *** ### unbreakable > **unbreakable**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 表示物品是否会损坏或损失耐久度。将其设置为 true 会暂时移除物品的耐久度 HUD,并暂停该物品的耐久度损失。 Whether an item breaks or loses durability. Setting to true temporarily removes item's durability HUD, and freezes durability loss on item. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:durability"` = `'minecraft:durability'` **`Beta`** ## Methods ### getDamageChance() > **getDamageChance**(`unbreakingEnchantmentLevel?`): `number` **`World Mutation`** **`Beta`** #### Parameters ##### unbreakingEnchantmentLevel? `number` 耐久魔咒等级,在计算损坏概率时受到此参数的影响。 传入的 `unbreakingEnchantmentLevel` 参数必须介于 \[0, 3]。 Unbreaking factor to consider in factoring the damage chance. Incoming unbreaking parameter must be within the range \[0, 3]. Defaults to: 0 Bounds: \[0, 3] #### Returns `number` 使用时的最大损坏概率。 #### Remarks 返回根据 `damageRange` 属性生成的最大损坏概率, 附带一个耐久附魔等级作为可选参数。 Returns the maximum chance that this item would be damaged using the damageRange property, given an unbreaking enchantment level. #### Throws 若 `unbreakingEnchantmentLevel` 参数未在范围内时,抛出 `TypeError` 。 *** ### getDamageChanceRange() > **getDamageChanceRange**(): `NumberRange` **`World Mutation`** **`Beta`** #### Returns `NumberRange` #### Remarks 返回用于计算物品损失耐久的概率范围。最终物品损失耐久的概率将落在此范围中。 A range of numbers that is used to calculate the damage chance for an item. The damage chance will fall within this range. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemDyeableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemDyeableComponent.md. # Class: ItemDyeableComponent component **`Beta`** 表示物品可被染色。当出现在物品上时,表示该物品可被染色。 When present on an item, this item can be dyed. ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### color? > `optional` **color?**: [`RGB`](/server/interfaces/RGB.md) **`World Mutation`** **`Beta`** #### Remarks 设置并返回该物品当前的颜色。 Sets and returns the current color of the item. *** ### defaultColor? > `readonly` `optional` **defaultColor?**: [`RGB`](/server/interfaces/RGB.md) **`Beta`** #### Remarks 返回该物品的默认颜色。 Returns the default color of the item. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:dyeable"` = `'minecraft:dyeable'` **`Beta`** ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemEnchantableComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemEnchantableComponent.md. # Class: ItemEnchantableComponent component **`Beta`** 当此组件存在于物品上时,表示该物品可以被附魔。 When present on an item, this item can have enchantments applied to it. ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### slots > `readonly` **slots**: [`EnchantmentSlot`](/server/enums/EnchantmentSlot.md)\[] **`Beta`** #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:enchantable"` = `'minecraft:enchantable'` **`Beta`** ## Methods ### addEnchantment() > **addEnchantment**(`enchantment`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### enchantment [`Enchantment`](/server/interfaces/Enchantment.md) 要添加的附魔接口。 The enchantment interface to be added. #### Returns `void` #### Remarks 向物品堆添加一个附魔。 Adds an enchantment to the item stack. #### Throws ScriptItemEnchantmentUnknownIdError: Exception thrown if the enchantment type does not exist. ScriptItemEnchantmentLevelOutOfBoundsError: Exception thrown if the enchantment level is outside the allowable range for the given enchantment type. ScriptItemEnchantmentTypeNotCompatibleError: Exception thrown if the enchantment is not compatible with the item stack. [EnchantmentLevelOutOfBoundsError](/server/classes/EnchantmentLevelOutOfBoundsError.md) [EnchantmentTypeNotCompatibleError](/server/classes/EnchantmentTypeNotCompatibleError.md) [EnchantmentTypeUnknownIdError](/server/classes/EnchantmentTypeUnknownIdError.md) Error *** ### addEnchantments() > **addEnchantments**(`enchantments`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### enchantments [`Enchantment`](/server/interfaces/Enchantment.md)\[] 要添加的附魔列表。 The list of enchantments to be added. #### Returns `void` #### Remarks 向物品堆添加一组附魔。 Adds a list of enchantments to the item stack. #### Throws ScriptItemEnchantmentUnknownIdError: Exception thrown if any enchantment type does not exist. ScriptItemEnchantmentLevelOutOfBoundsError: Exception thrown if any enchantment level is outside the allowable range for the given enchantment type. ScriptItemEnchantmentTypeNotCompatibleError: Exception thrown if any enchantment is not compatible with the item stack. [EnchantmentLevelOutOfBoundsError](/server/classes/EnchantmentLevelOutOfBoundsError.md) [EnchantmentTypeNotCompatibleError](/server/classes/EnchantmentTypeNotCompatibleError.md) [EnchantmentTypeUnknownIdError](/server/classes/EnchantmentTypeUnknownIdError.md) Error *** ### canAddEnchantment() > **canAddEnchantment**(`enchantment`): `boolean` **`Beta`** #### Parameters ##### enchantment [`Enchantment`](/server/interfaces/Enchantment.md) 要添加的附魔接口。 The enchantment interface to be added. #### Returns `boolean` 若该附魔可以添加到物品堆,则返回 true。 Returns true if the enchantment can be added to the item stack. #### Remarks 检查某个附魔是否可以添加到物品堆。 Checks whether an enchantment can be added to the item stack. #### Throws ScriptItemEnchantmentUnknownIdError: Exception thrown if the enchantment type does not exist. ScriptItemEnchantmentLevelOutOfBoundsError: Exception thrown if the enchantment level is outside the allowable range for the given enchantment type. [EnchantmentLevelOutOfBoundsError](/server/classes/EnchantmentLevelOutOfBoundsError.md) [EnchantmentTypeUnknownIdError](/server/classes/EnchantmentTypeUnknownIdError.md) *** ### getEnchantment() > **getEnchantment**(`enchantmentType`): [`Enchantment`](/server/interfaces/Enchantment.md) | `undefined` **`Beta`** #### Parameters ##### enchantmentType `string` | [`EnchantmentType`](/server/classes/EnchantmentType.md) 要获取的附魔类型。 The enchantment type to get. #### Returns [`Enchantment`](/server/interfaces/Enchantment.md) | `undefined` 若该附魔存在于物品堆上,则返回该附魔。 Returns the enchantment if it exists on the item stack. #### Remarks 从物品堆获取指定类型的附魔。 Gets the enchantment of a given type from the item stack. #### Throws ScriptItemEnchantmentUnknownIdError: Exception thrown if the enchantment type does not exist. [EnchantmentTypeUnknownIdError](/server/classes/EnchantmentTypeUnknownIdError.md) *** ### getEnchantments() > **getEnchantments**(): [`Enchantment`](/server/interfaces/Enchantment.md)\[] **`Beta`** #### Returns [`Enchantment`](/server/interfaces/Enchantment.md)\[] 返回物品堆上的附魔列表。 Returns a list of enchantments on the item stack. #### Remarks 获取物品堆上的所有附魔。 Gets all enchantments on the item stack. #### Throws This function can throw errors. *** ### hasEnchantment() > **hasEnchantment**(`enchantmentType`): `boolean` **`Beta`** #### Parameters ##### enchantmentType `string` | [`EnchantmentType`](/server/classes/EnchantmentType.md) 要检查的附魔类型。 The enchantment type to check for. #### Returns `boolean` 若物品堆具有该附魔类型,则返回 true。 Returns true if the item stack has the enchantment type. #### Remarks 检查物品堆是否具有指定的附魔类型。 Checks whether an item stack has a given enchantment type. #### Throws ScriptItemEnchantmentUnknownIdError: Exception thrown if the enchantment type does not exist. [EnchantmentTypeUnknownIdError](/server/classes/EnchantmentTypeUnknownIdError.md) *** ### removeAllEnchantments() > **removeAllEnchantments**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 移除应用于此物品堆的所有附魔。 Removes all enchantments applied to this item stack. #### Throws This function can throw errors. *** ### removeEnchantment() > **removeEnchantment**(`enchantmentType`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### enchantmentType `string` | [`EnchantmentType`](/server/classes/EnchantmentType.md) 要移除的附魔类型。 The enchantment type to remove. #### Returns `void` #### Remarks 移除指定类型的附魔。 Removes an enchantment of the given type. #### Throws ScriptItemEnchantmentUnknownIdError: Exception thrown if the enchantment type does not exist. [EnchantmentTypeUnknownIdError](/server/classes/EnchantmentTypeUnknownIdError.md) Error ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemFoodComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemFoodComponent.md. # Class: ItemFoodComponent component **`Beta`** 表示物品食物组件。当出现在物品上时,实体可以消耗此物品。 注意,只能在数驱物品上获取和使用该组件。 When present on an item, this item is consumable by entities. Note that this component only applies to data-driven items. ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### canAlwaysEat > `readonly` **canAlwaysEat**: `boolean` **`Beta`** #### Remarks 若为 `true` ,则无论饥饿值是否已满,玩家始终可以食用该物品。 If true, the player can always eat this item (even when not hungry). #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### nutrition > `readonly` **nutrition**: `number` **`Beta`** #### Remarks 表示实体在食用该物品后恢复的饥饿值,即营养值。 Represents how much nutrition this food item will give an entity when eaten. #### Throws This property can throw when used. *** ### saturationModifier > `readonly` **saturationModifier**: `number` **`Beta`** #### Remarks 当一个物品被食用, 将根据公式 `nutrition * saturation_modifier * 2` 来为玩家添加饱和状态。 When an item is eaten, this value is used according to this formula (nutrition \* saturation\_modifier \* 2) to apply a saturation buff. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) *** ### usingConvertsTo > `readonly` **usingConvertsTo**: `string` **`Beta`** #### Remarks 若给出,则使用时将该物品转换为标识符指定的物品。 When specified, converts the active item to the one specified by this property. #### Throws This property can throw when used. *** ### componentId > `readonly` `static` **componentId**: `"minecraft:food"` = `'minecraft:food'` **`Beta`** ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemInventoryComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemInventoryComponent.md. # Class: ItemInventoryComponent inventory component **`Beta`** 该组件被添加到具有 `Storage Item`(存储物品)组件的物品上。 可以访问和修改该物品的物品栏容器。 This component is added to items with the `Storage Item` component. Can access and modify this items inventory container. ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### container > `readonly` **container**: [`Container`](/server/classes/Container.md) **`Beta`** #### Throws This property can throw when used. [InvalidContainerError](/server/classes/InvalidContainerError.md) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:inventory"` = `'minecraft:inventory'` **`Beta`** ## 同领域相关 - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) - [BlockInventoryComponent](/server/classes/BlockInventoryComponent.md) - [EntityEnderInventoryComponent](/server/classes/EntityEnderInventoryComponent.md) - [EntityInventoryComponent](/server/classes/EntityInventoryComponent.md) - [PlayerCursorInventoryComponent](/server/classes/PlayerCursorInventoryComponent.md) - [BlockComponent](/server/classes/BlockComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemPotionComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemPotionComponent.md. # Class: ItemPotionComponent component **`Beta`** 表示物品为药水物品。当出现在物品上时,表示该物品为药水物品。 When present on an item, this item is a potion item. ## Extends - [`ItemComponent`](/server/classes/ItemComponent.md) ## Properties ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。 Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`isValid`](/server/classes/ItemComponent.md#isvalid) *** ### potionDeliveryType > `readonly` **potionDeliveryType**: [`PotionDeliveryType`](/server/classes/PotionDeliveryType.md) **`Beta`** #### Remarks 与该药水物品关联的 PotionDeliveryType。 The PotionDeliveryType associated with the potion item. #### Throws This property can throw when used. [EngineError](/common/classes/EngineError.md) Error *** ### potionEffectType > `readonly` **potionEffectType**: [`PotionEffectType`](/server/classes/PotionEffectType.md) **`Beta`** #### Remarks 与该药水物品关联的 PotionEffectType。 The PotionEffectType associated with the potion item. #### Throws This property can throw when used. [EngineError](/common/classes/EngineError.md) Error *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 组件的标识符。 Identifier of the component. #### Inherited from [`ItemComponent`](/server/classes/ItemComponent.md).[`typeId`](/server/classes/ItemComponent.md#typeid) *** ### componentId > `readonly` `static` **componentId**: `"minecraft:potion"` = `'minecraft:potion'` **`Beta`** ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Entity.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Entity.md. # Class: Entity entity **`Beta`** 表示世界中实体(生物、玩家或其他移动物体,如矿车)的状态。 Represents the state of an entity (a mob, the player, or other moving objects like minecarts) in the world. ## Extended by - [`Player`](/server/classes/Player.md) ## Properties ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 实体当前所在的维度。 Dimension that the entity is currently within. #### Throws This property can throw when used. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 实体的唯一标识符。此标识符旨在跨世界实例加载保持一致。不应从此唯一标识符的值和结构中推断任何含义——不要解析或解释它。即使 [Entity.isValid](#isvalid) 为 `false`,此属性也可访问。 Unique identifier of the entity. This identifier is intended to be consistent across loads of a world instance. No meaning should be inferred from the value and structure of this unique identifier - do not parse or interpret it. This property is accessible even if [Entity.isValid](#isvalid) is false. *** ### isClimbing > `readonly` **isClimbing**: `boolean` **`Beta`** #### Remarks 实体是否接触可攀爬方块。例如,梯子旁的玩家或石墙旁的蜘蛛。 Whether the entity is touching a climbable block. For example, a player next to a ladder or a spider next to a stone wall. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### isFalling > `readonly` **isFalling**: `boolean` **`Beta`** #### Remarks 实体是否具有大于 0 的摔落距离,或在滑翔时大于 1。 Whether the entity has a fall distance greater than 0, or greater than 1 while gliding. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### isInWater > `readonly` **isInWater**: `boolean` **`Beta`** #### Remarks 实体的任何部分是否在水方块内部。 Whether any part of the entity is inside a water block. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### isOnGround > `readonly` **isOnGround**: `boolean` **`Beta`** #### Remarks 实体是否在实心方块顶部。此属性可能以意外方式表现。此属性在实体首次生成时始终为 `true`,如果实体没有重力,则此属性可能不正确。 Whether the entity is on top of a solid block. This property may behave in unexpected ways. This property will always be true when an Entity is first spawned, and if the Entity has no gravity this property may be incorrect. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### isSleeping > `readonly` **isSleeping**: `boolean` **`Beta`** #### Remarks 如果为 `true`,实体当前正在睡觉。 If true, the entity is currently sleeping. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### isSneaking > **isSneaking**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 实体是否正在潜行——即移动得较慢且较安静。 Whether the entity is sneaking - that is, moving more slowly and more quietly. *** ### isSprinting > `readonly` **isSprinting**: `boolean` **`Beta`** #### Remarks 实体是否正在冲刺。例如,使用冲刺动作的玩家、逃跑的豹猫或用胡萝卜钓竿加速的猪。 Whether the entity is sprinting. For example, a player using the sprint action, an ocelot running away or a pig boosting with Carrot on a Stick. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### isSwimming > `readonly` **isSwimming**: `boolean` **`Beta`** #### Remarks 实体是否处于游泳状态。例如,使用游泳动作的玩家或水中的鱼。 Whether the entity is in the swimming state. For example, a player using the swim action or a fish in water. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回实体是否可以被脚本操作。当玩家的 EntityLifetimeState 设置为 Loaded 时,该玩家被视为有效。 Returns whether the entity can be manipulated by script. A Player is considered valid when it's EntityLifetimeState is set to Loaded. *** ### localizationKey > `readonly` **localizationKey**: `string` **`Beta`** #### Remarks 用于在 `.lang` 文件中本地化此实体名称的键。 Key for the localization of this entity's name used in .lang files. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### location > `readonly` **location**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 实体的当前位置。 Current location of the entity. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### nameplateDepthTested > **nameplateDepthTested**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 决定玩家名称标签是否应进行深度测试以确定可见性的布尔值。 Boolean which determines if the player nameplate should be depth tested for visibility. *** ### nameplateRenderDistance > **nameplateRenderDistance**: `number` **`World Mutation`** **`Beta`** #### Remarks 决定此实体名称标签渲染距离的浮点数。 Float that determines the render distance of this entity's nameplate. *** ### nameTag > **nameTag**: `string` **`World Mutation`** **`Beta`** #### Remarks 实体的给定名称。 Given name of the entity. *** ### scoreboardIdentity? > `readonly` `optional` **scoreboardIdentity?**: [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md) **`Beta`** #### Remarks 返回表示此实体的记分板身份。实体被击杀后仍将保持有效。 Returns a scoreboard identity that represents this entity. Will remain valid when the entity is killed. *** ### target? > `readonly` `optional` **target?**: `Entity` **`Beta`** #### Remarks 获取或设置用作 AI 相关行为(如攻击)目标的实体。如果实体当前没有目标,则返回 `undefined`。 Retrieves or sets an entity that is used as the target of AI-related behaviors, like attacking. If the entity currently has no target returns undefined. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 实体类型的标识符——例如,`minecraft:skeleton`。即使 [Entity.isValid](#isvalid) 为 `false`,此属性也可访问。 Identifier of the type of the entity - for example, 'minecraft:skeleton'. This property is accessible even if [Entity.isValid](#isvalid) is false. ## Methods ### addEffect() > **addEffect**(`effectType`, `duration`, `options?`): [`Effect`](/server/classes/Effect.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### effectType `string` | [`EffectType`](/server/classes/EffectType.md) 要添加到实体的效果类型。 Type of effect to add to the entity. ##### duration `number` 效果应用的时间量(以 tick 为单位)。每秒有 20 tick。使用 [TicksPerSecond](/server/variables/TicksPerSecond.md) 常量在 tick 和秒之间进行转换。值必须在 \[0, 20000000] 范围内。范围:\[1, 20000000] Amount of time, in ticks, for the effect to apply. There are 20 ticks per second. Use [TicksPerSecond](/server/variables/TicksPerSecond.md) constant to convert between ticks and seconds. The value must be within the range \[0, 20000000]. Bounds: \[1, 20000000] ##### options? [`EntityEffectOptions`](/server/interfaces/EntityEffectOptions.md) 效果的附加选项。 Additional options for the effect. #### Returns [`Effect`](/server/classes/Effect.md) | `undefined` 如果效果成功添加或更新,则不返回任何内容。如果持续时间或放大器超出有效范围,或者效果不存在,则可能抛出错误。 Returns nothing if the effect was added or updated successfully. This can throw an error if the duration or amplifier are outside of the valid ranges, or if the effect does not exist. #### Remarks 向实体添加或更新一个效果,例如中毒。 Adds or updates an effect, like poison, to the entity. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Examples **spawnPoisonedVillager.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEffectTypes } from '@minecraft/vanilla-data'; function spawnPoisonedVillager(targetLocation: DimensionLocation) { const villagerType = 'minecraft:villager_v2'; const villager = targetLocation.dimension.spawnEntity(villagerType, targetLocation); const duration = 20; villager.addEffect(MinecraftEffectTypes.Poison, duration, { amplifier: 1 }); } ``` **quickFoxLazyDog.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes, MinecraftEffectTypes } from '@minecraft/vanilla-data'; function quickFoxLazyDog(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const fox = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Fox, { x: targetLocation.x + 1, y: targetLocation.y + 2, z: targetLocation.z + 3, }); fox.addEffect(MinecraftEffectTypes.Speed, 10, { amplifier: 2, }); log('Created a fox.'); const wolf = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Wolf, { x: targetLocation.x + 4, y: targetLocation.y + 2, z: targetLocation.z + 3, }); wolf.addEffect(MinecraftEffectTypes.Slowness, 10, { amplifier: 2, }); wolf.isSneaking = true; log('Created a sneaking wolf.', 1); } ``` *** ### addItem() > **addItem**(`itemStack`): [`ItemStack`](/server/classes/ItemStack.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### itemStack [`ItemStack`](/server/classes/ItemStack.md) #### Returns [`ItemStack`](/server/classes/ItemStack.md) | `undefined` 如果物品已完全添加则返回 `undefined`,否则返回包含剩余数量的 ItemStack。 Returns undefined if the item was fully added or returns an ItemStack with the remaining count. #### Remarks 向实体的物品栏添加一个物品。 Adds an item to the entity's inventory. #### Throws This function can throw errors. [ContainerRulesError](/server/classes/ContainerRulesError.md) Error [InvalidEntityComponentError](/server/classes/InvalidEntityComponentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### addTag() > **addTag**(`tag`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### tag `string` 要添加的标签内容。标签必须少于 256 个字符。 Content of the tag to add. The tag must be less than 256 characters. #### Returns `boolean` 如果标签成功添加则返回 `true`。如果标签已存在于实体上,则可能失败。 Returns true if the tag was added successfully. This can fail if the tag already exists on the entity. #### Remarks 向实体添加一个指定的标签。 Adds a specified tag to an entity. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **tagsQuery.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function tagsQuery(targetLocation: DimensionLocation) { const mobs = ['creeper', 'skeleton', 'sheep']; // create some sample mob data for (let i = 0; i < 10; i++) { const mobTypeId = mobs[i % mobs.length]; const entity = targetLocation.dimension.spawnEntity(mobTypeId, targetLocation); entity.addTag('mobparty.' + mobTypeId); } const eqo: EntityQueryOptions = { tags: ['mobparty.skeleton'], }; for (const entity of targetLocation.dimension.getEntities(eqo)) { entity.kill(); } } ``` *** ### applyDamage() > **applyDamage**(`amount`, `options?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### amount `number` 要应用的伤害量。 Amount of damage to apply. ##### options? [`EntityApplyDamageByProjectileOptions`](/server/interfaces/EntityApplyDamageByProjectileOptions.md) | [`EntityApplyDamageOptions`](/server/interfaces/EntityApplyDamageOptions.md) 关于伤害来源的附加选项,可能为此实体添加额外效果或引发额外行为。 Additional options about the source of damage, which may add additional effects or spur additional behaviors on this entity. #### Returns `boolean` 实体是否受到任何伤害。如果实体无敌或应用的伤害小于或等于 0,则可能返回 `false`。 Whether the entity takes any damage. This can return false if the entity is invulnerable or if the damage applied is less than or equal to 0. #### Remarks 对实体应用一组伤害。 Applies a set of damage to an entity. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Example **applyDamageThenHeal.ts** ```typescript import { system, EntityHealthComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function applyDamageThenHeal(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const skelly = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Skeleton, targetLocation); skelly.applyDamage(19); // skeletons have max damage of 20 so this is a near-death skeleton system.runTimeout(() => { const health = skelly.getComponent(EntityComponentTypes.Health) as EntityHealthComponent; log('Skeleton health before heal: ' + health?.currentValue); health?.resetToMaxValue(); log('Skeleton health after heal: ' + health?.currentValue); }, 20); } ``` *** ### applyImpulse() > **applyImpulse**(`vector`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### vector [`Vector3`](/server/interfaces/Vector3.md) 冲量向量。 Impulse vector. #### Returns `void` #### Remarks 向实体的当前速度施加冲量向量。 Applies impulse vector to the current velocity of the entity. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **applyImpulse.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function applyImpulse(targetLocation: DimensionLocation) { const zombie = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Zombie, targetLocation); zombie.clearVelocity(); // throw the zombie up in the air zombie.applyImpulse({ x: 0, y: 0.5, z: 0 }); } ``` *** ### applyKnockback() > **applyKnockback**(`horizontalForce`, `verticalStrength`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### horizontalForce [`VectorXZ`](/server/interfaces/VectorXZ.md) ##### verticalStrength `number` 垂直向量的击退强度。 Knockback strength for the vertical vector. #### Returns `void` #### Remarks 向实体的当前速度施加冲量向量。 Applies impulse vector to the current velocity of the entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Example **bounceSkeletons.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function bounceSkeletons(targetLocation: DimensionLocation) { const mobs = ['creeper', 'skeleton', 'sheep']; // create some sample mob data for (let i = 0; i < 10; i++) { targetLocation.dimension.spawnEntity(mobs[i % mobs.length], targetLocation); } const eqo: EntityQueryOptions = { type: 'skeleton', }; for (const entity of targetLocation.dimension.getEntities(eqo)) { entity.applyKnockback(0, 0, 0, 1); } } ``` *** ### clearDynamicProperties() > **clearDynamicProperties**(): `void` **`Beta`** #### Returns `void` #### Remarks 清除此实体上设置的所有动态属性。 Clears all dynamic properties that have been set on this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### clearVelocity() > **clearVelocity**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将实体的当前速度设置为零。 Sets the current velocity of the Entity to zero. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **applyImpulse.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function applyImpulse(targetLocation: DimensionLocation) { const zombie = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Zombie, targetLocation); zombie.clearVelocity(); // throw the zombie up in the air zombie.applyImpulse({ x: 0, y: 0.5, z: 0 }); } ``` *** ### extinguishFire() > **extinguishFire**(`useEffects?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### useEffects? `boolean` 是否显示与灭火相关的任何视觉效果。默认值:`true` Whether to show any visual effects connected to the extinguishing. Defaults to: true #### Returns `boolean` 返回实体是否曾着火。 Returns whether the entity was on fire. #### Remarks 如果实体着火,则将其灭火。请注意,你可以调用 `getComponent('minecraft:onfire')`,如果存在,则实体着火。 Extinguishes the fire if the entity is on fire. Note that you can call getComponent('minecraft:onfire') and, if present, the entity is on fire. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **setOnFire.ts** ```typescript import { system, EntityOnFireComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function setOnFire(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const skelly = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Skeleton, targetLocation); skelly.setOnFire(20, true); system.runTimeout(() => { const onfire = skelly.getComponent(EntityComponentTypes.OnFire) as EntityOnFireComponent; log(onfire?.onFireTicksRemaining + ' fire ticks remaining.'); skelly.extinguishFire(true); log('Never mind. Fire extinguished.'); }, 20); } ``` *** ### getAABB() > **getAABB**(): [`AABB`](/server/interfaces/AABB.md) **`Beta`** #### Returns [`AABB`](/server/interfaces/AABB.md) 一个轴对齐的边界框。 An axis-aligned bounding box. #### Remarks 获取实体的碰撞边界。 Gets the entity's collision bounds. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getAllBlocksStandingOn() > **getAllBlocksStandingOn**(`options?`): [`Block`](/server/classes/Block.md)\[] **`Beta`** #### Parameters ##### options? [`GetBlocksStandingOnOptions`](/server/interfaces/GetBlocksStandingOnOptions.md) 返回哪些方块的附加配置选项。 Additional configuration options for what blocks are returned. #### Returns [`Block`](/server/classes/Block.md)\[] 此实体直接站在上面的实心方块。如果实体正在跳跃或飞行,则返回空列表。 The solid blocks that this entity is directly standing on. Returns an empty list if the entity is jumping or flying. #### Remarks 获取此实体直接站在上面的实心方块。忽略压力板。 Gets the solid blocks that this entity is directly standing on. Ignores pressure plates. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getBlockFromViewDirection() > **getBlockFromViewDirection**(`options?`): [`BlockRaycastHit`](/server/interfaces/BlockRaycastHit.md) | `undefined` **`Beta`** #### Parameters ##### options? [`BlockRaycastOptions`](/server/interfaces/BlockRaycastOptions.md) 射线投射的附加配置选项。 Additional configuration options for the ray cast. #### Returns [`BlockRaycastHit`](/server/interfaces/BlockRaycastHit.md) | `undefined` 返回从此实体视线方向上相交的第一个方块。 Returns the first intersecting block from the direction that this entity is looking at. #### Remarks 返回从此实体视线方向上相交的第一个方块。 Returns the first intersecting block from the direction that this entity is looking at. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getBlockStandingOn() > **getBlockStandingOn**(`options?`): [`Block`](/server/classes/Block.md) | `undefined` **`Beta`** #### Parameters ##### options? [`GetBlocksStandingOnOptions`](/server/interfaces/GetBlocksStandingOnOptions.md) 返回哪个方块的附加配置选项。 Additional configuration options for what block is returned. #### Returns [`Block`](/server/classes/Block.md) | `undefined` 最接近此实体中心的一个实心方块,此实体直接站在上面。如果实体正在飞行或跳跃,则为 `undefined`。 A single solid block closest to the center of the entity that this entity is directly standing on. Undefined if entity is flying or jumping. #### Remarks 获取最接近此实体中心的一个实心方块,此实体直接站在上面。忽略压力板。 Gets a single solid block closest to the center of the entity that this entity is directly standing on. Ignores pressure plates. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getComponent() > **getComponent**\<`T`>(`componentId`): [`EntityComponentReturnType`](/server/types/EntityComponentReturnType.md)\<`T`> | `undefined` **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` #### Parameters ##### componentId `T` 组件的标识符(例如,`'minecraft:health'`)。如果未指定命名空间前缀,则默认为 `'minecraft:'`。可用的组件 ID 可以在 [EntityComponentTypes](/server/enums/EntityComponentTypes.md) 枚举中找到。 The identifier of the component (e.g., 'minecraft:health'). If no namespace prefix is specified, 'minecraft:' is assumed. Available component IDs can be found as part of the [EntityComponentTypes](/server/enums/EntityComponentTypes.md) enum. #### Returns [`EntityComponentReturnType`](/server/types/EntityComponentReturnType.md)\<`T`> | `undefined` 如果组件存在于实体上则返回该组件,否则返回 `undefined`。 Returns the component if it exists on the entity, otherwise undefined. #### Remarks 获取实体的一个组件(表示附加功能)。 Gets a component (that represents additional capabilities) for an entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getComponents() > **getComponents**(): [`EntityComponent`](/server/classes/EntityComponent.md)\[] **`Beta`** #### Returns [`EntityComponent`](/server/classes/EntityComponent.md)\[] #### Remarks 返回此实体上存在的所有脚本组件。 Returns all scripting components that are present on this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getDynamicProperty() > **getDynamicProperty**(`identifier`): `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` **`Beta`** #### Parameters ##### identifier `string` 属性标识符。 The property identifier. #### Returns `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` 返回属性的值,如果属性尚未设置则返回 `undefined`。 Returns the value for the property, or undefined if the property has not been set. #### Remarks 返回一个属性值。 Returns a property value. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getDynamicPropertyIds() > **getDynamicPropertyIds**(): `string`\[] **`Beta`** #### Returns `string`\[] 此实体上设置的动态属性的字符串数组。 A string array of the dynamic properties set on this entity. #### Remarks 返回此实体上已使用的可用动态属性标识符集合。 Returns the available set of dynamic property identifiers that have been used on this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getDynamicPropertyTotalByteCount() > **getDynamicPropertyTotalByteCount**(): `number` **`Beta`** #### Returns `number` #### Remarks 返回此实体当前存储的所有动态属性的总大小(以字节为单位)。包括键和值的大小。这对于诊断性能警告信号很有用——例如,如果一个实体有数兆字节的关联动态属性,它在各种设备上加载可能会很慢。 Returns the total size, in bytes, of all the dynamic properties that are currently stored for this entity. This includes the size of both the key and the value. This can be useful for diagnosing performance warning signs - if, for example, an entity has many megabytes of associated dynamic properties, it may be slow to load on various devices. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getEffect() > **getEffect**(`effectType`): [`Effect`](/server/classes/Effect.md) | `undefined` **`Beta`** #### Parameters ##### effectType `string` | [`EffectType`](/server/classes/EffectType.md) 效果标识符。 The effect identifier. #### Returns [`Effect`](/server/classes/Effect.md) | `undefined` 指定效果的 Effect 对象,如果效果不存在则返回 `undefined`,如果效果类型不存在则抛出错误。 Effect object for the specified effect, undefined if the effect is not present, or throws an error if the effect does not exist. #### Remarks 返回实体上指定 EffectType 的效果,如果效果不存在则返回 `undefined`,如果效果类型不存在则抛出错误。 Returns the effect for the specified EffectType on the entity, undefined if the effect is not present, or throws an error if the effect does not exist. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getEffects() > **getEffects**(): [`Effect`](/server/classes/Effect.md)\[] **`Beta`** #### Returns [`Effect`](/server/classes/Effect.md)\[] 效果列表。 List of effects. #### Remarks 返回应用于此实体的一组效果。 Returns a set of effects applied to this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getEntitiesFromViewDirection() > **getEntitiesFromViewDirection**(`options?`): [`EntityRaycastHit`](/server/interfaces/EntityRaycastHit.md)\[] **`Beta`** #### Parameters ##### options? [`EntityRaycastOptions`](/server/interfaces/EntityRaycastOptions.md) 射线投射的附加配置选项。 Additional configuration options for the ray cast. #### Returns [`EntityRaycastHit`](/server/interfaces/EntityRaycastHit.md)\[] 返回从此实体视线方向上的实体集合。 Returns a set of entities from the direction that this entity is looking at. #### Remarks 通过从此实体的视角执行射线投射,获取此实体正在注视的实体。 Gets the entities that this entity is looking at by performing a ray cast from the view of this entity. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) *** ### getHeadLocation() > **getHeadLocation**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) 返回此实体头部组件的当前位置。 Returns the current location of the head component of this entity. #### Remarks 返回此实体头部组件的当前位置。 Returns the current location of the head component of this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getProperty() > **getProperty**(`identifier`): `string` | `number` | `boolean` | `undefined` **`Beta`** #### Parameters ##### identifier `string` 实体属性标识符。 The entity Property identifier. #### Returns `string` | `number` | `boolean` | `undefined` 返回当前属性值。对于枚举属性,返回字符串。对于浮点和整数属性,返回数字。对于未定义的属性,返回 `undefined`。 Returns the current property value. For enum properties, a string is returned. For float and int properties, a number is returned. For undefined properties, undefined is returned. #### Remarks 获取一个实体属性值。如果该属性在同一个 tick 内使用 setProperty 函数设置,更新后的值将不会反映出来,直到下一个 tick。 Gets an entity Property value. If the property was set using the setProperty function within the same tick, the updated value will not be reflected until the subsequent tick. #### Throws 如果实体无效则抛出异常。 Throws if the entity is invalid. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getRotation() > **getRotation**(): [`Vector2`](/server/interfaces/Vector2.md) **`Beta`** #### Returns [`Vector2`](/server/interfaces/Vector2.md) 返回包含此实体旋转的 Vec2(以度为单位)。 Returns a Vec2 containing the rotation of this entity (in degrees). #### Remarks 返回此实体的当前旋转组件。 Returns the current rotation component of this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getTags() > **getTags**(): `string`\[] **`Beta`** #### Returns `string`\[] 包含所有标签字符串的数组。 An array containing all tags as strings. #### Remarks 返回与实体关联的所有标签。 Returns all tags associated with the entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getVelocity() > **getVelocity**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) 返回实体的当前速度向量。 Returns the current velocity vector of the entity. #### Remarks 返回实体的当前速度向量。 Returns the current velocity vector of the entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **getFireworkVelocity.ts** ```typescript import { system, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function getFireworkVelocity(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const fireworkRocket = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.FireworksRocket, targetLocation); system.runTimeout(() => { const velocity = fireworkRocket.getVelocity(); log('Velocity of firework is: (x: ' + velocity.x + ', y:' + velocity.y + ', z:' + velocity.z + ')'); }, 5); } ``` *** ### getViewDirection() > **getViewDirection**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) 返回实体的当前视线方向。 Returns the current view direction of the entity. #### Remarks 返回实体的当前视线方向。 Returns the current view direction of the entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### hasComponent() > **hasComponent**(`componentId`): `boolean` **`Beta`** #### Parameters ##### componentId `string` 要检索的组件的标识符(例如,`'minecraft:rideable'`)。如果未指定命名空间前缀,则默认为 `'minecraft:'`。 The identifier of the component (e.g., 'minecraft:rideable') to retrieve. If no namespace prefix is specified, 'minecraft:' is assumed. #### Returns `boolean` 如果指定组件存在于该实体上,则返回 `true`。 Returns true if the specified component is present on this entity. #### Remarks 如果指定组件存在于该实体上,则返回 `true`。 Returns true if the specified component is present on this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### hasTag() > **hasTag**(`tag`): `boolean` **`Beta`** #### Parameters ##### tag `string` 要测试的标签标识符。 Identifier of the tag to test for. #### Returns `boolean` 返回实体是否具有特定标签。 Returns whether an entity has a particular tag. #### Remarks 返回实体是否具有特定标签。 Returns whether an entity has a particular tag. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### kill() > **kill**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` 如果实体可以被击杀则返回 `true`(即使它已经死亡),否则返回 `false`。 Returns true if entity can be killed (even if it is already dead), otherwise it returns false. #### Remarks 击杀此实体。实体将正常掉落战利品。 Kills this entity. The entity will drop loot as normal. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **tagsQuery.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function tagsQuery(targetLocation: DimensionLocation) { const mobs = ['creeper', 'skeleton', 'sheep']; // create some sample mob data for (let i = 0; i < 10; i++) { const mobTypeId = mobs[i % mobs.length]; const entity = targetLocation.dimension.spawnEntity(mobTypeId, targetLocation); entity.addTag('mobparty.' + mobTypeId); } const eqo: EntityQueryOptions = { tags: ['mobparty.skeleton'], }; for (const entity of targetLocation.dimension.getEntities(eqo)) { entity.kill(); } } ``` *** ### lookAt() > **lookAt**(`targetLocation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### targetLocation [`Vector3`](/server/interfaces/Vector3.md) 此实体应面向/注视的目标位置。 The target location that this entity should face/look towards. #### Returns `void` #### Remarks 设置实体的旋转以面对目标位置。如果适用,俯仰和偏航都将被设置,例如对于生物,俯仰控制头部倾斜,偏航控制身体旋转。 Sets the rotation of the entity to face a target location. Both pitch and yaw will be set, if applicable, such as for mobs where the pitch controls the head tilt and the yaw controls the body rotation. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) *** ### matches() > **matches**(`options`): `boolean` **`Beta`** #### Parameters ##### options [`EntityQueryOptions`](/server/interfaces/EntityQueryOptions.md) 执行匹配的查询条件。 The query to perform the match against. #### Returns `boolean` 如果实体匹配传入的 EntityQueryOptions 中的条件则返回 `true`,否则返回 `false`。 Returns true if the entity matches the criteria in the passed in EntityQueryOptions, otherwise it returns false. #### Remarks 将实体与传入的选项进行匹配。如果 EntityQueryOptions 中未指定位置,则使用实体的位置进行匹配。 Matches the entity against the passed in options. Uses the location of the entity for matching if the location is not specified in the passed in EntityQueryOptions. #### Throws 如果查询选项配置错误则抛出异常。 Throws if the query options are misconfigured. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) *** ### playAnimation() > **playAnimation**(`animationName`, `options?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### animationName `string` 动画标识符,例如 `animation.creeper.swelling`。 The animation identifier. e.g. animation.creeper.swelling ##### options? [`PlayAnimationOptions`](/server/interfaces/PlayAnimationOptions.md) 控制动画播放和过渡的附加选项。 Additional options to control the playback and transitions of the animation. #### Returns `void` #### Remarks 使实体播放给定的动画。 Cause the entity to play the given animation. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### remove() > **remove**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 立即从世界中移除实体。被移除的实体不会执行死亡动画或在移除时掉落战利品。 Immediately removes the entity from the world. The removed entity will not perform a death animation or drop loot upon removal. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) *** ### removeEffect() > **removeEffect**(`effectType`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### effectType `string` | [`EffectType`](/server/classes/EffectType.md) 效果标识符。 The effect identifier. #### Returns `boolean` 如果效果已被移除则返回 `true`。如果未找到效果或效果不存在则返回 `false`。 Returns true if the effect has been removed. Returns false if the effect is not found or does not exist. #### Remarks 移除实体上的指定 EffectType,如果效果不存在则返回 `false`。 Removes the specified EffectType on the entity, or returns false if the effect is not present. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### removeTag() > **removeTag**(`tag`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### tag `string` 要移除的标签内容。 Content of the tag to remove. #### Returns `boolean` 返回该标签是否存在于实体上。 Returns whether the tag existed on the entity. #### Remarks 从实体移除指定的标签。 Removes a specified tag from an entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### resetProperty() > **resetProperty**(`identifier`): `string` | `number` | `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` 实体属性标识符。 The Entity Property identifier. #### Returns `string` | `number` | `boolean` 返回默认属性值。对于枚举属性,返回字符串。对于浮点和整数属性,返回数字。对于未定义的属性,返回 `undefined`。 Returns the default property value. For enum properties, a string is returned. For float and int properties, a number is returned. For undefined properties, undefined is returned. #### Remarks 将实体属性重置为其默认值,如实体定义中所指定。此属性更改直到下一个 tick 才会应用。 Resets an Entity Property back to its default value, as specified in the Entity's definition. This property change is not applied until the next tick. #### Throws 如果实体无效则抛出异常。 Throws if the entity is invalid. [EngineError](/common/classes/EngineError.md) Error [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### runCommand() > **runCommand**(`commandString`): [`CommandResult`](/server/classes/CommandResult.md) **`World Mutation`** **`Beta`** #### Parameters ##### commandString `string` 命令字符串。注意:这不应包含前导斜杠。 The command string. Note: This should not include a leading forward slash. #### Returns [`CommandResult`](/server/classes/CommandResult.md) 包含命令是否成功的命令结果。 A command result containing whether the command was successful. #### Remarks 在实体上运行同步命令。 Runs a synchronous command on the entity. #### Throws This function can throw errors. [CommandError](/server/classes/CommandError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### setDynamicProperties() > **setDynamicProperties**(`values`): `void` **`Beta`** #### Parameters ##### values `Record`\<`string`, `boolean` | `number` | `string` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined`> 要设置的动态属性的键值对记录。如果数据值为 `null`,将会移除该属性。 A Record of key value pairs of the dynamic properties to set. If the data value is null, it will remove that property instead. #### Returns `void` #### Remarks 使用特定值设置多个动态属性。 Sets multiple dynamic properties with specific values. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### setDynamicProperty() > **setDynamicProperty**(`identifier`, `value?`): `void` **`Beta`** #### Parameters ##### identifier `string` 属性标识符。 The property identifier. ##### value? `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) 要设置的属性的数据值。如果值为 `null`,将会移除该属性。 Data value of the property to set. If the value is null, it will remove the property instead. #### Returns `void` #### Remarks 设置指定属性为一个值。 Sets a specified property to a value. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### setOnFire() > **setOnFire**(`seconds`, `useEffects?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### seconds `number` 设置实体着火的时间长度。 Length of time to set the entity on fire. ##### useEffects? `boolean` 是否应考虑副作用(如解冻)和其他条件,如雨水或防火保护。默认值:`true` Whether side-effects should be applied (e.g. thawing freeze) and other conditions such as rain or fire protection should be taken into consideration. Defaults to: true #### Returns `boolean` 实体是否被点燃。如果秒数小于或等于零、实体潮湿或实体免疫火焰,则可能失败。 Whether the entity was set on fire. This can fail if seconds is less than or equal to zero, the entity is wet or the entity is immune to fire. #### Remarks 点燃实体(如果它不在水中或雨里)。请注意,你可以调用 `getComponent('minecraft:onfire')`,如果存在,则实体着火。 Sets an entity on fire (if it is not in water or rain). Note that you can call getComponent('minecraft:onfire') and, if present, the entity is on fire. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **setOnFire.ts** ```typescript import { system, EntityOnFireComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function setOnFire(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const skelly = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Skeleton, targetLocation); skelly.setOnFire(20, true); system.runTimeout(() => { const onfire = skelly.getComponent(EntityComponentTypes.OnFire) as EntityOnFireComponent; log(onfire?.onFireTicksRemaining + ' fire ticks remaining.'); skelly.extinguishFire(true); log('Never mind. Fire extinguished.'); }, 20); } ``` *** ### setProperty() > **setProperty**(`identifier`, `value`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` 实体属性标识符。 The Entity Property identifier. ##### value `string` | `number` | `boolean` 属性值。提供的类型必须与实体定义中指定的类型兼容。 The property value. The provided type must be compatible with the type specified in the entity's definition. #### Returns `void` #### Remarks 将实体属性设置为提供的值。此属性更改直到下一个 tick 才会应用。 Sets an Entity Property to the provided value. This property change is not applied until the next tick. #### Throws 如果实体无效则抛出异常。如果提供了无效的标识符则抛出异常。如果提供的值类型与属性类型不匹配则抛出异常。如果提供的值超出预期范围(int、float 属性)则抛出异常。如果提供的字符串值与接受的枚举值集合不匹配(枚举属性)则抛出异常。 Throws if the entity is invalid. Throws if an invalid identifier is provided. Throws if the provided value type does not match the property type. Throws if the provided value is outside the expected range (int, float properties). Throws if the provided string value does not match the set of accepted enum values (enum properties [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### setRotation() > **setRotation**(`rotation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### rotation [`Vector2`](/server/interfaces/Vector2.md) 实体的 x 和 y 旋转(以度为单位)。对于大多数生物,x 旋转控制头部倾斜,y 旋转控制身体旋转。 The x and y rotation of the entity (in degrees). For most mobs, the x rotation controls the head tilt and the y rotation controls the body rotation. #### Returns `void` #### Remarks 设置实体的主要旋转。 Sets the main rotation of the entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### teleport() > **teleport**(`location`, `teleportOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) 实体的新位置。 New location for the entity. ##### teleportOptions? [`TeleportOptions`](/server/interfaces/TeleportOptions.md) 关于传送操作的选项。 Options regarding the teleport operation. #### Returns `void` #### Remarks 将选定的实体传送到新位置。 Teleports the selected entity to a new location #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Examples **teleport.ts** ```typescript import { system, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function teleport(targetLocation: DimensionLocation) { const cow = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Cow, targetLocation); system.runTimeout(() => { cow.teleport( { x: targetLocation.x + 2, y: targetLocation.y + 2, z: targetLocation.z + 2 }, { facingLocation: targetLocation, } ); }, 20); } ``` **teleportMovement.ts** ```typescript import { system, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function teleportMovement(targetLocation: DimensionLocation) { const pig = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Pig, targetLocation); let inc = 1; const runId = system.runInterval(() => { pig.teleport( { x: targetLocation.x + inc / 4, y: targetLocation.y + inc / 4, z: targetLocation.z + inc / 4 }, { facingLocation: targetLocation, } ); if (inc > 100) { system.clearRun(runId); } inc++; }, 4); } ``` *** ### triggerEvent() > **triggerEvent**(`eventName`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### eventName `string` 要触发的实体类型事件的名称。如果未指定命名空间,则默认为 `minecraft:`。 Name of the entity type event to trigger. If a namespace is not specified, minecraft: is assumed. #### Returns `void` #### Remarks 触发一个实体类型事件。对于每个实体,在实体的定义为关键实体行为定义了许多事件;例如,苦力怕有一个 `minecraft:start_exploding` 类型事件。 Triggers an entity type event. For every entity, a number of events are defined in an entities' definition for key entity behaviors; for example, creepers have a minecraft:start\_exploding type event. #### Throws 如果事件未在实体的定义中定义,则会抛出错误。 If the event is not defined in the definition of the entity, an error will be thrown. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Examples **triggerEvent.ts** ```typescript // A function that spawns a creeper and triggers it to explode immediately import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function spawnExplodingCreeper(location: DimensionLocation) { const creeper = location.dimension.spawnEntity(MinecraftEntityTypes.Creeper, location); creeper.triggerEvent('minecraft:start_exploding_forced'); } ``` **triggerEvent.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function triggerEvent(targetLocation: DimensionLocation) { const creeper = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Creeper, targetLocation); creeper.triggerEvent('minecraft:start_exploding_forced'); } ``` *** ### tryTeleport() > **tryTeleport**(`location`, `teleportOptions?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) 要传送实体的位置。 Location to teleport the entity to. ##### teleportOptions? [`TeleportOptions`](/server/interfaces/TeleportOptions.md) 关于传送操作的选项。 Options regarding the teleport operation. #### Returns `boolean` 返回传送是否成功。如果目标区块未加载或传送会导致与方块相交,则可能失败。 Returns whether the teleport succeeded. This can fail if the destination chunk is unloaded or if the teleport would result in intersecting with blocks. #### Remarks 尝试传送,但可能不会完成传送操作(例如,如果目标位置有方块阻挡)。 Attempts to try a teleport, but may not complete the teleport operation (for example, if there are blocks at the destination.) #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Player.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Player.md. # Class: Player player **`Beta`** 表示世界中的一个玩家。 Represents a player within the world. ## Extends - [`Entity`](/server/classes/Entity.md) ## Properties ### camera > `readonly` **camera**: [`Camera`](/server/classes/Camera.md) **`Beta`** #### Remarks 玩家的摄像机。 The player's Camera. #### Throws This property can throw when used. *** ### chatDisplayName 实验性 > `readonly` **chatDisplayName**: `string` **`Beta`** #### Remarks 玩家的聊天显示名称,由 [Player.chatNamePrefix](#chatnameprefix) + [Player.name](#name) + [Player.chatNameSuffix](#chatnamesuffix) 组成。这是以此玩家身份发送的聊天消息中所显示的作者名称。要更改显示在玩家头顶的名称,请使用 [Entity.nameTag](/server/classes/Entity.md#nametag)。 The player's chat display name, composed from [Player.chatNamePrefix](#chatnameprefix) + [Player.name](#name) + [Player.chatNameSuffix](#chatnamesuffix). This is the name shown as the author of chat messages sent by this player. To change the name shown above the player's head, use [Entity.nameTag](/server/classes/Entity.md#nametag). #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### chatMessagePrefix? > `optional` **chatMessagePrefix?**: `string` **`Beta`** **`World Mutation`** #### Remarks 一个可选的字符串,设置后会被添加到该玩家发送的聊天消息文本之前。可用于对玩家的消息应用格式或颜色代码(例如,使用 `'§a'` 使其消息变为绿色)。不影响玩家的名称显示 —— 请使用 [Player.chatNamePrefix](#chatnameprefix) 更改聊天中显示的名称,或使用 [Entity.nameTag](/server/classes/Entity.md#nametag) 更改玩家头顶的名称。设置为 `undefined` 以清除。 An optional string that, when set, is prepended to the text of chat messages sent by this player. Useful for applying formatting or color codes to a player's messages (e.g., '§a' to make their messages green). Does not affect the player's name display - use [Player.chatNamePrefix](#chatnameprefix) for the name shown in chat, or [Entity.nameTag](/server/classes/Entity.md#nametag) for the name above the player's head. Set to undefined to clear. *** ### chatNamePrefix? > `optional` **chatNamePrefix?**: `string` **`Beta`** **`World Mutation`** #### Remarks 一个可选的字符串,设置后会被添加到聊天消息中玩家的名称之前。不影响玩家头顶的名称标签或玩家列表 —— 请使用 [Entity.nameTag](/server/classes/Entity.md#nametag) 设置。要为消息文本本身添加前缀,请使用 [Player.chatMessagePrefix](#chatmessageprefix)。设置为 `undefined` 以清除。 An optional string that, when set, is prepended to the player's name in chat messages. Does not affect the name tag above the player's head or the player list - use [Entity.nameTag](/server/classes/Entity.md#nametag) for that. To prefix the message text itself, use [Player.chatMessagePrefix](#chatmessageprefix). Set to undefined to clear. *** ### chatNameSuffix? > `optional` **chatNameSuffix?**: `string` **`Beta`** **`World Mutation`** #### Remarks 一个可选的字符串,设置后会被追加到聊天消息中玩家的名称之后。不影响玩家头顶的名称标签或玩家列表 —— 请使用 [Entity.nameTag](/server/classes/Entity.md#nametag) 设置。另请参见 [Player.chatNamePrefix](#chatnameprefix)。设置为 `undefined` 以清除。 An optional string that, when set, is appended to the player's name in chat messages. Does not affect the name tag above the player's head or the player list - use [Entity.nameTag](/server/classes/Entity.md#nametag) for that. See also [Player.chatNamePrefix](#chatnameprefix). Set to undefined to clear. *** ### clientSystemInfo > `readonly` **clientSystemInfo**: [`ClientSystemInfo`](/server/classes/ClientSystemInfo.md) **`Beta`** #### Remarks 包含玩家的设备信息。 Contains the player's device information. #### Throws This property can throw when used. *** ### commandPermissionLevel > **commandPermissionLevel**: [`CommandPermissionLevel`](/server/enums/CommandPermissionLevel.md) **`World Mutation`** **`Beta`** #### Remarks *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 实体当前所在的维度。 Dimension that the entity is currently within. #### Throws This property can throw when used. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`dimension`](/server/classes/Entity.md#dimension) *** ### fogSettings 实验性 > `readonly` **fogSettings**: [`FogSettings`](/server/classes/FogSettings.md) **`Beta`** #### Remarks 包含用于操作玩家的渲染距离迷雾设置的方法。 Contains methods for manipulating the render distance fog settings of a Player. *** ### graphicsMode > `readonly` **graphicsMode**: [`GraphicsMode`](/server/enums/GraphicsMode.md) **`Beta`** #### Remarks 获取玩家客户端的当前图形模式。这可以在设置菜单的视频部分中更改,具体取决于可用硬件。 Gets the current graphics mode of the player's client. This can be changed in the Video section of the settings menu based on what hardware is available. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 实体的唯一标识符。此标识符旨在跨世界实例加载保持一致。不应从此唯一标识符的值和结构中推断任何含义——不要解析或解释它。即使 [Entity.isValid](/server/classes/Entity.md#isvalid) 为 `false`,此属性也可访问。 Unique identifier of the entity. This identifier is intended to be consistent across loads of a world instance. No meaning should be inferred from the value and structure of this unique identifier - do not parse or interpret it. This property is accessible even if [Entity.isValid](/server/classes/Entity.md#isvalid) is false. #### Inherited from [`Entity`](/server/classes/Entity.md).[`id`](/server/classes/Entity.md#id) *** ### inputInfo > `readonly` **inputInfo**: [`InputInfo`](/server/classes/InputInfo.md) **`Beta`** #### Remarks 包含玩家的输入信息。 Contains the player's input information. *** ### inputPermissions > `readonly` **inputPermissions**: [`PlayerInputPermissions`](/server/classes/PlayerInputPermissions.md) **`Beta`** #### Remarks 玩家的输入权限。 Input permissions of the player. *** ### isClimbing > `readonly` **isClimbing**: `boolean` **`Beta`** #### Remarks 实体是否接触可攀爬方块。例如,梯子旁的玩家或石墙旁的蜘蛛。 Whether the entity is touching a climbable block. For example, a player next to a ladder or a spider next to a stone wall. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`isClimbing`](/server/classes/Entity.md#isclimbing) *** ### isEmoting > `readonly` **isEmoting**: `boolean` **`Beta`** #### Remarks 如果为 `true`,玩家当前正在进行表情动作。 If true, the player is currently emoting. #### Throws This property can throw when used. *** ### isFalling > `readonly` **isFalling**: `boolean` **`Beta`** #### Remarks 实体是否具有大于 0 的摔落距离,或在滑翔时大于 1。 Whether the entity has a fall distance greater than 0, or greater than 1 while gliding. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`isFalling`](/server/classes/Entity.md#isfalling) *** ### isFlying > `readonly` **isFlying**: `boolean` **`Beta`** #### Remarks 玩家是否在飞行。例如,在创造模式或旁观者模式下。 Whether the player is flying. For example, in Creative or Spectator mode. #### Throws This property can throw when used. *** ### isGliding > `readonly` **isGliding**: `boolean` **`Beta`** #### Remarks 玩家是否正在使用鞘翅滑翔。 Whether the player is gliding with Elytra. #### Throws This property can throw when used. *** ### isInWater > `readonly` **isInWater**: `boolean` **`Beta`** #### Remarks 实体的任何部分是否在水方块内部。 Whether any part of the entity is inside a water block. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`isInWater`](/server/classes/Entity.md#isinwater) *** ### isJumping > `readonly` **isJumping**: `boolean` **`Beta`** #### Remarks 玩家是否正在跳跃。玩家按住跳跃动作时,此值将保持为 `true`。 Whether the player is jumping. This will remain true while the player is holding the jump action. #### Throws This property can throw when used. *** ### isOnGround > `readonly` **isOnGround**: `boolean` **`Beta`** #### Remarks 实体是否在实心方块顶部。此属性可能以意外方式表现。此属性在实体首次生成时始终为 `true`,如果实体没有重力,则此属性可能不正确。 Whether the entity is on top of a solid block. This property may behave in unexpected ways. This property will always be true when an Entity is first spawned, and if the Entity has no gravity this property may be incorrect. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`isOnGround`](/server/classes/Entity.md#isonground) *** ### isSleeping > `readonly` **isSleeping**: `boolean` **`Beta`** #### Remarks 如果为 `true`,实体当前正在睡觉。 If true, the entity is currently sleeping. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`isSleeping`](/server/classes/Entity.md#issleeping) *** ### isSneaking > **isSneaking**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 实体是否正在潜行——即移动得较慢且较安静。 Whether the entity is sneaking - that is, moving more slowly and more quietly. #### Inherited from [`Entity`](/server/classes/Entity.md).[`isSneaking`](/server/classes/Entity.md#issneaking) *** ### isSprinting > `readonly` **isSprinting**: `boolean` **`Beta`** #### Remarks 实体是否正在冲刺。例如,使用冲刺动作的玩家、逃跑的豹猫或用胡萝卜钓竿加速的猪。 Whether the entity is sprinting. For example, a player using the sprint action, an ocelot running away or a pig boosting with Carrot on a Stick. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`isSprinting`](/server/classes/Entity.md#issprinting) *** ### isSwimming > `readonly` **isSwimming**: `boolean` **`Beta`** #### Remarks 实体是否处于游泳状态。例如,使用游泳动作的玩家或水中的鱼。 Whether the entity is in the swimming state. For example, a player using the swim action or a fish in water. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`isSwimming`](/server/classes/Entity.md#isswimming) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回实体是否可以被脚本操作。当玩家的 EntityLifetimeState 设置为 Loaded 时,该玩家被视为有效。 Returns whether the entity can be manipulated by script. A Player is considered valid when it's EntityLifetimeState is set to Loaded. #### Inherited from [`Entity`](/server/classes/Entity.md).[`isValid`](/server/classes/Entity.md#isvalid) *** ### level > `readonly` **level**: `number` **`Beta`** #### Remarks 玩家当前的总等级,基于其经验值。 The current overall level for the player, based on their experience. #### Throws This property can throw when used. *** ### localizationKey > `readonly` **localizationKey**: `string` **`Beta`** #### Remarks 用于在 `.lang` 文件中本地化此实体名称的键。 Key for the localization of this entity's name used in .lang files. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`localizationKey`](/server/classes/Entity.md#localizationkey) *** ### location > `readonly` **location**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 实体的当前位置。 Current location of the entity. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`location`](/server/classes/Entity.md#location) *** ### locatorBar > `readonly` **locatorBar**: [`LocatorBar`](/server/classes/LocatorBar.md) **`Beta`** #### Remarks 玩家的 Locator Bar 定位栏。此属性用于管理显示在 HUD 上的导航点。 The player's Locator Bar. This property is used for managing waypoints displayed on the HUD. *** ### name > `readonly` **name**: `string` **`Beta`** #### Remarks 玩家的名称。 Name of the player. #### Throws This property can throw when used. *** ### nameplateDepthTested > **nameplateDepthTested**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 决定玩家名称标签是否应进行深度测试以确定可见性的布尔值。 Boolean which determines if the player nameplate should be depth tested for visibility. #### Inherited from [`Entity`](/server/classes/Entity.md).[`nameplateDepthTested`](/server/classes/Entity.md#nameplatedepthtested) *** ### nameplateRenderDistance > **nameplateRenderDistance**: `number` **`World Mutation`** **`Beta`** #### Remarks 决定此实体名称标签渲染距离的浮点数。 Float that determines the render distance of this entity's nameplate. #### Inherited from [`Entity`](/server/classes/Entity.md).[`nameplateRenderDistance`](/server/classes/Entity.md#nameplaterenderdistance) *** ### nameTag > **nameTag**: `string` **`World Mutation`** **`Beta`** #### Remarks 实体的给定名称。 Given name of the entity. #### Inherited from [`Entity`](/server/classes/Entity.md).[`nameTag`](/server/classes/Entity.md#nametag) *** ### onScreenDisplay > `readonly` **onScreenDisplay**: [`ScreenDisplay`](/server/classes/ScreenDisplay.md) **`Beta`** #### Remarks 包含用于操作玩家的屏幕显示的方法。 Contains methods for manipulating the on-screen display of a Player. #### Throws This property can throw when used. *** ### persistentId 实验性 > `readonly` **persistentId**: `string` **`Beta`** #### Remarks 一个可用于跨会话标识玩家的标识符。 An identifier that can be used to identify a player across sessions. #### Throws This property can throw when used. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### playerPermissionLevel > `readonly` **playerPermissionLevel**: [`PlayerPermissionLevel`](/server/enums/PlayerPermissionLevel.md) **`Beta`** #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### scoreboardIdentity? > `readonly` `optional` **scoreboardIdentity?**: [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md) **`Beta`** #### Remarks 返回表示此实体的记分板身份。实体被击杀后仍将保持有效。 Returns a scoreboard identity that represents this entity. Will remain valid when the entity is killed. #### Inherited from [`Entity`](/server/classes/Entity.md).[`scoreboardIdentity`](/server/classes/Entity.md#scoreboardidentity) *** ### selectedSlotIndex > **selectedSlotIndex**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### target? > `readonly` `optional` **target?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 获取或设置用作 AI 相关行为(如攻击)目标的实体。如果实体当前没有目标,则返回 `undefined`。 Retrieves or sets an entity that is used as the target of AI-related behaviors, like attacking. If the entity currently has no target returns undefined. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`target`](/server/classes/Entity.md#target) *** ### totalXpNeededForNextLevel > `readonly` **totalXpNeededForNextLevel**: `number` **`Beta`** #### Remarks 玩家达到下一级所需的总经验值。 The overall total set of experience needed to achieve the next level for a player. #### Throws This property can throw when used. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 实体类型的标识符——例如,`minecraft:skeleton`。即使 [Entity.isValid](/server/classes/Entity.md#isvalid) 为 `false`,此属性也可访问。 Identifier of the type of the entity - for example, 'minecraft:skeleton'. This property is accessible even if [Entity.isValid](/server/classes/Entity.md#isvalid) is false. #### Inherited from [`Entity`](/server/classes/Entity.md).[`typeId`](/server/classes/Entity.md#typeid) *** ### xpEarnedAtCurrentLevel > `readonly` **xpEarnedAtCurrentLevel**: `number` **`Beta`** #### Remarks 玩家当前等级已获得的经验值。 The current set of experience achieved for the player. #### Throws This property can throw when used. ## Methods ### addEffect() > **addEffect**(`effectType`, `duration`, `options?`): [`Effect`](/server/classes/Effect.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### effectType `string` | [`EffectType`](/server/classes/EffectType.md) 要添加到实体的效果类型。 Type of effect to add to the entity. ##### duration `number` 效果应用的时间量(以 tick 为单位)。每秒有 20 tick。使用 [TicksPerSecond](/server/variables/TicksPerSecond.md) 常量在 tick 和秒之间进行转换。值必须在 \[0, 20000000] 范围内。范围:\[1, 20000000] Amount of time, in ticks, for the effect to apply. There are 20 ticks per second. Use [TicksPerSecond](/server/variables/TicksPerSecond.md) constant to convert between ticks and seconds. The value must be within the range \[0, 20000000]. Bounds: \[1, 20000000] ##### options? [`EntityEffectOptions`](/server/interfaces/EntityEffectOptions.md) 效果的附加选项。 Additional options for the effect. #### Returns [`Effect`](/server/classes/Effect.md) | `undefined` 如果效果成功添加或更新,则不返回任何内容。如果持续时间或放大器超出有效范围,或者效果不存在,则可能抛出错误。 Returns nothing if the effect was added or updated successfully. This can throw an error if the duration or amplifier are outside of the valid ranges, or if the effect does not exist. #### Remarks 向实体添加或更新一个效果,例如中毒。 Adds or updates an effect, like poison, to the entity. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Examples **spawnPoisonedVillager.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEffectTypes } from '@minecraft/vanilla-data'; function spawnPoisonedVillager(targetLocation: DimensionLocation) { const villagerType = 'minecraft:villager_v2'; const villager = targetLocation.dimension.spawnEntity(villagerType, targetLocation); const duration = 20; villager.addEffect(MinecraftEffectTypes.Poison, duration, { amplifier: 1 }); } ``` **quickFoxLazyDog.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes, MinecraftEffectTypes } from '@minecraft/vanilla-data'; function quickFoxLazyDog(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const fox = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Fox, { x: targetLocation.x + 1, y: targetLocation.y + 2, z: targetLocation.z + 3, }); fox.addEffect(MinecraftEffectTypes.Speed, 10, { amplifier: 2, }); log('Created a fox.'); const wolf = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Wolf, { x: targetLocation.x + 4, y: targetLocation.y + 2, z: targetLocation.z + 3, }); wolf.addEffect(MinecraftEffectTypes.Slowness, 10, { amplifier: 2, }); wolf.isSneaking = true; log('Created a sneaking wolf.', 1); } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`addEffect`](/server/classes/Entity.md#addeffect) *** ### addExperience() > **addExperience**(`amount`): `number` **`World Mutation`** **`Beta`** #### Parameters ##### amount `number` 要添加的经验值数量。注意,这可以为负值。最小/最大边界为 -2^24 \~ 2^24。 Amount of experience to add. Note that this can be negative. Min/max bounds at -2^24 \~ 2^24 Bounds: \[-16777216, 16777216] #### Returns `number` 返回玩家的当前经验值。 Returns the current experience of the Player. #### Remarks 向玩家添加/移除经验值,并返回玩家的当前经验值。 Adds/removes experience to/from the Player and returns the current experience of the Player. #### Throws This function can throw errors. *** ### addItem() > **addItem**(`itemStack`): [`ItemStack`](/server/classes/ItemStack.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### itemStack [`ItemStack`](/server/classes/ItemStack.md) #### Returns [`ItemStack`](/server/classes/ItemStack.md) | `undefined` 如果物品已完全添加则返回 `undefined`,否则返回包含剩余数量的 ItemStack。 Returns undefined if the item was fully added or returns an ItemStack with the remaining count. #### Remarks 向实体的物品栏添加一个物品。 Adds an item to the entity's inventory. #### Throws This function can throw errors. [ContainerRulesError](/server/classes/ContainerRulesError.md) Error [InvalidEntityComponentError](/server/classes/InvalidEntityComponentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`addItem`](/server/classes/Entity.md#additem) *** ### addLevels() > **addLevels**(`amount`): `number` **`World Mutation`** **`Beta`** #### Parameters ##### amount `number` 要添加到玩家的数量。最小/最大边界为 -2^24 \~ 2^24。 Amount to add to the player. Min/max bounds at -2^24 \~ 2^24 Bounds: \[-16777216, 16777216] #### Returns `number` 返回玩家的当前等级。 Returns the current level of the Player. #### Remarks 向玩家添加/移除等级,并返回玩家的当前等级。 Adds/removes level to/from the Player and returns the current level of the Player. #### Throws This function can throw errors. *** ### addTag() > **addTag**(`tag`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### tag `string` 要添加的标签内容。标签必须少于 256 个字符。 Content of the tag to add. The tag must be less than 256 characters. #### Returns `boolean` 如果标签成功添加则返回 `true`。如果标签已存在于实体上,则可能失败。 Returns true if the tag was added successfully. This can fail if the tag already exists on the entity. #### Remarks 向实体添加一个指定的标签。 Adds a specified tag to an entity. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **tagsQuery.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function tagsQuery(targetLocation: DimensionLocation) { const mobs = ['creeper', 'skeleton', 'sheep']; // create some sample mob data for (let i = 0; i < 10; i++) { const mobTypeId = mobs[i % mobs.length]; const entity = targetLocation.dimension.spawnEntity(mobTypeId, targetLocation); entity.addTag('mobparty.' + mobTypeId); } const eqo: EntityQueryOptions = { tags: ['mobparty.skeleton'], }; for (const entity of targetLocation.dimension.getEntities(eqo)) { entity.kill(); } } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`addTag`](/server/classes/Entity.md#addtag) *** ### applyDamage() > **applyDamage**(`amount`, `options?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### amount `number` 要应用的伤害量。 Amount of damage to apply. ##### options? [`EntityApplyDamageByProjectileOptions`](/server/interfaces/EntityApplyDamageByProjectileOptions.md) | [`EntityApplyDamageOptions`](/server/interfaces/EntityApplyDamageOptions.md) 关于伤害来源的附加选项,可能为此实体添加额外效果或引发额外行为。 Additional options about the source of damage, which may add additional effects or spur additional behaviors on this entity. #### Returns `boolean` 实体是否受到任何伤害。如果实体无敌或应用的伤害小于或等于 0,则可能返回 `false`。 Whether the entity takes any damage. This can return false if the entity is invulnerable or if the damage applied is less than or equal to 0. #### Remarks 对实体应用一组伤害。 Applies a set of damage to an entity. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Example **applyDamageThenHeal.ts** ```typescript import { system, EntityHealthComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function applyDamageThenHeal(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const skelly = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Skeleton, targetLocation); skelly.applyDamage(19); // skeletons have max damage of 20 so this is a near-death skeleton system.runTimeout(() => { const health = skelly.getComponent(EntityComponentTypes.Health) as EntityHealthComponent; log('Skeleton health before heal: ' + health?.currentValue); health?.resetToMaxValue(); log('Skeleton health after heal: ' + health?.currentValue); }, 20); } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`applyDamage`](/server/classes/Entity.md#applydamage) *** ### applyImpulse() > **applyImpulse**(`vector`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### vector [`Vector3`](/server/interfaces/Vector3.md) 冲量向量。 Impulse vector. #### Returns `void` #### Remarks 向实体的当前速度施加冲量向量。 Applies impulse vector to the current velocity of the entity. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **applyImpulse.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function applyImpulse(targetLocation: DimensionLocation) { const zombie = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Zombie, targetLocation); zombie.clearVelocity(); // throw the zombie up in the air zombie.applyImpulse({ x: 0, y: 0.5, z: 0 }); } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`applyImpulse`](/server/classes/Entity.md#applyimpulse) *** ### applyKnockback() > **applyKnockback**(`horizontalForce`, `verticalStrength`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### horizontalForce [`VectorXZ`](/server/interfaces/VectorXZ.md) ##### verticalStrength `number` 垂直向量的击退强度。 Knockback strength for the vertical vector. #### Returns `void` #### Remarks 向实体的当前速度施加冲量向量。 Applies impulse vector to the current velocity of the entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Example **bounceSkeletons.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function bounceSkeletons(targetLocation: DimensionLocation) { const mobs = ['creeper', 'skeleton', 'sheep']; // create some sample mob data for (let i = 0; i < 10; i++) { targetLocation.dimension.spawnEntity(mobs[i % mobs.length], targetLocation); } const eqo: EntityQueryOptions = { type: 'skeleton', }; for (const entity of targetLocation.dimension.getEntities(eqo)) { entity.applyKnockback(0, 0, 0, 1); } } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`applyKnockback`](/server/classes/Entity.md#applyknockback) *** ### clearDynamicProperties() > **clearDynamicProperties**(): `void` **`Beta`** #### Returns `void` #### Remarks 清除此实体上设置的所有动态属性。 Clears all dynamic properties that have been set on this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`clearDynamicProperties`](/server/classes/Entity.md#cleardynamicproperties) *** ### clearPropertyOverridesForEntity() > **clearPropertyOverridesForEntity**(`targetEntity`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### targetEntity `string` | [`Entity`](/server/classes/Entity.md) 正在清除 Entity 属性覆盖的实体或实体 ID。 The Entity or the ID of the Entity whose Entity Property overrides are being cleared. #### Returns `void` #### Remarks 对此玩家,移除目标实体上所有 Entity 属性的覆盖。此更改不会应用到其他玩家,且直到下一刻才会应用。 For this player, removes all overrides of any Entity Properties on the target Entity. This change is not applied until the next tick and will not apply to other players. #### Throws 如果实体或实体 ID 无效则抛出。 Throws if the Entity or Entity ID is invalid. *** ### clearVelocity() > **clearVelocity**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将实体的当前速度设置为零。 Sets the current velocity of the Entity to zero. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **applyImpulse.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function applyImpulse(targetLocation: DimensionLocation) { const zombie = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Zombie, targetLocation); zombie.clearVelocity(); // throw the zombie up in the air zombie.applyImpulse({ x: 0, y: 0.5, z: 0 }); } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`clearVelocity`](/server/classes/Entity.md#clearvelocity) *** ### eatItem() > **eatItem**(`itemStack`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### itemStack [`ItemStack`](/server/classes/ItemStack.md) 要吃的物品。 The item to eat. #### Returns `void` #### Remarks 吃掉一个物品,为玩家提供该物品的饥饿度和饱和度效果。只能对食物物品使用。 Eats an item, providing the item's hunger and saturation effects to the player. Can only be used on food items. #### Throws 如果物品不是食物物品则抛出。 Throws if the item is not a food item. *** ### extinguishFire() > **extinguishFire**(`useEffects?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### useEffects? `boolean` 是否显示与灭火相关的任何视觉效果。默认值:`true` Whether to show any visual effects connected to the extinguishing. Defaults to: true #### Returns `boolean` 返回实体是否曾着火。 Returns whether the entity was on fire. #### Remarks 如果实体着火,则将其灭火。请注意,你可以调用 `getComponent('minecraft:onfire')`,如果存在,则实体着火。 Extinguishes the fire if the entity is on fire. Note that you can call getComponent('minecraft:onfire') and, if present, the entity is on fire. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **setOnFire.ts** ```typescript import { system, EntityOnFireComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function setOnFire(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const skelly = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Skeleton, targetLocation); skelly.setOnFire(20, true); system.runTimeout(() => { const onfire = skelly.getComponent(EntityComponentTypes.OnFire) as EntityOnFireComponent; log(onfire?.onFireTicksRemaining + ' fire ticks remaining.'); skelly.extinguishFire(true); log('Never mind. Fire extinguished.'); }, 20); } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`extinguishFire`](/server/classes/Entity.md#extinguishfire) *** ### getAABB() > **getAABB**(): [`AABB`](/server/interfaces/AABB.md) **`Beta`** #### Returns [`AABB`](/server/interfaces/AABB.md) 一个轴对齐的边界框。 An axis-aligned bounding box. #### Remarks 获取实体的碰撞边界。 Gets the entity's collision bounds. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getAABB`](/server/classes/Entity.md#getaabb) *** ### getAimAssist() > **getAimAssist**(): [`PlayerAimAssist`](/server/classes/PlayerAimAssist.md) **`Beta`** #### Returns [`PlayerAimAssist`](/server/classes/PlayerAimAssist.md) #### Remarks 玩家的瞄准辅助设置。 The player's aim-assist settings. *** ### getAllBlocksStandingOn() > **getAllBlocksStandingOn**(`options?`): [`Block`](/server/classes/Block.md)\[] **`Beta`** #### Parameters ##### options? [`GetBlocksStandingOnOptions`](/server/interfaces/GetBlocksStandingOnOptions.md) 返回哪些方块的附加配置选项。 Additional configuration options for what blocks are returned. #### Returns [`Block`](/server/classes/Block.md)\[] 此实体直接站在上面的实心方块。如果实体正在跳跃或飞行,则返回空列表。 The solid blocks that this entity is directly standing on. Returns an empty list if the entity is jumping or flying. #### Remarks 获取此实体直接站在上面的实心方块。忽略压力板。 Gets the solid blocks that this entity is directly standing on. Ignores pressure plates. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getAllBlocksStandingOn`](/server/classes/Entity.md#getallblocksstandingon) *** ### getBlockFromViewDirection() > **getBlockFromViewDirection**(`options?`): [`BlockRaycastHit`](/server/interfaces/BlockRaycastHit.md) | `undefined` **`Beta`** #### Parameters ##### options? [`BlockRaycastOptions`](/server/interfaces/BlockRaycastOptions.md) 射线投射的附加配置选项。 Additional configuration options for the ray cast. #### Returns [`BlockRaycastHit`](/server/interfaces/BlockRaycastHit.md) | `undefined` 返回从此实体视线方向上相交的第一个方块。 Returns the first intersecting block from the direction that this entity is looking at. #### Remarks 返回从此实体视线方向上相交的第一个方块。 Returns the first intersecting block from the direction that this entity is looking at. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getBlockFromViewDirection`](/server/classes/Entity.md#getblockfromviewdirection) *** ### getBlockStandingOn() > **getBlockStandingOn**(`options?`): [`Block`](/server/classes/Block.md) | `undefined` **`Beta`** #### Parameters ##### options? [`GetBlocksStandingOnOptions`](/server/interfaces/GetBlocksStandingOnOptions.md) 返回哪个方块的附加配置选项。 Additional configuration options for what block is returned. #### Returns [`Block`](/server/classes/Block.md) | `undefined` 最接近此实体中心的一个实心方块,此实体直接站在上面。如果实体正在飞行或跳跃,则为 `undefined`。 A single solid block closest to the center of the entity that this entity is directly standing on. Undefined if entity is flying or jumping. #### Remarks 获取最接近此实体中心的一个实心方块,此实体直接站在上面。忽略压力板。 Gets a single solid block closest to the center of the entity that this entity is directly standing on. Ignores pressure plates. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getBlockStandingOn`](/server/classes/Entity.md#getblockstandingon) *** ### getComponent() > **getComponent**\<`T`>(`componentId`): [`EntityComponentReturnType`](/server/types/EntityComponentReturnType.md)\<`T`> | `undefined` **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` #### Parameters ##### componentId `T` 组件的标识符(例如,`'minecraft:health'`)。如果未指定命名空间前缀,则默认为 `'minecraft:'`。可用的组件 ID 可以在 [EntityComponentTypes](/server/enums/EntityComponentTypes.md) 枚举中找到。 The identifier of the component (e.g., 'minecraft:health'). If no namespace prefix is specified, 'minecraft:' is assumed. Available component IDs can be found as part of the [EntityComponentTypes](/server/enums/EntityComponentTypes.md) enum. #### Returns [`EntityComponentReturnType`](/server/types/EntityComponentReturnType.md)\<`T`> | `undefined` 如果组件存在于实体上则返回该组件,否则返回 `undefined`。 Returns the component if it exists on the entity, otherwise undefined. #### Remarks 获取实体的一个组件(表示附加功能)。 Gets a component (that represents additional capabilities) for an entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getComponent`](/server/classes/Entity.md#getcomponent) *** ### getComponents() > **getComponents**(): [`EntityComponent`](/server/classes/EntityComponent.md)\[] **`Beta`** #### Returns [`EntityComponent`](/server/classes/EntityComponent.md)\[] #### Remarks 返回此实体上存在的所有脚本组件。 Returns all scripting components that are present on this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getComponents`](/server/classes/Entity.md#getcomponents) *** ### getControlScheme() > **getControlScheme**(): [`ControlScheme`](/server/enums/ControlScheme.md) **`Beta`** #### Returns [`ControlScheme`](/server/enums/ControlScheme.md) #### Remarks 返回玩家当前的控制方案。 Returns the player's current control scheme. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getDynamicProperty() > **getDynamicProperty**(`identifier`): `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` **`Beta`** #### Parameters ##### identifier `string` 属性标识符。 The property identifier. #### Returns `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` 返回属性的值,如果属性尚未设置则返回 `undefined`。 Returns the value for the property, or undefined if the property has not been set. #### Remarks 返回一个属性值。 Returns a property value. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getDynamicProperty`](/server/classes/Entity.md#getdynamicproperty) *** ### getDynamicPropertyIds() > **getDynamicPropertyIds**(): `string`\[] **`Beta`** #### Returns `string`\[] 此实体上设置的动态属性的字符串数组。 A string array of the dynamic properties set on this entity. #### Remarks 返回此实体上已使用的可用动态属性标识符集合。 Returns the available set of dynamic property identifiers that have been used on this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getDynamicPropertyIds`](/server/classes/Entity.md#getdynamicpropertyids) *** ### getDynamicPropertyTotalByteCount() > **getDynamicPropertyTotalByteCount**(): `number` **`Beta`** #### Returns `number` #### Remarks 返回此实体当前存储的所有动态属性的总大小(以字节为单位)。包括键和值的大小。这对于诊断性能警告信号很有用——例如,如果一个实体有数兆字节的关联动态属性,它在各种设备上加载可能会很慢。 Returns the total size, in bytes, of all the dynamic properties that are currently stored for this entity. This includes the size of both the key and the value. This can be useful for diagnosing performance warning signs - if, for example, an entity has many megabytes of associated dynamic properties, it may be slow to load on various devices. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getDynamicPropertyTotalByteCount`](/server/classes/Entity.md#getdynamicpropertytotalbytecount) *** ### getEffect() > **getEffect**(`effectType`): [`Effect`](/server/classes/Effect.md) | `undefined` **`Beta`** #### Parameters ##### effectType `string` | [`EffectType`](/server/classes/EffectType.md) 效果标识符。 The effect identifier. #### Returns [`Effect`](/server/classes/Effect.md) | `undefined` 指定效果的 Effect 对象,如果效果不存在则返回 `undefined`,如果效果类型不存在则抛出错误。 Effect object for the specified effect, undefined if the effect is not present, or throws an error if the effect does not exist. #### Remarks 返回实体上指定 EffectType 的效果,如果效果不存在则返回 `undefined`,如果效果类型不存在则抛出错误。 Returns the effect for the specified EffectType on the entity, undefined if the effect is not present, or throws an error if the effect does not exist. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getEffect`](/server/classes/Entity.md#geteffect) *** ### getEffects() > **getEffects**(): [`Effect`](/server/classes/Effect.md)\[] **`Beta`** #### Returns [`Effect`](/server/classes/Effect.md)\[] 效果列表。 List of effects. #### Remarks 返回应用于此实体的一组效果。 Returns a set of effects applied to this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getEffects`](/server/classes/Entity.md#geteffects) *** ### getEntitiesFromViewDirection() > **getEntitiesFromViewDirection**(`options?`): [`EntityRaycastHit`](/server/interfaces/EntityRaycastHit.md)\[] **`Beta`** #### Parameters ##### options? [`EntityRaycastOptions`](/server/interfaces/EntityRaycastOptions.md) 射线投射的附加配置选项。 Additional configuration options for the ray cast. #### Returns [`EntityRaycastHit`](/server/interfaces/EntityRaycastHit.md)\[] 返回从此实体视线方向上的实体集合。 Returns a set of entities from the direction that this entity is looking at. #### Remarks 通过从此实体的视角执行射线投射,获取此实体正在注视的实体。 Gets the entities that this entity is looking at by performing a ray cast from the view of this entity. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getEntitiesFromViewDirection`](/server/classes/Entity.md#getentitiesfromviewdirection) *** ### getGameMode() > **getGameMode**(): [`GameMode`](/server/enums/GameMode.md) **`Beta`** #### Returns [`GameMode`](/server/enums/GameMode.md) #### Remarks 获取此玩家的活跃游戏模式(如果已指定)。 Retrieves the active gamemode for this player, if specified. #### Throws This function can throw errors. *** ### getHeadLocation() > **getHeadLocation**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) 返回此实体头部组件的当前位置。 Returns the current location of the head component of this entity. #### Remarks 返回此实体头部组件的当前位置。 Returns the current location of the head component of this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getHeadLocation`](/server/classes/Entity.md#getheadlocation) *** ### getItemCooldown() > **getItemCooldown**(`cooldownCategory`): `number` **`Beta`** #### Parameters ##### cooldownCategory `string` 指定要获取当前冷却时间的冷却类别。 Specifies the cooldown category to retrieve the current cooldown for. #### Returns `number` #### Remarks 获取特定冷却类别的当前物品冷却时间。 Gets the current item cooldown time for a particular cooldown category. #### Throws This function can throw errors. *** ### getPing() > **getPing**(): `number` **`Beta`** #### Returns `number` 玩家的延迟(以毫秒为单位)。 The player's ping in milliseconds. #### Remarks 获取玩家的延迟(以毫秒为单位)。 Gets the player's ping in milliseconds. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getProperty() > **getProperty**(`identifier`): `string` | `number` | `boolean` | `undefined` **`Beta`** #### Parameters ##### identifier `string` 实体属性标识符。 The entity Property identifier. #### Returns `string` | `number` | `boolean` | `undefined` 返回当前属性值。对于枚举属性,返回字符串。对于浮点和整数属性,返回数字。对于未定义的属性,返回 `undefined`。 Returns the current property value. For enum properties, a string is returned. For float and int properties, a number is returned. For undefined properties, undefined is returned. #### Remarks 获取一个实体属性值。如果该属性在同一个 tick 内使用 setProperty 函数设置,更新后的值将不会反映出来,直到下一个 tick。 Gets an entity Property value. If the property was set using the setProperty function within the same tick, the updated value will not be reflected until the subsequent tick. #### Throws 如果实体无效则抛出异常。 Throws if the entity is invalid. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getProperty`](/server/classes/Entity.md#getproperty) *** ### getRotation() > **getRotation**(): [`Vector2`](/server/interfaces/Vector2.md) **`Beta`** #### Returns [`Vector2`](/server/interfaces/Vector2.md) 返回包含此实体旋转的 Vec2(以度为单位)。 Returns a Vec2 containing the rotation of this entity (in degrees). #### Remarks 返回此实体的当前旋转组件。 Returns the current rotation component of this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getRotation`](/server/classes/Entity.md#getrotation) *** ### getSpawnPoint() > **getSpawnPoint**(): [`DimensionLocation`](/server/interfaces/DimensionLocation.md) | `undefined` **`Beta`** #### Returns [`DimensionLocation`](/server/interfaces/DimensionLocation.md) | `undefined` #### Remarks 获取玩家的当前出生点。 Gets the current spawn point of the player. #### Throws This function can throw errors. *** ### getSplitScreenSlot() > **getSplitScreenSlot**(): [`PlayerSplitScreenSlot`](/server/enums/PlayerSplitScreenSlot.md) | `undefined` **`Beta`** #### Returns [`PlayerSplitScreenSlot`](/server/enums/PlayerSplitScreenSlot.md) | `undefined` 玩家的分屏槽位,如果玩家不在分屏会话中则返回 `undefined`。 The split screen slot of the player or undefined if the player is not in a split screen session. #### Remarks 返回玩家的分屏槽位。 Returns the split screen slot of the player. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getTags() > **getTags**(): `string`\[] **`Beta`** #### Returns `string`\[] 包含所有标签字符串的数组。 An array containing all tags as strings. #### Remarks 返回与实体关联的所有标签。 Returns all tags associated with the entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getTags`](/server/classes/Entity.md#gettags) *** ### getTotalXp() > **getTotalXp**(): `number` **`Beta`** #### Returns `number` #### Remarks 获取玩家的总经验值。 Gets the total experience of the Player. #### Throws This function can throw errors. *** ### getVelocity() > **getVelocity**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) 返回实体的当前速度向量。 Returns the current velocity vector of the entity. #### Remarks 返回实体的当前速度向量。 Returns the current velocity vector of the entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **getFireworkVelocity.ts** ```typescript import { system, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function getFireworkVelocity(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const fireworkRocket = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.FireworksRocket, targetLocation); system.runTimeout(() => { const velocity = fireworkRocket.getVelocity(); log('Velocity of firework is: (x: ' + velocity.x + ', y:' + velocity.y + ', z:' + velocity.z + ')'); }, 5); } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`getVelocity`](/server/classes/Entity.md#getvelocity) *** ### getViewDirection() > **getViewDirection**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) 返回实体的当前视线方向。 Returns the current view direction of the entity. #### Remarks 返回实体的当前视线方向。 Returns the current view direction of the entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`getViewDirection`](/server/classes/Entity.md#getviewdirection) *** ### hasComponent() > **hasComponent**(`componentId`): `boolean` **`Beta`** #### Parameters ##### componentId `string` 要检索的组件的标识符(例如,`'minecraft:rideable'`)。如果未指定命名空间前缀,则默认为 `'minecraft:'`。 The identifier of the component (e.g., 'minecraft:rideable') to retrieve. If no namespace prefix is specified, 'minecraft:' is assumed. #### Returns `boolean` 如果指定组件存在于该实体上,则返回 `true`。 Returns true if the specified component is present on this entity. #### Remarks 如果指定组件存在于该实体上,则返回 `true`。 Returns true if the specified component is present on this entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`hasComponent`](/server/classes/Entity.md#hascomponent) *** ### hasTag() > **hasTag**(`tag`): `boolean` **`Beta`** #### Parameters ##### tag `string` 要测试的标签标识符。 Identifier of the tag to test for. #### Returns `boolean` 返回实体是否具有特定标签。 Returns whether an entity has a particular tag. #### Remarks 返回实体是否具有特定标签。 Returns whether an entity has a particular tag. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`hasTag`](/server/classes/Entity.md#hastag) *** ### kill() > **kill**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` 如果实体可以被击杀则返回 `true`(即使它已经死亡),否则返回 `false`。 Returns true if entity can be killed (even if it is already dead), otherwise it returns false. #### Remarks 击杀此实体。实体将正常掉落战利品。 Kills this entity. The entity will drop loot as normal. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **tagsQuery.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function tagsQuery(targetLocation: DimensionLocation) { const mobs = ['creeper', 'skeleton', 'sheep']; // create some sample mob data for (let i = 0; i < 10; i++) { const mobTypeId = mobs[i % mobs.length]; const entity = targetLocation.dimension.spawnEntity(mobTypeId, targetLocation); entity.addTag('mobparty.' + mobTypeId); } const eqo: EntityQueryOptions = { tags: ['mobparty.skeleton'], }; for (const entity of targetLocation.dimension.getEntities(eqo)) { entity.kill(); } } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`kill`](/server/classes/Entity.md#kill) *** ### lookAt() > **lookAt**(`targetLocation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### targetLocation [`Vector3`](/server/interfaces/Vector3.md) 此实体应面向/注视的目标位置。 The target location that this entity should face/look towards. #### Returns `void` #### Remarks 设置实体的旋转以面对目标位置。如果适用,俯仰和偏航都将被设置,例如对于生物,俯仰控制头部倾斜,偏航控制身体旋转。 Sets the rotation of the entity to face a target location. Both pitch and yaw will be set, if applicable, such as for mobs where the pitch controls the head tilt and the yaw controls the body rotation. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`lookAt`](/server/classes/Entity.md#lookat) *** ### matches() > **matches**(`options`): `boolean` **`Beta`** #### Parameters ##### options [`EntityQueryOptions`](/server/interfaces/EntityQueryOptions.md) 执行匹配的查询条件。 The query to perform the match against. #### Returns `boolean` 如果实体匹配传入的 EntityQueryOptions 中的条件则返回 `true`,否则返回 `false`。 Returns true if the entity matches the criteria in the passed in EntityQueryOptions, otherwise it returns false. #### Remarks 将实体与传入的选项进行匹配。如果 EntityQueryOptions 中未指定位置,则使用实体的位置进行匹配。 Matches the entity against the passed in options. Uses the location of the entity for matching if the location is not specified in the passed in EntityQueryOptions. #### Throws 如果查询选项配置错误则抛出异常。 Throws if the query options are misconfigured. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`matches`](/server/classes/Entity.md#matches) *** ### playAnimation() > **playAnimation**(`animationName`, `options?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### animationName `string` 动画标识符,例如 `animation.creeper.swelling`。 The animation identifier. e.g. animation.creeper.swelling ##### options? [`PlayAnimationOptions`](/server/interfaces/PlayAnimationOptions.md) 控制动画播放和过渡的附加选项。 Additional options to control the playback and transitions of the animation. #### Returns `void` #### Remarks 使实体播放给定的动画。 Cause the entity to play the given animation. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`playAnimation`](/server/classes/Entity.md#playanimation) *** ### playMusic() > **playMusic**(`trackId`, `musicOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### trackId `string` 要播放的音乐曲目标识符。 Identifier of the music track to play. ##### musicOptions? [`MusicOptions`](/server/interfaces/MusicOptions.md) 音乐曲目的附加选项。 Additional options for the music track. #### Returns `void` #### Remarks 播放只有此特定玩家能听到的音乐曲目。 Plays a music track that only this particular player can hear. #### Throws This function can throw errors. *** ### playSound() > **playSound**(`soundId`, `soundOptions?`): [`SoundInstance`](/server/classes/SoundInstance.md) **`World Mutation`** **`Beta`** #### Parameters ##### soundId `string` | [`SoundDefinition`](/server/classes/SoundDefinition.md) ##### soundOptions? [`PlayerSoundOptions`](/server/interfaces/PlayerSoundOptions.md) 音效的附加可选选项。 Additional optional options for the sound. #### Returns [`SoundInstance`](/server/classes/SoundInstance.md) #### Remarks 播放只有此特定玩家能听到的音效。 Plays a sound that only this particular player can hear. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) Error #### Example **playMusicAndSound.ts** ```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); } ``` *** ### postClientMessage() > **postClientMessage**(`id`, `value`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### id `string` ##### value `string` #### Returns `void` #### Remarks 这是一个内部方法,用于向下游客户端发布系统消息。 This is an internal-facing method for posting a system message to downstream clients. #### Throws This function can throw errors. *** ### queueMusic() > **queueMusic**(`trackId`, `musicOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### trackId `string` 要播放的音乐曲目标识符。 Identifier of the music track to play. ##### musicOptions? [`MusicOptions`](/server/interfaces/MusicOptions.md) 音乐曲目的附加选项。 Additional options for the music track. #### Returns `void` #### Remarks 排队一首只有此特定玩家能听到的附加音乐曲目。如果当前没有曲目在播放,则会播放一首音乐曲目。 Queues an additional music track that only this particular player can hear. If a track is not playing, a music track will play. #### Throws 如果音量小于 0.0 将抛出错误。 如果淡变小于 0.0 将抛出错误。 An error will be thrown if volume is less than 0.0. An error will be thrown if fade is less than 0.0. *** ### remove() > **remove**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 立即从世界中移除实体。被移除的实体不会执行死亡动画或在移除时掉落战利品。 Immediately removes the entity from the world. The removed entity will not perform a death animation or drop loot upon removal. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`remove`](/server/classes/Entity.md#remove) *** ### removeEffect() > **removeEffect**(`effectType`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### effectType `string` | [`EffectType`](/server/classes/EffectType.md) 效果标识符。 The effect identifier. #### Returns `boolean` 如果效果已被移除则返回 `true`。如果未找到效果或效果不存在则返回 `false`。 Returns true if the effect has been removed. Returns false if the effect is not found or does not exist. #### Remarks 移除实体上的指定 EffectType,如果效果不存在则返回 `false`。 Removes the specified EffectType on the entity, or returns false if the effect is not present. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`removeEffect`](/server/classes/Entity.md#removeeffect) *** ### removePropertyOverrideForEntity() > **removePropertyOverrideForEntity**(`targetEntity`, `identifier`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### targetEntity [`Entity`](/server/classes/Entity.md) 正在移除 Entity 属性覆盖的实体。 The Entity whose Entity Property override is being removed. ##### identifier `string` Entity 属性标识符。 The Entity Property identifier. #### Returns `void` #### Remarks 对此玩家,移除 Entity 属性上的覆盖。此更改不会应用到其他玩家,且直到下一刻才会应用。 For this player, removes the override on an Entity Property. This change is not applied until the next tick and will not apply to other players. #### Throws 如果实体无效则抛出。 如果提供了无效的标识符则抛出。 如果提供的值类型与属性类型不匹配则抛出。 Throws if the entity is invalid. Throws if an invalid identifier is provided. Throws if the provided value type does not match the property type. *** ### removeTag() > **removeTag**(`tag`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### tag `string` 要移除的标签内容。 Content of the tag to remove. #### Returns `boolean` 返回该标签是否存在于实体上。 Returns whether the tag existed on the entity. #### Remarks 从实体移除指定的标签。 Removes a specified tag from an entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`removeTag`](/server/classes/Entity.md#removetag) *** ### resetLevel() > **resetLevel**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 重置玩家的等级。 Resets the level of the player. #### Throws This function can throw errors. *** ### resetProperty() > **resetProperty**(`identifier`): `string` | `number` | `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` 实体属性标识符。 The Entity Property identifier. #### Returns `string` | `number` | `boolean` 返回默认属性值。对于枚举属性,返回字符串。对于浮点和整数属性,返回数字。对于未定义的属性,返回 `undefined`。 Returns the default property value. For enum properties, a string is returned. For float and int properties, a number is returned. For undefined properties, undefined is returned. #### Remarks 将实体属性重置为其默认值,如实体定义中所指定。此属性更改直到下一个 tick 才会应用。 Resets an Entity Property back to its default value, as specified in the Entity's definition. This property change is not applied until the next tick. #### Throws 如果实体无效则抛出异常。 Throws if the entity is invalid. [EngineError](/common/classes/EngineError.md) Error [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`resetProperty`](/server/classes/Entity.md#resetproperty) *** ### runCommand() > **runCommand**(`commandString`): [`CommandResult`](/server/classes/CommandResult.md) **`World Mutation`** **`Beta`** #### Parameters ##### commandString `string` 命令字符串。注意:这不应包含前导斜杠。 The command string. Note: This should not include a leading forward slash. #### Returns [`CommandResult`](/server/classes/CommandResult.md) 包含命令是否成功的命令结果。 A command result containing whether the command was successful. #### Remarks 在实体上运行同步命令。 Runs a synchronous command on the entity. #### Throws This function can throw errors. [CommandError](/server/classes/CommandError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`runCommand`](/server/classes/Entity.md#runcommand) *** ### sendMessage() > **sendMessage**(`message`): `void` **`Beta`** #### Parameters ##### message `string` | [`RawMessage`](/server/interfaces/RawMessage.md) | (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[] 要显示的消息。 The message to be displayed. #### Returns `void` #### Remarks 向玩家发送消息。 Sends a message to the player. #### Throws 如果提供的 [RawMessage](/server/interfaces/RawMessage.md) 格式无效,此方法可能抛出错误。例如,如果为 `score` 提供了空的 `name` 字符串。 This method can throw if the provided [RawMessage](/server/interfaces/RawMessage.md) is in an invalid format. For example, if an empty `name` string is provided to `score`. [InvalidEntityError](/server/classes/InvalidEntityError.md) [RawMessageError](/server/classes/RawMessageError.md) #### Examples **nestedTranslation.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function nestedTranslation(targetLocation: DimensionLocation) { // Displays "Apple or Coal" const rawMessage = { translate: 'accessibility.list.or.two', with: { rawtext: [{ translate: 'item.apple.name' }, { translate: 'item.coal.name' }] }, }; world.sendMessage(rawMessage); } ``` **scoreWildcard.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function scoreWildcard(targetLocation: DimensionLocation) { // Displays the player's score for objective "obj". Each player will see their own score. const rawMessage = { score: { name: '*', objective: 'obj' } }; world.sendMessage(rawMessage); } ``` **sendBasicMessage.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function sendBasicMessage(targetLocation: DimensionLocation) { const players = world.getPlayers(); players[0].sendMessage('Hello World!'); } ``` **sendPlayerMessages.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function sendPlayerMessages(targetLocation: DimensionLocation) { for (const player of world.getAllPlayers()) { // Displays "First or Second" const rawMessage = { translate: 'accessibility.list.or.two', with: ['First', 'Second'] }; player.sendMessage(rawMessage); // Displays "Hello, world!" player.sendMessage('Hello, world!'); // Displays "Welcome, Amazing Player 1!" player.sendMessage({ translate: 'authentication.welcome', with: ['Amazing Player 1'] }); // Displays the player's score for objective "obj". Each player will see their own score. const rawMessageWithScore = { score: { name: '*', objective: 'obj' } }; player.sendMessage(rawMessageWithScore); // Displays "Apple or Coal" const rawMessageWithNestedTranslations = { translate: 'accessibility.list.or.two', with: { rawtext: [{ translate: 'item.apple.name' }, { translate: 'item.coal.name' }] }, }; player.sendMessage(rawMessageWithNestedTranslations); } } ``` **sendTranslatedMessage.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function sendTranslatedMessage(targetLocation: DimensionLocation) { const players = world.getPlayers(); players[0].sendMessage({ translate: 'authentication.welcome', with: ['Amazing Player 1'] }); } ``` *** ### setControlScheme() > **setControlScheme**(`controlScheme?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### controlScheme? [`ControlScheme`](/server/enums/ControlScheme.md) 控制方案类型。如果此参数为 `undefined`,此方法将清除玩家的控制方案,恢复为玩家摄像机的默认控制方案。 Control scheme type. If this argument is undefined, this method will clear the player's control scheme back to the player camera's default control scheme. #### Returns `void` 如果控制方案已成功添加或更新,则不返回任何内容。如果控制方案不被玩家当前摄像机允许,则可能抛出 InvalidArgumentError。 Returns nothing if the control scheme was added or updated successfully. This can throw an InvalidArgumentError if the control scheme is not allowed by the player's current camera. #### Remarks 设置玩家的控制方案。玩家的活跃摄像机预设必须通过脚本(如 camera.setCamera())或命令设置。 Set a player's control scheme. The player's active camera preset must be set by scripts like with camera.setCamera() or commands. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### setDynamicProperties() > **setDynamicProperties**(`values`): `void` **`Beta`** #### Parameters ##### values `Record`\<`string`, `boolean` | `number` | `string` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined`> 要设置的动态属性的键值对记录。如果数据值为 `null`,将会移除该属性。 A Record of key value pairs of the dynamic properties to set. If the data value is null, it will remove that property instead. #### Returns `void` #### Remarks 使用特定值设置多个动态属性。 Sets multiple dynamic properties with specific values. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`setDynamicProperties`](/server/classes/Entity.md#setdynamicproperties) *** ### setDynamicProperty() > **setDynamicProperty**(`identifier`, `value?`): `void` **`Beta`** #### Parameters ##### identifier `string` 属性标识符。 The property identifier. ##### value? `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) 要设置的属性的数据值。如果值为 `null`,将会移除该属性。 Data value of the property to set. If the value is null, it will remove the property instead. #### Returns `void` #### Remarks 设置指定属性为一个值。 Sets a specified property to a value. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`setDynamicProperty`](/server/classes/Entity.md#setdynamicproperty) *** ### setGameMode() > **setGameMode**(`gameMode?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### gameMode? [`GameMode`](/server/enums/GameMode.md) 活跃的游戏模式。 Active gamemode. #### Returns `void` #### Remarks 为此玩家设置游戏模式覆盖。 Sets a gamemode override for this player. #### Throws This function can throw errors. *** ### setOnFire() > **setOnFire**(`seconds`, `useEffects?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### seconds `number` 设置实体着火的时间长度。 Length of time to set the entity on fire. ##### useEffects? `boolean` 是否应考虑副作用(如解冻)和其他条件,如雨水或防火保护。默认值:`true` Whether side-effects should be applied (e.g. thawing freeze) and other conditions such as rain or fire protection should be taken into consideration. Defaults to: true #### Returns `boolean` 实体是否被点燃。如果秒数小于或等于零、实体潮湿或实体免疫火焰,则可能失败。 Whether the entity was set on fire. This can fail if seconds is less than or equal to zero, the entity is wet or the entity is immune to fire. #### Remarks 点燃实体(如果它不在水中或雨里)。请注意,你可以调用 `getComponent('minecraft:onfire')`,如果存在,则实体着火。 Sets an entity on fire (if it is not in water or rain). Note that you can call getComponent('minecraft:onfire') and, if present, the entity is on fire. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Example **setOnFire.ts** ```typescript import { system, EntityOnFireComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function setOnFire(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const skelly = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Skeleton, targetLocation); skelly.setOnFire(20, true); system.runTimeout(() => { const onfire = skelly.getComponent(EntityComponentTypes.OnFire) as EntityOnFireComponent; log(onfire?.onFireTicksRemaining + ' fire ticks remaining.'); skelly.extinguishFire(true); log('Never mind. Fire extinguished.'); }, 20); } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`setOnFire`](/server/classes/Entity.md#setonfire) *** ### setProperty() > **setProperty**(`identifier`, `value`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` 实体属性标识符。 The Entity Property identifier. ##### value `string` | `number` | `boolean` 属性值。提供的类型必须与实体定义中指定的类型兼容。 The property value. The provided type must be compatible with the type specified in the entity's definition. #### Returns `void` #### Remarks 将实体属性设置为提供的值。此属性更改直到下一个 tick 才会应用。 Sets an Entity Property to the provided value. This property change is not applied until the next tick. #### Throws 如果实体无效则抛出异常。如果提供了无效的标识符则抛出异常。如果提供的值类型与属性类型不匹配则抛出异常。如果提供的值超出预期范围(int、float 属性)则抛出异常。如果提供的字符串值与接受的枚举值集合不匹配(枚举属性)则抛出异常。 Throws if the entity is invalid. Throws if an invalid identifier is provided. Throws if the provided value type does not match the property type. Throws if the provided value is outside the expected range (int, float properties). Throws if the provided string value does not match the set of accepted enum values (enum properties [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`setProperty`](/server/classes/Entity.md#setproperty) *** ### setPropertyOverrideForEntity() > **setPropertyOverrideForEntity**(`targetEntity`, `identifier`, `value`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### targetEntity [`Entity`](/server/classes/Entity.md) 其 Entity 属性正在被覆盖的实体。 The Entity whose Entity Property is being overriden. ##### identifier `string` Entity 属性标识符。 The Entity Property identifier. ##### value `string` | `number` | `boolean` 覆盖值。提供的类型必须与实体定义中指定的类型兼容。 The override value. The provided type must be compatible with the type specified in the entity's definition. #### Returns `void` #### Remarks 对此玩家,将目标实体上的 Entity 属性覆盖为提供的值。此属性必须是客户端同步的。此更改不会应用到其他玩家,且直到下一刻才会应用。 For this player, overrides an Entity Property on the target Entity to the provided value. This property must be client synced. This change is not applied until the next tick and will not apply to other players. #### Throws 如果实体无效则抛出。 如果提供了无效的标识符则抛出。 如果提供的值类型与属性类型不匹配则抛出。 如果提供的值超出预期范围(int、float 属性)则抛出。 如果提供的字符串值与接受的枚举值集合不匹配(enum 属性)则抛出。 Throws if the entity is invalid. Throws if an invalid identifier is provided. Throws if the provided value type does not match the property type. Throws if the provided value is outside the expected range (int, float properties). Throws if the provided string value does not match the set of accepted enum values (enum properties) *** ### setRotation() > **setRotation**(`rotation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### rotation [`Vector2`](/server/interfaces/Vector2.md) 实体的 x 和 y 旋转(以度为单位)。对于大多数生物,x 旋转控制头部倾斜,y 旋转控制身体旋转。 The x and y rotation of the entity (in degrees). For most mobs, the x rotation controls the head tilt and the y rotation controls the body rotation. #### Returns `void` #### Remarks 设置实体的主要旋转。 Sets the main rotation of the entity. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`setRotation`](/server/classes/Entity.md#setrotation) *** ### setSpawnPoint() > **setSpawnPoint**(`spawnPoint?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### spawnPoint? [`DimensionLocation`](/server/interfaces/DimensionLocation.md) #### Returns `void` #### Remarks 为此特定玩家设置当前起始出生点。 Sets the current starting spawn point for this particular player. #### Throws This function can throw errors. Error [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### spawnParticle() > **spawnParticle**(`effectName`, `location`, `molangVariables?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### effectName `string` 要创建的粒子标识符。 Identifier of the particle to create. ##### location [`Vector3`](/server/interfaces/Vector3.md) 创建粒子发射器的位置。 The location at which to create the particle emitter. ##### molangVariables? [`MolangVariableMap`](/server/classes/MolangVariableMap.md) 一组可选的、可自定义的变量,可为该粒子进行调整。 A set of optional, customizable variables that can be adjusted for this particle. #### Returns `void` #### Remarks 在世界中的指定位置创建一个新的粒子发射器。仅对目标玩家可见。 Creates a new particle emitter at a specified location in the world. Only visible to the target player. #### Throws This function can throw errors. Error [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) #### Example **spawnParticle.ts** ```typescript import { world, MolangVariableMap, Vector3 } from '@minecraft/server'; world.afterEvents.playerSpawn.subscribe(event => { const targetLocation = event.player.location; for (let i = 0; i < 100; i++) { const molang = new MolangVariableMap(); molang.setColorRGB('variable.color', { red: Math.random(), green: Math.random(), blue: Math.random(), }); const newLocation: Vector3 = { x: targetLocation.x + Math.floor(Math.random() * 8) - 4, y: targetLocation.y + Math.floor(Math.random() * 8) - 4, z: targetLocation.z + Math.floor(Math.random() * 8) - 4, }; event.player.spawnParticle('minecraft:colored_flame_particle', newLocation, molang); } }); ``` *** ### startItemCooldown() > **startItemCooldown**(`cooldownCategory`, `tickDuration`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### cooldownCategory `string` 指定要获取当前冷却时间的冷却类别。 Specifies the cooldown category to retrieve the current cooldown for. ##### tickDuration `number` 物品冷却的持续时间(以刻为单位)。 Duration in ticks of the item cooldown. Bounds: \[0, 32767] #### Returns `void` #### Remarks 设置特定冷却类别的物品冷却时间。 Sets the item cooldown time for a particular cooldown category. #### Throws This function can throw errors. *** ### stopAllSounds() > **stopAllSounds**(): `void` **`Beta`** **`World Mutation`** #### Returns `void` #### Remarks 为此特定玩家停止所有音效播放。 Stops all sounds from playing for this particular player. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### stopMusic() > **stopMusic**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 为此特定玩家停止播放任何音乐曲目。 Stops any music tracks from playing for this particular player. #### Throws This function can throw errors. *** ### stopSound() > **stopSound**(`soundId`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### soundId `string` 音效的标识符。 Identifier of the sound. #### Returns `void` #### Remarks 为此特定玩家停止播放音效。 Stops a sound from playing for this particular player. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### teleport() > **teleport**(`location`, `teleportOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) 实体的新位置。 New location for the entity. ##### teleportOptions? [`TeleportOptions`](/server/interfaces/TeleportOptions.md) 关于传送操作的选项。 Options regarding the teleport operation. #### Returns `void` #### Remarks 将选定的实体传送到新位置。 Teleports the selected entity to a new location #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Examples **teleport.ts** ```typescript import { system, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function teleport(targetLocation: DimensionLocation) { const cow = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Cow, targetLocation); system.runTimeout(() => { cow.teleport( { x: targetLocation.x + 2, y: targetLocation.y + 2, z: targetLocation.z + 2 }, { facingLocation: targetLocation, } ); }, 20); } ``` **teleportMovement.ts** ```typescript import { system, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function teleportMovement(targetLocation: DimensionLocation) { const pig = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Pig, targetLocation); let inc = 1; const runId = system.runInterval(() => { pig.teleport( { x: targetLocation.x + inc / 4, y: targetLocation.y + inc / 4, z: targetLocation.z + inc / 4 }, { facingLocation: targetLocation, } ); if (inc > 100) { system.clearRun(runId); } inc++; }, 4); } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`teleport`](/server/classes/Entity.md#teleport) *** ### triggerEvent() > **triggerEvent**(`eventName`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### eventName `string` 要触发的实体类型事件的名称。如果未指定命名空间,则默认为 `minecraft:`。 Name of the entity type event to trigger. If a namespace is not specified, minecraft: is assumed. #### Returns `void` #### Remarks 触发一个实体类型事件。对于每个实体,在实体的定义为关键实体行为定义了许多事件;例如,苦力怕有一个 `minecraft:start_exploding` 类型事件。 Triggers an entity type event. For every entity, a number of events are defined in an entities' definition for key entity behaviors; for example, creepers have a minecraft:start\_exploding type event. #### Throws 如果事件未在实体的定义中定义,则会抛出错误。 If the event is not defined in the definition of the entity, an error will be thrown. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) #### Examples **triggerEvent.ts** ```typescript // A function that spawns a creeper and triggers it to explode immediately import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function spawnExplodingCreeper(location: DimensionLocation) { const creeper = location.dimension.spawnEntity(MinecraftEntityTypes.Creeper, location); creeper.triggerEvent('minecraft:start_exploding_forced'); } ``` **triggerEvent.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function triggerEvent(targetLocation: DimensionLocation) { const creeper = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Creeper, targetLocation); creeper.triggerEvent('minecraft:start_exploding_forced'); } ``` #### Inherited from [`Entity`](/server/classes/Entity.md).[`triggerEvent`](/server/classes/Entity.md#triggerevent) *** ### tryTeleport() > **tryTeleport**(`location`, `teleportOptions?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) 要传送实体的位置。 Location to teleport the entity to. ##### teleportOptions? [`TeleportOptions`](/server/interfaces/TeleportOptions.md) 关于传送操作的选项。 Options regarding the teleport operation. #### Returns `boolean` 返回传送是否成功。如果目标区块未加载或传送会导致与方块相交,则可能失败。 Returns whether the teleport succeeded. This can fail if the destination chunk is unloaded or if the teleport would result in intersecting with blocks. #### Remarks 尝试传送,但可能不会完成传送操作(例如,如果目标位置有方块阻挡)。 Attempts to try a teleport, but may not complete the teleport operation (for example, if there are blocks at the destination.) #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) #### Inherited from [`Entity`](/server/classes/Entity.md).[`tryTeleport`](/server/classes/Entity.md#tryteleport) ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ExplosionAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ExplosionAfterEvent.md. # Class: ExplosionAfterEvent event **`Beta`** 包含有关已发生的爆炸的信息。 Contains information regarding an explosion that has happened. ## Extended by - [`ExplosionBeforeEvent`](/server/classes/ExplosionBeforeEvent.md) ## Properties ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 爆炸发生的维度。 Dimension where the explosion has occurred. *** ### source? > `readonly` `optional` **source?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 爆炸的可选来源。 Optional source of the explosion. ## Methods ### getImpactedBlocks() > **getImpactedBlocks**(): [`Block`](/server/classes/Block.md)\[] **`Beta`** #### Returns [`Block`](/server/classes/Block.md)\[] #### Remarks 受此爆炸事件影响的方块集合。 A collection of blocks impacted by this explosion event. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ExplosionBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ExplosionBeforeEvent.md. # Class: ExplosionBeforeEvent event **`Beta`** 包含有关已发生的爆炸的信息。 Contains information regarding an explosion that has happened. ## Extends - [`ExplosionAfterEvent`](/server/classes/ExplosionAfterEvent.md) ## Properties ### cancel > **cancel**: `boolean` **`Beta`** #### Remarks 如果设置为 `true`,则取消爆炸事件。 If set to true, cancels the explosion event. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 爆炸发生的维度。 Dimension where the explosion has occurred. #### Inherited from [`ExplosionAfterEvent`](/server/classes/ExplosionAfterEvent.md).[`dimension`](/server/classes/ExplosionAfterEvent.md#dimension) *** ### source? > `readonly` `optional` **source?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 爆炸的可选来源。 Optional source of the explosion. #### Inherited from [`ExplosionAfterEvent`](/server/classes/ExplosionAfterEvent.md).[`source`](/server/classes/ExplosionAfterEvent.md#source) ## Methods ### getImpactedBlocks() > **getImpactedBlocks**(): [`Block`](/server/classes/Block.md)\[] **`Beta`** #### Returns [`Block`](/server/classes/Block.md)\[] #### Remarks 受此爆炸事件影响的方块集合。 A collection of blocks impacted by this explosion event. #### Inherited from [`ExplosionAfterEvent`](/server/classes/ExplosionAfterEvent.md).[`getImpactedBlocks`](/server/classes/ExplosionAfterEvent.md#getimpactedblocks) *** ### setImpactedBlocks() > **setImpactedBlocks**(`blocks`): `void` **`Beta`** #### Parameters ##### blocks [`Block`](/server/classes/Block.md)\[] 受此爆炸影响的新方块列表。 New list of blocks that are impacted by this explosion. #### Returns `void` #### Remarks 更新受此爆炸事件影响的方法集合。 Updates a collection of blocks impacted by this explosion event. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ISerializable.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ISerializable.md. # Class: ISerializable **`Beta`** ## Extended by - [`Structure`](/server/classes/Structure.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Structure.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Structure.md. # Class: Structure **`Beta`** 表示已加载的结构模板(.mcstructure 文件)。可以使用 /structure 命令或 [StructureManager](/server/classes/StructureManager.md) API 在世界中放置结构。 Represents a loaded structure template (.mcstructure file). Structures can be placed in a world using the /structure command or the [StructureManager](/server/classes/StructureManager.md) APIs. ## Extends - [`ISerializable`](/server/classes/ISerializable.md) ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 结构的名称。标识符必须包含命名空间。对于通过 /structure 命令或结构方块创建的结构,此命名空间默认为 "mystructure"。 The name of the structure. The identifier must include a namespace. For structures created via the /structure command or structure blocks, this namespace defaults to "mystructure". *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回 Structure 是否有效。如果 Structure 被删除,则将变为无效。 Returns whether the Structure is valid. The Structure may become invalid if it is deleted. *** ### size > `readonly` **size**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 结构的尺寸。例如,单方块结构的尺寸为 \{x:1, y:1, z:1}。 The dimensions of the structure. For example, a single block structure will have a size of \{x:1, y:1, z:1}. #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) ## Methods ### getBlockPermutation() > **getBlockPermutation**(`location`): [`BlockPermutation`](/server/classes/BlockPermutation.md) | `undefined` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) 相对于 Structure 原点的方块位置。 The block location relative to the Structure's origin. #### Returns [`BlockPermutation`](/server/classes/BlockPermutation.md) | `undefined` 返回 BlockPermutation。如果指定位置不存在方块,则返回 `undefined`。 Returns a BlockPermutation. Returns undefined if a block does not exist at the given location. #### Remarks 返回表示 Structure 中指定位置方块的 BlockPermutation。 Returns a BlockPermutation representing the block contained within the Structure at the given location. #### Throws 如果位置超出结构边界则抛出。 如果 Structure 已被删除则抛出。 Throws if the location is outside the structure's bounds. Throws if the Structure has been deleted. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### getIsWaterlogged() > **getIsWaterlogged**(`location`): `boolean` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) 相对于 Structure 原点的方块位置。 The block location relative to the Structure's origin. #### Returns `boolean` 返回指定位置的方块是否含水。如果指定位置不存在方块,则返回 `false`。 Returns whether the block at the given location is waterlogged. Returns false if a block does not exist at the given location. #### Remarks 返回指定位置的方块是否含水。 Returns whether the block at the given location is waterlogged. #### Throws 如果位置超出结构边界则抛出。 如果 Structure 已被删除则抛出。 Throws if the location is outside the structure's bounds. Throws if the Structure has been deleted. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### saveAs() > **saveAs**(`identifier`, `saveMode?`): `Structure` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` 新创建的 Structure 的名称。 The name of the newly created Structure. ##### saveMode? [`StructureSaveMode`](/server/enums/StructureSaveMode.md) 确定 Structure 的保存方式。默认为保存到世界。 Determines how the Structure should be saved. Defaults to saving to the world. Defaults to: 1 #### Returns `Structure` 返回新创建的结构。 Returns the newly created structure. #### Remarks 创建 Structure 的副本并以新名称保存。 Creates a copy of a Structure and saves it with a new name. #### Throws 如果标识符无效则抛出。有效的标识符必须包含命名空间且必须唯一。 如果 Structure 已被删除则抛出。 Throws if the identifier is invalid. A valid identifier must include a namespace and must be unique. Throws if the Structure has been deleted. [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### saveToWorld() > **saveToWorld**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将修改后的 Structure 保存到世界文件中。 Saves a modified Structure to the world file. #### Throws 如果 Structure 已被删除则抛出。 Throws if the Structure has been deleted. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### setBlockPermutation() > **setBlockPermutation**(`location`, `blockPermutation?`, `waterlogged?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) 相对于 Structure 原点的方块位置。 The block location relative to the Structure's origin. ##### blockPermutation? [`BlockPermutation`](/server/classes/BlockPermutation.md) 要设置的 BlockPermutation。 The BlockPermutation to set. Defaults to: null ##### waterlogged? `boolean` 指定方块是否应含水。空气和未定义的方块不能含水。 Specifies whether the block should be waterlogged. Air and undefined blocks cannot be waterlogged. Defaults to: false #### Returns `void` #### Remarks 在 Structure 中设置一个 BlockPermutation。 Sets a BlockPermutation within a Structure. #### Throws 如果方块类型为 StructureVoid 则抛出。 如果方块未定义且 waterlogged 设置为 `true` 则抛出。 如果方块为空气且 waterlogged 设置为 `true` 则抛出。 如果位置超出结构边界则抛出。 如果 Structure 已被删除则抛出。 Throws if the type of block is StructureVoid. Throws if the block is undefined and waterlogged is set to true. Throws if the block is air and waterlogged is set to true. Throws if the location is outside the structure's bounds. Throws if the Structure has been deleted. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidStructureError](/server/classes/InvalidStructureError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemCompleteUseEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemCompleteUseEvent.md. # Class: ItemCompleteUseEvent event **`Beta`** 包含与可蓄力物品完成蓄力相关的信息。 Contains information related to a chargeable item completing being charged. ## Extended by - [`ItemComponentCompleteUseEvent`](/server/classes/ItemComponentCompleteUseEvent.md) ## Properties ### itemStack > `readonly` **itemStack**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 返回已完成蓄力的物品堆。 Returns the item stack that has completed charging. *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回触发该物品事件的源实体。 Returns the source entity that triggered this item event. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemComponentCompleteUseEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemComponentCompleteUseEvent.md. # Class: ItemComponentCompleteUseEvent event component **`Beta`** 包含与通过组件完成蓄力的可蓄力物品相关的信息。 Contains information related to a chargeable item completing being charged via a component. ## Extends - [`ItemCompleteUseEvent`](/server/classes/ItemCompleteUseEvent.md) ## Properties ### itemStack > `readonly` **itemStack**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 返回已完成蓄力的物品堆。 Returns the item stack that has completed charging. #### Inherited from [`ItemCompleteUseEvent`](/server/classes/ItemCompleteUseEvent.md).[`itemStack`](/server/classes/ItemCompleteUseEvent.md#itemstack) *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回触发该物品事件的源实体。 Returns the source entity that triggered this item event. #### Inherited from [`ItemCompleteUseEvent`](/server/classes/ItemCompleteUseEvent.md).[`source`](/server/classes/ItemCompleteUseEvent.md#source) ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemUseAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemUseAfterEvent.md. # Class: ItemUseAfterEvent event **`Beta`** 包含与物品被用于方块相关的信息。该事件在玩家使用的物品成功触发实体交互时触发。 Contains information related to an item being used on a block. This event fires when an item used by a player successfully triggers an entity interaction. ## Extended by - [`ItemUseBeforeEvent`](/server/classes/ItemUseBeforeEvent.md) ## Properties ### itemStack > **itemStack**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 被使用的受影响物品堆。 The impacted item stack that is being used. *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回触发该物品事件的源实体。 Returns the source entity that triggered this item event. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemUseBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemUseBeforeEvent.md. # Class: ItemUseBeforeEvent event **`Beta`** 包含与某次物品使用相关的信息。 Contains information related to an item being used. ## Extends - [`ItemUseAfterEvent`](/server/classes/ItemUseAfterEvent.md) ## Properties ### cancel > **cancel**: `boolean` **`Beta`** #### Remarks 若设置为 true,则会取消该物品的使用行为。 If set to true, this will cancel the item use behavior. *** ### itemStack > **itemStack**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 被使用的受影响物品堆。 The impacted item stack that is being used. #### Inherited from [`ItemUseAfterEvent`](/server/classes/ItemUseAfterEvent.md).[`itemStack`](/server/classes/ItemUseAfterEvent.md#itemstack) *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回触发该物品事件的源实体。 Returns the source entity that triggered this item event. #### Inherited from [`ItemUseAfterEvent`](/server/classes/ItemUseAfterEvent.md).[`source`](/server/classes/ItemUseAfterEvent.md#source) ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemUseOnEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemUseOnEvent.md. # Class: ItemUseOnEvent event **`Beta`** 包含有关在方块上使用物品的信息。 Contains information regarding the use of an item on a block. ## Extended by - [`ItemComponentUseOnEvent`](/server/classes/ItemComponentUseOnEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此事件影响的方块。 The block impacted by this event. *** ### blockFace > `readonly` **blockFace**: [`Direction`](/server/enums/Direction.md) **`Beta`** #### Remarks 使用物品所在的方块面。 The face of the block that the item was used on. *** ### faceLocation > `readonly` **faceLocation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 相对于使用物品的方块西北底角的位置。 Location relative to the bottom north-west corner of the block that the item was used on. *** ### itemStack > `readonly` **itemStack**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 在方块上使用的物品堆。 The item stack used on the block. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemComponentUseOnEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemComponentUseOnEvent.md. # Class: ItemComponentUseOnEvent event component **`Beta`** 包含通过组件对某个方块使用物品时相关的信息。 Contains information regarding the use of an item on a block via a component. ## Extends - [`ItemUseOnEvent`](/server/classes/ItemUseOnEvent.md) ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此事件影响的方块。 The block impacted by this event. #### Inherited from [`ItemUseOnEvent`](/server/classes/ItemUseOnEvent.md).[`block`](/server/classes/ItemUseOnEvent.md#block) *** ### blockFace > `readonly` **blockFace**: [`Direction`](/server/enums/Direction.md) **`Beta`** #### Remarks 使用物品所在的方块面。 The face of the block that the item was used on. #### Inherited from [`ItemUseOnEvent`](/server/classes/ItemUseOnEvent.md).[`blockFace`](/server/classes/ItemUseOnEvent.md#blockface) *** ### faceLocation > `readonly` **faceLocation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 相对于使用物品的方块西北底角的位置。 Location relative to the bottom north-west corner of the block that the item was used on. #### Inherited from [`ItemUseOnEvent`](/server/classes/ItemUseOnEvent.md).[`faceLocation`](/server/classes/ItemUseOnEvent.md#facelocation) *** ### itemStack > `readonly` **itemStack**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 在方块上使用的物品堆。 The item stack used on the block. #### Inherited from [`ItemUseOnEvent`](/server/classes/ItemUseOnEvent.md).[`itemStack`](/server/classes/ItemUseOnEvent.md#itemstack) *** ### source > `readonly` **source**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 对方块使用该物品的实体。 The entity that used the item on the block. *** ### usedOnBlockPermutation > `readonly` **usedOnBlockPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks 物品被使用的方块所对应的方块状态。 The block permutation that the item was used on. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootItemCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootItemCondition.md. # Class: LootItemCondition **`Beta`** 所有战利品物品条件派生的抽象基类。战利品物品条件是一组规则或要求,必须满足这些条件才能产生战利品掉落。 An abstract base class from which all loot item conditions are derived. A loot item condition is a set of rules or requirements which must be met for a loot drop to happen. ## Extended by - [`DamagedByEntityCondition`](/server/classes/DamagedByEntityCondition.md) - [`EntityHasMarkVariantCondition`](/server/classes/EntityHasMarkVariantCondition.md) - [`EntityHasVariantCondition`](/server/classes/EntityHasVariantCondition.md) - [`EntityKilledCondition`](/server/classes/EntityKilledCondition.md) - [`IsBabyCondition`](/server/classes/IsBabyCondition.md) - [`KilledByEntityCondition`](/server/classes/KilledByEntityCondition.md) - [`KilledByPlayerCondition`](/server/classes/KilledByPlayerCondition.md) - [`KilledByPlayerOrPetsCondition`](/server/classes/KilledByPlayerOrPetsCondition.md) - [`MatchToolCondition`](/server/classes/MatchToolCondition.md) - [`PassengerOfEntityCondition`](/server/classes/PassengerOfEntityCondition.md) - [`RandomChanceCondition`](/server/classes/RandomChanceCondition.md) - [`RandomChanceWithLootingCondition`](/server/classes/RandomChanceWithLootingCondition.md) - [`RandomDifficultyChanceCondition`](/server/classes/RandomDifficultyChanceCondition.md) - [`RandomRegionalDifficultyChanceCondition`](/server/classes/RandomRegionalDifficultyChanceCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/DamagedByEntityCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/DamagedByEntityCondition.md. # Class: DamagedByEntityCondition entity **`Beta`** 战利品物品条件,检查战利品来源是否被特定类型的实体伤害过。 Loot item condition that checks whether the loot source was damaged by a specific type of entity. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### entityType > `readonly` **entityType**: `string` **`Beta`** #### Remarks 此条件通过所需的实体类型。 The entity type required for this condition to pass. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [Entity](/server/classes/Entity.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHasMarkVariantCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHasMarkVariantCondition.md. # Class: EntityHasMarkVariantCondition entity **`Beta`** Loot item condition that checks the value of the mark variant of a mob as it drops its loot. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### value > `readonly` **value**: `number` **`Beta`** #### Remarks The mark variant value the mob must have for this condition to pass. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHasVariantCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHasVariantCondition.md. # Class: EntityHasVariantCondition entity **`Beta`** Loot item condition that checks the variant value of a mob as it drops its loot. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### value > `readonly` **value**: `number` **`Beta`** #### Remarks The variant value the mob must have for this condition to pass. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityKilledCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityKilledCondition.md. # Class: EntityKilledCondition entity **`Beta`** Loot item condition that checks the entity type of the entity dropping its loot. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### entityType > `readonly` **entityType**: `string` **`Beta`** #### Remarks The entity type required for this condition to pass. Example: 'minecraft:skeleton'. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/IsBabyCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/IsBabyCondition.md. # Class: IsBabyCondition **`Beta`** 用于检查掉落战利品的实体是否为幼体的战利品物品条件。 Loot item condition that checks whether or not the entity dropping loot is a baby. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/KilledByEntityCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/KilledByEntityCondition.md. # Class: KilledByEntityCondition entity **`Beta`** 战利品物品条件,用于检查掉落来源是否被特定类型的实体击杀。 Loot item condition that checks whether or not the drop source was killed by a specific type of entity. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### entityType > `readonly` **entityType**: `string` **`Beta`** #### Remarks 此条件通过所需的实体类型。 示例:`minecraft:skeleton`。 The entity type required for this condition to pass. Example: 'minecraft:skeleton'. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/KilledByPlayerCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/KilledByPlayerCondition.md. # Class: KilledByPlayerCondition player **`Beta`** 战利品物品条件,用于检查战利品掉落的来源是否被玩家击杀。 Loot item condition that checks whether or not the source of the loot drop was killed by the player. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) - [Player](/server/classes/Player.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/KilledByPlayerOrPetsCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/KilledByPlayerOrPetsCondition.md. # Class: KilledByPlayerOrPetsCondition player **`Beta`** 战利品物品条件,用于检查战利品掉落的来源是否被玩家或玩家的任何宠物击杀。 Loot item condition that checks whether or not the source of the loot drop was killed by the player or any of the player's pets. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [Player](/server/classes/Player.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/MatchToolCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/MatchToolCondition.md. # Class: MatchToolCondition **`Beta`** 用于检查是否使用合适的工具触发战利品事件的战利品物品条件。可以描述要比较的物品类型、数量、耐久度、附魔或物品标签数组。 Loot item condition that checks whether an appropriate tool was used to trigger the loot event. Can describe item type, count, durability, enchantments, or arrays of item tags to compare against. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### count > `readonly` **count**: `NumberRange` **`Beta`** 此条件通过所需的堆叠大小或数量。 #### Remarks The stack size, or count, required for this condition to pass. *** ### durability > `readonly` **durability**: `NumberRange` **`Beta`** 此条件通过所需的耐久度值。 #### Remarks The durability value required for this condition to pass. *** ### enchantments > `readonly` **enchantments**: [`EnchantInfo`](/server/classes/EnchantInfo.md)\[] **`Beta`** 此条件通过所需的附魔数组。 #### Remarks Array of enchantments required for this condition to pass. *** ### itemName > `readonly` **itemName**: `string` **`Beta`** 此条件通过所需的工具物品名称。 #### Remarks The name of the tool item required for this condition to pass. *** ### itemTagsAll > `readonly` **itemTagsAll**: `string`\[] **`Beta`** 此条件通过必须全部匹配的物品标签数组。 #### Remarks Array of item tags which ALL must be matched for this condition to pass. *** ### itemTagsAny > `readonly` **itemTagsAny**: `string`\[] **`Beta`** 此条件通过至少需要匹配一个的物品标签数组。 #### Remarks Array of item tags, from which at least 1 must be matched for this condition to pass. *** ### itemTagsNone > `readonly` **itemTagsNone**: `string`\[] **`Beta`** 此条件通过需要恰好零个匹配的物品标签数组。 #### Remarks Array of item tags, from which exactly zero must match for this condition to pass. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PassengerOfEntityCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PassengerOfEntityCondition.md. # Class: PassengerOfEntityCondition entity **`Beta`** 用于检查战利品实体当前是否为特定类型实体乘客的战利品条件。 Loot item condition that checks whether the looting entity is currently a passenger of a specific type of entity. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### entityType > `readonly` **entityType**: `string` **`Beta`** 此条件通过所需的实体类型。 #### Remarks The entity type required for this condition to pass. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/RandomChanceCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/RandomChanceCondition.md. # Class: RandomChanceCondition **`Beta`** 将给定值应用于战利品掉落几率的战利品物品条件。 Loot item condition that applies a given value to the chances that loot will drop. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### chance > `readonly` **chance**: `number` **`Beta`** #### Remarks 战利品掉落的几率,范围为 0.0-1.0。 The chance, from 0.0-1.0, that loot will drop. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/RandomChanceWithLootingCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/RandomChanceWithLootingCondition.md. # Class: RandomChanceWithLootingCondition **`Beta`** 将给定值应用于战利品掉落几率(受所用工具的抢夺附魔等级影响)的战利品物品条件。 Loot item condition that applies a given value to the chances that loot will drop, modified by the level of looting enchantment on the tool used. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### chance > `readonly` **chance**: `number` **`Beta`** #### Remarks 战利品掉落的基础几率,范围为 0.0-1.0,将受 "lootingMultiplier" 值的修正。 The base chance, from 0.0-1.0, that loot will drop. Will be modified by the 'lootingMultiplier' value. *** ### lootingMultiplier > `readonly` **lootingMultiplier**: `number` **`Beta`** #### Remarks 每级抢夺附魔增加的掉落几率。 The increase in drop chance per looting enchant level. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/RandomDifficultyChanceCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/RandomDifficultyChanceCondition.md. # Class: RandomDifficultyChanceCondition **`Beta`** 根据当前难度等级将给定值应用于战利品掉落几率的战利品物品条件。 Loot item condition that applies given values to the chances that loot will drop based on the current difficulty level. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### chances > `readonly` **chances**: `number`\[] **`Beta`** #### Remarks 一个四元素数组,包含每个难度等级的战利品掉落几率,依次为:和平、简单、普通、困难。 A four-element array containing the chance of a loot drop occurring for each difficulty level, in order: Peaceful, Easy, Normal, Hard. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/RandomRegionalDifficultyChanceCondition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/RandomRegionalDifficultyChanceCondition.md. # Class: RandomRegionalDifficultyChanceCondition **`Beta`** 将给定值应用于战利品掉落几率(受掉落发生区域修正)的战利品物品条件。 Loot item condition that applies a given value to the chances that loot will drop, modified by the region the drop is happening within. ## Extends - [`LootItemCondition`](/server/classes/LootItemCondition.md) ## Properties ### maxChance > `readonly` **maxChance**: `number` **`Beta`** #### Remarks 战利品掉落的基础几率,范围为 0.0-1.0,将受当前区域倍率的修正。 The base chance, from 0.0-1.0, that loot will drop. Will be modified by the current region's multiplier. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootItemFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootItemFunction.md. # Class: LootItemFunction **`Beta`** 所有战利品物品函数派生的抽象基类。战利品物品函数可以在战利品掉落时以多种方式修改掉落物,可选地依赖于一组必须满足的条件。 An abstract base class from which all loot item functions are derived. Loot item functions can modify loot drops in a variety of ways as they happen, optionally dependent on a set of conditions which must be met. ## Extended by - [`CarryOverBlockEntityDataFunction`](/server/classes/CarryOverBlockEntityDataFunction.md) - [`EnchantRandomEquipmentFunction`](/server/classes/EnchantRandomEquipmentFunction.md) - [`EnchantRandomlyFunction`](/server/classes/EnchantRandomlyFunction.md) - [`EnchantWithLevelsFunction`](/server/classes/EnchantWithLevelsFunction.md) - [`ExplorationMapFunction`](/server/classes/ExplorationMapFunction.md) - [`ExplosionDecayFunction`](/server/classes/ExplosionDecayFunction.md) - [`FillContainerFunction`](/server/classes/FillContainerFunction.md) - [`LootingEnchantFunction`](/server/classes/LootingEnchantFunction.md) - [`RandomAuxValueFunction`](/server/classes/RandomAuxValueFunction.md) - [`RandomBlockStateFunction`](/server/classes/RandomBlockStateFunction.md) - [`RandomDyeFunction`](/server/classes/RandomDyeFunction.md) - [`SetArmorTrimFunction`](/server/classes/SetArmorTrimFunction.md) - [`SetBannerDetailsFunction`](/server/classes/SetBannerDetailsFunction.md) - [`SetBookContentsFunction`](/server/classes/SetBookContentsFunction.md) - [`SetDataFromColorIndexFunction`](/server/classes/SetDataFromColorIndexFunction.md) - [`SetItemCountFunction`](/server/classes/SetItemCountFunction.md) - [`SetItemDamageFunction`](/server/classes/SetItemDamageFunction.md) - [`SetItemDataFunction`](/server/classes/SetItemDataFunction.md) - [`SetItemLoreFunction`](/server/classes/SetItemLoreFunction.md) - [`SetItemNameFunction`](/server/classes/SetItemNameFunction.md) - [`SetOminousBottleFunction`](/server/classes/SetOminousBottleFunction.md) - [`SetPotionFunction`](/server/classes/SetPotionFunction.md) - [`SetSpawnEggFunction`](/server/classes/SetSpawnEggFunction.md) - [`SetStewEffectFunction`](/server/classes/SetStewEffectFunction.md) - [`SmeltItemFunction`](/server/classes/SmeltItemFunction.md) - [`SpecificEnchantFunction`](/server/classes/SpecificEnchantFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CarryOverBlockEntityDataFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CarryOverBlockEntityDataFunction.md. # Class: CarryOverBlockEntityDataFunction entity block **`Beta`** 战利品物品函数,会尝试将被破坏方块的方块实体数据复制到掉落的物品上。 Loot item function that will try to copy the block entity data from the destroyed block to the dropped item. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### dynamicProperties > `readonly` **dynamicProperties**: `boolean` **`Beta`** #### Remarks 如果为 `true`,并且方块实体具有 `dynamic_properties`,则该函数会将动态属性从方块实体复制到掉落的物品上。 If true, and if the block entity had dynamic\_properties, the function will copy the dynamic properties from the block entity to the dropped item. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityHitBlockAfterEvent](/server/classes/EntityHitBlockAfterEvent.md) - [EntityHitBlockAfterEventSignal](/server/classes/EntityHitBlockAfterEventSignal.md) - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EnchantRandomEquipmentFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EnchantRandomEquipmentFunction.md. # Class: EnchantRandomEquipmentFunction **`Beta`** 战利品物品函数,使用与原版生物生成时附魔装备相同的算法,对掉落的物品应用随机附魔。 Loot item function that applies a random enchant to the dropped item using the same algorithm used while enchanting equipment vanilla mobs spawn with. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### chance > `readonly` **chance**: `number` **`Beta`** #### Remarks 决定装备被附魔的可能性的值。 Value that determines the likelihood of equipment being enchanted. *** ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EnchantRandomlyFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EnchantRandomlyFunction.md. # Class: EnchantRandomlyFunction **`Beta`** 随机附魔掉落物品的战利品物品函数。 Loot item function that randomly enchants the dropped item. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### treasure > `readonly` **treasure**: `boolean` **`Beta`** #### Remarks 确定是否将宝藏附魔包含在随机选择的附魔中。 Determines whether or not treasure enchantments are included in the randomly chosen enchantments. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EnchantWithLevelsFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EnchantWithLevelsFunction.md. # Class: EnchantWithLevelsFunction **`Beta`** 对掉落物品应用随机附魔的战利品物品函数。 Loot item function that applies a random enchant to the dropped item. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### levels > `readonly` **levels**: `NumberRange` **`Beta`** #### Remarks 函数从中随机选择要应用的附魔等级的值范围。包含最小值和最大值。 The value range from which the function randomly chooses the level of enchantment to apply. Contains minimum and maximum values. *** ### treasure > `readonly` **treasure**: `boolean` **`Beta`** #### Remarks 确定是否将宝藏附魔包含在随机附魔选择中的值。 Value that determines whether or not treasure enchants should be included in the random enchant selection. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ExplorationMapFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ExplorationMapFunction.md. # Class: ExplorationMapFunction **`Beta`** 战利品物品函数,修改掉落的藏宝图以标记一个位置。 Loot item function that modifies a dropped treasure map to mark a location. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### destination > `readonly` **destination**: `string` **`Beta`** #### Remarks 决定将掉落哪种类型的藏宝图。 Determines which type of treasure map will drop. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ExplosionDecayFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ExplosionDecayFunction.md. # Class: ExplosionDecayFunction **`Beta`** 战利品物品函数,确定战利品掉落物是否应该被爆炸摧毁。 Loot item function that determines whether or not loot drops should be destroyed by explosions. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/FillContainerFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/FillContainerFunction.md. # Class: FillContainerFunction inventory **`Beta`** 使用另一张战利品表来填充已掉落容器物品的战利品物品函数。 Loot item function that populates a dropped container item using another loot table. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### lootTable > `readonly` **lootTable**: `string` **`Beta`** #### Remarks 用于填充该容器的战利品表路径。 The path to the loot table with which the container will be filled. ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootingEnchantFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootingEnchantFunction.md. # Class: LootingEnchantFunction **`Beta`** 如果提供的工具具有抢夺附魔,则掉落额外物品的战利品物品函数。 Loot item function that drops extra items if the provided tool has the looting enchant. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### count > `readonly` **count**: `NumberRange` **`Beta`** #### Remarks 函数从中随机选择额外物品掉落数量的数值范围。包含最小值和最大值。 The value range from which the function randomly chooses the number of extra items to drop. Contains minimum and maximum values. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/RandomAuxValueFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/RandomAuxValueFunction.md. # Class: RandomAuxValueFunction **`Beta`** 随机修改掉落物品数据值的战利品物品函数。 Loot item function that randomly modifies the data value of the item dropped. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### values > `readonly` **values**: `NumberRange` **`Beta`** #### Remarks 函数随机选择数据值的范围,包含最小值和最大值。 The value range from which the function randomly chooses the data value to assign. Contains minimum and maximum values. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/RandomBlockStateFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/RandomBlockStateFunction.md. # Class: RandomBlockStateFunction block **`Beta`** 随机修改掉落物品方块状态的战利品物品函数。 Loot item function that randomly modifies the block state of the item dropped. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### blockState > `readonly` **blockState**: `string` **`Beta`** *** ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### values > `readonly` **values**: `NumberRange` **`Beta`** #### Remarks 函数随机选择给定方块状态值的范围,包含最小值和最大值。 The range from which the function randomly chooses the value to assign to the given block state. Contains minimum and maximum values. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/RandomDyeFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/RandomDyeFunction.md. # Class: RandomDyeFunction **`Beta`** 对掉落物品应用随机染色的战利品物品函数。 Loot item function that applies a randomly dye to the dropped item. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetArmorTrimFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetArmorTrimFunction.md. # Class: SetArmorTrimFunction **`Beta`** 修改掉落盔甲物品的纹饰的战利品物品函数。 Loot item function that modifies the trim on a dropped armor item. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### material > `readonly` **material**: `string` **`Beta`** #### Remarks 应用于盔甲纹饰的材料。 The material to apply to the armor trim. *** ### pattern > `readonly` **pattern**: `string` **`Beta`** #### Remarks 应用于盔甲纹饰的图案。 The pattern to apply to the armor trim. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetBannerDetailsFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetBannerDetailsFunction.md. # Class: SetBannerDetailsFunction **`Beta`** 修改掉落旗帜类型的战利品物品函数。 Loot item function that modifies the type of a banner that drops. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### baseColor 实验性 > `readonly` **baseColor**: `string` **`Beta`** #### Remarks 掉落旗帜的底色。 The base color for the dropped banner. *** ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### patterns 实验性 > `readonly` **patterns**: [`BannerPattern`](/server/classes/BannerPattern.md)\[] **`Beta`** #### Remarks 用于装饰旗帜的 [BannerPattern](/server/classes/BannerPattern.md) 对象数组,包括颜色和图案类型。 An array of [BannerPattern](/server/classes/BannerPattern.md) objects used to decorate the banner, including color and pattern type. *** ### type > `readonly` **type**: `number` **`Beta`** #### Remarks 掉落的旗帜类型。 The type of banner to drop. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetBookContentsFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetBookContentsFunction.md. # Class: SetBookContentsFunction **`Beta`** 修改掉落书本内容的战利品物品函数。 Loot item function that modifies the contents of a dropped book. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### author > `readonly` **author**: `string` **`Beta`** #### Remarks 书本作者的名称。 The name of the book's author. *** ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### pages > `readonly` **pages**: `string`\[] **`Beta`** #### Remarks 放置在书本页面中的文本数组。 An array of text to be placed in the pages of the book. *** ### title > `readonly` **title**: `string` **`Beta`** #### Remarks 书本的标题。 The book's title. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetDataFromColorIndexFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetDataFromColorIndexFunction.md. # Class: SetDataFromColorIndexFunction **`Beta`** 根据颜色索引修改掉落物品数据值的战利品物品函数。如果未设置颜色索引,则默认为零。 Loot item function that modifies the dropped item's data value based on its color index. Defaults to zero if no color index is set. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetItemCountFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetItemCountFunction.md. # Class: SetItemCountFunction **`Beta`** 修改战利品池条目掉落物品数量的战利品物品函数。 Loot item function that modifies the number items that drop from the loot pool entry. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### count > `readonly` **count**: `NumberRange` **`Beta`** #### Remarks 函数随机选择掉落物品数量的范围,包含最小值和最大值。 The value range from which the function randomly chooses the number of items to drop. Contains minimum and maximum values. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetItemDamageFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetItemDamageFunction.md. # Class: SetItemDamageFunction damage **`Beta`** 修改掉落物品耐久度值的战利品物品函数。 Loot item function that modifies the durability value of the item dropped. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### damage > `readonly` **damage**: `NumberRange` **`Beta`** #### Remarks 函数随机选择耐久度值的范围,包含最小值和最大值。必须始终介于 0.0 和 1.0 之间。 The value range from which the function randomly chooses the durability value to assign. Contains minimum and maximum values. Must always be between 0.0 and 1.0. ## 同领域相关 - [EntityApplyDamageByProjectileOptions](/server/interfaces/EntityApplyDamageByProjectileOptions.md) - [EntityApplyDamageOptions](/server/interfaces/EntityApplyDamageOptions.md) - [EntityDamageCause](/server/enums/EntityDamageCause.md) - [EntityDamageSource](/server/interfaces/EntityDamageSource.md) - [EntityHealthChangedAfterEvent](/server/classes/EntityHealthChangedAfterEvent.md) - [EntityHealthChangedAfterEventSignal](/server/classes/EntityHealthChangedAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetItemDataFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetItemDataFunction.md. # Class: SetItemDataFunction **`Beta`** 修改掉落物品数据值的战利品物品函数。 Loot item function that modifies the data value of the item dropped. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### data > `readonly` **data**: `NumberRange` **`Beta`** #### Remarks 函数随机选择数据值的范围,包含最小值和最大值。 The value range from which the function randomly chooses the data value to assign. Contains minimum and maximum values. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetItemLoreFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetItemLoreFunction.md. # Class: SetItemLoreFunction **`Beta`** 修改掉落物品 lore 的战利品物品函数。 Loot item function that modifies the lore of the item dropped. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### lore > `readonly` **lore**: `string`\[] **`Beta`** #### Remarks 应用于掉落物品的 lore。 The lore to apply to the dropped item. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetItemNameFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetItemNameFunction.md. # Class: SetItemNameFunction **`Beta`** 修改掉落物品名称的战利品物品函数。 Loot item function that modifies the name of the item dropped. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### name > `readonly` **name**: `string` **`Beta`** #### Remarks 应用于掉落物品的名称。 The name to apply to the dropped item. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetOminousBottleFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetOminousBottleFunction.md. # Class: SetOminousBottleFunction **`Beta`** 修改不祥之瓶增幅值(amplifier)的战利品物品函数。 Loot item function that modifies an ominous bottle's amplifier value. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### amplifier > `readonly` **amplifier**: `NumberRange` **`Beta`** #### Remarks 函数随机选择增幅值(amplifier)的范围,包含最小值和最大值。 The value range from which the function randomly chooses the amplifier value to assign. Contains minimum and maximum values. *** ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetPotionFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetPotionFunction.md. # Class: SetPotionFunction **`Beta`** 为掉落药水分配类型的战利品物品函数。 Loot item function that assigns a type to a dropped potion. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 分配给掉落药水的 id。 The id to be assigned to the dropped potion. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetSpawnEggFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetSpawnEggFunction.md. # Class: SetSpawnEggFunction **`Beta`** 为掉落的刷怪蛋分配实体类型的战利品物品函数。不适用于除刷怪蛋外的任何物品。 Loot item function that assigns an entity type to a dropped spawn egg. Does not work on any items other than spawn eggs. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 分配给掉落刷怪蛋的实体。 The entity to be assigned to the dropped egg. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SetStewEffectFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SetStewEffectFunction.md. # Class: SetStewEffectFunction effect **`Beta`** 修改掉落煲类物品效果的战利品物品函数。 Loot item function that modifies the effects of a dropped stew item. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### effects > `readonly` **effects**: `number`\[] **`Beta`** #### Remarks 对应于煲类效果的整数数组,将从中随机选择并应用于掉落物品。 An array of integers corresponding to stew effects to be randomly chosen from and applied to the dropped item. ## 同领域相关 - [Effect](/server/classes/Effect.md) - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent.md) - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal.md) - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent.md) - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal.md) - [EffectType](/server/classes/EffectType.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SmeltItemFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SmeltItemFunction.md. # Class: SmeltItemFunction **`Beta`** 将掉落物品视为在熔炉中冶炼或烹饪处理后的战利品物品函数。 Loot item function that processes the dropped item as if it was smelted or cooked in a furnace. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SpecificEnchantFunction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SpecificEnchantFunction.md. # Class: SpecificEnchantFunction **`Beta`** 为掉落物品应用一个或多个预定义附魔的战利品物品函数。 Loot item function that applies one or several predefined enchants to the dropped item. ## Extends - [`LootItemFunction`](/server/classes/LootItemFunction.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** #### Inherited from [`LootItemFunction`](/server/classes/LootItemFunction.md).[`conditions`](/server/classes/LootItemFunction.md#conditions) *** ### enchantments > `readonly` **enchantments**: [`EnchantInfo`](/server/classes/EnchantInfo.md)\[] **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootPoolEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootPoolEntry.md. # Class: LootPoolEntry **`Beta`** 表示战利品表中的一个条目,描述战利品掉落时的一个可能掉落物。可以包含一个物品、另一个战利品表、另一个战利品表的路径或空掉落。 Represents one entry within Loot Table, which describes one possible drop when a loot drop occurs. Can contain an item, another loot table, a path to another loot table, or an empty drop. ## Extended by - [`EmptyLootItem`](/server/classes/EmptyLootItem.md) - [`LootItem`](/server/classes/LootItem.md) - [`LootTableEntry`](/server/classes/LootTableEntry.md) - [`LootTableReference`](/server/classes/LootTableReference.md) ## Properties ### quality > `readonly` **quality**: `number` **`Beta`** #### Remarks 获取给定战利品池条目的品质。 Gets the quality of a given loot pool entry. *** ### subTable? > `readonly` `optional` **subTable?**: `LootPoolEntry` **`Beta`** #### Remarks 获取给定战利品池条目的子表。 Gets the subtable of a given loot pool entry. *** ### weight > `readonly` **weight**: `number` **`Beta`** #### Remarks 获取给定战利品池条目的权重。 Gets the weight of a given loot pool entry. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EmptyLootItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EmptyLootItem.md. # Class: EmptyLootItem **`Beta`** 表示战利品池中的一个完全空的条目。如果选择此条目,则不会掉落任何物品。 Represents a completely empty entry in a loot pool. If this entry is chosen, no items will drop. ## Extends - [`LootPoolEntry`](/server/classes/LootPoolEntry.md) ## Properties ### quality > `readonly` **quality**: `number` **`Beta`** #### Remarks 获取给定战利品池条目的品质。 Gets the quality of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`quality`](/server/classes/LootPoolEntry.md#quality) *** ### subTable? > `readonly` `optional` **subTable?**: [`LootPoolEntry`](/server/classes/LootPoolEntry.md) **`Beta`** #### Remarks 获取给定战利品池条目的子表。 Gets the subtable of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`subTable`](/server/classes/LootPoolEntry.md#subtable) *** ### weight > `readonly` **weight**: `number` **`Beta`** #### Remarks 获取给定战利品池条目的权重。 Gets the weight of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`weight`](/server/classes/LootPoolEntry.md#weight) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootItem.md. # Class: LootItem **`Beta`** 表示包含要掉落物品的战利品池条目。 Represents a loot pool entry containing an item to drop. ## Extends - [`LootPoolEntry`](/server/classes/LootPoolEntry.md) ## Properties ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** *** ### functions > `readonly` **functions**: [`LootItemFunction`](/server/classes/LootItemFunction.md)\[] **`Beta`** *** ### name? > `readonly` `optional` **name?**: [`ItemType`](/server/classes/ItemType.md) **`Beta`** #### Remarks 此条目中包含的物品名称。 The name of the item contained in this entry. *** ### quality > `readonly` **quality**: `number` **`Beta`** #### Remarks 获取给定战利品池条目的品质。 Gets the quality of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`quality`](/server/classes/LootPoolEntry.md#quality) *** ### subTable? > `readonly` `optional` **subTable?**: [`LootPoolEntry`](/server/classes/LootPoolEntry.md) **`Beta`** #### Remarks 获取给定战利品池条目的子表。 Gets the subtable of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`subTable`](/server/classes/LootPoolEntry.md#subtable) *** ### weight > `readonly` **weight**: `number` **`Beta`** #### Remarks 获取给定战利品池条目的权重。 Gets the weight of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`weight`](/server/classes/LootPoolEntry.md#weight) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootTableEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootTableEntry.md. # Class: LootTableEntry **`Beta`** 表示包含另一个独立的嵌套战利品表的战利品池条目。 Represents a loot pool entry containing another separate, nested loot table. ## Extends - [`LootPoolEntry`](/server/classes/LootPoolEntry.md) ## Properties ### lootTable > `readonly` **lootTable**: [`LootTable`](/server/classes/LootTable.md) **`Beta`** #### Remarks 获取存储为父战利品池中子表的战利品表。 Gets the loot table stored as a subtable in the parent loot pool. *** ### quality > `readonly` **quality**: `number` **`Beta`** #### Remarks 获取给定战利品池条目的品质。 Gets the quality of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`quality`](/server/classes/LootPoolEntry.md#quality) *** ### subTable? > `readonly` `optional` **subTable?**: [`LootPoolEntry`](/server/classes/LootPoolEntry.md) **`Beta`** #### Remarks 获取给定战利品池条目的子表。 Gets the subtable of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`subTable`](/server/classes/LootPoolEntry.md#subtable) *** ### weight > `readonly` **weight**: `number` **`Beta`** #### Remarks 获取给定战利品池条目的权重。 Gets the weight of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`weight`](/server/classes/LootPoolEntry.md#weight) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootTableReference.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootTableReference.md. # Class: LootTableReference **`Beta`** 表示包含对另一个战利品表(由其路径描述)的引用的战利品池条目。 Represents a loot pool entry containing a reference to another loot table, described by its path. ## Extends - [`LootPoolEntry`](/server/classes/LootPoolEntry.md) ## Properties ### path > `readonly` **path**: `string` **`Beta`** #### Remarks 引用的战利品表的路径。示例:`loot_tables/chests/village/village_bundle.json` The path to the referenced loot table. Example: `loot_tables/chests/village/village_bundle.json` *** ### quality > `readonly` **quality**: `number` **`Beta`** #### Remarks 获取给定战利品池条目的品质。 Gets the quality of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`quality`](/server/classes/LootPoolEntry.md#quality) *** ### subTable? > `readonly` `optional` **subTable?**: [`LootPoolEntry`](/server/classes/LootPoolEntry.md) **`Beta`** #### Remarks 获取给定战利品池条目的子表。 Gets the subtable of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`subTable`](/server/classes/LootPoolEntry.md#subtable) *** ### weight > `readonly` **weight**: `number` **`Beta`** #### Remarks 获取给定战利品池条目的权重。 Gets the weight of a given loot pool entry. #### Inherited from [`LootPoolEntry`](/server/classes/LootPoolEntry.md).[`weight`](/server/classes/LootPoolEntry.md#weight) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PrimitiveShape.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PrimitiveShape.md. # Class: PrimitiveShape **`Beta`** 文本图元的基础类。表示世界中的一个对象及其基本属性。 The base class for a text primitive. Represents an object in the world and its base properties. ## Extended by - [`TextPrimitive`](/server/classes/TextPrimitive.md) ## Properties ### attachedTo? > `optional` **attachedTo?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 此形状所依附的实体。设置时,此形状将复制所依附实体的根位置,并且形状的位置将用作偏移量。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. *** ### color > **color**: [`RGBA`](/server/interfaces/RGBA.md) **`Beta`** #### Remarks 形状的颜色。 The color of the shape. *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 形状可见的维度。如果维度为 `undefined`,则将在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 返回形状是否具有有限的自动移除时间。 Returns true if the shape has a limited time span before being removed. *** ### location > `readonly` **location**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 形状的位置。 The location of the shape. *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定为每个客户端渲染此图元的远近。默认情况下,距离将匹配客户端的渲染距离设置。 If defined, this distance will be used to determine how far away this primitive will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 *** ### rotation > **rotation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 形状的旋转角度(欧拉角 —— \[Pitch, Yaw, Roll])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。 The scale of the shape. Bounds: \[-1000, 1000] *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 距离此形状自动移除的剩余时间(以秒为单位)。如果形状没有有限的生存期,则返回 `undefined`。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 距离此形状自动移除的总初始时间(以秒为单位)。如果形状没有有限的生存期,则返回 `undefined`。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. *** ### visibleTo > **visibleTo**: [`Player`](/server/classes/Player.md)\[] **`Beta`** #### Remarks 此形状对其可见的玩家列表。如果留空,形状将对所有玩家可见。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 PrimitiveShapesManager 的 addText 方法重新添加该形状。 Removes this shape from the world. The shape can be re-added via the PrimitiveShapesManager's addText method. *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) | [`DimensionLocation`](/server/interfaces/DimensionLocation.md) #### Returns `void` #### Remarks 设置形状的位置和维度。如果维度为 `undefined`,则将在所有维度中显示。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/TextPrimitive.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/TextPrimitive.md. # Class: TextPrimitive **`Beta`** A primitive shape class that represents a text label in the world with a background. ## Extends - [`PrimitiveShape`](/server/classes/PrimitiveShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new TextPrimitive**(`location`, `text`): `TextPrimitive` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) | [`DimensionLocation`](/server/interfaces/DimensionLocation.md) ##### text `string` | [`RawMessage`](/server/interfaces/RawMessage.md) #### Returns `TextPrimitive` #### Overrides `PrimitiveShape.constructor` ## Properties ### attachedTo? > `optional` **attachedTo?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 此形状所依附的实体。设置时,此形状将复制所依附实体的根位置,并且形状的位置将用作偏移量。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`attachedTo`](/server/classes/PrimitiveShape.md#attachedto) *** ### backfaceVisible > **backfaceVisible**: `boolean` **`Beta`** #### Remarks If set to true, the text primitive will render the back-face of the background. Defaults to true but will always be false if 'useRotation' is set to false. *** ### backgroundColorOverride? > `optional` **backgroundColorOverride?**: [`RGBA`](/server/interfaces/RGBA.md) **`Beta`** #### Remarks The color of the background plate of the text. If set to undefined, it will use the default color. *** ### color > **color**: [`RGBA`](/server/interfaces/RGBA.md) **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`color`](/server/classes/PrimitiveShape.md#color) *** ### depthTest > **depthTest**: `boolean` **`Beta`** #### Remarks If set to true, the text will be hidden behind blocks or entities. By default this is set to false (will always render). *** ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 形状可见的维度。如果维度为 `undefined`,则将在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`dimension`](/server/classes/PrimitiveShape.md#dimension) *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 返回形状是否具有有限的自动移除时间。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`hasDuration`](/server/classes/PrimitiveShape.md#hasduration) *** ### lineGapHeight 实验性 > **lineGapHeight**: `number` **`Beta`** #### Remarks This value determines the gap between lines for the TextPrimitive. By default the line gap height is 0. *** ### location > `readonly` **location**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 形状的位置。 The location of the shape. #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`location`](/server/classes/PrimitiveShape.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定为每个客户端渲染此图元的远近。默认情况下,距离将匹配客户端的渲染距离设置。 If defined, this distance will be used to determine how far away this primitive will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`maximumRenderDistance`](/server/classes/PrimitiveShape.md#maximumrenderdistance) *** ### rotation > **rotation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 形状的旋转角度(欧拉角 —— \[Pitch, Yaw, Roll])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`rotation`](/server/classes/PrimitiveShape.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。 The scale of the shape. Bounds: \[-1000, 1000] #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`scale`](/server/classes/PrimitiveShape.md#scale) *** ### text > `readonly` **text**: `string` | [`RawMessage`](/server/interfaces/RawMessage.md) **`Beta`** #### Remarks Get the text of the debug text shape. Returns the RawText of the debug text if `setText` was called with a RawMessage or a RawText object, otherwise returns a string. *** ### textBackfaceVisible > **textBackfaceVisible**: `boolean` **`Beta`** #### Remarks If set to true, the text primitive will render the back-face of the text. Defaults to true but will always be false if 'useRotation' is set to false. *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 距离此形状自动移除的剩余时间(以秒为单位)。如果形状没有有限的生存期,则返回 `undefined`。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`timeLeft`](/server/classes/PrimitiveShape.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 距离此形状自动移除的总初始时间(以秒为单位)。如果形状没有有限的生存期,则返回 `undefined`。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`totalTimeLeft`](/server/classes/PrimitiveShape.md#totaltimeleft) *** ### useRotation > **useRotation**: `boolean` **`Beta`** #### Remarks If set to true, the text will not face the camera and instead will use the rotation from the shape. *** ### visibleTo > **visibleTo**: [`Player`](/server/classes/Player.md)\[] **`Beta`** #### Remarks 此形状对其可见的玩家列表。如果留空,形状将对所有玩家可见。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`visibleTo`](/server/classes/PrimitiveShape.md#visibleto) ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 PrimitiveShapesManager 的 addText 方法重新添加该形状。 Removes this shape from the world. The shape can be re-added via the PrimitiveShapesManager's addText method. #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`remove`](/server/classes/PrimitiveShape.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) | [`DimensionLocation`](/server/interfaces/DimensionLocation.md) #### Returns `void` #### Remarks 设置形状的位置和维度。如果维度为 `undefined`,则将在所有维度中显示。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`PrimitiveShape`](/server/classes/PrimitiveShape.md).[`setLocation`](/server/classes/PrimitiveShape.md#setlocation) *** ### setText() > **setText**(`text`): `void` **`Beta`** #### Parameters ##### text `string` | [`RawMessage`](/server/interfaces/RawMessage.md) #### Returns `void` #### Remarks Sets the text to display. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [RawMessageError](/server/classes/RawMessageError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SystemInfo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SystemInfo.md. # Class: SystemInfo **`Beta`** 包含设备信息,如内存层级。 Contains device information, like memory tier. ## Extended by - [`ClientSystemInfo`](/server/classes/ClientSystemInfo.md) ## Properties ### memoryTier > `readonly` **memoryTier**: [`MemoryTier`](/server/enums/MemoryTier.md) **`Beta`** #### Remarks 描述设备的内存。 Describes the memory of the device. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ClientSystemInfo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ClientSystemInfo.md. # Class: ClientSystemInfo **`Beta`** 包含客户端实例的设备信息。 Contains the device information for a client instance. ## Extends - [`SystemInfo`](/server/classes/SystemInfo.md) ## Properties ### locale > `readonly` **locale**: `string` **`Beta`** #### Remarks 客户端选择的区域设置(例如,`en_US`、`fr_FR`、`ja_JP`)。请注意,在大多数情况下,服务端脚本不应使用此属性来手动本地化文本。相反,应使用带有 translate 字段的 [RawMessage](/server/interfaces/RawMessage.md) 来发送本地化键,让每个客户端自动以其自己的语言解析。直接使用区域设置进行本地化是不稳定的,并且当同一服务器上的玩家使用不同语言时可能会产生意外结果。 The locale selected by the client (e.g., en\_US, fr\_FR, ja\_JP). Note that in most cases, server scripts should not use this property to manually localize text. Instead, use [RawMessage](/server/interfaces/RawMessage.md) with a translate field to send localization keys, allowing each client to resolve them in their own language automatically. Direct use of locale for localization is fragile and may produce unexpected results when players with different languages are on the same server. *** ### maxRenderDistance > `readonly` **maxRenderDistance**: `number` **`Beta`** #### Remarks 设备的最大渲染距离(以区块为单位)。 The max render distance for the device in chunks. *** ### memoryTier > `readonly` **memoryTier**: [`MemoryTier`](/server/enums/MemoryTier.md) **`Beta`** #### Remarks 描述设备的内存。 Describes the memory of the device. #### Inherited from [`SystemInfo`](/server/classes/SystemInfo.md).[`memoryTier`](/server/classes/SystemInfo.md#memorytier) *** ### platformType > `readonly` **platformType**: [`PlatformType`](/server/enums/PlatformType.md) **`Beta`** #### Remarks 设备的平台类型。 The platform type of the device. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Waypoint.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Waypoint.md. # Class: Waypoint **`Beta`** Base class for waypoints displayed on the player's locator bar. Waypoints can track locations or entities and are rendered with customizable textures and colors. 显示在玩家定位栏上的路径点的基类。路径点可以跟踪位置或实体,并使用可自定义的纹理和颜色进行渲染。 Waypoints act as shared handles that can be added to multiple players' locator bars. When you modify a waypoint's properties (such as color, texture, or enabled state), the changes are reflected for all players who have that waypoint in their locator bar. This allows you to efficiently manage waypoints across multiple players without creating separate instances for each player. 路径点作为共享句柄,可以添加到多个玩家的定位栏中。当你修改路径点的属性(如颜色、纹理或启用状态)时,所有在其定位栏中拥有该路径点的玩家都会看到这些更改。这使得你可以高效地跨多个玩家管理路径点,而无需为每个玩家创建单独的实例。 ## Extended by - [`EntityWaypoint`](/server/classes/EntityWaypoint.md) - [`LocationWaypoint`](/server/classes/LocationWaypoint.md) ## Properties ### color? > `optional` **color?**: [`RGB`](/server/interfaces/RGB.md) **`World Mutation`** **`Beta`** #### Remarks Optional [RGB](/server/interfaces/RGB.md) color tint applied to the waypoint icon. If not specified, the waypoint uses its default color. 应用于路径点图标的可选 [RGB](/server/interfaces/RGB.md) 颜色色调。如果未指定,路径点将使用其默认颜色。 *** ### isEnabled > **isEnabled**: `boolean` **`World Mutation`** **`Beta`** #### Remarks Controls whether the waypoint is currently displayed on the player's screen. When disabled, the waypoint is hidden but remains valid. 控制路径点当前是否显示在玩家的屏幕上。禁用时,路径点会被隐藏但仍保持有效。 *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks Returns whether the waypoint is currently valid. A waypoint becomes invalid when its tracked entity is no longer valid. 返回路径点当前是否有效。当路径点跟踪的实体不再有效时,路径点将变为无效。 *** ### textureSelector > **textureSelector**: [`WaypointTextureSelector`](/server/interfaces/WaypointTextureSelector.md) **`World Mutation`** **`Beta`** #### Remarks The [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md) that determines which icon texture is displayed for the waypoint based on distance or other criteria. 根据距离或其他条件确定路径点显示哪种图标纹理的 [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md)。 ## Methods ### getDimensionLocation() > **getDimensionLocation**(): [`DimensionLocation`](/server/interfaces/DimensionLocation.md) **`World Mutation`** **`Beta`** #### Returns [`DimensionLocation`](/server/interfaces/DimensionLocation.md) #### Remarks Gets the current [DimensionLocation](/server/interfaces/DimensionLocation.md) of the waypoint. For entity waypoints, this returns the entity's current position. For location waypoints, this returns the stored location. 获取路径点的当前 [DimensionLocation](/server/interfaces/DimensionLocation.md)。对于实体路径点,返回实体的当前位置。对于位置路径点,返回存储的位置。 #### Throws This function can throw errors. [InvalidWaypointError](/server/classes/InvalidWaypointError.md) [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) *** ### remove() > **remove**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Removes the waypoint from all locator bars it has been added to. This affects all players who have this waypoint in their locator bar. 从所有已添加的定位栏中移除该路径点。这会影响所有在其定位栏中拥有此路径点的玩家。 [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityWaypoint.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityWaypoint.md. # Class: EntityWaypoint entity **`Beta`** Waypoint that tracks an entity's position. The waypoint automatically updates as the entity moves and becomes invalid when the entity is removed. ## Extends - [`Waypoint`](/server/classes/Waypoint.md) ## Extended by - [`PlayerWaypoint`](/server/classes/PlayerWaypoint.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new EntityWaypoint**(`entity`, `textureSelector`, `entityRules`, `color?`): `EntityWaypoint` **`Beta`** #### Parameters ##### entity [`Entity`](/server/classes/Entity.md) ##### textureSelector [`WaypointTextureSelector`](/server/interfaces/WaypointTextureSelector.md) ##### entityRules [`EntityVisibilityRules`](/server/interfaces/EntityVisibilityRules.md) ##### color? [`RGB`](/server/interfaces/RGB.md) #### Returns `EntityWaypoint` #### Throws This function can throw errors. [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) #### Overrides `Waypoint.constructor` ## Properties ### color? > `optional` **color?**: [`RGB`](/server/interfaces/RGB.md) **`World Mutation`** **`Beta`** #### Remarks Optional [RGB](/server/interfaces/RGB.md) color tint applied to the waypoint icon. If not specified, the waypoint uses its default color. 应用于路径点图标的可选 [RGB](/server/interfaces/RGB.md) 颜色色调。如果未指定,路径点将使用其默认颜色。 #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`color`](/server/classes/Waypoint.md#color) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks The entity being tracked by this waypoint. #### Throws This property can throw when used. [InvalidWaypointError](/server/classes/InvalidWaypointError.md) [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) *** ### entityRules > `readonly` **entityRules**: [`EntityVisibilityRules`](/server/interfaces/EntityVisibilityRules.md) **`Beta`** #### Remarks The visibility rules that control when the waypoint is shown based on the entity's state (e.g., sneaking, invisible, dead). #### Throws This property can throw when used. [InvalidWaypointError](/server/classes/InvalidWaypointError.md) [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) *** ### isEnabled > **isEnabled**: `boolean` **`World Mutation`** **`Beta`** #### Remarks Controls whether the waypoint is currently displayed on the player's screen. When disabled, the waypoint is hidden but remains valid. 控制路径点当前是否显示在玩家的屏幕上。禁用时,路径点会被隐藏但仍保持有效。 #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`isEnabled`](/server/classes/Waypoint.md#isenabled) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks Returns whether the waypoint is currently valid. A waypoint becomes invalid when its tracked entity is no longer valid. 返回路径点当前是否有效。当路径点跟踪的实体不再有效时,路径点将变为无效。 #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`isValid`](/server/classes/Waypoint.md#isvalid) *** ### textureSelector > **textureSelector**: [`WaypointTextureSelector`](/server/interfaces/WaypointTextureSelector.md) **`World Mutation`** **`Beta`** #### Remarks The [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md) that determines which icon texture is displayed for the waypoint based on distance or other criteria. 根据距离或其他条件确定路径点显示哪种图标纹理的 [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md)。 #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`textureSelector`](/server/classes/Waypoint.md#textureselector) ## Methods ### getDimensionLocation() > **getDimensionLocation**(): [`DimensionLocation`](/server/interfaces/DimensionLocation.md) **`World Mutation`** **`Beta`** #### Returns [`DimensionLocation`](/server/interfaces/DimensionLocation.md) #### Remarks Gets the current [DimensionLocation](/server/interfaces/DimensionLocation.md) of the waypoint. For entity waypoints, this returns the entity's current position. For location waypoints, this returns the stored location. 获取路径点的当前 [DimensionLocation](/server/interfaces/DimensionLocation.md)。对于实体路径点,返回实体的当前位置。对于位置路径点,返回存储的位置。 #### Throws This function can throw errors. [InvalidWaypointError](/server/classes/InvalidWaypointError.md) [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`getDimensionLocation`](/server/classes/Waypoint.md#getdimensionlocation) *** ### remove() > **remove**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Removes the waypoint from all locator bars it has been added to. This affects all players who have this waypoint in their locator bar. 从所有已添加的定位栏中移除该路径点。这会影响所有在其定位栏中拥有此路径点的玩家。 #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`remove`](/server/classes/Waypoint.md#remove) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerWaypoint.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerWaypoint.md. # Class: PlayerWaypoint player **`Beta`** 跟踪玩家位置的导航点。扩展 [EntityWaypoint](/server/classes/EntityWaypoint.md),增加了特定于玩家的可见性规则,如隐藏状态和旁观者模式。 Waypoint that tracks a player's position. Extends [EntityWaypoint](/server/classes/EntityWaypoint.md) with additional player-specific visibility rules such as hidden state and spectator mode. ## Extends - [`EntityWaypoint`](/server/classes/EntityWaypoint.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new PlayerWaypoint**(`player`, `textureSelector`, `playerRules`, `color?`): `PlayerWaypoint` **`Beta`** #### Parameters ##### player [`Player`](/server/classes/Player.md) ##### textureSelector [`WaypointTextureSelector`](/server/interfaces/WaypointTextureSelector.md) ##### playerRules [`PlayerVisibilityRules`](/server/interfaces/PlayerVisibilityRules.md) ##### color? [`RGB`](/server/interfaces/RGB.md) #### Returns `PlayerWaypoint` #### Throws This function can throw errors. [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) #### Overrides [`EntityWaypoint`](/server/classes/EntityWaypoint.md).[`constructor`](/server/classes/EntityWaypoint.md#constructor) ## Properties ### color? > `optional` **color?**: [`RGB`](/server/interfaces/RGB.md) **`World Mutation`** **`Beta`** #### Remarks Optional [RGB](/server/interfaces/RGB.md) color tint applied to the waypoint icon. If not specified, the waypoint uses its default color. 应用于路径点图标的可选 [RGB](/server/interfaces/RGB.md) 颜色色调。如果未指定,路径点将使用其默认颜色。 #### Inherited from [`EntityWaypoint`](/server/classes/EntityWaypoint.md).[`color`](/server/classes/EntityWaypoint.md#color) *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks The entity being tracked by this waypoint. #### Throws This property can throw when used. [InvalidWaypointError](/server/classes/InvalidWaypointError.md) [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) #### Inherited from [`EntityWaypoint`](/server/classes/EntityWaypoint.md).[`entity`](/server/classes/EntityWaypoint.md#entity) *** ### entityRules > `readonly` **entityRules**: [`EntityVisibilityRules`](/server/interfaces/EntityVisibilityRules.md) **`Beta`** #### Remarks The visibility rules that control when the waypoint is shown based on the entity's state (e.g., sneaking, invisible, dead). #### Throws This property can throw when used. [InvalidWaypointError](/server/classes/InvalidWaypointError.md) [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) #### Inherited from [`EntityWaypoint`](/server/classes/EntityWaypoint.md).[`entityRules`](/server/classes/EntityWaypoint.md#entityrules) *** ### isEnabled > **isEnabled**: `boolean` **`World Mutation`** **`Beta`** #### Remarks Controls whether the waypoint is currently displayed on the player's screen. When disabled, the waypoint is hidden but remains valid. 控制路径点当前是否显示在玩家的屏幕上。禁用时,路径点会被隐藏但仍保持有效。 #### Inherited from [`EntityWaypoint`](/server/classes/EntityWaypoint.md).[`isEnabled`](/server/classes/EntityWaypoint.md#isenabled) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks Returns whether the waypoint is currently valid. A waypoint becomes invalid when its tracked entity is no longer valid. 返回路径点当前是否有效。当路径点跟踪的实体不再有效时,路径点将变为无效。 #### Inherited from [`EntityWaypoint`](/server/classes/EntityWaypoint.md).[`isValid`](/server/classes/EntityWaypoint.md#isvalid) *** ### playerRules > `readonly` **playerRules**: [`PlayerVisibilityRules`](/server/interfaces/PlayerVisibilityRules.md) **`Beta`** #### Remarks 控制导航点何时基于玩家状态显示的 [PlayerVisibilityRules](/server/interfaces/PlayerVisibilityRules.md)(例如隐藏、旁观者模式、旁观者查看其他旁观者)。 The [PlayerVisibilityRules](/server/interfaces/PlayerVisibilityRules.md) that control when the waypoint is shown based on the player's state (e.g., hidden, spectator mode, spectator viewing another spectator). #### Throws This property can throw when used. [InvalidWaypointError](/server/classes/InvalidWaypointError.md) [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) *** ### textureSelector > **textureSelector**: [`WaypointTextureSelector`](/server/interfaces/WaypointTextureSelector.md) **`World Mutation`** **`Beta`** #### Remarks The [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md) that determines which icon texture is displayed for the waypoint based on distance or other criteria. 根据距离或其他条件确定路径点显示哪种图标纹理的 [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md)。 #### Inherited from [`EntityWaypoint`](/server/classes/EntityWaypoint.md).[`textureSelector`](/server/classes/EntityWaypoint.md#textureselector) ## Methods ### getDimensionLocation() > **getDimensionLocation**(): [`DimensionLocation`](/server/interfaces/DimensionLocation.md) **`World Mutation`** **`Beta`** #### Returns [`DimensionLocation`](/server/interfaces/DimensionLocation.md) #### Remarks Gets the current [DimensionLocation](/server/interfaces/DimensionLocation.md) of the waypoint. For entity waypoints, this returns the entity's current position. For location waypoints, this returns the stored location. 获取路径点的当前 [DimensionLocation](/server/interfaces/DimensionLocation.md)。对于实体路径点,返回实体的当前位置。对于位置路径点,返回存储的位置。 #### Throws This function can throw errors. [InvalidWaypointError](/server/classes/InvalidWaypointError.md) [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) #### Inherited from [`EntityWaypoint`](/server/classes/EntityWaypoint.md).[`getDimensionLocation`](/server/classes/EntityWaypoint.md#getdimensionlocation) *** ### remove() > **remove**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Removes the waypoint from all locator bars it has been added to. This affects all players who have this waypoint in their locator bar. 从所有已添加的定位栏中移除该路径点。这会影响所有在其定位栏中拥有此路径点的玩家。 #### Inherited from [`EntityWaypoint`](/server/classes/EntityWaypoint.md).[`remove`](/server/classes/EntityWaypoint.md#remove) ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LocationWaypoint.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LocationWaypoint.md. # Class: LocationWaypoint **`Beta`** 指向世界中固定位置的路径点。与实体路径点不同,位置路径点始终保持有效,并且其位置可以更新。 Waypoint that points to a fixed location in the world. Unlike entity waypoints, location waypoints always remain valid and their position can be updated. ## Extends - [`Waypoint`](/server/classes/Waypoint.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new LocationWaypoint**(`dimensionLocation`, `textureSelector`, `color?`): `LocationWaypoint` **`Beta`** #### Parameters ##### dimensionLocation [`DimensionLocation`](/server/interfaces/DimensionLocation.md) ##### textureSelector [`WaypointTextureSelector`](/server/interfaces/WaypointTextureSelector.md) ##### color? [`RGB`](/server/interfaces/RGB.md) #### Returns `LocationWaypoint` #### Throws This function can throw errors. [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) #### Overrides `Waypoint.constructor` ## Properties ### color? > `optional` **color?**: [`RGB`](/server/interfaces/RGB.md) **`World Mutation`** **`Beta`** #### Remarks Optional [RGB](/server/interfaces/RGB.md) color tint applied to the waypoint icon. If not specified, the waypoint uses its default color. 应用于路径点图标的可选 [RGB](/server/interfaces/RGB.md) 颜色色调。如果未指定,路径点将使用其默认颜色。 #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`color`](/server/classes/Waypoint.md#color) *** ### isEnabled > **isEnabled**: `boolean` **`World Mutation`** **`Beta`** #### Remarks Controls whether the waypoint is currently displayed on the player's screen. When disabled, the waypoint is hidden but remains valid. 控制路径点当前是否显示在玩家的屏幕上。禁用时,路径点会被隐藏但仍保持有效。 #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`isEnabled`](/server/classes/Waypoint.md#isenabled) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks Returns whether the waypoint is currently valid. A waypoint becomes invalid when its tracked entity is no longer valid. 返回路径点当前是否有效。当路径点跟踪的实体不再有效时,路径点将变为无效。 #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`isValid`](/server/classes/Waypoint.md#isvalid) *** ### textureSelector > **textureSelector**: [`WaypointTextureSelector`](/server/interfaces/WaypointTextureSelector.md) **`World Mutation`** **`Beta`** #### Remarks The [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md) that determines which icon texture is displayed for the waypoint based on distance or other criteria. 根据距离或其他条件确定路径点显示哪种图标纹理的 [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md)。 #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`textureSelector`](/server/classes/Waypoint.md#textureselector) ## Methods ### getDimensionLocation() > **getDimensionLocation**(): [`DimensionLocation`](/server/interfaces/DimensionLocation.md) **`World Mutation`** **`Beta`** #### Returns [`DimensionLocation`](/server/interfaces/DimensionLocation.md) #### Remarks Gets the current [DimensionLocation](/server/interfaces/DimensionLocation.md) of the waypoint. For entity waypoints, this returns the entity's current position. For location waypoints, this returns the stored location. 获取路径点的当前 [DimensionLocation](/server/interfaces/DimensionLocation.md)。对于实体路径点,返回实体的当前位置。对于位置路径点,返回存储的位置。 #### Throws This function can throw errors. [InvalidWaypointError](/server/classes/InvalidWaypointError.md) [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError.md) #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`getDimensionLocation`](/server/classes/Waypoint.md#getdimensionlocation) *** ### remove() > **remove**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Removes the waypoint from all locator bars it has been added to. This affects all players who have this waypoint in their locator bar. 从所有已添加的定位栏中移除该路径点。这会影响所有在其定位栏中拥有此路径点的玩家。 #### Inherited from [`Waypoint`](/server/classes/Waypoint.md).[`remove`](/server/classes/Waypoint.md#remove) *** ### setDimensionLocation() > **setDimensionLocation**(`dimensionLocation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### dimensionLocation [`DimensionLocation`](/server/interfaces/DimensionLocation.md) 路径点的新 `DimensionLocation`(维度和坐标)。 The new [DimensionLocation](/server/interfaces/DimensionLocation.md) (dimension and coordinates) for the waypoint. #### Returns `void` #### Remarks 更新此路径点指向的维度和位置。 Updates the dimension and location that this waypoint points to. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/AimAssistCategory.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/AimAssistCategory.md. # Class: AimAssistCategory **`Beta`** 处理存在于 world.aimAssist 注册表中的瞄准辅助分类的句柄。 Handle to an aim-assist category that exists in the world.aimAssist registry. ## Properties ### defaultBlockPriority > `readonly` **defaultBlockPriority**: `number` **`Beta`** #### Remarks 用于未在 getBlockPriorities 中找到的方块类型的默认瞄准优先级。 Default targeting priority used for block types not found in getBlockPriorities. #### Throws This property can throw when used. *** ### defaultEntityPriority > `readonly` **defaultEntityPriority**: `number` **`Beta`** #### Remarks 用于未在 getEntityPriorities 中找到的实体类型的默认瞄准优先级。 Default targeting priority used for entity types not found in getEntityPriorities. #### Throws This property can throw when used. *** ### identifier > `readonly` **identifier**: `string` **`Beta`** #### Remarks 与该分类关联的唯一 ID。 The unique Id associated with the category. ## Methods ### getBlockPriorities() > **getBlockPriorities**(): `Record`\<`string`, `number`> **`Beta`** #### Returns `Record`\<`string`, `number`> 记录方块 ID 到其优先级设置的映射。数字越大,优先级越高。 The record mapping block Ids to their priority settings. Larger numbers have greater priority. #### Remarks 获取用于方块瞄准的优先级设置。 Gets the priority settings used for block targeting. #### Throws This function can throw errors. *** ### getBlockTagPriorities() > **getBlockTagPriorities**(): `Record`\<`string`, `number`> **`Beta`** #### Returns `Record`\<`string`, `number`> 记录方块标签到其优先级设置的映射。数字越大,优先级越高。 The record mapping block tags to their priority settings. Larger numbers have greater priority. #### Remarks 获取用于方块瞄准的优先级设置。 Gets the priority settings used for block targeting. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### getEntityPriorities() > **getEntityPriorities**(): `Record`\<`string`, `number`> **`Beta`** #### Returns `Record`\<`string`, `number`> 记录实体 ID 到其优先级设置的映射。数字越大,优先级越高。 The record mapping entity Ids to their priority settings. Larger numbers have greater priority. #### Remarks 获取用于实体瞄准的优先级设置。 Gets the priority settings used for entity targeting. #### Throws This function can throw errors. *** ### getEntityTypeFamilyPriorities() > **getEntityTypeFamilyPriorities**(): `Record`\<`string`, `number`> **`Beta`** #### Returns `Record`\<`string`, `number`> 将实体类型家族映射到 Record 中的优先级设置。数字越大,优先级越高。 Map entity type families to their priority settings in a Record. Larger numbers have greater priority. #### Remarks 获取用于实体瞄准的优先级设置。 Gets the priority settings used for entity targeting. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/AimAssistCategorySettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/AimAssistCategorySettings.md. # Class: AimAssistCategorySettings **`Beta`** 与 AimAssistRegistry.addCategory 一起使用的设置,用于创建 AimAssistCategory。 Settings used with AimAssistRegistry.addCategory for creation of the AimAssistCategory. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new AimAssistCategorySettings**(`identifier`): `AimAssistCategorySettings` **`Beta`** #### Parameters ##### identifier `string` #### Returns `AimAssistCategorySettings` #### Remarks 构造函数,接受一个唯一 ID 来与创建的 AimAssistCategory 关联。必须具有命名空间。 Constructor that takes a unique Id to associate with the created AimAssistCategory. Must have a namespace. ## Properties ### defaultBlockPriority > **defaultBlockPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks 可选。用于未提供给 setBlockPriorities 的方块类型的默认瞄准优先级。 Optional. Default targeting priority used for block types not provided to setBlockPriorities. *** ### defaultEntityPriority > **defaultEntityPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks 可选。用于未提供给 setEntityPriorities 的实体类型的默认瞄准优先级。 Optional. Default targeting priority used for entity types not provided to setEntityPriorities. *** ### identifier > `readonly` **identifier**: `string` **`Beta`** #### Remarks 用于注册分类的唯一 ID。必须具有命名空间。 The unique Id used to register the category with. Must have a namespace. ## Methods ### getBlockPriorities() > **getBlockPriorities**(): `Record`\<`string`, `number`> **`Beta`** #### Returns `Record`\<`string`, `number`> 记录方块 ID 到其优先级设置的映射。数字越大,优先级越高。 The record mapping block Ids to their priority settings. Larger numbers have greater priority. #### Remarks 获取用于方块瞄准的优先级设置。 Gets the priority settings used for block targeting. *** ### getBlockTagPriorities() > **getBlockTagPriorities**(): `Record`\<`string`, `number`> **`Beta`** #### Returns `Record`\<`string`, `number`> 记录方块标签到其优先级设置的映射。数字越大,优先级越高。 The record mapping block tags to their priority settings. Larger numbers have greater priority. #### Remarks 获取用于方块瞄准的优先级设置。 Gets the priority settings used for block targeting. *** ### getEntityPriorities() > **getEntityPriorities**(): `Record`\<`string`, `number`> **`Beta`** #### Returns `Record`\<`string`, `number`> 记录实体 ID 到其优先级设置的映射。数字越大,优先级越高。 The record mapping entity Ids to their priority settings. Larger numbers have greater priority. #### Remarks 获取用于实体瞄准的优先级设置。 Gets the priority settings used for entity targeting. *** ### getEntityTypeFamilyPriorities() > **getEntityTypeFamilyPriorities**(): `Record`\<`string`, `number`> **`Beta`** #### Returns `Record`\<`string`, `number`> 将实体类型家族映射到 Record 中的优先级设置。数字越大,优先级越高。 Map entity type families to their priority settings in a Record. Larger numbers have greater priority. #### Remarks 获取用于实体瞄准的优先级设置。 Gets the priority settings used for entity targeting. *** ### setBlockPriorities() > **setBlockPriorities**(`blockPriorities`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockPriorities `Record`\ 将方块 ID 映射到其优先级设置的记录。数字越大,优先级越高。 A record mapping block Ids to their priority settings. Larger numbers have greater priority. #### Returns `void` #### Remarks 设置用于方块瞄准的优先级设置。 Sets the priority settings used for block targeting. *** ### setBlockTagPriorities() > **setBlockTagPriorities**(`blockTagPriorities`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockTagPriorities `Record`\<`string`, `number`> #### Returns `void` #### Remarks 设置用于方块瞄准的优先级设置。 Sets the priority settings used for block targeting. *** ### setEntityPriorities() > **setEntityPriorities**(`entityPriorities`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### entityPriorities `Record`\ 将实体 ID 映射到其优先级设置的记录。数字越大,优先级越高。 A record mapping entity Ids to their priority settings. Larger numbers have greater priority. #### Returns `void` #### Remarks 设置用于实体瞄准的优先级设置。 Sets the priority settings used for entity targeting. *** ### setEntityTypeFamilyPriorities() > **setEntityTypeFamilyPriorities**(`entityTypeFamilyPriorities`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### entityTypeFamilyPriorities `Record`\<`string`, `number`> #### Returns `void` #### Remarks 设置用于实体瞄准的优先级设置。 Sets the priority settings used for entity targeting. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/AimAssistPreset.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/AimAssistPreset.md. # Class: AimAssistPreset **`Beta`** 处理存在于 world.aimAssist 注册表中的瞄准辅助预设的句柄。 Handle to an aim-assist preset that exists in the world.aimAssist registry. ## Properties ### defaultItemSettings? > `readonly` `optional` **defaultItemSettings?**: `string` **`Beta`** #### Remarks 可选。用于未提供给 setItemSettings 的项目的默认瞄准辅助分类 ID。 Optional. Default aim-assist category Id used for items not provided to setItemSettings. #### Throws This property can throw when used. *** ### handSettings? > `readonly` `optional` **handSettings?**: `string` **`Beta`** #### Remarks 可选。用于空手的瞄准辅助分类 ID。 Optional. Aim-assist category Id used for an empty hand. #### Throws This property can throw when used. *** ### identifier > `readonly` **identifier**: `string` **`Beta`** #### Remarks 与该预设关联的唯一 ID。 The unique Id associated with the preset. ## Methods ### getExcludedBlockTagTargets() > **getExcludedBlockTagTargets**(): `string`\[] **`Beta`** #### Returns `string`\[] 方块标签数组。 The array of block tags. #### Remarks 获取要从瞄准辅助目标中排除的方块标签列表。 Gets the list of block tags to exclude from aim assist targeting. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### getExcludedBlockTargets() > **getExcludedBlockTargets**(): `string`\[] **`Beta`** #### Returns `string`\[] 方块 ID 数组。 The array of block Ids. #### Remarks 获取要从瞄准辅助目标中排除的方块 ID 列表。 Gets the list of block Ids to exclude from aim assist targeting. #### Throws This function can throw errors. *** ### getExcludedEntityTargets() > **getExcludedEntityTargets**(): `string`\[] **`Beta`** #### Returns `string`\[] 实体 ID 数组。 The array of entity Ids. #### Remarks 获取要从瞄准辅助目标中排除的实体 ID 列表。 Gets the list of entity Ids to exclude from aim assist targeting. #### Throws This function can throw errors. *** ### getExcludedEntityTypeFamilyTargets() > **getExcludedEntityTypeFamilyTargets**(): `string`\[] **`Beta`** #### Returns `string`\[] 实体类型家族数组。 The array of entity type families. #### Remarks 获取要从瞄准辅助目标中排除的实体类型家族列表。 Gets the list of entity type families to exclude from aim assist targeting. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### getItemSettings() > **getItemSettings**(): `Record`\<`string`, `string`> **`Beta`** #### Returns `Record`\<`string`, `string`> 记录物品 ID 到瞄准辅助分类 ID 的映射。 The record mapping item Ids to aim-assist category Ids. #### Remarks 获取每个物品的瞄准辅助分类 ID。 Gets the per-item aim-assist category Ids. #### Throws This function can throw errors. *** ### getLiquidTargetingItems() > **getLiquidTargetingItems**(): `string`\[] **`Beta`** #### Returns `string`\[] 物品 ID 数组。 The array of item Ids. #### Remarks 获取手持时将通过瞄准辅助瞄准液体方块的物品 ID 列表。 Gets the list of item Ids that will target liquid blocks with aim-assist when being held. #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/AimAssistPresetSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/AimAssistPresetSettings.md. # Class: AimAssistPresetSettings **`Beta`** 与 AimAssistRegistry.addPreset 一起使用的设置,用于创建 AimAssistPreset。 Settings used with AimAssistRegistry.addPreset for creation of the AimAssistPreset. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new AimAssistPresetSettings**(`identifier`): `AimAssistPresetSettings` **`Beta`** #### Parameters ##### identifier `string` #### Returns `AimAssistPresetSettings` #### Remarks 构造函数,接受一个唯一 ID 来与创建的 AimAssistPreset 关联。必须具有命名空间。 Constructor that takes a unique Id to associate with the created AimAssistPreset. Must have a namespace. ## Properties ### defaultItemSettings? > `optional` **defaultItemSettings?**: `string` **`World Mutation`** **`Beta`** #### Remarks 可选。用于未提供给 setItemSettings 的项目的默认瞄准辅助分类 ID。 Optional. Default aim-assist category Id used for items not provided to setItemSettings. *** ### handSettings? > `optional` **handSettings?**: `string` **`World Mutation`** **`Beta`** #### Remarks 可选。用于空手的瞄准辅助分类 ID。 Optional. Aim-assist category Id used for an empty hand. *** ### identifier > `readonly` **identifier**: `string` **`Beta`** #### Remarks 用于注册预设的唯一 ID。必须具有命名空间。 The unique Id used to register the preset with. Must have a namespace. ## Methods ### getExcludedBlockTagTargets() > **getExcludedBlockTagTargets**(): `string`\[] | `undefined` **`Beta`** #### Returns `string`\[] | `undefined` 方块标签数组。 The array of block tags. #### Remarks 获取要从瞄准辅助目标中排除的方块标签列表。 Gets the list of block tags to exclude from aim assist targeting. *** ### getExcludedBlockTargets() > **getExcludedBlockTargets**(): `string`\[] | `undefined` **`Beta`** #### Returns `string`\[] | `undefined` 方块 ID 数组。 The array of block Ids. #### Remarks 获取要从瞄准辅助目标中排除的方块 ID 列表。 Gets the list of block Ids to exclude from aim assist targeting. *** ### getExcludedEntityTargets() > **getExcludedEntityTargets**(): `string`\[] | `undefined` **`Beta`** #### Returns `string`\[] | `undefined` 实体 ID 数组。 The array of entity Ids. #### Remarks 获取要从瞄准辅助目标中排除的实体 ID 列表。 Gets the list of entity Ids to exclude from aim assist targeting. *** ### getExcludedEntityTypeFamilyTargets() > **getExcludedEntityTypeFamilyTargets**(): `string`\[] | `undefined` **`Beta`** #### Returns `string`\[] | `undefined` 实体类型家族数组。 The array of entity type families. #### Remarks 获取要从瞄准辅助目标中排除的实体类型家族列表。 Gets the list of entity type families to exclude from aim assist targeting. *** ### getItemSettings() > **getItemSettings**(): `Record`\<`string`, `string`> **`Beta`** #### Returns `Record`\<`string`, `string`> 记录物品 ID 到瞄准辅助分类 ID 的映射。 The record mapping item Ids to aim-assist category Ids. #### Remarks 获取每个物品的瞄准辅助分类 ID。 Gets the per-item aim-assist category Ids. *** ### getLiquidTargetingItems() > **getLiquidTargetingItems**(): `string`\[] | `undefined` **`Beta`** #### Returns `string`\[] | `undefined` 物品 ID 数组。 The array of item Ids. #### Remarks 获取手持时将通过瞄准辅助瞄准液体方块的物品 ID 列表。 Gets the list of item Ids that will target liquid blocks with aim-assist when being held. *** ### setExcludedBlockTagTargets() > **setExcludedBlockTagTargets**(`targets?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### targets? `string`\[] 方块标签数组。 An array of block tags. #### Returns `void` #### Remarks 设置要从瞄准辅助目标中排除的方块标签列表。 Sets the list of block tags to exclude from aim assist targeting. *** ### setExcludedBlockTargets() > **setExcludedBlockTargets**(`targets?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### targets? (`string` | `number` | `symbol`)\[] 方块 ID 数组。 An array of block Ids. #### Returns `void` #### Remarks 设置要从瞄准辅助目标中排除的方块 ID 列表。 Sets the list of block Ids to exclude from aim assist targeting. *** ### setExcludedEntityTargets() > **setExcludedEntityTargets**(`targets?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### targets? (`string` | `number` | `symbol`)\[] 实体 ID 数组。 An array of entity Ids. #### Returns `void` #### Remarks 设置要从瞄准辅助目标中排除的实体 ID 列表。 Sets the list of entity Ids to exclude from aim assist targeting. *** ### setExcludedEntityTypeFamilyTargets() > **setExcludedEntityTypeFamilyTargets**(`targets?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### targets? `string`\[] 实体类型家族数组。 An array of entity type families. #### Returns `void` #### Remarks 设置要从瞄准辅助目标中排除的实体类型家族列表。 Sets the list of entity type families to exclude from aim assist targeting. *** ### setItemSettings() > **setItemSettings**(`itemSettings`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### itemSettings `Record`\ 记录物品 ID 到瞄准辅助分类 ID 的映射。分类 ID 必须具有命名空间。 A record mapping item Ids to aim-assist category Ids. Category Ids must have a namespace. #### Returns `void` #### Remarks 设置每个物品的瞄准辅助分类 ID。 Sets the per-item aim-assist category Ids. *** ### setLiquidTargetingItems() > **setLiquidTargetingItems**(`items?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### items? (`string` | `number` | `symbol`)\[] 物品 ID 数组。 An array of item Ids. #### Returns `void` #### Remarks 设置手持时将通过瞄准辅助瞄准液体方块的物品 ID 列表。 Sets the list of item Ids that will target liquid blocks with aim-assist when being held. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/AimAssistRegistry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/AimAssistRegistry.md. # Class: AimAssistRegistry **`Beta`** 用于管理世界瞄准辅助设置的 API 容器。 A container for APIs related to the world's aim-assist settings. ## Properties ### DefaultCategoryId > `readonly` `static` **DefaultCategoryId**: `"minecraft:default"` = `'minecraft:default'` **`Beta`** #### Remarks 未另行指定时使用的默认瞄准辅助分类 ID。 The default aim-assist category Id that is used when not otherwise specified. *** ### DefaultPresetId > `readonly` `static` **DefaultPresetId**: `"minecraft:aim_assist_default"` = `'minecraft:aim_assist_default'` **`Beta`** #### Remarks 未另行指定时使用的默认瞄准辅助预设 ID。 The default aim-assist preset Id that is used when not otherwise specified. ## Methods ### addCategory() > **addCategory**(`category`): [`AimAssistCategory`](/server/classes/AimAssistCategory.md) **`World Mutation`** **`Beta`** #### Parameters ##### category [`AimAssistCategorySettings`](/server/classes/AimAssistCategorySettings.md) 用于创建新分类的分类设置。 The category settings used to create the new category. #### Returns [`AimAssistCategory`](/server/classes/AimAssistCategory.md) 创建的分类句柄。 The created category handle. #### Remarks 向注册表添加一个瞄准辅助分类。 Adds an aim-assist category to the registry. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) Error [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [NamespaceNameError](/server/classes/NamespaceNameError.md) *** ### addPreset() > **addPreset**(`preset`): [`AimAssistPreset`](/server/classes/AimAssistPreset.md) **`World Mutation`** **`Beta`** #### Parameters ##### preset [`AimAssistPresetSettings`](/server/classes/AimAssistPresetSettings.md) 用于创建新预设的预设设置。 The preset settings used to create the new preset. #### Returns [`AimAssistPreset`](/server/classes/AimAssistPreset.md) 创建的预设句柄。 The created preset handle. #### Remarks 向注册表添加一个瞄准辅助预设。 Adds an aim-assist preset to the registry. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) Error [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [NamespaceNameError](/server/classes/NamespaceNameError.md) *** ### getCategories() > **getCategories**(): [`AimAssistCategory`](/server/classes/AimAssistCategory.md)\[] **`Beta`** #### Returns [`AimAssistCategory`](/server/classes/AimAssistCategory.md)\[] 所有可用分类对象的数组。 An array of all available category objects. #### Remarks 获取注册表中所有可用的分类。 Gets all available categories in the registry. *** ### getCategory() > **getCategory**(`categoryId`): [`AimAssistCategory`](/server/classes/AimAssistCategory.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### categoryId `string` #### Returns [`AimAssistCategory`](/server/classes/AimAssistCategory.md) | `undefined` 如果存在则返回分类对象,否则返回 undefined。 The category object if it exists, otherwise returns undefined. #### Remarks 获取与提供的 ID 关联的分类。 Gets the category associated with the provided Id. *** ### getPreset() > **getPreset**(`presetId`): [`AimAssistPreset`](/server/classes/AimAssistPreset.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### presetId `string` 要检索的预设的 ID。必须具有命名空间。 The Id of the preset to retrieve. Must have a namespace. #### Returns [`AimAssistPreset`](/server/classes/AimAssistPreset.md) | `undefined` 如果存在则返回预设对象,否则返回 undefined。 The preset object if it exists, otherwise returns undefined. #### Remarks 获取与提供的 ID 关联的预设。 Gets the preset associated with the provided Id. *** ### getPresets() > **getPresets**(): [`AimAssistPreset`](/server/classes/AimAssistPreset.md)\[] **`Beta`** #### Returns [`AimAssistPreset`](/server/classes/AimAssistPreset.md)\[] 所有可用预设对象的数组。 An array of all available preset objects. #### Remarks 获取注册表中所有可用的预设。 Gets all available presets in the registry. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BannerPattern.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BannerPattern.md. # Class: BannerPattern **`Beta`** 描述单个旗帜图案,包括颜色和图案类型。 Describes a single banner pattern, which includes a colour and a pattern type. ## Properties ### color > `readonly` **color**: `string` **`Beta`** #### Remarks 应用于此旗帜图案的颜色。 The color to apply to this banner pattern. *** ### pattern > `readonly` **pattern**: `string` **`Beta`** #### Remarks 应用于旗帜的图案类型(例如渐变、V 形、十字等)。 The pattern type (e.g. gradient, chevron, cross, etc.) to apply to the banner. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BiomeType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BiomeType.md. # Class: BiomeType biome **`Beta`** 描述一种生物群系类型。 Describes a type of biome. ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 生物群系类型的标识符。 Identifier of the biome type. ## Methods ### getTags() > **getTags**(): `string`\[] **`Beta`** #### Returns `string`\[] #### Remarks 返回该生物群系的标签列表。 Returns a list of the biome's tags. *** ### hasTags() > **hasTags**(`tags`): `boolean` **`Beta`** #### Parameters ##### tags `string`\[] 要检查的标签列表。 The list of tags to check against the biome. #### Returns `boolean` #### Remarks 检查生物群系是否拥有所有提供的标签。 Checks if the biome has all of the provided tags. ## 同领域相关 - [BiomeFilter](/server/interfaces/BiomeFilter.md) - [BiomeSearchOptions](/server/interfaces/BiomeSearchOptions.md) - [BiomeTypes](/server/classes/BiomeTypes.md) - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BiomeTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BiomeTypes.md. # Class: BiomeTypes biome **`Beta`** 支持 Minecraft 中注册的可用生物群系类型目录。 Supports a catalog of available biome types registered within Minecraft. ## Methods ### get() > `static` **get**(`typeName`): [`BiomeType`](/server/classes/BiomeType.md) | `undefined` **`Beta`** #### Parameters ##### typeName `string` 生物群系的标识符。通常应使用命名空间标识符(例如 minecraft:frozen\_peaks)。 Identifier of the biome. Generally, namespaced identifiers (e.g., minecraft:frozen\_peaks) should be used. #### Returns [`BiomeType`](/server/classes/BiomeType.md) | `undefined` 如果生物群系存在,则返回 BiomeType 对象。如果不存在,则返回 undefined。 If the biome exists, a BiomeType object is returned. If not, undefined is returned. #### Remarks 返回特定的生物群系类型。 Returns a specific biome type. *** ### getAll() > `static` **getAll**(): [`BiomeType`](/server/classes/BiomeType.md)\[] **`Beta`** #### Returns [`BiomeType`](/server/classes/BiomeType.md)\[] #### Remarks 返回 Minecraft 中所有注册的生物群系类型。 Returns all registered biome types within Minecraft ## 同领域相关 - [BiomeFilter](/server/interfaces/BiomeFilter.md) - [BiomeSearchOptions](/server/interfaces/BiomeSearchOptions.md) - [BiomeType](/server/classes/BiomeType.md) - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Block.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Block.md. # Class: Block block **`Beta`** Represents a block in a dimension. A block represents a unique X, Y, and Z within a dimension and get/sets the state of the block at that location. This type was significantly updated in version 1.17.10.21. ## Properties ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks Returns the dimension that the block is within. *** ### isAir > `readonly` **isAir**: `boolean` **`Beta`** #### Remarks Returns true if this block is an air block (i.e., empty space). #### Throws This property can throw when used. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### isLiquid > `readonly` **isLiquid**: `boolean` **`Beta`** #### Remarks Returns true if this block is a liquid block - (e.g., a water block and a lava block are liquid, while an air block and a stone block are not. Water logged blocks are not liquid blocks). #### Throws This property can throw when used. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### isSolid 实验性 > `readonly` **isSolid**: `boolean` **`Beta`** #### Remarks Returns true if this block is solid and impassible - (e.g., a cobblestone block and a diamond block are solid, while a ladder block and a fence block are not). #### Throws This property can throw when used. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks Returns true if this reference to a block is still valid (for example, if the block is unloaded, references to that block will no longer be valid.) *** ### isWaterlogged > `readonly` **isWaterlogged**: `boolean` **`Beta`** #### Remarks Returns or sets whether this block has water on it. #### Throws This property can throw when used. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### localizationKey > `readonly` **localizationKey**: `string` **`Beta`** #### Remarks Key for the localization of this block's name used in .lang files. #### Throws This property can throw when used. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### location > `readonly` **location**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks Coordinates of the specified block. #### Throws This property can throw when used. *** ### permutation > `readonly` **permutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks Additional block configuration data that describes the block. #### Throws This property can throw when used. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### type > `readonly` **type**: [`BlockType`](/server/classes/BlockType.md) **`Beta`** #### Remarks Gets the type of block. #### Throws This property can throw when used. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks Identifier of the type of block for this block. Warning: Vanilla block names can be changed in future releases, try using 'Block.matches' instead for block comparison. #### Throws This property can throw when used. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### x > `readonly` **x**: `number` **`Beta`** #### Remarks X coordinate of the block. *** ### y > `readonly` **y**: `number` **`Beta`** #### Remarks Y coordinate of the block. *** ### z > `readonly` **z**: `number` **`Beta`** #### Remarks Z coordinate of the block. ## Methods ### above() > **above**(`steps?`): `Block` | `undefined` **`Beta`** #### Parameters ##### steps? `number` Number of steps above to step before returning. Defaults to: 1 #### Returns `Block` | `undefined` #### Remarks Returns the [Block](/server/enums/CustomCommandSource.md#block) above this block (positive in the Y direction). #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### below() > **below**(`steps?`): `Block` | `undefined` **`Beta`** #### Parameters ##### steps? `number` Number of steps below to step before returning. Defaults to: 1 #### Returns `Block` | `undefined` #### Remarks Returns the [Block](/server/enums/CustomCommandSource.md#block) below this block (negative in the Y direction). #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### bottomCenter() > **bottomCenter**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks Returns the [Vector3](/server/interfaces/Vector3.md) of the center of this block on the X and Z axis. *** ### canBeDestroyedByLiquidSpread() > **canBeDestroyedByLiquidSpread**(`liquidType`): `boolean` **`Beta`** #### Parameters ##### liquidType [`Water`](/server/enums/LiquidType.md#water) The type of liquid this function should be called for. #### Returns `boolean` Whether this block is removed when touched by liquid. #### Remarks Returns whether this block is removed when touched by liquid. #### Throws This function can throw errors. Error [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### canContainLiquid() > **canContainLiquid**(`liquidType`): `boolean` **`Beta`** #### Parameters ##### liquidType [`Water`](/server/enums/LiquidType.md#water) The type of liquid this function should be called for. #### Returns `boolean` Whether this block can have a liquid placed over it. #### Remarks Returns whether this block can have a liquid placed over it, i.e. be waterlogged. #### Throws This function can throw errors. Error [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### canPlace() > **canPlace**(`blockToPlace`, `faceToPlaceOn?`): `boolean` **`Beta`** #### Parameters ##### blockToPlace `string` | [`BlockPermutation`](/server/classes/BlockPermutation.md) | [`BlockType`](/server/classes/BlockType.md) Block type or block permutation to check placement for. ##### faceToPlaceOn? [`Direction`](/server/enums/Direction.md) Optional specific face of this block to check placement against. #### Returns `boolean` Returns `true` if the block type or permutation can be placed on this block, else `false`. #### Remarks Checks to see whether it is valid to place the specified block type or block permutation, on a specified face on this block. #### Throws This function can throw errors. Error [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### center() > **center**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks Returns the [Vector3](/server/interfaces/Vector3.md) of the center of this block on the X, Y, and Z axis. *** ### east() > **east**(`steps?`): `Block` | `undefined` **`Beta`** #### Parameters ##### steps? `number` Number of steps to the east to step before returning. Defaults to: 1 #### Returns `Block` | `undefined` #### Remarks Returns the [Block](/server/enums/CustomCommandSource.md#block) to the east of this block (positive in the X direction). #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### getComponent() > **getComponent**\<`T`>(`componentId`): [`BlockComponentReturnType`](/server/types/BlockComponentReturnType.md)\<`T`> | `undefined` **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` #### Parameters ##### componentId `T` The identifier of the component (e.g., 'minecraft:inventory'). If no namespace prefix is specified, 'minecraft:' is assumed. Available component IDs are those in the [BlockComponentTypes](/server/enums/BlockComponentTypes.md) enum and custom component IDs registered with the [BlockComponentRegistry](/server/classes/BlockComponentRegistry.md). #### Returns [`BlockComponentReturnType`](/server/types/BlockComponentReturnType.md)\<`T`> | `undefined` Returns the component if it exists on the block, otherwise undefined. #### Remarks Gets a component (that represents additional capabilities) for a block - for example, an inventory component of a chest block. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### getComponents() > **getComponents**(): [`BlockComponent`](/server/classes/BlockComponent.md)\[] **`Beta`** #### Returns [`BlockComponent`](/server/classes/BlockComponent.md)\[] #### Remarks Returns all scripting components that are present on this block. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### getItemStack() > **getItemStack**(`amount?`, `withData?`): [`ItemStack`](/server/classes/ItemStack.md) | `undefined` **`Beta`** #### Parameters ##### amount? `number` Number of instances of this block to place in the item stack. Defaults to: 1 Bounds: \[1, 255] ##### withData? `boolean` Whether additional data facets of the item stack are included. Defaults to: false #### Returns [`ItemStack`](/server/classes/ItemStack.md) | `undefined` An itemStack with the specified amount of items and data. Returns undefined if block type is incompatible. #### Remarks Creates a prototype item stack based on this block that can be used with Container/ContainerSlot APIs. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### getLightLevel() > **getLightLevel**(): `number` **`World Mutation`** **`Beta`** #### Returns `number` The brightness level on the block. #### Remarks Returns the total brightness level of light shining on a certain block. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) *** ### getMapColor() > **getMapColor**(): [`RGBA`](/server/interfaces/RGBA.md) **`Beta`** #### Returns [`RGBA`](/server/interfaces/RGBA.md) #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### getParts() > **getParts**(): `Block`\[] | `undefined` **`Beta`** #### Returns `Block`\[] | `undefined` #### Preview #### Remarks Returns array of all loaded block parts if this block has the 'minecraft:multi\_block' trait. If it does not have the trait returns undefined #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### getRedstonePower() > **getRedstonePower**(): `number` | `undefined` **`Beta`** #### Returns `number` | `undefined` Returns undefined if redstone power is not applicable to this block. #### Remarks Returns the net redstone power of this block. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### getSkyLightLevel() > **getSkyLightLevel**(): `number` **`World Mutation`** **`Beta`** #### Returns `number` The brightness level on the block. #### Remarks Returns the brightness level of light shining from the sky on a certain block. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) *** ### getTags() > **getTags**(): `string`\[] **`Beta`** #### Returns `string`\[] The list of tags that the block has. #### Remarks Returns a set of tags for a block. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### hasComponent() > **hasComponent**(`componentId`): `boolean` **`Beta`** #### Parameters ##### componentId `string` The identifier of the component (e.g., 'minecraft:inventory') to retrieve. If no namespace prefix is specified, 'minecraft:' is assumed. #### Returns `boolean` #### Remarks Returns true if the specified component is present on this block. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### hasTag() > **hasTag**(`tag`): `boolean` **`Beta`** #### Parameters ##### tag `string` Tag to check for. #### Returns `boolean` Returns `true` if the permutation of this block has the tag, else `false`. #### Remarks Checks to see if the permutation of this block has a specific tag. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) #### Example **checkBlockTags.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; function checkBlockTags(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // Fetch the block const block = targetLocation.dimension.getBlock(targetLocation); // check that the block is loaded if (block) { log(`Block is dirt: ${block.hasTag('dirt')}`); log(`Block is wood: ${block.hasTag('wood')}`); log(`Block is stone: ${block.hasTag('stone')}`); } } ``` *** ### isLiquidBlocking() > **isLiquidBlocking**(`liquidType`): `boolean` **`Beta`** #### Parameters ##### liquidType [`Water`](/server/enums/LiquidType.md#water) The type of liquid this function should be called for. #### Returns `boolean` Whether this block stops liquid from flowing. #### Remarks Returns whether this block stops liquid from flowing. #### Throws This function can throw errors. Error [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### liquidCanFlowFromDirection() > **liquidCanFlowFromDirection**(`liquidType`, `flowDirection`): `boolean` **`Beta`** #### Parameters ##### liquidType [`Water`](/server/enums/LiquidType.md#water) The type of liquid this function should be called for. ##### flowDirection [`Direction`](/server/enums/Direction.md) #### Returns `boolean` Whether liquid can flow into the block from the provided direction, or flow out from the provided direction when liquid is placed into it with a bucket #### Remarks Returns whether liquid can flow into the block from the provided direction, or flow out from the provided direction when liquid is placed into it with a bucket. #### Throws This function can throw errors. Error [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### liquidSpreadCausesSpawn() > **liquidSpreadCausesSpawn**(`liquidType`): `boolean` **`Beta`** #### Parameters ##### liquidType [`Water`](/server/enums/LiquidType.md#water) The type of liquid this function should be called for. #### Returns `boolean` Whether this block is removed and spawns its item when touched by liquid. #### Remarks Returns whether this block is removed and spawns its item when touched by liquid. #### Throws This function can throw errors. Error [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### matches() > **matches**(`blockName`, `states?`): `boolean` **`Beta`** #### Parameters ##### blockName `string` Block type identifier to match this API against. ##### states? `Record`\<`string`, `string` | `number` | `boolean`> Optional set of block states to test this block against. #### Returns `boolean` Returns true if the block matches the specified criteria. #### Remarks Tests whether this block matches a specific criteria. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### north() > **north**(`steps?`): `Block` | `undefined` **`Beta`** #### Parameters ##### steps? `number` Number of steps to the north to step before returning. Defaults to: 1 #### Returns `Block` | `undefined` #### Remarks Returns the [Block](/server/enums/CustomCommandSource.md#block) to the north of this block (negative in the Z direction). #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### offset() > **offset**(`offset`): `Block` | `undefined` **`Beta`** #### Parameters ##### offset [`Vector3`](/server/interfaces/Vector3.md) The offset vector. For example, an offset of 0, 1, 0 will return the block above the current block. #### Returns `Block` | `undefined` Block at the specified offset, or undefined if that block could not be retrieved (for example, the block and its relative chunk is not loaded yet.) #### Remarks Returns a block at an offset relative vector to this block. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### setPermutation() > **setPermutation**(`permutation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### permutation [`BlockPermutation`](/server/classes/BlockPermutation.md) Permutation that contains a set of property states for the Block. #### Returns `void` #### Remarks Sets the block in the dimension to the state of the permutation. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### setType() > **setType**(`blockType`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockType `string` | [`BlockType`](/server/classes/BlockType.md) Identifier of the type of block to apply - for example, minecraft:powered\_repeater. #### Returns `void` #### Remarks Sets the type of block. #### Throws This function can throw errors. Error [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### setWaterlogged() > **setWaterlogged**(`isWaterlogged`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### isWaterlogged `boolean` true if the block should have water within it. #### Returns `void` #### Remarks Sets whether this block has a water logged state - for example, whether stairs are submerged within water. #### Throws This function can throw errors. Error [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### south() > **south**(`steps?`): `Block` | `undefined` **`Beta`** #### Parameters ##### steps? `number` Number of steps to the south to step before returning. Defaults to: 1 #### Returns `Block` | `undefined` #### Remarks Returns the [Block](/server/enums/CustomCommandSource.md#block) to the south of this block (positive in the Z direction). #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### trySetPermutation() > **trySetPermutation**(`permutation`): `boolean` **`Beta`** **`World Mutation`** #### Parameters ##### permutation [`BlockPermutation`](/server/classes/BlockPermutation.md) Permutation that contains a set of property states for the Block. #### Returns `boolean` Returns `true` if the block permutation data was successfully set, else `false`. #### Remarks Tries to set the block in the dimension to the state of the permutation by first checking if the placement is valid. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### west() > **west**(`steps?`): `Block` | `undefined` **`Beta`** #### Parameters ##### steps? `number` Number of steps to the west to step before returning. Defaults to: 1 #### Returns `Block` | `undefined` #### Remarks Returns the [Block](/server/enums/CustomCommandSource.md#block) to the west of this block (negative in the X direction). #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) ## 同领域相关 - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockBoundingBoxUtils.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockBoundingBoxUtils.md. # Class: BlockBoundingBoxUtils block **`Beta`** 边界框工具类,提供许多用于创建和使用 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象的有用函数。 Bounding Box Utils is a utility class that provides a number of useful functions for the creation and utility of [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) objects ## Methods ### createValid() > `static` **createValid**(`min`, `max`): [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) **`World Mutation`** **`Beta`** #### Parameters ##### min [`Vector3`](/server/interfaces/Vector3.md) 一个角点的世界坐标位置。 A corner world location ##### max [`Vector3`](/server/interfaces/Vector3.md) 对角线相对的另一个角点的世界坐标位置。 A corner world location diametrically opposite #### Returns [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Remarks 创建一个经过验证的 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 实例,其中 min 和 max 分量保证满足 (min \<= max)。 Create a validated instance of a [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) where the min and max components are guaranteed to be (min \<= max) *** ### dilate() > `static` **dilate**(`box`, `size`): [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) **`World Mutation`** **`Beta`** #### Parameters ##### box [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) ##### size [`Vector3`](/server/interfaces/Vector3.md) #### Returns [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) 返回一个新的 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象,表示更改后的结果。 Return a new [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) object representing the changes #### Remarks 沿各轴按给定大小扩展一个 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md)。 大小可以为负数以实现收缩。 注意:如果收缩大小大于跨度,角点可能被反转,但 min/max 关系将保持正确。 Expand a [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) by a given amount along each axis. Sizes can be negative to perform contraction. Note: corners can be inverted if the contraction size is greater than the span, but the min/max relationship will remain correct *** ### equals() > `static` **equals**(`box`, `other`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### box [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) ##### other [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Returns `boolean` #### Remarks 检查两个 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象是否完全相同。 Check if two [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) objects are identical *** ### expand() > `static` **expand**(`box`, `other`): [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) **`World Mutation`** **`Beta`** #### Parameters ##### box [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) ##### other [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Returns [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) 一个新的 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 实例,表示能够同时包含两者的最小可能边界框。 A new [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) instance representing the smallest possible bounding box which can encompass both #### Remarks 扩展初始 box 对象的边界以包含第二个 box 参数。 生成的 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象将是一个恰好包含这两个盒子的 BlockBoundingBox。 Expand the initial box object bounds to include the 2nd box argument. The resultant [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) object will be a BlockBoundingBox which exactly encompasses the two boxes. *** ### getCenter() > `static` **getCenter**(`box`): [`Vector3`](/server/interfaces/Vector3.md) **`World Mutation`** **`Beta`** #### Parameters ##### box [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Returns [`Vector3`](/server/interfaces/Vector3.md) 注意 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象表示完整的方块,因此具有奇数边界的盒子的中心在数学上并不居中。 例如,BlockBoundingBox(0,0,0 -> 3,3,3) 的中心为 (1,1,1)(而不是预期的 (1.5,1.5,1.5))。 Note that [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) objects represent whole blocks, so the center of boxes which have odd numbered bounds are not mathematically centered... i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a center of (1,1,1) (not (1.5, 1.5, 1.5) as expected) #### Remarks 计算给定 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象的中心方块。 Calculate the center block of a given [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) object. *** ### getIntersection() > `static` **getIntersection**(`box`, `other`): [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### box [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) ##### other [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Returns [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) | `undefined` #### Remarks 计算表示两个相交 BlockBoundingBox 的并集区域的 BlockBoundingBox。 Calculate the BlockBoundingBox which represents the union area of two intersecting BlockBoundingBoxes *** ### getSpan() > `static` **getSpan**(`box`): [`Vector3`](/server/interfaces/Vector3.md) **`World Mutation`** **`Beta`** #### Parameters ##### box [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Returns [`Vector3`](/server/interfaces/Vector3.md) #### Remarks 获取 BlockBoundingBox 各轴分量的跨度。 Get the Span of each of the BlockBoundingBox Axis components *** ### intersects() > `static` **intersects**(`box`, `other`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### box [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) ##### other [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Returns `boolean` #### Remarks 检查两个 BlockBoundingBox 对象是否相交。 Check to see if two BlockBoundingBox objects intersect *** ### isInside() > `static` **isInside**(`box`, `pos`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### box [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) ##### pos [`Vector3`](/server/interfaces/Vector3.md) #### Returns `boolean` #### Remarks 检查给定的坐标是否在 BlockBoundingBox 内部。 Check to see if a given coordinate is inside a BlockBoundingBox *** ### isValid() > `static` **isValid**(`box`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### box [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) #### Returns `boolean` #### Remarks 检查 BlockBoundingBox 是否有效(即 min \<= max)。 Check to see if a BlockBoundingBox is valid (i.e. (min \<= max)) *** ### translate() > `static` **translate**(`box`, `delta`): [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) **`World Mutation`** **`Beta`** #### Parameters ##### box [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) ##### delta [`Vector3`](/server/interfaces/Vector3.md) #### Returns [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) 返回一个新的 BlockBoundingBox 对象,表示移动后的结果。 Return a new BlockBoundingBox object which represents the change #### Remarks 按给定量移动 BlockBoundingBox。 Move a BlockBoundingBox by a given amount ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockComponentRegistry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockComponentRegistry.md. # Class: BlockComponentRegistry block component **`Beta`** 用于注册方块自定义组件的注册表类。 Registry class for block custom components. ## Methods ### registerCustomComponent() > **registerCustomComponent**(`name`, `customComponent`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### name `string` ##### customComponent [`BlockCustomComponent`](/server/interfaces/BlockCustomComponent.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) [CustomComponentInvalidRegistryError](/server/classes/CustomComponentInvalidRegistryError.md) [EngineError](/common/classes/EngineError.md) [NamespaceNameError](/server/classes/NamespaceNameError.md) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockContainerClosedAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockContainerClosedAfterEventSignal.md. # Class: BlockContainerClosedAfterEventSignal event block inventory **`Beta`** 管理与方块容器被关闭时相关的回调。 Manages callbacks that are connected to when a block container is closed. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`BlockContainerAccessEventOptions`](/server/interfaces/BlockContainerAccessEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks 添加一个将在方块容器被关闭时调用的回调。 Adds a callback that will be called when a block container is closed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在方块容器被关闭时调用的回调。 Removes a callback from being called when a block container is closed. ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockContainerOpenedAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockContainerOpenedAfterEventSignal.md. # Class: BlockContainerOpenedAfterEventSignal event block inventory **`Beta`** 管理与方块容器被打开时相关的回调。 Manages callbacks that are connected to when a block container is opened. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`BlockContainerAccessEventOptions`](/server/interfaces/BlockContainerAccessEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks 添加一个将在方块容器被打开时调用的回调。 Adds a callback that will be called when a block container is opened. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在方块容器被打开时调用的回调。 Removes a callback from being called when a block container is opened. ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockCustomComponentAlreadyRegisteredError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockCustomComponentAlreadyRegisteredError.md. # Class: BlockCustomComponentAlreadyRegisteredError block error component **`Beta`** 当尝试注册一个已经注册过的方块自定义组件时抛出的错误。 Error thrown when attempting to register a block custom component that has already been registered. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockCustomComponentReloadNewComponentError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockCustomComponentReloadNewComponentError.md. # Class: BlockCustomComponentReloadNewComponentError block error component **`Beta`** 当重新加载过程中发现新的方块自定义组件时抛出的错误。 Error thrown when a new block custom component is detected during reload. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockCustomComponentReloadNewEventError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockCustomComponentReloadNewEventError.md. # Class: BlockCustomComponentReloadNewEventError event block error component **`Beta`** 当重新加载过程中发现新的方块自定义组件事件时抛出的错误。 Error thrown when a new block custom component event is detected during reload. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockCustomComponentReloadVersionError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockCustomComponentReloadVersionError.md. # Class: BlockCustomComponentReloadVersionError block error component **`Beta`** 当重新加载过程中发现方块自定义组件版本发生变化时抛出的错误。 Error thrown when a block custom component version change is detected during reload. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockExplodeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockExplodeAfterEventSignal.md. # Class: BlockExplodeAfterEventSignal event block **`Beta`** 管理与爆炸发生时相关回调,当爆炸影响单个方块时触发。 Manages callbacks that are connected to when an explosion occurs, as it impacts individual blocks. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个将在爆炸发生时调用的回调,当爆炸影响单个方块时触发。 Adds a callback that will be called when an explosion occurs, as it impacts individual blocks. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在爆炸发生时调用的回调。 Removes a callback from being called when an explosion occurs, as it impacts individual blocks. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockLocationIterator.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockLocationIterator.md. # Class: BlockLocationIterator block **`Beta`** BlockLocationIterator 返回其正在迭代的方块体积中的下一个方块位置。 BlockLocationIterator 用于抽象其获取来源的方块体积的形状(因此它可以表示构成矩形、立方体、球体、线条和复杂形状的所有方块位置)。 每次迭代传递返回父形状中的下一个有效方块位置。 除非父形状另有指定,否则 BlockLocationIterator 将按 X 递增、然后 Z 递增、然后 Y 递增的顺序在 3D 空间中进行迭代。 (实际上是在 XZ 平面上逐步移动,当该平面中所有位置都遍历完毕后,将 Y 坐标递增到下一个 XZ 切片)。 A BlockLocationIterator returns the next block location of the block volume across which it is iterating. The BlockLocationIterator is used to abstract the shape of the block volume it was fetched from (so it can represent all the block locations that make up rectangles, cubes, spheres, lines and complex shapes). Each iteration pass returns the next valid block location in the parent shape. Unless otherwise specified by the parent shape - the BlockLocationIterator will iterate over a 3D space in the order of increasing X, followed by increasing Z followed by increasing Y. (Effectively stepping across the XZ plane, and when all the locations in that plane are exhausted, increasing the Y coordinate to the next XZ slice) ## Implements - `Iterable`\<[`Vector3`](/server/interfaces/Vector3.md)> ## Methods ### \[iterator]\() > **\[iterator]**(): `Iterator`\<[`Vector3`](/server/interfaces/Vector3.md)> **`World Mutation`** **`Beta`** #### Returns `Iterator`\<[`Vector3`](/server/interfaces/Vector3.md)> #### Remarks #### Implementation of `Iterable.[iterator]` *** ### isValid() > **isValid**(): `boolean` **`Beta`** #### Returns `boolean` #### Remarks 检查底层的方块体积是否已失效。如果方块体积在创建迭代器之后和迭代之前被修改,则返回 `false`,否则返回 `true`。 Checks if the underlining block volume has been invalidated. Will return false if the block volume was modified between creating the iterator and iterating it, and true otherwise. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### next() > **next**(): `IteratorResult`\<[`Vector3`](/server/interfaces/Vector3.md)> **`World Mutation`** **`Beta`** #### Returns `IteratorResult`\<[`Vector3`](/server/interfaces/Vector3.md)> #### Remarks ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockPermutation.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockPermutation.md. # Class: BlockPermutation block **`Beta`** 包含类型 [BlockType](/server/enums/CustomCommandParamType.md#blocktype) 和属性(有时也称为方块状态)的组合,用于描述一个方块(但不属于特定的 [Block](/server/enums/CustomCommandSource.md#block))。 ## Example **addTranslatedSign.ts** ```typescript import { world, BlockPermutation, BlockSignComponent, BlockComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function addTranslatedSign(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); const dim = players[0].dimension; const signBlock = dim.getBlock(targetLocation); if (!signBlock) { log('Could not find a block at specified location.'); return -1; } const signPerm = BlockPermutation.resolve(MinecraftBlockTypes.StandingSign, { ground_sign_direction: 8 }); signBlock.setPermutation(signPerm); const signComponent = signBlock.getComponent(BlockComponentTypes.Sign) as BlockSignComponent; signComponent?.setText({ translate: 'item.skull.player.name', with: [players[0].name] }); } ``` ## Properties ### localizationKey > `readonly` **localizationKey**: `string` **`Beta`** #### Remarks 此方块排列的名称在 .lang 文件中使用的本地化键。 Key for the localization of this BlockPermutation's name used in .lang files. *** ### type > `readonly` **type**: [`BlockType`](/server/classes/BlockType.md) **`Beta`** #### Remarks 置换所具有的 [BlockType](/server/enums/CustomCommandParamType.md#blocktype)。 The [BlockType](/server/enums/CustomCommandParamType.md#blocktype) that the permutation has. ## Methods ### canBeDestroyedByLiquidSpread() > **canBeDestroyedByLiquidSpread**(`liquidType`): `boolean` **`Beta`** #### Parameters ##### liquidType [`Water`](/server/enums/LiquidType.md#water) 此函数应为之调用的液体类型。 The type of liquid this function should be called for. #### Returns `boolean` 此方块在接触液体时是否被移除。 Whether this block is removed when touched by liquid. #### Remarks 返回此方块在接触液体时是否被移除。 Returns whether this block is removed when touched by liquid. #### Throws This function can throw errors. *** ### canContainLiquid() > **canContainLiquid**(`liquidType`): `boolean` **`Beta`** #### Parameters ##### liquidType [`Water`](/server/enums/LiquidType.md#water) 此函数应为之调用的液体类型。 The type of liquid this function should be called for. #### Returns `boolean` 此方块是否可以在其上放置液体。 Whether this block can have a liquid placed over it. #### Remarks 返回此方块是否可以在其上放置液体,即被水浸没。 Returns whether this block can have a liquid placed over it, i.e. be waterlogged. #### Throws This function can throw errors. *** ### getAllStates() > **getAllStates**(): `Record`\<`string`, `boolean` | `number` | `string`> **`Beta`** #### Returns `Record`\<`string`, `boolean` | `number` | `string`> 返回置换所具有的所有方块状态的列表。 Returns the list of all of the block states that the permutation has. #### Remarks 返回与此方块关联的所有可用方块状态。 Returns all available block states associated with this block. *** ### getItemStack() > **getItemStack**(`amount?`): [`ItemStack`](/server/classes/ItemStack.md) | `undefined` **`Beta`** #### Parameters ##### amount? `number` 要放入原型物品堆中的此方块排列的数量。 默认为:1 范围:\[1, 255] Number of instances of this block to place in the prototype item stack. Defaults to: 1 Bounds: \[1, 255] #### Returns [`ItemStack`](/server/classes/ItemStack.md) | `undefined` #### Remarks 基于此方块置换检索一个原型物品堆,可用于物品 Container/ContainerSlot API。 Retrieves a prototype item stack based on this block permutation that can be used with item Container/ContainerSlot APIs. *** ### getState() > **getState**\<`T`>(`stateName`): `any` **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` | `number` | `symbol` #### Parameters ##### stateName `T` 要返回值的方块状态名称。 Name of the block state who's value is to be returned. #### Returns `any` 如果置换具有该状态则返回状态值,否则返回 `undefined`。 Returns the state if the permutation has it, else `undefined`. #### Remarks 获取置换的状态。 Gets a state for the permutation. *** ### getTags() > **getTags**(): `string`\[] **`Beta`** #### Returns `string`\[] #### Remarks 创建置换的副本。 Creates a copy of the permutation. *** ### hasTag() > **hasTag**(`tag`): `boolean` **`Beta`** #### Parameters ##### tag `string` #### Returns `boolean` 如果置换具有该标签则返回 `true`,否则返回 `false`。 Returns `true` if the permutation has the tag, else `false`. #### Remarks 检查置换是否具有特定标签。 Checks to see if the permutation has a specific tag. #### Example **checkBlockTags.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; function checkBlockTags(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // Fetch the block const block = targetLocation.dimension.getBlock(targetLocation); // check that the block is loaded if (block) { log(`Block is dirt: ${block.hasTag('dirt')}`); log(`Block is wood: ${block.hasTag('wood')}`); log(`Block is stone: ${block.hasTag('stone')}`); } } ``` *** ### isLiquidBlocking() > **isLiquidBlocking**(`liquidType`): `boolean` **`Beta`** #### Parameters ##### liquidType [`Water`](/server/enums/LiquidType.md#water) 此函数应为之调用的液体类型。 The type of liquid this function should be called for. #### Returns `boolean` 此方块是否阻止液体流动。 Whether this block stops liquid from flowing. #### Remarks 返回此方块是否阻止液体流动。 Returns whether this block stops liquid from flowing. #### Throws This function can throw errors. *** ### liquidSpreadCausesSpawn() > **liquidSpreadCausesSpawn**(`liquidType`): `boolean` **`Beta`** #### Parameters ##### liquidType [`Water`](/server/enums/LiquidType.md#water) 此函数应为之调用的液体类型。 The type of liquid this function should be called for. #### Returns `boolean` 此方块在接触液体时是否被移除并生成其物品。 Whether this block is removed and spawns its item when touched by liquid. #### Remarks 返回此方块在接触液体时是否被移除并生成其物品。 Returns whether this block is removed and spawns its item when touched by liquid. #### Throws This function can throw errors. *** ### matches() > **matches**\<`T`>(`blockName`, `states?`): `boolean` **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` = `MinecraftBlockTypes` #### Parameters ##### blockName `T` 要比较的可选状态集合。 An optional set of states to compare against. ##### states? [`BlockStateArg`](/server/types/BlockStateArg.md)\<`T`> #### Returns `boolean` #### Remarks 返回指定置换是否与此置换匹配。如果未指定状态,则 matches 会在更广泛的类型集合上进行检查。 Returns a boolean whether a specified permutation matches this permutation. If states is not specified, matches checks against the set of types more broadly. *** ### withState() > **withState**\<`T`>(`name`, `value`): `BlockPermutation` **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` | `number` | `symbol` #### Parameters ##### name `T` 方块属性的标识符。 Identifier of the block property. ##### value `BlockStateSuperset` 方块属性的值。 Value of the block property. #### Returns `BlockPermutation` #### Remarks 返回一个设置了特定属性的派生方块排列。 Returns a derived BlockPermutation with a specific property set. #### Throws This function can throw errors. *** ### resolve() > `static` **resolve**\<`T`>(`blockName`, `states?`): `BlockPermutation` **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` = `MinecraftBlockTypes` #### Parameters ##### blockName `T` 要检查的方块的标识符。 Identifier of the block to check. ##### states? [`BlockStateArg`](/server/types/BlockStateArg.md)\<`T`> #### Returns `BlockPermutation` #### Remarks 给定类型标识符和可选的属性集合,将返回一个可在其他方块 API 中使用的方块排列对象(例如 block.setPermutation)。 Given a type identifier and an optional set of properties, will return a BlockPermutation object that is usable in other block APIs (e.g., block.setPermutation) #### Throws This function can throw errors. #### Example **addBlockColorCube.ts** ```typescript import { BlockPermutation, DimensionLocation } from '@minecraft/server'; import { Vector3Utils } from '@minecraft/math'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function addBlockColorCube(targetLocation: DimensionLocation) { const allWoolBlocks: string[] = [ MinecraftBlockTypes.WhiteWool, MinecraftBlockTypes.OrangeWool, MinecraftBlockTypes.MagentaWool, MinecraftBlockTypes.LightBlueWool, MinecraftBlockTypes.YellowWool, MinecraftBlockTypes.LimeWool, MinecraftBlockTypes.PinkWool, MinecraftBlockTypes.GrayWool, MinecraftBlockTypes.LightGrayWool, MinecraftBlockTypes.CyanWool, MinecraftBlockTypes.PurpleWool, MinecraftBlockTypes.BlueWool, MinecraftBlockTypes.BrownWool, MinecraftBlockTypes.GreenWool, MinecraftBlockTypes.RedWool, MinecraftBlockTypes.BlackWool, ]; const cubeDim = 7; let colorIndex = 0; for (let x = 0; x <= cubeDim; x++) { for (let y = 0; y <= cubeDim; y++) { for (let z = 0; z <= cubeDim; z++) { colorIndex++; targetLocation.dimension .getBlock(Vector3Utils.add(targetLocation, { x, y, z })) ?.setPermutation(BlockPermutation.resolve(allWoolBlocks[colorIndex % allWoolBlocks.length])); } } } } ``` ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockStates.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockStates.md. # Class: BlockStates block **`Beta`** 枚举所有 [BlockStateType](/server/classes/BlockStateType.md)。 Enumerates all [BlockStateType](/server/classes/BlockStateType.md)s. ## Methods ### get() > `static` **get**(`stateName`): [`BlockStateType`](/server/classes/BlockStateType.md) | `undefined` **`Beta`** #### Parameters ##### stateName `string` #### Returns [`BlockStateType`](/server/classes/BlockStateType.md) | `undefined` 如果找到则返回 [Block](/server/enums/CustomCommandSource.md#block) 状态实例。如果未找到方块状态实例,则返回 `undefined`。 Returns the [Block](/server/enums/CustomCommandSource.md#block) state instance if it is found. If the block state instance is not found returns undefined. #### Remarks 检索特定的方块状态实例。 Retrieves a specific block state instance. *** ### getAll() > `static` **getAll**(): [`BlockStateType`](/server/classes/BlockStateType.md)\[] **`Beta`** #### Returns [`BlockStateType`](/server/classes/BlockStateType.md)\[] #### Remarks 检索所有可用方块状态的集合。 Retrieves a set of all available block states. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockStateType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockStateType.md. # Class: BlockStateType block **`Beta`** 表示方块的可配置状态值。例如,楼梯的朝向方向可以作为方块状态访问。 Represents a configurable state value of a block instance. For example, the facing direction of stairs is accessible as a block state. ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 方块属性的标识符。 Identifier of the block property. *** ### validValues > `readonly` **validValues**: (`string` | `number` | `boolean`)\[] **`Beta`** #### Remarks 方块属性的有效值集合。 A set of valid values for the block property. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockType.md. # Class: BlockType block **`Beta`** 方块的类型(或模板)。不包含置换数据(状态),仅包含其表示的方块类型。此类型在 1.17.10.21 版本引入。 The type (or template) of a block. Does not contain permutation data (state) other than the type of block it represents. This type was introduced as of version 1.17.10.21. ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 方块类型名称 - 例如 `minecraft:acacia_stairs`。 Block type name - for example, `minecraft:acacia_stairs`. *** ### localizationKey > `readonly` **localizationKey**: `string` **`Beta`** #### Remarks 此 BlockType 名称在 .lang 文件中使用的本地化键。 Key for the localization of this BlockType's name used in .lang files. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BlockTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BlockTypes.md. # Class: BlockTypes block **`Beta`** 包含此世界中可用的 Minecraft 方块类型目录。 Contains a catalog of Minecraft Block Types that are available in this world. ## Methods ### get() > `static` **get**(`typeName`): [`BlockType`](/server/classes/BlockType.md) | `undefined` **`Beta`** #### Parameters ##### typeName `string` 方块类型的标识符。应采用 namespace:id 模式,例如 minecraft:dirt。 Identifier of the block type. Should follow a namespace:id pattern, such as minecraft:dirt. #### Returns [`BlockType`](/server/classes/BlockType.md) | `undefined` BlockType 对象,如果该方块类型在此世界中不可用则返回 `undefined`。 BlockType object, or undefined if the block type is not available within this world. #### Remarks 返回指定标识符的 BlockType 对象。 Returns a BlockType object for the specified identifier. *** ### getAll() > `static` **getAll**(): [`BlockType`](/server/classes/BlockType.md)\[] **`Beta`** #### Returns [`BlockType`](/server/classes/BlockType.md)\[] #### Remarks 返回所有可用方块类型的集合。 Returns a collection of all available block types. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BookError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BookError.md. # Class: BookError error **`Beta`** 使用 [ItemBookComponent](/server/classes/ItemBookComponent.md) 时可能抛出的错误。 Errors that can be thrown when using [ItemBookComponent](/server/classes/ItemBookComponent.md). ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### reason > `readonly` **reason**: [`BookErrorReason`](/server/enums/BookErrorReason.md) **`Early Execution`** **`Beta`** #### Remarks 错误的原因。 The reason for the error. *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) - [BookPageContentError](/server/classes/BookPageContentError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/BookPageContentError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/BookPageContentError.md. # Class: BookPageContentError error **`Beta`** 当在 [ItemBookComponent](/server/classes/ItemBookComponent.md) 上设置的页面内容无效时(例如超过最大页面长度)调用的错误。 The error called if page content being set on an [ItemBookComponent](/server/classes/ItemBookComponent.md) are invalid ie. exceeding the maximum page length. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### pageIndex > `readonly` **pageIndex**: `number` **`Early Execution`** **`Beta`** #### Remarks 请求修改的页面索引。 The index of the page requested to be modified. *** ### reason > `readonly` **reason**: [`BookErrorReason`](/server/enums/BookErrorReason.md) **`Early Execution`** **`Beta`** #### Remarks 错误的原因。 The reason for the error. *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ButtonPushAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ButtonPushAfterEventSignal.md. # Class: ButtonPushAfterEventSignal event **`Beta`** 管理与按钮被按下时相关的回调。 ## Example **buttonPushEvent.ts** ```typescript import { world, system, BlockPermutation, ButtonPushAfterEvent, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function buttonPushEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // set up a button on cobblestone const cobblestone = targetLocation.dimension.getBlock(targetLocation); const button = targetLocation.dimension.getBlock({ x: targetLocation.x, y: targetLocation.y + 1, z: targetLocation.z, }); if (cobblestone === undefined || button === undefined) { log('Could not find block at location.'); return -1; } cobblestone.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.Cobblestone)); button.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.AcaciaButton).withState('facing_direction', 1)); world.afterEvents.buttonPush.subscribe((buttonPushEvent: ButtonPushAfterEvent) => { const eventLoc = buttonPushEvent.block.location; if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y + 1 && eventLoc.z === targetLocation.z) { log('Button push event at tick ' + system.currentTick); } }); } ``` ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个将在按钮被按下时调用的回调。 Adds a callback that will be called when a button is pushed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在按钮被按下时调用的回调。 Removes a callback from being called when a button is pushed. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Camera.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Camera.md. # Class: Camera **`Beta`** 包含与指定玩家的活动相机相关的方法。 Contains methods relating to the active camera for the specified player. ## Properties ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回该相机是否可访问和使用。当相机的拥有者玩家已加载且自身有效时,该相机被视为有效。 Returns whether the Camera is valid to access and use. A Camera is considered valid when the owning Player of the Camera is loaded and valid itself. ## Methods ### addShake() > **addShake**(`shakeCameraOptions`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### shakeCameraOptions [`CameraShakeOptions`](/server/interfaces/CameraShakeOptions.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### attachToEntity() > **attachToEntity**(`attachCameraOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### attachCameraOptions? [`CameraAttachOptions`](/server/interfaces/CameraAttachOptions.md) 相机要附加到的实体的选项。包含实体标识符和可选的实体位置。 Options for the entity the camera is attaching to. Contains the entity identifier and optional entity location. #### Returns `void` #### Remarks 将相机附加到非玩家实体上。 Attaches the camera to a non-player entity. #### Throws This function can throw errors. *** ### clear() > **clear**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 清除指定玩家的活动相机。使指定玩家结束任何进行中的相机视角,包括任何缓动相机运动,并返回到其正常视角。 Clears the active camera for the specified player. Causes the specified players to end any in-progress camera perspectives, including any eased camera motions, and return to their normal perspective. #### Throws This function can throw errors. *** ### fade() > **fade**(`fadeCameraOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### fadeCameraOptions? [`CameraFadeOptions`](/server/interfaces/CameraFadeOptions.md) 相机淡入淡出操作的附加选项。 Additional options around camera fade operations. #### Returns `void` #### Remarks 开始相机淡入淡出过渡。淡入淡出过渡是一种全屏颜色,会淡入、保持、然后淡出。 Begins a camera fade transition. A fade transition is a full-screen color that fades-in, holds, and then fades-out. #### Throws This function can throw errors. *** ### playAnimation() > **playAnimation**(`splineType`, `cameraAnimationOptions`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### splineType [`CatmullRomSpline`](/server/classes/CatmullRomSpline.md) | [`LinearSpline`](/server/classes/LinearSpline.md) ##### cameraAnimationOptions [`AnimationOptions`](/server/interfaces/AnimationOptions.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setCamera() > **setCamera**(`cameraPreset`, `setOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### cameraPreset `string` 在 JSON 中定义的相机预设文件的标识符。 Identifier of a camera preset file defined within JSON. ##### setOptions? [`CameraFixedBoomOptions`](/server/interfaces/CameraFixedBoomOptions.md) | [`CameraSetFacingOptions`](/server/interfaces/CameraSetFacingOptions.md) | [`CameraSetLocationOptions`](/server/interfaces/CameraSetLocationOptions.md) | [`CameraSetPosOptions`](/server/interfaces/CameraSetPosOptions.md) | [`CameraSetRotOptions`](/server/interfaces/CameraSetRotOptions.md) | [`CameraTargetOptions`](/server/interfaces/CameraTargetOptions.md) 相机的附加选项。 Additional options for the camera. #### Returns `void` #### Remarks 为指定玩家设置当前活动相机。 Sets the current active camera for the specified player. #### Throws This function can throw errors. *** ### setCameraWithEase() > **setCameraWithEase**(`cameraPreset`, `easeOptions`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### cameraPreset `string` 在 JSON 中定义的相机预设文件的标识符。 Identifier of a camera preset file defined within JSON. ##### easeOptions [`EaseOptions`](/server/interfaces/EaseOptions.md) 用于将相机从上一个位置缓动到当前位置的选项。 Options to ease the camera from the previous camera to the current one. #### Returns `void` #### Remarks 使用缓动设置当前活动相机。 Sets the current active camera with easing. #### Throws 当前在未启用实验性相机切换功能时,缓动到 `minecraft:first_person` 预设会抛出异常。 Throws when easing to minecraft:first\_person presets currently without the experimental cameras toggle enabled. *** ### setDefaultCamera() > **setDefaultCamera**(`cameraPreset`, `easeOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### cameraPreset `string` 在 JSON 中定义的相机预设文件的标识符。 Identifier of a camera preset file defined within JSON. ##### easeOptions? [`EaseOptions`](/server/interfaces/EaseOptions.md) 用于将相机缓动回其原始位置和旋转的选项。 Options to ease the camera back to its original position and rotation. #### Returns `void` #### Remarks 为指定玩家设置当前活动相机,并将位置和旋转重置为 JSON 中定义的值。 Sets the current active camera for the specified player and resets the position and rotation to the values defined in the JSON. #### Throws This function can throw errors. *** ### setFov() > **setFov**(`fovCameraOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### fovCameraOptions? [`CameraFovOptions`](/server/interfaces/CameraFovOptions.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### stopShaking() > **stopShaking**(): `void` **`Beta`** **`World Mutation`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CatmullRomSpline.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CatmullRomSpline.md. # Class: CatmullRomSpline **`Beta`** CatmullRom 样条曲线创建。 CatmullRom spline creation. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new CatmullRomSpline**(): `CatmullRomSpline` **`Beta`** #### Returns `CatmullRomSpline` ## Properties ### controlPoints > **controlPoints**: [`Vector3`](/server/interfaces/Vector3.md)\[] **`World Mutation`** **`Beta`** #### Remarks CatmullRom 曲线的控制点。 Control points for the CatmullRom curve. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ChatSendAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ChatSendAfterEvent.md. # Class: ChatSendAfterEvent event **`Beta`** 当玩家输入聊天消息时触发的事件。 An event that fires as players enter chat messages. ## Properties ### message > `readonly` **message**: `string` **`Beta`** #### Remarks 正在广播的消息。 Message that is being broadcast. *** ### sender > `readonly` **sender**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 发送聊天消息的玩家。 Player that sent the chat message. *** ### targets? > `readonly` `optional` **targets?**: [`Player`](/server/classes/Player.md)\[] **`Beta`** #### Remarks 可选的要接收此消息的玩家列表。如果已定义,此消息将直接发送给一个或多个玩家(即不进行广播)。 Optional list of players that will receive this message. If defined, this message is directly targeted to one or more players (i.e., is not broadcast.) ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ChatSendAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ChatSendAfterEventSignal.md. # Class: ChatSendAfterEventSignal event **`Beta`** 管理与聊天消息发送相关的回调。 Manages callbacks that are connected to chat messages being sent. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,当新的聊天消息发送时将被调用。 Adds a callback that will be called when new chat messages are sent. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使其在发送新的聊天消息时不再被调用。 Removes a callback from being called when new chat messages are sent. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ChatSendBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ChatSendBeforeEvent.md. # Class: ChatSendBeforeEvent event **`Beta`** 当玩家输入聊天消息时触发的事件。 An event that fires as players enter chat messages. ## Properties ### cancel > **cancel**: `boolean` **`Beta`** #### Remarks 如果在 beforeChat 事件处理程序中设置为 `true`,则此消息不会广播出去。 If set to true in a beforeChat event handler, this message is not broadcast out. *** ### message > `readonly` **message**: `string` **`Beta`** #### Remarks 正在广播的消息。 Message that is being broadcast. *** ### sender > `readonly` **sender**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 发送聊天消息的玩家。 Player that sent the chat message. *** ### targets? > `readonly` `optional` **targets?**: [`Player`](/server/classes/Player.md)\[] **`Beta`** #### Remarks 可选的要接收此消息的玩家列表。如果已定义,此消息将直接发送给一个或多个玩家(即不进行广播)。 Optional list of players that will receive this message. If defined, this message is directly targeted to one or more players (i.e., is not broadcast.) ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ChatSendBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ChatSendBeforeEventSignal.md. # Class: ChatSendBeforeEventSignal event **`Beta`** 管理与聊天消息发送前触发的事件相关的回调。 Manages callbacks that are connected to an event that fires before chat messages are sent. ## Example **customCommand.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function customCommand(targetLocation: DimensionLocation) { const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => { if (eventData.message.includes('cancel')) { // Cancel event if the message contains "cancel" eventData.cancel = true; } else { const args = eventData.message.split(' '); if (args.length > 0) { switch (args[0].toLowerCase()) { case 'echo': // Send a modified version of chat message world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`); break; case 'help': world.sendMessage(`Available commands: echo `); break; } } } }); } ``` ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns :::tip 以受限执行权限被调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks 添加一个回调,将在新的聊天消息发送之前被调用。 Adds a callback that will be called before new chat messages are sent. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks 移除一个回调,使其在新的聊天消息发送之前不再被调用。 Removes a callback from being called before new chat messages are sent. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CommandError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CommandError.md. # Class: CommandError error **`Beta`** 由命令执行失败抛出的错误类型。 Type of error thrown by failed command execution. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CommandResult.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CommandResult.md. # Class: CommandResult **`Beta`** 包含命令执行结果的返回数据。 Contains return data on the result of a command execution. ## Properties ### successCount > `readonly` **successCount**: `number` **`Beta`** #### Remarks 如果命令对多个实体、方块或物品进行操作,则返回此命令的成功应用次数。 If the command operates against a number of entities, blocks, or items, this returns the number of successful applications of this command. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Container.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Container.md. # Class: Container inventory **`Beta`** 表示一个可以容纳多组物品的容器。用于诸如玩家、运输矿车、羊驼等实体。 Represents a container that can hold sets of items. Used with entities such as Players, Chest Minecarts, Llamas, and more. ## Example **containers.ts** ```typescript import { ItemStack, EntityInventoryComponent, BlockInventoryComponent, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes, MinecraftItemTypes, MinecraftEntityTypes } from '@minecraft/vanilla-data'; function containers(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const xLocation = targetLocation; // left chest location const xPlusTwoLocation = { x: targetLocation.x + 2, y: targetLocation.y, z: targetLocation.z }; // right chest const chestCart = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.ChestMinecart, { x: targetLocation.x + 4, y: targetLocation.y, z: targetLocation.z, }); const xChestBlock = targetLocation.dimension.getBlock(xLocation); const xPlusTwoChestBlock = targetLocation.dimension.getBlock(xPlusTwoLocation); if (!xChestBlock || !xPlusTwoChestBlock) { log('Could not retrieve chest blocks.'); return; } xChestBlock.setType(MinecraftBlockTypes.Chest); xPlusTwoChestBlock.setType(MinecraftBlockTypes.Chest); const xPlusTwoChestInventoryComp = xPlusTwoChestBlock.getComponent('inventory') as BlockInventoryComponent; const xChestInventoryComponent = xChestBlock.getComponent('inventory') as BlockInventoryComponent; const chestCartInventoryComp = chestCart.getComponent('inventory') as EntityInventoryComponent; const xPlusTwoChestContainer = xPlusTwoChestInventoryComp.container; const xChestContainer = xChestInventoryComponent.container; const chestCartContainer = chestCartInventoryComp.container; if (!xPlusTwoChestContainer || !xChestContainer || !chestCartContainer) { log('Could not retrieve chest containers.'); return; } xPlusTwoChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Apple, 10)); if (xPlusTwoChestContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) { log('Expected apple in x+2 container slot index 0', -1); } xPlusTwoChestContainer.setItem(1, new ItemStack(MinecraftItemTypes.Emerald, 10)); if (xPlusTwoChestContainer.getItem(1)?.typeId !== MinecraftItemTypes.Emerald) { log('Expected emerald in x+2 container slot index 1', -1); } if (xPlusTwoChestContainer.size !== 27) { log('Unexpected size: ' + xPlusTwoChestContainer.size, -1); } if (xPlusTwoChestContainer.emptySlotsCount !== 25) { log('Unexpected emptySlotsCount: ' + xPlusTwoChestContainer.emptySlotsCount, -1); } xChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Cake, 10)); xPlusTwoChestContainer.transferItem(0, chestCartContainer); // transfer the apple from the xPlusTwo chest to a chest cart xPlusTwoChestContainer.swapItems(1, 0, xChestContainer); // swap the cake from x and the emerald from xPlusTwo if (chestCartContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) { log('Expected apple in minecraft chest container slot index 0', -1); } if (xChestContainer.getItem(0)?.typeId === MinecraftItemTypes.Emerald) { log('Expected emerald in x container slot index 0', -1); } if (xPlusTwoChestContainer.getItem(1)?.typeId === MinecraftItemTypes.Cake) { log('Expected cake in x+2 container slot index 1', -1); } } ``` ## Properties ### containerRules? > `readonly` `optional` **containerRules?**: [`ContainerRules`](/server/interfaces/ContainerRules.md) **`Beta`** #### Remarks 如果定义了这些规则,其他容器操作如果导致这些规则被违反则会抛出异常。例如,将潜影盒添加到原版 bundles 中。 If these rules are defined other container operations will throw if they cause these rules to be invalidated. For example, adding a shulker box to a vanilla bundle. *** ### emptySlotsCount > `readonly` **emptySlotsCount**: `number` **`Beta`** #### Remarks 容器中空槽位的数量。 Count of the slots in the container that are empty. #### Throws 如果容器无效则抛出异常。 Throws if the container is invalid. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回容器对象(或与此容器关联的实体或方块)在此上下文中是否仍然可用。 Returns whether a container object (or the entity or block that this container is associated with) is still available for use in this context. *** ### size > `readonly` **size**: `number` **`Beta`** #### Remarks 此容器中的槽位数。例如,一个标准的单方块箱子大小为 27。注意,玩家的物品栏容器共有 36 个槽位,9 个快捷栏槽位加 27 个物品栏槽位。 The number of slots in this container. For example, a standard single-block chest has a size of 27. Note, a player's inventory container contains a total of 36 slots, 9 hotbar slots plus 27 inventory slots. #### Throws 如果容器无效则抛出异常。 Throws if the container is invalid. *** ### weight > `readonly` **weight**: `number` **`Beta`** #### Remarks 容器中所有物品的总重量。 The combined weight of all items in the container. #### Throws This property can throw when used. [InvalidContainerError](/server/classes/InvalidContainerError.md) ## Methods ### addItem() > **addItem**(`itemStack`): [`ItemStack`](/server/classes/ItemStack.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### itemStack [`ItemStack`](/server/classes/ItemStack.md) 要添加的物品堆叠。 The stack of items to add. #### Returns [`ItemStack`](/server/classes/ItemStack.md) | `undefined` #### Remarks 向容器中添加一个物品。该物品将被放置在第一个可用的槽位中,并可以与相同类型的现有物品堆叠。请注意,如果希望在特定槽位中设置物品,请使用 [Container.setItem](#setitem)。 Adds an item to the container. The item is placed in the first available slot(s) and can be stacked with existing items of the same type. Note, use [Container.setItem](#setitem) if you wish to set the item in a particular slot. #### Throws 不会因超过重量限制而抛出 [ContainerRules](/server/interfaces/ContainerRules.md) 错误,而是会添加物品直至达到重量限制为止。 Won't throw [ContainerRules](/server/interfaces/ContainerRules.md) error for over weight limit but will instead add items up to the weight limit. [ContainerRulesError](/server/classes/ContainerRulesError.md) Error *** ### clearAll() > **clearAll**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 清空容器中的所有物品栏物品。 Clears all inventory items in the container. #### Throws 如果容器无效则抛出异常。 Throws if the container is invalid. *** ### contains() > **contains**(`itemStack`): `boolean` **`Beta`** #### Parameters ##### itemStack [`ItemStack`](/server/classes/ItemStack.md) 要查找的物品。 The item to find. #### Returns `boolean` #### Remarks 尝试在容器中查找一个物品。 Attempts to find an item inside the container #### Throws This function can throw errors. [InvalidContainerError](/server/classes/InvalidContainerError.md) *** ### find() > **find**(`itemStack`): `number` | `undefined` **`Beta`** #### Parameters ##### itemStack [`ItemStack`](/server/classes/ItemStack.md) 要查找的物品。 The item to find. #### Returns `number` | `undefined` #### Remarks 查找容器内第一个匹配物品的索引。 Find the index of the first instance of an item inside the container #### Throws This function can throw errors. [InvalidContainerError](/server/classes/InvalidContainerError.md) *** ### findLast() > **findLast**(`itemStack`): `number` | `undefined` **`Beta`** #### Parameters ##### itemStack [`ItemStack`](/server/classes/ItemStack.md) 要查找的物品。 The item to find. #### Returns `number` | `undefined` #### Remarks 查找容器内最后一个匹配物品的索引。 Find the index of the last instance of an item inside the container #### Throws This function can throw errors. [InvalidContainerError](/server/classes/InvalidContainerError.md) *** ### firstEmptySlot() > **firstEmptySlot**(): `number` | `undefined` **`Beta`** #### Returns `number` | `undefined` #### Remarks 查找容器内第一个空槽位的索引。 Finds the index of the first empty slot inside the container #### Throws This function can throw errors. [InvalidContainerError](/server/classes/InvalidContainerError.md) *** ### firstItem() > **firstItem**(): `number` | `undefined` **`Beta`** #### Returns `number` | `undefined` #### Remarks 查找容器内第一个物品的索引。 Finds the index of the first item inside the container #### Throws This function can throw errors. [InvalidContainerError](/server/classes/InvalidContainerError.md) *** ### getItem() > **getItem**(`slot`): [`ItemStack`](/server/classes/ItemStack.md) | `undefined` **`Beta`** #### Parameters ##### slot `number` 要从中检索物品的槽位的从零开始的索引。最小值:0 Zero-based index of the slot to retrieve items from. Minimum value: 0 #### Returns [`ItemStack`](/server/classes/ItemStack.md) | `undefined` #### Remarks 获取指定槽位中的 [ItemStack](/server/classes/ItemStack.md)。如果槽位为空,则返回 `undefined`。此方法不会更改或清空指定槽位的内容。要获取特定槽位的引用,请参阅 [Container.getSlot](#getslot)。 Gets an [ItemStack](/server/classes/ItemStack.md) of the item at the specified slot. If the slot is empty, returns `undefined`. This method does not change or clear the contents of the specified slot. To get a reference to a particular slot, see [Container.getSlot](#getslot). #### Throws 如果容器无效或 `slot` 索引超出范围则抛出异常。 Throws if the container is invalid or if the `slot` index is out of bounds. #### Example **getFirstHotbarItem.ts** ```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; } } ``` *** ### getSlot() > **getSlot**(`slot`): [`ContainerSlot`](/server/classes/ContainerSlot.md) **`Beta`** #### Parameters ##### slot `number` 要返回的槽位索引。此索引必须在容器的范围内。最小值:0 The index of the slot to return. This index must be within the bounds of the container. Minimum value: 0 #### Returns [`ContainerSlot`](/server/classes/ContainerSlot.md) #### Remarks 返回一个容器槽位。这作为给定索引处槽位的引用。 Returns a container slot. This acts as a reference to a slot at the given index for this container. #### Throws 如果容器无效或 `slot` 索引超出范围则抛出异常。 Throws if the container is invalid or if the `slot` index is out of bounds. *** ### moveItem() > **moveItem**(`fromSlot`, `toSlot`, `toContainer`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### fromSlot `number` 此容器中要移出物品的从零开始的索引。最小值:0 Zero-based index of the slot to transfer an item from, on this container. Minimum value: 0 ##### toSlot `number` `toContainer` 中要移入物品的从零开始的索引。最小值:0 Zero-based index of the slot to transfer an item to, on `toContainer`. Minimum value: 0 ##### toContainer `Container` 要移入的目标容器。注意可以是与源容器相同的容器。 Target container to transfer to. Note this can be the same container as the source. #### Returns `void` #### Remarks 将物品从一个槽位移到另一个槽位,可以跨容器移动。 Moves an item from one slot to another, potentially across containers. #### Throws 如果此容器或 `toContainer` 无效,或者 `fromSlot` 或 `toSlot` 索引超出范围则抛出异常。 Throws if either this container or `toContainer` are invalid or if the `fromSlot` or `toSlot` indices out of bounds. [ContainerRulesError](/server/classes/ContainerRulesError.md) Error #### Example **moveBetweenContainers.ts** ```typescript import { world, EntityInventoryComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function moveBetweenContainers(targetLocation: DimensionLocation) { const players = world.getAllPlayers(); const chestCart = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.ChestMinecart, { x: targetLocation.x + 1, y: targetLocation.y, z: targetLocation.z, }); if (players.length > 0) { const fromPlayer = players[0]; const fromInventory = fromPlayer.getComponent(EntityComponentTypes.Inventory) as EntityInventoryComponent; const toInventory = chestCart.getComponent(EntityComponentTypes.Inventory) as EntityInventoryComponent; if (fromInventory && toInventory && fromInventory.container && toInventory.container) { fromInventory.container.moveItem(0, 0, toInventory.container); } } } ``` *** ### setItem() > **setItem**(`slot`, `itemStack?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### slot `number` 要放置物品的槽位的从零开始的索引。最小值:0 Zero-based index of the slot to set an item at. Minimum value: 0 ##### itemStack? [`ItemStack`](/server/classes/ItemStack.md) 要放置在指定槽位中的物品堆叠。将 `itemStack` 设置为 `undefined` 将清空该槽位。 Stack of items to place within the specified slot. Setting `itemStack` to undefined will clear the slot. #### Returns `void` #### Remarks 在特定槽位中设置物品堆叠。 Sets an item stack within a particular slot. #### Throws 如果容器无效或 `slot` 索引超出范围则抛出异常。 Throws if the container is invalid or if the `slot` index is out of bounds. [ContainerRulesError](/server/classes/ContainerRulesError.md) Error *** ### swapItems() > **swapItems**(`slot`, `otherSlot`, `otherContainer`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### slot `number` 此容器中要交换的槽位的从零开始的索引。最小值:0 Zero-based index of the slot to swap from this container. Minimum value: 0 ##### otherSlot `number` 要交换的槽位的从零开始的索引。最小值:0 Zero-based index of the slot to swap with. Minimum value: 0 ##### otherContainer `Container` 要交换的目标容器。注意可以是与源容器相同的容器。 Target container to swap with. Note this can be the same container as this source. #### Returns `void` #### Remarks 在容器内的两个不同槽位之间交换物品。 Swaps items between two different slots within containers. #### Throws 如果此容器或 `otherContainer` 无效,或者 `slot` 或 `otherSlot` 超出范围则抛出异常。 Throws if either this container or `otherContainer` are invalid or if the `slot` or `otherSlot` are out of bounds. [ContainerRulesError](/server/classes/ContainerRulesError.md) Error *** ### transferItem() > **transferItem**(`fromSlot`, `toContainer`): [`ItemStack`](/server/classes/ItemStack.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### fromSlot `number` 此容器中要移出物品的从零开始的索引。最小值:0 Zero-based index of the slot to transfer an item from, on this container. Minimum value: 0 ##### toContainer `Container` 要移入的目标容器。注意可以是与源容器相同的容器。 Target container to transfer to. Note this can be the same container as the source. #### Returns [`ItemStack`](/server/classes/ItemStack.md) | `undefined` 包含无法转移的物品的 ItemStack。如果所有物品都已转移,则返回 `undefined`。 An itemStack with the items that couldn't be transferred. Returns undefined if all items were transferred. #### Remarks 将物品从一个槽位移到另一个容器,或移到同一容器中的第一个可用槽位。 Moves an item from one slot to another container, or to the first available slot in the same container. #### Throws 如果此容器或 `toContainer` 无效,或者 `fromSlot` 或 `toSlot` 索引超出范围则抛出异常。不会因超过重量限制而抛出 [ContainerRules](/server/interfaces/ContainerRules.md) 错误,而是会添加物品直至达到重量限制为止。 Throws if either this container or `toContainer` are invalid or if the `fromSlot` or `toSlot` indices out of bounds. Won't throw [ContainerRules](/server/interfaces/ContainerRules.md) error for over weight limit but will instead add items up to the weight limit. [ContainerRulesError](/server/classes/ContainerRulesError.md) Error #### Example **transferBetweenContainers.ts** ```typescript import { world, EntityInventoryComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function transferBetweenContainers(targetLocation: DimensionLocation) { const players = world.getAllPlayers(); const chestCart = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.ChestMinecart, { x: targetLocation.x + 1, y: targetLocation.y, z: targetLocation.z, }); if (players.length > 0) { const fromPlayer = players[0]; const fromInventory = fromPlayer.getComponent(EntityComponentTypes.Inventory) as EntityInventoryComponent; const toInventory = chestCart.getComponent(EntityComponentTypes.Inventory) as EntityInventoryComponent; if (fromInventory && toInventory && fromInventory.container && toInventory.container) { fromInventory.container.transferItem(0, toInventory.container); } } } ``` ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ContainerRulesError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ContainerRulesError.md. # Class: ContainerRulesError inventory error **`Beta`** 当容器操作违反了 [ContainerRules](/server/interfaces/ContainerRules.md) 时抛出的错误。 Error thrown if [ContainerRules](/server/interfaces/ContainerRules.md) are broken on container operations. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### reason > `readonly` **reason**: [`ContainerRulesErrorReason`](/server/enums/ContainerRulesErrorReason.md) **`Early Execution`** **`Beta`** #### Remarks 抛出该错误的具体原因。 The specific reason the error was thrown. *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [ContainerRulesErrorReason](/server/enums/ContainerRulesErrorReason.md) - [InvalidContainerError](/server/classes/InvalidContainerError.md) - [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ContainerSlot.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ContainerSlot.md. # Class: ContainerSlot inventory **`Beta`** 表示更广泛容器(例如实体物品栏)中的一个槽位。 Represents a slot within a broader container (e.g., entity inventory.) ## Properties ### amount > **amount**: `number` **`World Mutation`** **`Beta`** #### Remarks 堆叠中的物品数量。有效值范围为 1-255。提供的值将被限制到物品的最大堆叠大小。 Number of the items in the stack. Valid values range between 1-255. The provided value will be clamped to the item's maximum stack size. Bounds: \[1, 255] #### Throws 如果值超出 1-255 的范围则抛出异常。 Throws if the value is outside the range of 1-255. *** ### isStackable > `readonly` **isStackable**: `boolean` **`Beta`** #### Remarks 返回物品是否可堆叠。如果物品的最大堆叠大小大于 1,并且物品不包含任何自定义数据或属性,则该物品被视为可堆叠。 Returns whether the item is stackable. An item is considered stackable if the item's maximum stack size is greater than 1 and the item does not contain any custom data or properties. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回 ContainerSlot 是否有效。如果容器存在且已加载,并且槽位索引有效,则该容器槽位有效。 Returns whether the ContainerSlot is valid. The container slot is valid if the container exists and is loaded, and the slot index is valid. *** ### keepOnDeath > **keepOnDeath**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 获取或设置物品在死亡时是否保留。 Gets or sets whether the item is kept on death. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. *** ### lockMode > **lockMode**: [`ItemLockMode`](/server/enums/ItemLockMode.md) **`World Mutation`** **`Beta`** #### Remarks 获取或设置物品的锁定模式。默认值为 `ItemLockMode.none`。 Gets or sets the item's lock mode. The default value is `ItemLockMode.none`. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. *** ### maxAmount > `readonly` **maxAmount**: `number` **`Beta`** #### Remarks 最大堆叠大小。此值因物品类型而异。例如,火把的最大堆叠大小为 64,而鸡蛋的最大堆叠大小为 16。 The maximum stack size. This value varies depending on the type of item. For example, torches have a maximum stack size of 64, while eggs have a maximum stack size of 16. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### nameTag? > `optional` **nameTag?**: `string` **`World Mutation`** **`Beta`** #### Remarks 此物品堆叠的给定名称。悬停在物品上时会显示名称标签。将名称标签设置为空字符串或 `undefined` 将移除该名称标签。 Given name of this stack of items. The name tag is displayed when hovering over the item. Setting the name tag to an empty string or `undefined` will remove the name tag. #### Throws 如果槽位的容器无效则抛出异常。如果长度超过 255 个字符也会抛出异常。 Throws if the slot's container is invalid. Also throws if the length exceeds 255 characters. *** ### type > `readonly` **type**: [`ItemType`](/server/classes/ItemType.md) **`Beta`** #### Remarks 物品的类型。 The type of the item. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [EngineError](/common/classes/EngineError.md) [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 堆叠物品类型的标识符。如果未指定命名空间,则默认为 `minecraft:`。示例包括 `wheat` 或 `apple`。 Identifier of the type of items for the stack. If a namespace is not specified, 'minecraft:' is assumed. Examples include 'wheat' or 'apple'. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) ## Methods ### clearDynamicProperties() > **clearDynamicProperties**(): `void` **`Beta`** #### Returns `void` #### Remarks 清除此物品堆叠上设置的所有动态属性。 Clears all dynamic properties that have been set on this item stack. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### getCanDestroy() > **getCanDestroy**(): `string`\[] **`Beta`** #### Returns `string`\[] #### Remarks 返回此容器槽位中的物品是否可以被破坏。 Returns whether the item within this container slot can be destroyed. #### Throws This function can throw errors. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### getCanPlaceOn() > **getCanPlaceOn**(): `string`\[] **`Beta`** #### Returns `string`\[] #### Remarks 返回此容器槽位中的物品是否可以放置在方块上。 Returns if the item in this container slot can be placed on. #### Throws This function can throw errors. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### getDynamicProperty() > **getDynamicProperty**(`identifier`): `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` **`Beta`** #### Parameters ##### identifier `string` 属性标识符。 The property identifier. #### Returns `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` 返回属性的值,如果属性尚未设置则返回 `undefined`。 Returns the value for the property, or undefined if the property has not been set. #### Remarks 返回一个属性值。 Returns a property value. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### getDynamicPropertyIds() > **getDynamicPropertyIds**(): `string`\[] **`Beta`** #### Returns `string`\[] 此实体上设置的动态属性的字符串数组。 A string array of the dynamic properties set on this entity. #### Remarks 返回此物品堆叠上已使用的可用动态属性标识符集合。 Returns the available set of dynamic property identifiers that have been used on this item stack. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### getDynamicPropertyTotalByteCount() > **getDynamicPropertyTotalByteCount**(): `number` **`Beta`** #### Returns `number` #### Remarks 返回此实体当前存储的所有动态属性的总大小(以字节为单位)。包括键和值的大小。这对于诊断性能警告信号很有用——例如,如果一个实体有数兆字节的关联动态属性,它在各种设备上加载可能会很慢。 Returns the total size, in bytes, of all the dynamic properties that are currently stored for this entity. This includes the size of both the key and the value. This can be useful for diagnosing performance warning signs - if, for example, an entity has many megabytes of associated dynamic properties, it may be slow to load on various devices. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### getItem() > **getItem**(): [`ItemStack`](/server/classes/ItemStack.md) | `undefined` **`Beta`** #### Returns [`ItemStack`](/server/classes/ItemStack.md) | `undefined` 返回槽位中物品的副本。如果槽位为空则返回 `undefined`。 Returns a copy of the item in the slot. Returns undefined if the slot is empty. #### Remarks 创建物品堆叠的精确副本,包括任何自定义数据或属性。 Creates an exact copy of the item stack, including any custom data or properties. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### getLore() > **getLore**(): `string`\[] **`Beta`** #### Returns `string`\[] 一个 lore 字符串数组。如果物品没有 lore,则返回空数组。 An array of lore strings. If the item does not have lore, returns an empty array. #### Remarks 返回 ItemStack 的 lore 值——一个次要显示字符串。 Returns the lore value - a secondary display string - for an ItemStack. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### getRawLore() > **getRawLore**(): [`RawMessage`](/server/interfaces/RawMessage.md)\[] **`Beta`** #### Returns [`RawMessage`](/server/interfaces/RawMessage.md)\[] 一个 lore 行数组。如果物品没有 lore,则返回空数组。 An array of lore lines. If the item does not have lore, returns an empty array. #### Remarks 返回 ItemStack 的 lore 值——一个次要显示字符串。字符串类型的 lore 行将被转换为 [RawMessage](/server/interfaces/RawMessage.md) 并放置在 [RawMessage.text](/server/interfaces/RawMessage.md#text) 下。 Returns the lore value - a secondary display string - for an ItemStack. String lore lines will be converted to a [RawMessage](/server/interfaces/RawMessage.md) and put under [RawMessage.text](/server/interfaces/RawMessage.md#text). #### Throws This function can throw errors. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### getTags() > **getTags**(): `string`\[] **`Beta`** #### Returns `string`\[] 返回槽位中物品的所有标签。如果槽位为空则返回空数组。 Returns all tags for the item in the slot. Return an empty array if the the slot is empty. #### Remarks 返回槽位中物品的所有标签。 Returns all tags for the item in the slot. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### hasItem() > **hasItem**(): `boolean` **`Beta`** #### Returns `boolean` #### Remarks 返回此槽位是否拥有物品。 Returns true if this slot has an item. #### Throws This function can throw errors. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### hasTag() > **hasTag**(`tag`): `boolean` **`Beta`** #### Parameters ##### tag `string` 物品标签。 The item tag. #### Returns `boolean` 如果槽位为空或槽位中的物品不具有给定标签,则返回 `false`。 Returns false when the slot is empty or the item in the slot does not have the given tag. #### Remarks 返回槽位中的物品是否具有给定标签。 Returns whether the item in the slot slot has the given tag. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### isStackableWith() > **isStackableWith**(`itemStack`): `boolean` **`Beta`** #### Parameters ##### itemStack [`ItemStack`](/server/classes/ItemStack.md) 正在比较的 ItemStack。 The ItemStack that is being compared. #### Returns `boolean` 返回此物品堆叠是否可以与给定的 `itemStack` 堆叠。 Returns whether this item stack can be stacked with the given `itemStack`. #### Remarks 返回此物品堆叠是否可以与给定的 `itemStack` 堆叠。这是通过比较物品类型以及物品堆叠关联的任何自定义数据和属性来确定的。每个物品堆叠的数量不予考虑。 Returns whether this item stack can be stacked with the given `itemStack`. This is determined by comparing the item type and any custom data and properties associated with the item stacks. The amount of each item stack is not taken into consideration. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### setCanDestroy() > **setCanDestroy**(`blockIdentifiers?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockIdentifiers? `string`\[] 由标识符指定的方块列表。 The list of blocks, given by their identifiers. #### Returns `void` #### Remarks 在冒险模式下此物品可以破坏的方块类型列表。方块名称显示在物品的工具提示中。将该值设置为 `undefined` 将清除该列表。 The list of block types this item can break in Adventure mode. The block names are displayed in the item's tooltip. Setting the value to undefined will clear the list. #### Throws 如果槽位的容器无效则抛出异常。如果提供的任何方块标识符无效也会抛出异常。 Throws if the slot's container is invalid. Also throws if any of the provided block identifiers are invalid. Error [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### setCanPlaceOn() > **setCanPlaceOn**(`blockIdentifiers?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockIdentifiers? `string`\[] 由标识符指定的方块列表。 The list of blocks, given by their identifiers. #### Returns `void` #### Remarks 在冒险模式下此物品可以放置在上面的方块类型列表。这仅适用于方块物品。方块名称显示在物品的工具提示中。将该值设置为 `undefined` 将清除该列表。 The list of block types this item can be placed on in Adventure mode. This is only applicable to block items. The block names are displayed in the item's tooltip. Setting the value to undefined will clear the list. #### Throws 如果槽位的容器无效则抛出异常。如果提供的任何方块标识符无效也会抛出异常。 Throws if the slot's container is invalid. Also throws if any of the provided block identifiers are invalid. Error [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### setDynamicProperties() > **setDynamicProperties**(`values`): `void` **`Beta`** #### Parameters ##### values `Record`\<`string`, `boolean` | `number` | `string` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined`> 要设置的动态属性的键值对记录。如果数据值为 `null`,将会移除该属性。 A Record of key value pairs of the dynamic properties to set. If the data value is null, it will remove that property instead. #### Returns `void` #### Remarks 使用特定值设置多个动态属性。 Sets multiple dynamic properties with specific values. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) *** ### setDynamicProperty() > **setDynamicProperty**(`identifier`, `value?`): `void` **`Beta`** #### Parameters ##### identifier `string` 属性标识符。 The property identifier. ##### value? `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) 要设置的属性的数据值。如果值为 `null`,将会移除该属性。 Data value of the property to set. If the value is null, it will remove the property instead. #### Returns `void` #### Remarks 设置指定属性为一个值。 Sets a specified property to a value. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) *** ### setItem() > **setItem**(`itemStack?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### itemStack? [`ItemStack`](/server/classes/ItemStack.md) 要放置在槽位中的 ItemStack。 The ItemStack to be placed in the slot. #### Returns `void` #### Remarks 在槽位中设置给定的 ItemStack,替换任何现有物品。 Sets the given ItemStack in the slot, replacing any existing item. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [ContainerRulesError](/server/classes/ContainerRulesError.md) [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) *** ### setLore() > **setLore**(`loreList?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### loreList? (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[] 一个 lore 字符串列表。将此参数设置为 `undefined` 将清除 lore。 A list of lore strings. Setting this argument to undefined will clear the lore. #### Returns `void` #### Remarks 设置 ItemStack 的 lore 值——一个次要显示字符串。 Sets the lore value - a secondary display string - for an ItemStack. #### Throws 如果槽位的容器无效则抛出异常。 Throws if the slot's container is invalid. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) Error [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CustomCommandError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomCommandError.md. # Class: CustomCommandError error **`Beta`** 当 CustomCommandRegistry 操作发生错误时抛出的错误对象。 Error object thrown when CustomCommandRegistry errors occur. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### reason > `readonly` **reason**: [`CustomCommandErrorReason`](/server/enums/CustomCommandErrorReason.md) **`Early Execution`** **`Beta`** #### Remarks 错误的原因。 Reason for the error. *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CustomCommandOrigin.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomCommandOrigin.md. # Class: CustomCommandOrigin **`Beta`** 关于命令来源的详细信息。 Details about the origins of the command. ## Properties ### initiator? > `readonly` `optional` **initiator?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 如果此命令是通过 NPC 发起的,则返回发起 NPC 对话的实体。 If this command was initiated via an NPC, returns the entity that initiated the NPC dialogue. *** ### sourceBlock? > `readonly` `optional` **sourceBlock?**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 如果此命令是通过方块(如命令方块)触发的,则为来源方块。 Source block if this command was triggered via a block (e.g., a commandblock.) *** ### sourceEntity? > `readonly` `optional` **sourceEntity?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 如果此命令是由实体(如 NPC)触发的,则为来源实体。 Source entity if this command was triggered by an entity (e.g., a NPC). *** ### sourceType > `readonly` **sourceType**: [`CustomCommandSource`](/server/enums/CustomCommandSource.md) **`Beta`** #### Remarks 返回触发此命令的来源类型。 Returns the type of source that fired this command. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CustomCommandRegistry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomCommandRegistry.md. # Class: CustomCommandRegistry **`Beta`** 提供注册自定义命令的功能。 Provides the functionality for registering custom commands. ## Methods ### registerCommand() > **registerCommand**(`customCommand`, `callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### customCommand [`CustomCommand`](/server/interfaces/CustomCommand.md) ##### callback (`origin`, ...`args`) => [`CustomCommandResult`](/server/interfaces/CustomCommandResult.md) | `undefined` 命令执行时触发的回调。 The callback triggered when the command executes. #### Returns `void` #### Remarks 注册一个自定义命令,该命令在执行时触发脚本回调。 Registers a custom command that when executed triggers a script callback. #### Throws This function can throw errors. [CustomCommandError](/server/classes/CustomCommandError.md) [EngineError](/common/classes/EngineError.md) [NamespaceNameError](/server/classes/NamespaceNameError.md) *** ### registerEnum() > **registerEnum**(`name`, `values`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### name `string` ##### values `string`\[] #### Returns `void` #### Remarks 注册一个自定义命令枚举。 Registers a custom command enum. #### Throws This function can throw errors. [CustomCommandError](/server/classes/CustomCommandError.md) [EngineError](/common/classes/EngineError.md) [NamespaceNameError](/server/classes/NamespaceNameError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CustomComponentInvalidRegistryError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomComponentInvalidRegistryError.md. # Class: CustomComponentInvalidRegistryError error component **`Beta`** 在系统启动事件之外尝试注册自定义组件时抛出的错误。 Thrown when trying to register a custom component outside of the system startup event. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [CustomComponentNameError](/server/classes/CustomComponentNameError.md) - [CustomComponentNameErrorReason](/server/enums/CustomComponentNameErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CustomComponentNameError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomComponentNameError.md. # Class: CustomComponentNameError error component **`Beta`** 当自定义组件名称包含无效字符时抛出的错误。 Thrown when trying to register a custom component with a name that contains invalid characters. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### reason > `readonly` **reason**: [`CustomComponentNameErrorReason`](/server/enums/CustomComponentNameErrorReason.md) **`Early Execution`** **`Beta`** #### Remarks *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [CustomComponentInvalidRegistryError](/server/classes/CustomComponentInvalidRegistryError.md) - [CustomComponentNameErrorReason](/server/enums/CustomComponentNameErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CustomComponentParameters.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomComponentParameters.md. # Class: CustomComponentParameters component **`Beta`** 包含自定义组件的 JSON 参数。 Contains the custom component's JSON parameters ## Properties ### params > `readonly` **params**: `unknown` **`Beta`** #### Remarks 包含来自自定义组件定义的参数的 JSON 对象。 JSON object containing the parameters from the custom component definition ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CustomDimensionAlreadyRegisteredError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomDimensionAlreadyRegisteredError.md. # Class: CustomDimensionAlreadyRegisteredError dimension error **`Beta`** 当尝试注册一个已注册过的自定义维度名称时抛出的错误。 Thrown when trying to register a custom dimension with a name that has already been registered. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError.md) - [CustomDimensionNameError](/server/classes/CustomDimensionNameError.md) - [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CustomDimensionInvalidRegistryError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomDimensionInvalidRegistryError.md. # Class: CustomDimensionInvalidRegistryError dimension error **`Beta`** 在系统启动事件之外尝试注册自定义维度时抛出的错误。 Thrown when trying to register a custom dimension outside of the system startup event. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError.md) - [CustomDimensionNameError](/server/classes/CustomDimensionNameError.md) - [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CustomDimensionNameError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomDimensionNameError.md. # Class: CustomDimensionNameError dimension error **`Beta`** 当尝试使用包含无效字符的名称注册自定义维度时抛出的错误。 Thrown when trying to register a custom dimension with a name that contains invalid characters. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError.md) - [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError.md) - [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/CustomDimensionReloadNewDimensionError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomDimensionReloadNewDimensionError.md. # Class: CustomDimensionReloadNewDimensionError dimension error **`Beta`** 在使用 /reload 命令后,尝试注册一个之前未注册的自定义维度时抛出的错误。在重载期间不能添加新的自定义维度。 Thrown after using the /reload command when trying to register a custom dimension that was not previously registered. New custom dimensions cannot be added during a reload. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError.md) - [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError.md) - [CustomDimensionNameError](/server/classes/CustomDimensionNameError.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/DataDrivenEntityTriggerAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/DataDrivenEntityTriggerAfterEvent.md. # Class: DataDrivenEntityTriggerAfterEvent event entity **`Beta`** 包含与数据驱动实体事件触发相关的信息——例如,鸡的 `minecraft:ageable_grow_up` 事件。 Contains information related to firing of a data driven entity event - for example, the minecraft:ageable\_grow\_up event on a chicken. ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 触发事件的实体。 Entity that the event triggered on. *** ### eventId > `readonly` **eventId**: `string` **`Beta`** #### Remarks 正在触发的数据驱动事件的名称。 Name of the data driven event being triggered. ## Methods ### getModifiers() > **getModifiers**(): [`DefinitionModifier`](/server/interfaces/DefinitionModifier.md)\[] **`Beta`** #### Returns [`DefinitionModifier`](/server/interfaces/DefinitionModifier.md)\[] #### Remarks 一个可更新的组件状态修改列表,是此触发事件的效果。 An updateable list of modifications to component state that are the effect of this triggered event. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) - [EntityContainerClosedAfterEventSignal](/server/classes/EntityContainerClosedAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/DataDrivenEntityTriggerAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/DataDrivenEntityTriggerAfterEventSignal.md. # Class: DataDrivenEntityTriggerAfterEventSignal event entity **`Beta`** 包含与数据驱动实体事件触发相关的事件注册信息——例如,鸡的 `minecraft:ageable_grow_up` 事件。 Contains event registration related to firing of a data driven entity event - for example, the minecraft:ageable\_grow\_up event on a chicken. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityDataDrivenTriggerEventOptions`](/server/interfaces/EntityDataDrivenTriggerEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,将在数据驱动实体事件触发后被调用。 Adds a callback that will be called after a data driven entity event is triggered. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使其在数据驱动实体事件触发后不再被调用。 Removes a callback that will be called after a data driven entity event is triggered. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) - [EntityContainerClosedAfterEventSignal](/server/classes/EntityContainerClosedAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Dimension.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Dimension.md. # Class: Dimension dimension **`Beta`** A class that represents a particular dimension (e.g., The End) within a world. ## Properties ### heightRange > `readonly` **heightRange**: `NumberRange` **`Beta`** #### Remarks Height range of the dimension. #### Throws This property can throw when used. *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Identifier of the dimension. *** ### localizationKey > `readonly` **localizationKey**: `string` **`Beta`** #### Remarks Key for the localization of a dimension's name used by language files. ## Methods ### calculateClosestBiomeFromSeed() > **calculateClosestBiomeFromSeed**(`pos`, `biomeToFind`, `options?`): [`Vector3`](/server/interfaces/Vector3.md) | `undefined` **`Beta`** #### Parameters ##### pos [`Vector3`](/server/interfaces/Vector3.md) Starting location to look for a biome to find. ##### biomeToFind `string` | [`BiomeType`](/server/classes/BiomeType.md) Identifier of the biome to look for. ##### options? [`BiomeSearchOptions`](/server/interfaces/BiomeSearchOptions.md) Additional selection criteria for a biome search. #### Returns [`Vector3`](/server/interfaces/Vector3.md) | `undefined` Returns a location of the biome, or undefined if a biome could not be found. #### Preview #### Remarks Calculates the location of the closest biome of a particular type from the world seed. Note that calculateClosestBiomeFromSeed can be an expensive operation, so avoid using many of these calls within a particular tick. The result is derived purely from the world generation algorithm and the world seed, so the returned location may not reflect the actual current terrain if biomes have been modified after generation. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) Error *** ### cloneBlocks() > **cloneBlocks**(`beginLocation`, `endLocation`, `destination`, `cloneMode`, `filter?`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### beginLocation [`Vector3`](/server/interfaces/Vector3.md) The lower northwest starting corner of the area to clone from. ##### endLocation [`Vector3`](/server/interfaces/Vector3.md) The upper southeast ending corner of the area to clone from. ##### destination [`Vector3`](/server/interfaces/Vector3.md) The lower northwest starting corner of the area to clone to. ##### cloneMode [`CloneMode`](/server/enums/CloneMode.md) Specifies how the cloned blocks should be placed at the destination. ##### filter? [`BlockFilter`](/server/interfaces/BlockFilter.md) An optional block filter used to include only matching blocks from the source area. #### Returns `void` #### Remarks Clones a region of blocks from one area of the dimension to another. #### Throws This function can throw errors. Error [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### containsBiomes() > **containsBiomes**(`volume`, `biomeFilter`, `isSuperset`): `boolean` **`Beta`** #### Parameters ##### volume [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md) Area to check biomes in. ##### biomeFilter [`BiomeFilter`](/server/interfaces/BiomeFilter.md) A list of biomes to include and exclude. A list of tags to include and exclude. Will return false if a biome is found in the area that is in the excluded list or contains any of the excluded tags. ##### isSuperset `boolean` Superset is used to determine the strictness of the filter. If superset is set to true then the area must contain one or more biomes in the included list or that contains all of the included tags. If superset is set to false then the area must contain only biomes in the included list and that contain all of the included tags #### Returns `boolean` Returns true if the biomes in the area match the filter settings passed in. Otherwise, returns false. #### Remarks Checks if an area contains the specified biomes. If the area is partially inside world boundaries, only the area that is in bounds will be searched. This operation takes longer proportional to both the area of the volume and the number of biomes to check. #### Throws An error will be thrown if the area provided includes unloaded chunks. An error will be thrown if the area provided is completely outside the world boundaries. An error will be thrown if an unknown biome name is provided. [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) [UnloadedChunksError](/server/classes/UnloadedChunksError.md) *** ### containsBlock() > **containsBlock**(`volume`, `filter`, `allowUnloadedChunks?`): `boolean` **`Beta`** #### Parameters ##### volume [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md) Volume of blocks that will be checked. ##### filter [`BlockFilter`](/server/interfaces/BlockFilter.md) Block filter that will be checked against each block in the volume. ##### allowUnloadedChunks? `boolean` If set to true will suppress the UnloadedChunksError if some or all of the block volume is outside of the loaded chunks. Will only check the block locations that are within the loaded chunks in the volume. Defaults to: false #### Returns `boolean` Returns true if at least one block in the volume satisfies the filter, false otherwise. #### Remarks Searches the block volume for a block that satisfies the block filter. #### Throws This function can throw errors. Error [UnloadedChunksError](/server/classes/UnloadedChunksError.md) *** ### createExplosion() > **createExplosion**(`location`, `radius`, `explosionOptions?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) The location of the explosion. ##### radius `number` Radius, in blocks, of the explosion to create. Bounds: \[0, 1000] ##### explosionOptions? [`ExplosionOptions`](/server/interfaces/ExplosionOptions.md) Additional configurable options for the explosion. #### Returns `boolean` #### Remarks Creates an explosion at the specified location. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) #### Examples **createExplosion.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; function createExplosion(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { log('Creating an explosion of radius 10.'); targetLocation.dimension.createExplosion(targetLocation, 10); } ``` **createNoBlockExplosion.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { Vector3Utils } from '@minecraft/math'; function createNoBlockExplosion(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const explodeNoBlocksLoc = Vector3Utils.floor(Vector3Utils.add(targetLocation, { x: 1, y: 2, z: 1 })); log('Creating an explosion of radius 15 that does not break blocks.'); targetLocation.dimension.createExplosion(explodeNoBlocksLoc, 15, { breaksBlocks: false }); } ``` **createExplosions.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { Vector3Utils } from '@minecraft/math'; function createExplosions(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const explosionLoc = Vector3Utils.add(targetLocation, { x: 0.5, y: 0.5, z: 0.5 }); log('Creating an explosion of radius 15 that causes fire.'); targetLocation.dimension.createExplosion(explosionLoc, 15, { causesFire: true }); const belowWaterLoc = Vector3Utils.add(targetLocation, { x: 3, y: 1, z: 3 }); log('Creating an explosion of radius 10 that can go underwater.'); targetLocation.dimension.createExplosion(belowWaterLoc, 10, { allowUnderwater: true }); } ``` *** ### fillBlocks() > **fillBlocks**(`volume`, `block`, `options?`): [`ListBlockVolume`](/server/classes/ListBlockVolume.md) **`World Mutation`** **`Beta`** #### Parameters ##### volume [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md) Volume of blocks to be filled. ##### block `string` | [`BlockPermutation`](/server/classes/BlockPermutation.md) | [`BlockType`](/server/classes/BlockType.md) Type of block to fill the volume with. ##### options? [`BlockFillOptions`](/server/interfaces/BlockFillOptions.md) A set of additional options, such as a block filter which can be used to include / exclude specific blocks in the fill. #### Returns [`ListBlockVolume`](/server/classes/ListBlockVolume.md) Returns a ListBlockVolume which contains all the blocks that were placed. #### Remarks Fills an area of blocks with a specific block type. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) Error [UnloadedChunksError](/server/classes/UnloadedChunksError.md) *** ### getBiome() > **getBiome**(`location`): [`BiomeType`](/server/classes/BiomeType.md) **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) Location at which to check the biome. #### Returns [`BiomeType`](/server/classes/BiomeType.md) #### Remarks Returns the biome type at the specified location. #### Throws An error will be thrown if the location is out of world bounds. An error will be thrown if the location is in an unloaded chunk. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### getBlock() > **getBlock**(`location`): [`Block`](/server/classes/Block.md) | `undefined` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) The location at which to return a block. #### Returns [`Block`](/server/classes/Block.md) | `undefined` Block at the specified location, or 'undefined' if asking for a block at an unloaded chunk. #### Remarks Returns a block instance at the given location. #### Throws PositionInUnloadedChunkError: Exception thrown when trying to interact with a Block object that isn't in a loaded and ticking chunk anymore PositionOutOfWorldBoundariesError: Exception thrown when trying to interact with a position outside of dimension height range [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### getBlockAbove() > **getBlockAbove**(`location`, `options?`): [`Block`](/server/classes/Block.md) | `undefined` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) Location to retrieve the block above from. ##### options? [`BlockRaycastOptions`](/server/interfaces/BlockRaycastOptions.md) The options to decide if a block is a valid result. #### Returns [`Block`](/server/classes/Block.md) | `undefined` #### Remarks Gets the first block found above a given block location based on the given options (by default will find the first solid block above). #### Throws This function can throw errors. *** ### getBlockBelow() > **getBlockBelow**(`location`, `options?`): [`Block`](/server/classes/Block.md) | `undefined` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) Location to retrieve the block below from. ##### options? [`BlockRaycastOptions`](/server/interfaces/BlockRaycastOptions.md) The options to decide if a block is a valid result. #### Returns [`Block`](/server/classes/Block.md) | `undefined` #### Remarks Gets the first block found below a given block location based on the given options (by default will find the first solid block below). #### Throws This function can throw errors. *** ### getBlockFromRay() > **getBlockFromRay**(`location`, `direction`, `options?`): [`BlockRaycastHit`](/server/interfaces/BlockRaycastHit.md) | `undefined` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) Location from where to initiate the ray check. ##### direction [`Vector3`](/server/interfaces/Vector3.md) Vector direction to cast the ray. ##### options? [`BlockRaycastOptions`](/server/interfaces/BlockRaycastOptions.md) Additional options for processing this raycast query. #### Returns [`BlockRaycastHit`](/server/interfaces/BlockRaycastHit.md) | `undefined` #### Remarks Gets the first block that intersects with a vector emanating from a location. #### Throws This function can throw errors. *** ### getBlocks() > **getBlocks**(`volume`, `options`, `allowUnloadedChunks?`): [`ListBlockVolume`](/server/classes/ListBlockVolume.md) **`Beta`** #### Parameters ##### volume [`BlockVolumeBase`](/server/classes/BlockVolumeBase.md) Volume of blocks that will be checked. ##### options [`BlockQueryOptions`](/server/interfaces/BlockQueryOptions.md) Block query options including filter criteria and optional closest/farthest distance sorting from a location. ##### allowUnloadedChunks? `boolean` If set to true will suppress the UnloadedChunksError if some or all of the block volume is outside of the loaded chunks. Will only check the block locations that are within the loaded chunks in the volume. Defaults to: false #### Returns [`ListBlockVolume`](/server/classes/ListBlockVolume.md) Returns the ListBlockVolume that contains all the block locations that satisfied the block query options. #### Preview #### Remarks Gets all the blocks in a volume that satisfy the block query options. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) Error [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [UnloadedChunksError](/server/classes/UnloadedChunksError.md) *** ### getEntities() > **getEntities**(`options?`): [`Entity`](/server/classes/Entity.md)\[] **`Beta`** #### Parameters ##### options? [`EntityQueryOptions`](/server/interfaces/EntityQueryOptions.md) Additional options that can be used to filter the set of entities returned. #### Returns [`Entity`](/server/classes/Entity.md)\[] An entity array. #### Remarks Returns a set of entities based on a set of conditions defined via the EntityQueryOptions set of filter criteria. #### Throws This function can throw errors. [CommandError](/server/classes/CommandError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) #### Examples **bounceSkeletons.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function bounceSkeletons(targetLocation: DimensionLocation) { const mobs = ['creeper', 'skeleton', 'sheep']; // create some sample mob data for (let i = 0; i < 10; i++) { targetLocation.dimension.spawnEntity(mobs[i % mobs.length], targetLocation); } const eqo: EntityQueryOptions = { type: 'skeleton', }; for (const entity of targetLocation.dimension.getEntities(eqo)) { entity.applyKnockback(0, 0, 0, 1); } } ``` **tagsQuery.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function tagsQuery(targetLocation: DimensionLocation) { const mobs = ['creeper', 'skeleton', 'sheep']; // create some sample mob data for (let i = 0; i < 10; i++) { const mobTypeId = mobs[i % mobs.length]; const entity = targetLocation.dimension.spawnEntity(mobTypeId, targetLocation); entity.addTag('mobparty.' + mobTypeId); } const eqo: EntityQueryOptions = { tags: ['mobparty.skeleton'], }; for (const entity of targetLocation.dimension.getEntities(eqo)) { entity.kill(); } } ``` **testThatEntityIsFeatherItem.ts** ```typescript import { EntityItemComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; function testThatEntityIsFeatherItem( log: (message: string, status?: number) => void, targetLocation: DimensionLocation ) { const items = targetLocation.dimension.getEntities({ location: targetLocation, maxDistance: 20, }); for (const item of items) { const itemComp = item.getComponent(EntityComponentTypes.Item) as EntityItemComponent; if (itemComp) { if (itemComp.itemStack.typeId.endsWith('feather')) { log('Success! Found a feather', 1); } } } } ``` *** ### getEntitiesAtBlockLocation() > **getEntitiesAtBlockLocation**(`location`): [`Entity`](/server/classes/Entity.md)\[] **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) The location at which to return entities. #### Returns [`Entity`](/server/classes/Entity.md)\[] Zero or more entities at the specified location. #### Remarks Returns a set of entities at a particular location. *** ### getEntitiesFromRay() > **getEntitiesFromRay**(`location`, `direction`, `options?`): [`EntityRaycastHit`](/server/interfaces/EntityRaycastHit.md)\[] **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) ##### direction [`Vector3`](/server/interfaces/Vector3.md) ##### options? [`EntityRaycastOptions`](/server/interfaces/EntityRaycastOptions.md) Additional options for processing this raycast query. #### Returns [`EntityRaycastHit`](/server/interfaces/EntityRaycastHit.md)\[] #### Remarks Gets entities that intersect with a specified vector emanating from a location. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) *** ### getGeneratedStructures() > **getGeneratedStructures**(`location`): `any`\[] **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) Location at which to check for structures. #### Returns `any`\[] #### Remarks Returns a vector of generated structures that contain the specified location (ex: Pillager Outpost, Mineshaft, etc.). The vector will be empty if no structures are found. #### Throws An error will be thrown if the location is out of world bounds. An error will be thrown if the location is in an unloaded chunk. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### getLightLevel() > **getLightLevel**(`location`): `number` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) Location of the block we want to check the brightness of. #### Returns `number` The brightness level on the block. #### Remarks Returns the total brightness level of light shining on a certain block position. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) *** ### getPlayers() > **getPlayers**(`options?`): [`Player`](/server/classes/Player.md)\[] **`Beta`** #### Parameters ##### options? [`EntityQueryOptions`](/server/interfaces/EntityQueryOptions.md) Additional options that can be used to filter the set of players returned. #### Returns [`Player`](/server/classes/Player.md)\[] A player array. #### Remarks Returns a set of players based on a set of conditions defined via the EntityQueryOptions set of filter criteria. #### Throws This function can throw errors. [CommandError](/server/classes/CommandError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### getSkyLightLevel() > **getSkyLightLevel**(`location`): `number` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) Position of the block we want to check the brightness of. #### Returns `number` The brightness level on the block. #### Remarks Returns the brightness level of light shining from the sky on a certain block position. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) *** ### getTopmostBlock() > **getTopmostBlock**(`locationXZ`, `minHeight?`): [`Block`](/server/classes/Block.md) | `undefined` **`Beta`** #### Parameters ##### locationXZ [`VectorXZ`](/server/interfaces/VectorXZ.md) Location to retrieve the topmost block for. ##### minHeight? `number` The Y height to begin the search from. Defaults to the maximum dimension height. #### Returns [`Block`](/server/classes/Block.md) | `undefined` #### Remarks Returns the highest block at the given XZ location. #### Throws This function can throw errors. *** ### getWeather() > **getWeather**(): [`WeatherType`](/server/enums/WeatherType.md) **`Beta`** #### Returns [`WeatherType`](/server/enums/WeatherType.md) Returns a WeatherType that explains the broad category of weather that is currently going on. #### Remarks Returns the current weather. *** ### isChunkLoaded() > **isChunkLoaded**(`location`): `boolean` **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) Location to check if the chunk is loaded. #### Returns `boolean` #### Remarks Returns true if the chunk at the given location is loaded (and valid for use with scripting). *** ### placeFeature() > **placeFeature**(`featureName`, `location`, `shouldThrow?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### featureName `string` The string identifier for the feature. ##### location [`Vector3`](/server/interfaces/Vector3.md) Location to place the feature. ##### shouldThrow? `boolean` Specifies if the function call will throw an error if the feature could not be placed. Note: The function call will always throw an error if using an unknown feature name or trying to place in a unloaded chunk. Defaults to: false #### Returns `boolean` #### Remarks Places the given feature into the dimension at the specified location. #### Throws An error will be thrown if the feature name is invalid. An error will be thrown if the location is in an unloaded chunk. Error [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) *** ### placeFeatureRule() > **placeFeatureRule**(`featureRuleName`, `location`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### featureRuleName `string` The string identifier for the feature rule. ##### location [`Vector3`](/server/interfaces/Vector3.md) Location to place the feature rule. #### Returns `boolean` #### Remarks Places the given feature rule into the dimension at the specified location. #### Throws An error will be thrown if the feature rule name is invalid. An error will be thrown if the location is in an unloaded chunk. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) *** ### playSound() > **playSound**(`soundId`, `location`, `soundOptions?`): [`SoundInstance`](/server/classes/SoundInstance.md) **`World Mutation`** **`Beta`** #### Parameters ##### soundId `string` Identifier of the sound. ##### location [`Vector3`](/server/interfaces/Vector3.md) Location of the sound. ##### soundOptions? [`WorldSoundOptions`](/server/interfaces/WorldSoundOptions.md) Additional options for configuring additional effects for the sound. #### Returns [`SoundInstance`](/server/classes/SoundInstance.md) #### Remarks Plays a sound for all players. #### Throws An error will be thrown if volume is less than 0.0. An error will be thrown if fade is less than 0.0. An error will be thrown if pitch is less than 0.01. An error will be thrown if volume is less than 0.0. [EngineError](/common/classes/EngineError.md) [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError.md) *** ### runCommand() > **runCommand**(`commandString`): [`CommandResult`](/server/classes/CommandResult.md) **`World Mutation`** **`Beta`** #### Parameters ##### commandString `string` Command to run. Note that command strings should not start with slash. #### Returns [`CommandResult`](/server/classes/CommandResult.md) Returns a command result with a count of successful values from the command. #### Remarks Runs a command synchronously using the context of the broader dimenion. #### Throws Throws an exception if the command fails due to incorrect parameters or command syntax, or in erroneous cases for the command. Note that in many cases, if the command does not operate (e.g., a target selector found no matches), this method will not throw an exception. [CommandError](/server/classes/CommandError.md) *** ### setBlockPermutation() > **setBlockPermutation**(`location`, `permutation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) The location within the dimension to set the block. ##### permutation [`BlockPermutation`](/server/classes/BlockPermutation.md) The block permutation to set. #### Returns `void` #### Remarks Sets a block in the world using a BlockPermutation. BlockPermutations are blocks with a particular state. #### Throws Throws if the location is within an unloaded chunk or outside of the world bounds. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### setBlockType() > **setBlockType**(`location`, `blockType`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) The location within the dimension to set the block. ##### blockType `string` | [`BlockType`](/server/classes/BlockType.md) The type of block to set. This can be either a string identifier or a BlockType. The default block permutation is used. #### Returns `void` #### Remarks Sets a block at a given location within the dimension. #### Throws Throws if the location is within an unloaded chunk or outside of the world bounds. Error [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### setWeather() > **setWeather**(`weatherType`, `duration?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### weatherType [`WeatherType`](/server/enums/WeatherType.md) Set the type of weather to apply. ##### duration? `number` Sets the duration of the weather (in ticks). If no duration is provided, the duration will be set to a random duration between 300 and 900 seconds. Bounds: \[1, 1000000] #### Returns `void` #### Remarks Sets the current weather within the dimension #### Throws This function can throw errors. *** ### spawnEntity() > **spawnEntity**\<`T`>(`identifier`, `location`, `options?`): [`Entity`](/server/classes/Entity.md) **`World Mutation`** **`Beta`** #### Type Parameters ##### T `T` = `never` #### Parameters ##### identifier [`EntityIdentifierType`](/server/types/EntityIdentifierType.md)\<`NoInfer`\<`T`>> Identifier of the type of entity to spawn. If no namespace is specified, 'minecraft:' is assumed. ##### location [`Vector3`](/server/interfaces/Vector3.md) The location at which to create the entity. ##### options? [`SpawnEntityOptions`](/server/interfaces/SpawnEntityOptions.md) #### Returns [`Entity`](/server/classes/Entity.md) Newly created entity at the specified location. #### Remarks Creates a new entity (e.g., a mob) at the specified location. #### Throws This function can throw errors. [EntitySpawnError](/server/classes/EntitySpawnError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) #### Examples **spawnAdultHorse.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { Vector3Utils } from '@minecraft/math'; function spawnAdultHorse(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { log('Create a horse and triggering the ageable_grow_up event, ensuring the horse is created as an adult'); targetLocation.dimension.spawnEntity( 'minecraft:horse', Vector3Utils.add(targetLocation, { x: 0, y: 1, z: 0 }) ); } ``` **quickFoxLazyDog.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes, MinecraftEffectTypes } from '@minecraft/vanilla-data'; function quickFoxLazyDog(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const fox = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Fox, { x: targetLocation.x + 1, y: targetLocation.y + 2, z: targetLocation.z + 3, }); fox.addEffect(MinecraftEffectTypes.Speed, 10, { amplifier: 2, }); log('Created a fox.'); const wolf = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Wolf, { x: targetLocation.x + 4, y: targetLocation.y + 2, z: targetLocation.z + 3, }); wolf.addEffect(MinecraftEffectTypes.Slowness, 10, { amplifier: 2, }); wolf.isSneaking = true; log('Created a sneaking wolf.', 1); } ``` **triggerEvent.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function triggerEvent(targetLocation: DimensionLocation) { const creeper = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Creeper, targetLocation); creeper.triggerEvent('minecraft:start_exploding_forced'); } ``` *** ### spawnItem() > **spawnItem**(`itemStack`, `location`): [`Entity`](/server/classes/Entity.md) **`World Mutation`** **`Beta`** #### Parameters ##### itemStack [`ItemStack`](/server/classes/ItemStack.md) ##### location [`Vector3`](/server/interfaces/Vector3.md) The location at which to create the item stack. #### Returns [`Entity`](/server/classes/Entity.md) Newly created item stack entity at the specified location. #### Remarks Creates a new item stack as an entity at the specified location. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) #### Examples **itemStacks.ts** ```typescript import { ItemStack, DimensionLocation } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function itemStacks(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const oneItemLoc = { x: targetLocation.x + targetLocation.y + 3, y: 2, z: targetLocation.z + 1 }; const fiveItemsLoc = { x: targetLocation.x + 1, y: targetLocation.y + 2, z: targetLocation.z + 1 }; const diamondPickaxeLoc = { x: targetLocation.x + 2, y: targetLocation.y + 2, z: targetLocation.z + 4 }; const oneEmerald = new ItemStack(MinecraftItemTypes.Emerald, 1); const onePickaxe = new ItemStack(MinecraftItemTypes.DiamondPickaxe, 1); const fiveEmeralds = new ItemStack(MinecraftItemTypes.Emerald, 5); log(`Spawning an emerald at (${oneItemLoc.x}, ${oneItemLoc.y}, ${oneItemLoc.z})`); targetLocation.dimension.spawnItem(oneEmerald, oneItemLoc); log(`Spawning five emeralds at (${fiveItemsLoc.x}, ${fiveItemsLoc.y}, ${fiveItemsLoc.z})`); targetLocation.dimension.spawnItem(fiveEmeralds, fiveItemsLoc); log(`Spawning a diamond pickaxe at (${diamondPickaxeLoc.x}, ${diamondPickaxeLoc.y}, ${diamondPickaxeLoc.z})`); targetLocation.dimension.spawnItem(onePickaxe, diamondPickaxeLoc); } ``` **spawnFeatherItem.ts** ```typescript import { ItemStack, DimensionLocation } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function spawnFeatherItem(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const featherItem = new ItemStack(MinecraftItemTypes.Feather, 1); targetLocation.dimension.spawnItem(featherItem, targetLocation); log(`New feather created at ${targetLocation.x}, ${targetLocation.y}, ${targetLocation.z}!`); } ``` *** ### spawnParticle() > **spawnParticle**(`effectName`, `location`, `molangVariables?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### effectName `string` Identifier of the particle to create. ##### location [`Vector3`](/server/interfaces/Vector3.md) The location at which to create the particle emitter. ##### molangVariables? [`MolangVariableMap`](/server/classes/MolangVariableMap.md) A set of optional, customizable variables that can be adjusted for this particle. #### Returns `void` #### Remarks Creates a new particle emitter at a specified location in the world. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) #### Example **spawnParticle.ts** ```typescript import { MolangVariableMap, DimensionLocation } from '@minecraft/server'; function spawnParticle(targetLocation: DimensionLocation) { for (let i = 0; i < 100; i++) { const molang = new MolangVariableMap(); molang.setColorRGB('variable.color', { red: Math.random(), green: Math.random(), blue: Math.random() }); const newLocation = { x: targetLocation.x + Math.floor(Math.random() * 8) - 4, y: targetLocation.y + Math.floor(Math.random() * 8) - 4, z: targetLocation.z + Math.floor(Math.random() * 8) - 4, }; targetLocation.dimension.spawnParticle('minecraft:colored_flame_particle', newLocation, molang); } } ``` *** ### spawnXp() > **spawnXp**(`location`, `amount`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### location [`Vector3`](/server/interfaces/Vector3.md) The location at which to spawn the experience orb. ##### amount `number` The amount of experience to give the experience orb. Bounds: \[1, 12000] #### Returns `void` #### Remarks Spawns an experience orb at a specified location in the dimension. #### Throws This function can throw errors. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### stopAllSounds() > **stopAllSounds**(): `void` **`Beta`** **`World Mutation`** #### Returns `void` #### Remarks Stops all sounds from playing for all players. *** ### stopSound() > **stopSound**(`soundId`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### soundId `string` Identifier of the sound. #### Returns `void` #### Remarks Stops a sound from playing for all players. ## 同领域相关 - [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError.md) - [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError.md) - [CustomDimensionNameError](/server/classes/CustomDimensionNameError.md) - [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError.md) - [DimensionLocation](/server/interfaces/DimensionLocation.md) - [DimensionRegistry](/server/classes/DimensionRegistry.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/DimensionRegistry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/DimensionRegistry.md. # Class: DimensionRegistry dimension **`Beta`** 提供注册自定义维度的功能。自定义维度只能在系统启动事件期间注册。 Provides the functionality for registering custom dimensions. Custom dimensions can only be registered during the system startup event. ## Methods ### registerCustomDimension() > **registerCustomDimension**(`typeId`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### typeId `string` 自定义维度的命名空间标识符(例如,`mypack:my_dimension`)。必须包含命名空间,并仅使用有效的标识符字符。 The namespaced identifier for the custom dimension (e.g., 'mypack:my\_dimension'). Must include a namespace and use only valid identifier characters. #### Returns `void` #### Remarks 注册一个新的自定义维度类型。必须在系统启动事件期间调用。维度将使用虚空生成器创建。 Registers a new custom dimension type. Must be called during the system startup event. The dimension will be created using the void generator. #### Throws This function can throw errors. [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError.md) [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError.md) [CustomDimensionNameError](/server/classes/CustomDimensionNameError.md) [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError.md) [EngineError](/common/classes/EngineError.md) [NamespaceNameError](/server/classes/NamespaceNameError.md) ## 同领域相关 - [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError.md) - [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError.md) - [CustomDimensionNameError](/server/classes/CustomDimensionNameError.md) - [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError.md) - [Dimension](/server/classes/Dimension.md) - [DimensionLocation](/server/interfaces/DimensionLocation.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/DimensionType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/DimensionType.md. # Class: DimensionType dimension **`Beta`** 表示维度的一种类型。目前仅适用于原版维度。 Represents a type of dimension. Currently only works with Vanilla dimensions. ## Properties ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 维度类型的标识符。目前仅适用于原版维度。 Identifier of the dimension type. Currently only works with Vanilla dimensions. ## 同领域相关 - [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError.md) - [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError.md) - [CustomDimensionNameError](/server/classes/CustomDimensionNameError.md) - [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError.md) - [Dimension](/server/classes/Dimension.md) - [DimensionLocation](/server/interfaces/DimensionLocation.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/DimensionTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/DimensionTypes.md. # Class: DimensionTypes dimension **`Beta`** 用于访问所有可用的维度类型。目前仅适用于原版维度。 Used for accessing all available dimension types. Currently only works with Vanilla dimensions. ## Methods ### get() > `static` **get**(`dimensionTypeId`): [`DimensionType`](/server/classes/DimensionType.md) | `undefined` **`Early Execution`** **`Beta`** #### Parameters ##### dimensionTypeId `string` #### Returns [`DimensionType`](/server/classes/DimensionType.md) | `undefined` #### Remarks 使用基于字符串的标识符检索维度类型。目前仅适用于原版维度。 Retrieves a dimension type using a string-based identifier. Currently only works with Vanilla dimensions. *** ### getAll() > `static` **getAll**(): [`DimensionType`](/server/classes/DimensionType.md)\[] **`Early Execution`** **`Beta`** #### Returns [`DimensionType`](/server/classes/DimensionType.md)\[] #### Remarks 检索所有维度类型的数组。目前仅适用于原版维度。 Retrieves an array of all dimension types. Currently only works with Vanilla dimensions. ## 同领域相关 - [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError.md) - [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError.md) - [CustomDimensionNameError](/server/classes/CustomDimensionNameError.md) - [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError.md) - [Dimension](/server/classes/Dimension.md) - [DimensionLocation](/server/interfaces/DimensionLocation.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Effect.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Effect.md. # Class: Effect effect **`Beta`** 表示一个已添加到实体上的效果——例如中毒。 Represents an effect - like poison - that has been added to an Entity. ## Properties ### amplifier > `readonly` **amplifier**: `number` **`Beta`** #### Remarks 获取应用于此效果的放大器。示例值通常范围为 0 到 4。例如:效果"跳跃提升 II"的放大器值为 1。 Gets an amplifier that may have been applied to this effect. Sample values range typically from 0 to 4. Example: The effect 'Jump Boost II' will have an amplifier value of 1. #### Throws This property can throw when used. *** ### displayName > `readonly` **displayName**: `string` **`Beta`** #### Remarks 获取此效果的玩家友好名称。 Gets the player-friendly name of this effect. #### Throws This property can throw when used. *** ### duration > `readonly` **duration**: `number` **`Beta`** #### Remarks 获取此效果的整个指定持续时间(以 tick 为单位)。每秒有 20 tick。使用 [TicksPerSecond](/server/variables/TicksPerSecond.md) 常量在 tick 和秒之间进行转换。 Gets the entire specified duration, in ticks, of this effect. There are 20 ticks per second. Use [TicksPerSecond](/server/variables/TicksPerSecond.md) constant to convert between ticks and seconds. #### Throws This property can throw when used. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回一个效果实例在此上下文中是否可用于使用。 Returns whether an effect instance is available for use in this context. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 获取此效果的类型 ID。 Gets the type id of this effect. #### Throws This property can throw when used. ## 同领域相关 - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent.md) - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal.md) - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent.md) - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal.md) - [EffectType](/server/classes/EffectType.md) - [EffectTypes](/server/classes/EffectTypes.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EffectAddAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EffectAddAfterEvent.md. # Class: EffectAddAfterEvent event effect **`Beta`** 包含与将效果(如中毒)添加到实体相关的变化信息。 Contains information related to changes to an effect - like poison - being added to an entity. ## Properties ### effect > `readonly` **effect**: [`Effect`](/server/classes/Effect.md) **`Beta`** #### Remarks 效果的附加属性和详细信息。 Additional properties and details of the effect. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 正在添加效果的实体。 Entity that the effect is being added to. ## 同领域相关 - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal.md) - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent.md) - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EffectAddAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EffectAddAfterEventSignal.md. # Class: EffectAddAfterEventSignal event effect **`Beta`** 管理与将效果添加到实体时相关的回调。 Manages callbacks that are connected to when an effect is added to an entity. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityEventOptions`](/server/interfaces/EntityEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,当效果被添加到实体时将被调用。 Adds a callback that will be called when an effect is added to an entity. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使其在效果被添加到实体时不再被调用。 Removes a callback from being called when an effect is added to an entity. ## 同领域相关 - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent.md) - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent.md) - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EffectAddBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EffectAddBeforeEvent.md. # Class: EffectAddBeforeEvent event effect **`Beta`** 包含与将效果(如中毒)添加到实体相关的变化信息。 Contains information related to changes to an effect - like poison - being added to an entity. ## Properties ### cancel > **cancel**: `boolean` **`Beta`** #### Remarks 当设置为 `true` 时会取消事件。 When set to true will cancel the event. *** ### duration > **duration**: `number` **`Beta`** #### Remarks 效果的持续时间。 Effect duration. *** ### effectType > `readonly` **effectType**: `string` **`Beta`** #### Remarks 正在添加的效果的类型。 The type of the effect that is being added. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 正在添加效果的实体。 Entity that the effect is being added to. ## 同领域相关 - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent.md) - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal.md) - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EffectAddBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EffectAddBeforeEventSignal.md. # Class: EffectAddBeforeEventSignal event effect **`Beta`** 管理与将效果添加到实体时相关的回调。 Manages callbacks that are connected to when an effect is added to an entity. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns :::tip 以受限执行权限被调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks 添加一个回调,当效果被添加到实体时将被调用。 Adds a callback that will be called when an effect is added to an entity. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks 移除一个回调,使其在效果被添加到实体时不再被调用。 Removes a callback from being called when an effect is added to an entity. ## 同领域相关 - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent.md) - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal.md) - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EffectType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EffectType.md. # Class: EffectType effect **`Beta`** 表示一种效果类型——例如中毒——可以应用于实体。 Represents a type of effect - like poison - that can be applied to an entity. ## Methods ### getName() > **getName**(): `string` **`Beta`** #### Returns `string` 效果类型的标识符。 Identifier of the effect type. #### Remarks 此效果类型的标识符名称。 Identifier name of this effect type. ## 同领域相关 - [Effect](/server/classes/Effect.md) - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent.md) - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal.md) - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent.md) - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal.md) - [EffectTypes](/server/classes/EffectTypes.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EffectTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EffectTypes.md. # Class: EffectTypes effect **`Beta`** 表示一种效果类型——例如中毒——可以应用于实体。 Represents a type of effect - like poison - that can be applied to an entity. ## Methods ### get() > `static` **get**(`identifier`): [`EffectType`](/server/classes/EffectType.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` 效果的标识符。 The identifier for the effect. #### Returns [`EffectType`](/server/classes/EffectType.md) | `undefined` 返回给定标识符的效果类型,如果效果不存在则返回 `undefined`。 Effect type for the given identifier or undefined if the effect does not exist. #### Remarks 获取给定标识符的效果类型。 Effect type for the given identifier. *** ### getAll() > `static` **getAll**(): [`EffectType`](/server/classes/EffectType.md)\[] **`World Mutation`** **`Beta`** #### Returns [`EffectType`](/server/classes/EffectType.md)\[] 所有效果的列表。 A list of all effects. #### Remarks 获取所有效果。 Gets all effects. ## 同领域相关 - [Effect](/server/classes/Effect.md) - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent.md) - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal.md) - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent.md) - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal.md) - [EffectType](/server/classes/EffectType.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EnchantInfo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EnchantInfo.md. # Class: EnchantInfo **`Beta`** 附魔信息。 Enchantment information. ## Properties ### enchantment > `readonly` **enchantment**: `string` **`Beta`** 附魔的标识符。 The enchantment identifier. *** ### range > `readonly` **range**: `NumberRange` **`Beta`** 值的范围。 The value range. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EnchantmentLevelOutOfBoundsError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EnchantmentLevelOutOfBoundsError.md. # Class: EnchantmentLevelOutOfBoundsError error **`Beta`** 当附魔等级超出允许范围时抛出的错误。 Error thrown when an enchantment level is out of the allowed bounds. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EnchantmentType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EnchantmentType.md. # Class: EnchantmentType **`Beta`** 包含一种附魔类型的信息。 Contains information on a type of enchantment. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new EnchantmentType**(`enchantmentType`): `EnchantmentType` **`Beta`** #### Parameters ##### enchantmentType `string` #### Returns `EnchantmentType` #### Throws This function can throw errors. ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 附魔类型的名称。 The name of the enchantment type. *** ### maxLevel > `readonly` **maxLevel**: `number` **`Beta`** #### Remarks 此附魔类型可拥有的最大等级。 The maximum level this type of enchantment can have. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EnchantmentTypeNotCompatibleError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EnchantmentTypeNotCompatibleError.md. # Class: EnchantmentTypeNotCompatibleError error **`Beta`** 当附魔类型与指定物品不兼容时抛出的错误。 Error thrown when an enchantment type is not compatible with the specified item. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EnchantmentTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EnchantmentTypes.md. # Class: EnchantmentTypes **`Beta`** 包含此世界中可用的 Minecraft 附魔类型目录。 Contains a catalog of Minecraft Enchantment Types that are available in this world. ## Methods ### get() > `static` **get**(`enchantmentId`): [`EnchantmentType`](/server/classes/EnchantmentType.md) | `undefined` **`Beta`** #### Parameters ##### enchantmentId `string` 附魔的标识符。例如,`minecraft:flame`。 Identifier of the enchantment. For example, "minecraft:flame". #### Returns [`EnchantmentType`](/server/classes/EnchantmentType.md) | `undefined` 如果可用,返回表示指定附魔的 EnchantmentType 对象。 If available, returns an EnchantmentType object that represents the specified enchantment. #### Remarks 使用指定标识符检索附魔。 Retrieves an enchantment with the specified identifier. *** ### getAll() > `static` **getAll**(): [`EnchantmentType`](/server/classes/EnchantmentType.md)\[] **`Beta`** #### Returns [`EnchantmentType`](/server/classes/EnchantmentType.md)\[] #### Remarks 返回所有可用附魔类型的集合。 Returns a collection of all available enchantment types. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EnchantmentTypeUnknownIdError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EnchantmentTypeUnknownIdError.md. # Class: EnchantmentTypeUnknownIdError error **`Beta`** 当使用了未知的附魔类型标识符时抛出的错误。 Error thrown when an unknown enchantment type identifier is used. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityContainerClosedAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityContainerClosedAfterEvent.md. # Class: EntityContainerClosedAfterEvent event entity inventory **`Beta`** 包含关于特定实体容器被关闭的信息。 Contains information regarding a specific entity container being closed. ## Properties ### closeSource > `readonly` **closeSource**: [`ContainerAccessSource`](/server/interfaces/ContainerAccessSource.md) **`Beta`** #### Remarks 实体容器被关闭的来源。 The source of the entity container being closed. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** ## 同领域相关 - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEventSignal](/server/classes/EntityContainerClosedAfterEventSignal.md) - [EntityContainerOpenedAfterEvent](/server/classes/EntityContainerOpenedAfterEvent.md) - [EntityContainerOpenedAfterEventSignal](/server/classes/EntityContainerOpenedAfterEventSignal.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityContainerClosedAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityContainerClosedAfterEventSignal.md. # Class: EntityContainerClosedAfterEventSignal event entity inventory **`Beta`** Manages callbacks that are connected to when an entity container is closed. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityContainerAccessEventOptions`](/server/interfaces/EntityContainerAccessEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when an entity container is closed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when an entity container is closed. ## 同领域相关 - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) - [EntityContainerOpenedAfterEvent](/server/classes/EntityContainerOpenedAfterEvent.md) - [EntityContainerOpenedAfterEventSignal](/server/classes/EntityContainerOpenedAfterEventSignal.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityContainerOpenedAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityContainerOpenedAfterEvent.md. # Class: EntityContainerOpenedAfterEvent event entity inventory **`Beta`** Contains information regarding a specific entity container being opened. ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** *** ### openSource > `readonly` **openSource**: [`ContainerAccessSource`](/server/interfaces/ContainerAccessSource.md) **`Beta`** #### Remarks The source of the entity container being opened. ## 同领域相关 - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) - [EntityContainerClosedAfterEventSignal](/server/classes/EntityContainerClosedAfterEventSignal.md) - [EntityContainerOpenedAfterEventSignal](/server/classes/EntityContainerOpenedAfterEventSignal.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityContainerOpenedAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityContainerOpenedAfterEventSignal.md. # Class: EntityContainerOpenedAfterEventSignal event entity inventory **`Beta`** Manages callbacks that are connected to when an entity container is opened. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityContainerAccessEventOptions`](/server/interfaces/EntityContainerAccessEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when an entity container is opened. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when an entity container is opened. ## 同领域相关 - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) - [EntityContainerClosedAfterEventSignal](/server/classes/EntityContainerClosedAfterEventSignal.md) - [EntityContainerOpenedAfterEvent](/server/classes/EntityContainerOpenedAfterEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityDefinitionFeedItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityDefinitionFeedItem.md. # Class: EntityDefinitionFeedItem entity **`Beta`** 作为 Ageable 组件的一部分,表示一组可以喂给实体的物品及其促进成长的速率。 As part of the Ageable component, represents a set of items that can be fed to an entity and the rate at which that causes them to grow. ## Properties ### growth > `readonly` **growth**: `number` **`Beta`** #### Remarks 实体在喂食此物品时年龄增长的量。值通常在 0 到 1 之间。 The amount by which an entity's age will increase when fed this item. Values usually range between 0 and 1. *** ### item > `readonly` **item**: `string` **`Beta`** #### Remarks 可喂食物品类型的标识符。如果未指定命名空间,则默认为 `minecraft:`。示例值包括 `wheat` 或 `golden_apple`。 Identifier of type of item that can be fed. If a namespace is not specified, 'minecraft:' is assumed. Example values include 'wheat' or 'golden\_apple'. *** ### resultItem? > `readonly` `optional` **resultItem?**: `string` **`Beta`** #### Remarks 喂食后产生的物品的类型 ID。这通常为空,但用于某些场景,例如用一桶鱼喂食鹦鹉螺时,结果物品将是一个空桶。 Type ID of the resulting item after feeding has occurred. This will usually be empty but is used for scenarios such as feeding a Nautilus with a bucket of fish, where the result item will be an empty bucket. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityDieAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityDieAfterEvent.md. # Class: EntityDieAfterEvent event entity **`Beta`** 包含与游戏中实体死亡相关的数据。 Contains data related to the death of an entity in the game. ## Properties ### damageSource > `readonly` **damageSource**: [`EntityDamageSource`](/server/interfaces/EntityDamageSource.md) **`Beta`** #### Remarks 如果指定,提供关于导致此实体死亡的伤害来源的更多信息。 If specified, provides more information on the source of damage that caused the death of this entity. *** ### deadEntity > `readonly` **deadEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 现已死亡的实体对象。 Now-dead entity object. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityDieAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityDieAfterEventSignal.md. # Class: EntityDieAfterEventSignal event entity **`Beta`** Supports registering for an event that fires after an entity has died. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` Function to call when an entity dies. ##### options? [`EntityEventOptions`](/server/interfaces/EntityEventOptions.md) Additional filtering options for when the subscription fires. #### Returns Returns the closure that can be used in future downstream calls to unsubscribe. (`arg0`) => `void` #### Remarks Subscribes to an event that fires when an entity dies. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Stops this event from calling your function when an entity dies. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHealAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHealAfterEvent.md. # Class: EntityHealAfterEvent event entity **`Beta`** Contains information related to an entity having been healed. ## Properties ### healedEntity > `readonly` **healedEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks Entity that was healed. *** ### healing > `readonly` **healing**: `number` **`Beta`** #### Remarks Describes the amount of healing. *** ### healSource > `readonly` **healSource**: [`EntityHealSource`](/server/classes/EntityHealSource.md) **`Beta`** #### Remarks Information on the source of healing. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHealAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHealAfterEventSignal.md. # Class: EntityHealAfterEventSignal event entity **`Beta`** Manages callbacks that are connected to when an entity is healed. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityHealEventOptions`](/server/interfaces/EntityHealEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when an entity is healed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when an entity is healed. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHealBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHealBeforeEvent.md. # Class: EntityHealBeforeEvent event entity **`Beta`** Contains information related to an entity that will be healed. ## Properties ### cancel > **cancel**: `boolean` **`Beta`** *** ### healedEntity > `readonly` **healedEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks Entity that will be healed. *** ### healing > **healing**: `number` **`Beta`** #### Remarks Describes the amount of healing. *** ### healSource > `readonly` **healSource**: [`EntityHealSource`](/server/classes/EntityHealSource.md) **`Beta`** #### Remarks Information on the source of healing. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHealBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHealBeforeEventSignal.md. # Class: EntityHealBeforeEventSignal event entity **`Beta`** Manages callbacks that are connected to when an entity will be healed. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip This closure is called with restricted-execution privilege. ::: ##### options? [`EntityHealEventOptions`](/server/interfaces/EntityHealEventOptions.md) #### Returns :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks Adds a callback that will be called when an entity will be healed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks Removes a callback from being called when an entity will be healed. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHealSource.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHealSource.md. # Class: EntityHealSource entity **`Beta`** 提供有关治愈如何应用于实体的信息。 Provides information about how healing has been applied to an entity. ## Properties ### cause > `readonly` **cause**: [`EntityHealCause`](/server/enums/EntityHealCause.md) **`Beta`** #### Remarks 治愈来源的原因枚举值。 Cause enumerator of the source of healing. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHealthChangedAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHealthChangedAfterEvent.md. # Class: EntityHealthChangedAfterEvent event entity damage **`Beta`** Contains information related to an entity when its health changes. Warning: don't change the health of an entity in this event, or it will cause an infinite loop! ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks Entity whose health changed. *** ### newValue > `readonly` **newValue**: `number` **`Beta`** #### Remarks New health value of the entity. *** ### oldValue > `readonly` **oldValue**: `number` **`Beta`** #### Remarks Old health value of the entity. ## 同领域相关 - [EntityHealthChangedAfterEventSignal](/server/classes/EntityHealthChangedAfterEventSignal.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityApplyDamageByProjectileOptions](/server/interfaces/EntityApplyDamageByProjectileOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHealthChangedAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHealthChangedAfterEventSignal.md. # Class: EntityHealthChangedAfterEventSignal event entity damage **`Beta`** Manages callbacks that are connected to when the health of an entity changes. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityEventOptions`](/server/interfaces/EntityEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when the health of an entity changes. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when the health of an entity changes. ## 同领域相关 - [EntityHealthChangedAfterEvent](/server/classes/EntityHealthChangedAfterEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityApplyDamageByProjectileOptions](/server/interfaces/EntityApplyDamageByProjectileOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHitBlockAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHitBlockAfterEvent.md. # Class: EntityHitBlockAfterEvent event entity block **`Beta`** Contains information related to an entity hitting a block. ## Properties ### blockFace > `readonly` **blockFace**: [`Direction`](/server/enums/Direction.md) **`Beta`** #### Remarks Face of the block that was hit. *** ### damagingEntity > `readonly` **damagingEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks Entity that made the attack. *** ### hitBlock > `readonly` **hitBlock**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks Block that was hit by the attack. *** ### hitBlockPermutation > `readonly` **hitBlockPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks Block permutation that was hit by the attack. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityHitBlockAfterEventSignal](/server/classes/EntityHitBlockAfterEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHitBlockAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHitBlockAfterEventSignal.md. # Class: EntityHitBlockAfterEventSignal event entity block **`Beta`** Manages callbacks that are connected to when an entity hits a block. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityEventOptions`](/server/interfaces/EntityEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when an entity hits a block. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when an entity hits a block. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityHitBlockAfterEvent](/server/classes/EntityHitBlockAfterEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHitEntityAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHitEntityAfterEvent.md. # Class: EntityHitEntityAfterEvent event entity **`Beta`** 包含实体击中另一个实体后的相关信息。 Contains information related to an entity hitting another entity. ## Properties ### damagingEntity > `readonly` **damagingEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** *** ### hitEntity > `readonly` **hitEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHitEntityAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHitEntityAfterEventSignal.md. # Class: EntityHitEntityAfterEventSignal event entity **`Beta`** Manages callbacks that are connected to when an entity makes a melee attack on another entity. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityEventOptions`](/server/interfaces/EntityEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when an entity hits another entity. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when an entity makes a melee attack on another entity. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHurtAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHurtAfterEvent.md. # Class: EntityHurtAfterEvent event entity **`Beta`** 包含与实体受到伤害相关的信息。 Contains information related to an entity getting hurt. ## Properties ### damage > `readonly` **damage**: `number` **`Beta`** #### Remarks 描述造成的伤害量。 Describes the amount of damage caused. *** ### damageSource > `readonly` **damageSource**: [`EntityDamageSource`](/server/interfaces/EntityDamageSource.md) **`Beta`** #### Remarks 可能施加此伤害的实体的来源信息。 Source information on the entity that may have applied this damage. *** ### hurtEntity > `readonly` **hurtEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 受到伤害的实体。 Entity that was hurt. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHurtAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHurtAfterEventSignal.md. # Class: EntityHurtAfterEventSignal event entity **`Beta`** 管理与实体受到伤害时相关的回调。 Manages callbacks that are connected to when an entity is hurt. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityHurtAfterEventOptions`](/server/interfaces/EntityHurtAfterEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks 添加一个将在实体受到伤害时被调用的回调。 Adds a callback that will be called when an entity is hurt. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在实体受到伤害时被调用的回调。 Removes a callback from being called when an entity is hurt. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHurtBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHurtBeforeEvent.md. # Class: EntityHurtBeforeEvent event entity **`Beta`** 包含与即将受到伤害的实体相关的信息。 Contains information related to an entity that will be hurt. ## Properties ### cancel > **cancel**: `boolean` **`Beta`** *** ### damage > **damage**: `number` **`Beta`** #### Remarks 描述将要造成的伤害量。 Describes the amount of damage that will be caused. *** ### damageSource > `readonly` **damageSource**: [`EntityDamageSource`](/server/interfaces/EntityDamageSource.md) **`Beta`** #### Remarks 可能施加此伤害的实体的来源信息。 Source information on the entity that may have applied this damage. *** ### hurtEntity > `readonly` **hurtEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 将要受到伤害的实体。 Entity that will be hurt. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityHurtBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityHurtBeforeEventSignal.md. # Class: EntityHurtBeforeEventSignal event entity **`Beta`** 管理与实体将要受到伤害时相关的回调。 Manages callbacks that are connected to when an entity will be hurt. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: ##### options? [`EntityHurtBeforeEventOptions`](/server/interfaces/EntityHurtBeforeEventOptions.md) #### Returns :::tip 以受限执行权限调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks 添加一个将在实体将要受到伤害时被调用的回调。 Adds a callback that will be called when an entity will be hurt. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks 移除一个在实体将要受到伤害时被调用的回调。 Removes a callback from being called when an entity will be hurt. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityItemDropAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityItemDropAfterEvent.md. # Class: EntityItemDropAfterEvent event entity **`Beta`** 包含与实体已掉落物品相关的信息。 Contains information related to an entity having dropped items. ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 已掉落物品的实体。 The entity that has dropped the items. *** ### items > `readonly` **items**: [`Entity`](/server/classes/Entity.md)\[] **`Beta`** #### Remarks 实体已掉落的物品列表。 The list of items the entity has dropped. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityItemDropAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityItemDropAfterEventSignal.md. # Class: EntityItemDropAfterEventSignal event entity **`Beta`** 管理与实体已掉落物品时相关的回调。 Manages callbacks that are connected to when an entity has dropped items. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityItemDropEventOptions`](/server/interfaces/EntityItemDropEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks 添加一个将在实体已掉落物品时被调用的回调。 Adds a callback that will be called when an entity has dropped items. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在实体已掉落物品时被调用的回调。 Removes a callback from being called when an entity has dropped items. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityItemPickupAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityItemPickupAfterEvent.md. # Class: EntityItemPickupAfterEvent event entity **`Beta`** 包含与实体已拾取物品相关的信息。 Contains information related to an entity having picked up items. ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 已拾取物品的实体。 The entity that has picked up the items. *** ### items > `readonly` **items**: [`ItemStack`](/server/classes/ItemStack.md)\[] **`Beta`** #### Remarks 实体已拾取的物品列表。 The list of items the entity has picked up. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityItemPickupAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityItemPickupAfterEventSignal.md. # Class: EntityItemPickupAfterEventSignal event entity **`Beta`** 管理与实体已拾取物品时相关的回调。 Manages callbacks that are connected to when an entity has picked up items. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityItemPickupEventOptions`](/server/interfaces/EntityItemPickupEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks 添加一个将在实体已拾取物品时被调用的回调。 Adds a callback that will be called when an entity has picked up items. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在实体已拾取物品时被调用的回调。 Removes a callback from being called when an entity has picked up items. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityItemPickupBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityItemPickupBeforeEvent.md. # Class: EntityItemPickupBeforeEvent event entity **`Beta`** 包含与实体将要拾取物品相关的信息。 Contains information related to an entity picking up an item. ## Properties ### cancel > **cancel**: `boolean` **`Beta`** #### Remarks 如果设置为 `true`,则物品将不会被拾取。 If set to true the item will not be picked up. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 将要拾取物品的实体。 The entity that will pick up the item. *** ### item > `readonly` **item**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 将要被拾取的物品。 The item that will be picked up. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityItemPickupBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityItemPickupBeforeEventSignal.md. # Class: EntityItemPickupBeforeEventSignal event entity **`Beta`** 管理与实体将要拾取物品时相关的回调。 Manages callbacks that are connected to when an entity will pick up an item. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: ##### options? [`EntityItemPickupEventOptions`](/server/interfaces/EntityItemPickupEventOptions.md) #### Returns :::tip 以受限执行权限调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks 添加一个将在实体将要拾取物品时被调用的回调。 Adds a callback that will be called when an entity will pick up an item. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks 移除一个在实体将要拾取物品时被调用的回调。 Removes a callback from being called when an entity will pick up an item. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityLoadAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityLoadAfterEvent.md. # Class: EntityLoadAfterEvent event entity **`Beta`** Contains data related to an entity loaded within the world. This could happen when an unloaded chunk is reloaded, or when an entity changes dimensions. ## Properties ### entity > **entity**: [`Entity`](/server/classes/Entity.md) **`World Mutation`** **`Beta`** #### Remarks Entity that was loaded. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityLoadAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityLoadAfterEventSignal.md. # Class: EntityLoadAfterEventSignal event entity **`Beta`** 管理与实体加载后相关的回调。 Manages callbacks that are connected to after an entity is loaded. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,将在实体加载后被调用。 Adds a callback that will be called after an entity is loaded. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使其在实体加载后不再被调用。 Removes a callback from being called after an entity is loaded. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityRemoveAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityRemoveAfterEvent.md. # Class: EntityRemoveAfterEvent event entity **`Beta`** Data for an event that happens when an entity is removed from the world (for example, the entity is unloaded because it is not close to players.) ## Properties ### removedEntityId > `readonly` **removedEntityId**: `string` **`Beta`** #### Remarks Id of the entity that was removed. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks Identifier of the type of the entity removed - for example, 'minecraft:skeleton'. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityRemoveAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityRemoveAfterEventSignal.md. # Class: EntityRemoveAfterEventSignal event entity **`Beta`** Allows registration for an event that fires when an entity is removed from the game (for example, unloaded, or a few seconds after they are dead.) ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` Function to call. ##### options? [`EntityEventOptions`](/server/interfaces/EntityEventOptions.md) Additional filtering options for this event. #### Returns Returns a closure that can be used in subsequent unsubscribe operations. (`arg0`) => `void` #### Remarks Will call your function every time an entity is removed from the game. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Unsubscribes your function from subsequent calls when an entity is removed. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityRemoveBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityRemoveBeforeEvent.md. # Class: EntityRemoveBeforeEvent event entity **`Beta`** Data for an event that happens when an entity is being removed from the world (for example, the entity is unloaded because it is not close to players.) ## Properties ### removedEntity > `readonly` **removedEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks Reference to an entity that is being removed. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityRemoveBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityRemoveBeforeEventSignal.md. # Class: EntityRemoveBeforeEventSignal event entity **`Beta`** 管理与实体被移除前相关的回调。 Manages callbacks that are connected to before an entity is removed. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,将在实体被移除前调用。 Adds a callback that will be called before an entity is removed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使其在实体被移除前不再被调用。 Removes a callback from being called before an entity is removed. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntitySpawnAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntitySpawnAfterEvent.md. # Class: EntitySpawnAfterEvent event entity **`Beta`** Contains data related to an entity spawning within the world. ## Example **logEntitySpawnEvent.ts** ```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); } ``` ## Properties ### cause > `readonly` **cause**: [`EntityInitializationCause`](/server/enums/EntityInitializationCause.md) **`Beta`** #### Remarks Initialization cause (Spawned, Born ...). *** ### entity > **entity**: [`Entity`](/server/classes/Entity.md) **`World Mutation`** **`Beta`** #### Remarks Entity that was spawned. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntitySpawnAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntitySpawnAfterEventSignal.md. # Class: EntitySpawnAfterEventSignal event entity **`Beta`** Registers a script-based event handler for handling what happens when an entity spawns. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` Function that handles the spawn event. #### Returns (`arg0`) => `void` #### Remarks Method to register an event handler for what happens when an entity spawns. #### Example **logEntitySpawnEvent.ts** ```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); } ``` *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` Original function that was passed into the subscribe event, that is to be unregistered. #### Returns `void` #### Remarks Unregisters a method that was previously subscribed to the subscription event. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntitySpawnError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntitySpawnError.md. # Class: EntitySpawnError entity error **`Beta`** 实体生成失败时抛出的错误。 Error thrown when entity spawning fails. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [InvalidEntityComponentError](/server/classes/InvalidEntityComponentError.md) - [InvalidEntityError](/server/classes/InvalidEntityError.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityStartSneakingAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityStartSneakingAfterEvent.md. # Class: EntityStartSneakingAfterEvent event entity **`Beta`** 包含实体开始潜行后的相关数据。 Contains data related to an entity after it starts sneaking. ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityStartSneakingAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityStartSneakingAfterEventSignal.md. # Class: EntityStartSneakingAfterEventSignal event entity **`Beta`** Manages callbacks that are connected to when an entity begins sneaking. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntitySneakingChangedEventOptions`](/server/interfaces/EntitySneakingChangedEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when an entity begins sneaking. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when an entity begins sneaking. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityStopSneakingAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityStopSneakingAfterEvent.md. # Class: EntityStopSneakingAfterEvent event entity **`Beta`** 包含实体停止潜行后的相关数据。 Contains data related to an entity after it stops sneaking. ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityStopSneakingAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityStopSneakingAfterEventSignal.md. # Class: EntityStopSneakingAfterEventSignal event entity **`Beta`** Manages callbacks that are connected to when an entity stops sneaking. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntitySneakingChangedEventOptions`](/server/interfaces/EntitySneakingChangedEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when an entity stops sneaking. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when an entity stops sneaking. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityTamedAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityTamedAfterEvent.md. # Class: EntityTamedAfterEvent event entity **`Beta`** ## Preview Contains data related to an entity being tamed. ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** *** ### tamingEntity > `readonly` **tamingEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityTamedAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityTamedAfterEventSignal.md. # Class: EntityTamedAfterEventSignal event entity **`Beta`** ## Preview Manages callbacks that are connected to when an entity is tamed. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityTamedEventOptions`](/server/interfaces/EntityTamedEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityTamedBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityTamedBeforeEvent.md. # Class: EntityTamedBeforeEvent event entity **`Beta`** ## Preview Contains information regarding an event before an entity is tamed. ## Properties ### cancel > **cancel**: `boolean` **`Beta`** #### Remarks When set to true will cancel the event. *** ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks The entity that is being tamed. *** ### tamingEntity > `readonly` **tamingEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks The entity that is attempting to tame the entity. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityTamedBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityTamedBeforeEventSignal.md. # Class: EntityTamedBeforeEventSignal event entity **`Beta`** ## Preview Manages callbacks that are connected to before an entity is tamed. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip This closure is called with restricted-execution privilege. ::: ##### options? [`EntityTamedEventOptions`](/server/interfaces/EntityTamedEventOptions.md) #### Returns :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityType.md. # Class: EntityType entity **`Beta`** 表示一种实体类型的信息。 Represents information about a type of entity. ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 此实体类型的标识符——例如,`minecraft:skeleton`。 Identifier of this entity type - for example, 'minecraft:skeleton'. *** ### localizationKey > `readonly` **localizationKey**: `string` **`Beta`** #### Remarks 用于在 `.lang` 文件中本地化此 EntityType 名称的键。 Key for the localization of this EntityType's name used in .lang files. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityTypes.md. # Class: EntityTypes entity **`Beta`** 用于访问世界中当前可用的所有实体类型。 Used for accessing all entity types currently available for use within the world. ## Methods ### get() > `static` **get**\<`T`>(`identifier`): [`EntityType`](/server/classes/EntityType.md) | `undefined` **`Beta`** #### Type Parameters ##### T `T` = `never` #### Parameters ##### identifier [`EntityIdentifierType`](/server/types/EntityIdentifierType.md)\<`NoInfer`\<`T`>> #### Returns [`EntityType`](/server/classes/EntityType.md) | `undefined` #### Remarks 使用字符串标识符检索实体类型。 Retrieves an entity type using a string-based identifier. *** ### getAll() > `static` **getAll**(): [`EntityType`](/server/classes/EntityType.md)\[] **`Beta`** #### Returns [`EntityType`](/server/classes/EntityType.md)\[] #### Remarks 检索此世界中的所有实体类型集合。 Retrieves a set of all entity types within this world. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityUpgradeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityUpgradeAfterEvent.md. # Class: EntityUpgradeAfterEvent event entity **`Beta`** Contains information related to firing of a data driven entity version upgrade. ## Properties ### entity > `readonly` **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks Entity that the upgrade triggered on. *** ### upgradeId > `readonly` **upgradeId**: `string` **`Beta`** #### Remarks Name of the data driven upgrade being triggered. ## Methods ### getModifiers() > **getModifiers**(): [`DefinitionModifier`](/server/interfaces/DefinitionModifier.md)\[] **`Beta`** #### Returns [`DefinitionModifier`](/server/interfaces/DefinitionModifier.md)\[] #### Remarks An updateable list of modifications to component state that are the effect of this triggered upgrade. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/EntityUpgradeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityUpgradeAfterEventSignal.md. # Class: EntityUpgradeAfterEventSignal event entity **`Beta`** Contains event registration related to firing of a data driven entity version upgrade. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`EntityDataDrivenTriggerEventOptions`](/server/interfaces/EntityDataDrivenTriggerEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called after a data driven entity version upgrade is triggered. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback that will be called after a data driven entity version upgrade is triggered. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ExplosionAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ExplosionAfterEventSignal.md. # Class: ExplosionAfterEventSignal event **`Beta`** 管理与爆炸发生时相关的回调。 Manages callbacks that are connected to when an explosion occurs. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,将在爆炸发生时被调用。 Adds a callback that will be called when an explosion occurs. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使其在爆炸发生时不再被调用。 Removes a callback from being called when an explosion occurs. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ExplosionBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ExplosionBeforeEventSignal.md. # Class: ExplosionBeforeEventSignal event **`Beta`** 管理与爆炸发生前相关的回调。 Manages callbacks that are connected to before an explosion occurs. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns :::tip 以受限执行权限被调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks 添加一个回调,将在爆炸发生前被调用。该回调可以选择性更改或取消爆炸行为。 Adds a callback that will be called when before an explosion occurs. The callback can optionally change or cancel explosion behavior. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks 移除一个回调,使其在爆炸发生前不再被调用。 Removes a callback from being called from before when an explosion would occur. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/FeedItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/FeedItem.md. # Class: FeedItem **`Beta`** 作为 Healable 组件的一部分,表示可喂给实体并产生生命值效果的特定物品。 As part of the Healable component, represents a specific item that can be fed to an entity to cause health effects. ## Properties ### healAmount > `readonly` **healAmount**: `number` **`Beta`** #### Remarks 实体被喂食此物品时获得的生命值。该数值是从 0 开始的整数,示例值最高可达 40。 The amount of health this entity gains when fed this item. This number is an integer starting at 0. Sample values can go as high as 40. *** ### item > `readonly` **item**: `string` **`Beta`** #### Remarks 可用于喂食的物品类型标识符。若未指定命名空间,则假定为 'minecraft:'。示例值包括 'wheat' 或 'golden\_apple'。 Identifier of type of item that can be fed. If a namespace is not specified, 'minecraft:' is assumed. Example values include 'wheat' or 'golden\_apple'. *** ### resultItem? > `readonly` `optional` **resultItem?**: `string` **`Beta`** #### Remarks 喂食后产生的物品的类型 ID。该值通常为空,但也用于向鹦鹉螺喂食一桶鱼等场景,此时产生的物品将是空桶。 Type ID of the resulting item after feeding has occurred. This will usually be empty but is used for scenarios such as feeding a Nautilus with a bucket of fish, where the result item will be an empty bucket. ## Methods ### getEffects() > **getEffects**(): [`FeedItemEffect`](/server/classes/FeedItemEffect.md)\[] **`Beta`** #### Returns [`FeedItemEffect`](/server/classes/FeedItemEffect.md)\[] #### Remarks 作为 Healable 组件的一部分,表示实体被喂食某物品后可能产生的可选副作用集合。 As part of the Healable component, an optional collection of side effects that can occur from being fed an item. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/FeedItemEffect.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/FeedItemEffect.md. # Class: FeedItemEffect effect **`Beta`** 表示将食物喂给实体后产生的效果。 Represents an effect that is applied as a result of a food item being fed to an entity. ## Properties ### amplifier > `readonly` **amplifier**: `number` **`Beta`** #### Remarks 获取可能应用于此效果的倍率。有效值为从 0 开始的整数,通常介于 0 到 4 之间。 Gets an amplifier that may have been applied to this effect. Valid values are integers starting at 0 and up - but usually ranging between 0 and 4. *** ### chance > `readonly` **chance**: `number` **`Beta`** #### Remarks 实体被喂食此物品后应用该效果的概率。有效值介于 0 到 1 之间。 Chance that this effect is applied as a result of the entity being fed this item. Valid values range between 0 and 1. *** ### duration > `readonly` **duration**: `number` **`Beta`** #### Remarks 获取此效果的持续时间,以刻为单位。 Gets the duration, in ticks, of this effect. *** ### name > `readonly` **name**: `string` **`Beta`** #### Remarks 获取要应用的效果标识符。示例值包括 'fire\_resistance' 或 'regeneration'。 Gets the identifier of the effect to apply. Example values include 'fire\_resistance' or 'regeneration'. ## 同领域相关 - [Effect](/server/classes/Effect.md) - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent.md) - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal.md) - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent.md) - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal.md) - [EffectType](/server/classes/EffectType.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/FluidContainer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/FluidContainer.md. # Class: FluidContainer inventory **`Beta`** 表示与流体容器相关的常量。 Represents constants related to fluid containers. ## Properties ### maxFillLevel > `readonly` `static` **maxFillLevel**: `6` = `6` **`Beta`** #### Remarks 表示流体容器的最大填充等级常量。 Constant that represents the maximum fill level of a fluid container. *** ### minFillLevel > `readonly` `static` **minFillLevel**: `0` = `0` **`Beta`** #### Remarks 表示流体容器的最小填充等级常量。 Constant that represents the minimum fill level of a fluid container. ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/FogSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/FogSettings.md. # Class: FogSettings **`Beta`** 提供对玩家实体雾设置堆栈的访问,使脚本能够推入、弹出、移除和查询生效中的雾设置。 Provides access to the fog definitions stack of a player entity, allowing scripts to push, pop, remove, and query active fog definitions. ## Methods ### getStack() > **getStack**(): `string`\[] **`World Mutation`** **`Beta`** #### Returns `string`\[] 当前堆栈中的雾设置标识符数组。 An array of fog definition identifiers currently on the stack. #### Remarks 返回玩家雾设置堆栈中当前的雾标识符列表,按从底部到顶部的顺序排列。 Returns the list of fog identifiers currently on the player's fog stack, ordered from bottom to top. #### Throws Throws if the entity is invalid. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getTags() > **getTags**(): `string`\[] **`World Mutation`** **`Beta`** #### Returns `string`\[] 与堆栈中雾设置关联的标签字符串数组。 An array of tag strings associated with fog settings on the stack. #### Remarks 返回玩家雾设置堆栈中当前存在的标签列表。 Returns the list of tags currently present on the player's fog stack. #### Throws Throws if the entity is invalid. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### pop() > **pop**(`tag?`): `string` | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### tag? `string` 用于标识要弹出条目的可选标签。如果提供,则从顶部到底部搜索堆栈,并移除最近推入且带有此标签的条目。如果省略,则移除最近推入的条目,无论其标签为何。 An optional tag identifying which entry to pop. If provided, searches the stack from top to bottom and removes the most recently pushed entry with this tag. If omitted, removes the most recently pushed entry regardless of tag. #### Returns `string` | `undefined` 返回被弹出的雾设置标识符;如果堆栈未发生变化,则返回 undefined。 Returns the identifier of the popped fog definition, or undefined if the stack was unchanged. #### Remarks 从玩家的雾设置堆栈中移除最近推入的雾设置。 Removes the most recently pushed fog definition from the player's fog stack. #### Throws Throws if the entity is invalid. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### push() > **push**(`fogId`, `tag?`): `number` **`World Mutation`** **`Beta`** #### Parameters ##### fogId `string` 要推入堆栈的雾设置标识符(例如 'minecraft:fog\_bamboo\_jungle')。 The identifier of the fog definition to push onto the stack (e.g. 'minecraft:fog\_bamboo\_jungle'). ##### tag? `string` 用于标记此雾设置在堆栈中条目的可选标签,以便通过 pop 或 remove 定位该条目。如果省略,则以 'untagged' 标签存储该条目。 An optional tag used to label this fog definition on the stack, allowing it to be targeted by pop or remove. If omitted, the entry is stored with the tag 'untagged'. #### Returns `number` 雾设置被插入到堆栈后所在位置的从零开始索引。 Returns the zero-based index at which the fog definition was inserted into the stack. #### Remarks 将新的雾设置推入玩家的雾设置堆栈。 Pushes a new fog definition onto the player's fog stack. #### Throws Throws if the entity is invalid, the fog identifier is invalid, or if the stack limit of 16 has been exceeded. [FogSettingsError](/server/classes/FogSettingsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### remove() > **remove**(`tag?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### tag? `string` 用于标识要移除条目的可选标签。如果省略,则清除所有雾设置,无论其标签为何。 An optional tag identifying which the entries to remove. If omitted, clears all fog definitions regardless of tag. #### Returns `boolean` 如果至少移除了一个条目,则返回 true;如果堆栈未发生变化,则返回 false。 Returns true if at least one entry was removed, or false if the stack was unchanged. #### Remarks 从玩家的雾设置堆栈中移除带有指定标签的所有雾设置。如果未提供标签,则清除所有雾设置。 Removes all fog definitions with the given tag from the player's fog stack. If no tag is provided, clears all fog definitions. #### Throws Throws if the entity is invalid. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### setStack() > **setStack**(`fogIds`, `tag?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### fogIds `string`\[] 要设为玩家雾设置堆栈的雾设置标识符堆栈(例如 \['minecraft:fog\_bamboo\_jungle'])。最多 16 个条目。 A stack of fog definition identifiers to set on the player's fog stack (e.g. \['minecraft:fog\_bamboo\_jungle']). Maximum of 16 entries. ##### tag? `string` 与新条目关联的可选标签,用于通过 pop 或 remove 定位这些条目。 An optional tag to associate with the new entries, used to target them with pop or remove. #### Returns `void` #### Remarks 将玩家的雾设置堆栈设为给定的雾标识符列表,并替换所有现有条目。 Sets the player's fog stack to the given list of fog identifiers, replacing any existing entries. #### Throws Throws if the entity is invalid, if more than 16 fog identifiers are provided, or if any fog identifier is invalid. [FogSettingsError](/server/classes/FogSettingsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/FogSettingsError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/FogSettingsError.md. # Class: FogSettingsError error **`Beta`** 当超出雾效栈上限或提供了无效的雾效标识符时,由 [FogSettings](/server/classes/FogSettings.md) 操作抛出的错误。 Error thrown by [FogSettings](/server/classes/FogSettings.md) operations when the fog stack limit is exceeded or an invalid fog identifier is provided. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/GameRuleChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/GameRuleChangeAfterEvent.md. # Class: GameRuleChangeAfterEvent event **`Beta`** 包含关于已更改的 world.gameRules 属性的信息。 Contains information regarding a changed world.gameRules property. ## Properties ### rule > `readonly` **rule**: [`GameRule`](/server/enums/GameRule.md) **`Beta`** #### Remarks 与已更改的 world.gameRules 属性相对应的规则标识符。 The rule identifier pertaining to the changed world.gameRules property. *** ### value > `readonly` **value**: `number` | `boolean` **`Beta`** #### Remarks 更改之后的 world.gameRules 属性的值。 The value of the world.gameRules property after being changed. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/GameRuleChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/GameRuleChangeAfterEventSignal.md. # Class: GameRuleChangeAfterEventSignal event **`Beta`** 管理当 world.gameRules 属性发生变化时所连接的回调。 Manages callbacks that are connected to when a world.gameRules property has changed. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加当 world.gameRules 属性发生变化时会被调用的回调。 Adds a callback that will be called when a world.gameRules property is changed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除当 world.gameRules 属性发生变化时不再被调用的回调。 Removes a callback from being called when a world.gameRules property is changed. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/GameRules.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/GameRules.md. # Class: GameRules **`Beta`** 表示一个世界体验的规则集合。 Represents the game rules for a world experience. ## Properties ### commandBlockOutput > **commandBlockOutput**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### commandBlocksEnabled > **commandBlocksEnabled**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### doDayLightCycle > **doDayLightCycle**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### doEntityDrops > **doEntityDrops**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### doFireTick > **doFireTick**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### doImmediateRespawn > **doImmediateRespawn**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### doInsomnia > **doInsomnia**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### doLimitedCrafting > **doLimitedCrafting**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### doMobLoot > **doMobLoot**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### doMobSpawning > **doMobSpawning**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### doTileDrops > **doTileDrops**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### doWeatherCycle > **doWeatherCycle**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### drowningDamage > **drowningDamage**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### fallDamage > **fallDamage**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### fireDamage > **fireDamage**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### freezeDamage > **freezeDamage**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### functionCommandLimit > **functionCommandLimit**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### keepInventory > **keepInventory**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### maxCommandChainLength > **maxCommandChainLength**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### mobGriefing > **mobGriefing**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### naturalRegeneration > **naturalRegeneration**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### playersSleepingPercentage > **playersSleepingPercentage**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### playerWaypoints 实验性 > **playerWaypoints**: [`PlayerWaypointsMode`](/server/enums/PlayerWaypointsMode.md) **`Beta`** **`World Mutation`** #### Remarks *** ### projectilesCanBreakBlocks > **projectilesCanBreakBlocks**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### pvp > **pvp**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### randomTickSpeed > **randomTickSpeed**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### recipesUnlock > **recipesUnlock**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### respawnBlocksExplode > **respawnBlocksExplode**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### sendCommandFeedback > **sendCommandFeedback**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### showBorderEffect > **showBorderEffect**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### showCoordinates > **showCoordinates**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### showDaysPlayed > **showDaysPlayed**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### showDeathMessages > **showDeathMessages**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### showRecipeMessages > **showRecipeMessages**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### showTags > **showTags**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### spawnRadius > **spawnRadius**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### tntExplodes > **tntExplodes**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### tntExplosionDropDecay > **tntExplosionDropDecay**: `boolean` **`World Mutation`** **`Beta`** #### Remarks [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InputInfo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InputInfo.md. # Class: InputInfo **`Beta`** 包含某个客户端实例的输入信息。 Contains the input information for a client instance. ## Properties ### lastInputModeUsed > `readonly` **lastInputModeUsed**: [`InputMode`](/server/enums/InputMode.md) **`Beta`** #### Remarks 玩家最后使用的输入模式。 The last input mode used by the player. #### Throws This property can throw when used. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### touchOnlyAffectsHotbar > `readonly` **touchOnlyAffectsHotbar**: `boolean` **`Beta`** #### Remarks 玩家的触摸输入是否仅影响触摸栏。 Whether the player touch input only affects the touchbar or not. #### Throws This property can throw when used. [InvalidEntityError](/server/classes/InvalidEntityError.md) ## Methods ### getButtonState() > **getButtonState**(`button`): [`ButtonState`](/server/enums/ButtonState.md) **`Beta`** #### Parameters ##### button [`InputButton`](/server/enums/InputButton.md) #### Returns [`ButtonState`](/server/enums/ButtonState.md) #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### getMovementVector() > **getMovementVector**(): [`Vector2`](/server/interfaces/Vector2.md) **`Beta`** #### Returns [`Vector2`](/server/interfaces/Vector2.md) #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidBlockComponentError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidBlockComponentError.md. # Class: InvalidBlockComponentError block error component **`Beta`** 当方块无效时会抛出此错误。在访问不具备相应组件的方块上的组件时,也会抛出此错误。 The error can occur when a block is invalid. This can also occur when accessing components on a block that doesn't have them. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidContainerError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidContainerError.md. # Class: InvalidContainerError inventory error **`Beta`** 容器无效。当容器缺失或被删除时会抛出此错误。 The container is invalid. This can occur if the container is missing or deleted. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [ContainerRulesError](/server/classes/ContainerRulesError.md) - [ContainerRulesErrorReason](/server/enums/ContainerRulesErrorReason.md) - [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidContainerSlotError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidContainerSlotError.md. # Class: InvalidContainerSlotError inventory error **`Beta`** 容器槽位无效。当所属容器被销毁或卸载时会抛出此错误。 The container slot is invalid. This can occur when the owning container is destroyed or unloaded. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [ContainerRulesError](/server/classes/ContainerRulesError.md) - [ContainerRulesErrorReason](/server/enums/ContainerRulesErrorReason.md) - [InvalidContainerError](/server/classes/InvalidContainerError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidEntityComponentError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidEntityComponentError.md. # Class: InvalidEntityComponentError entity error component **`Beta`** 在访问不具备相应组件的实体上的组件时会抛出此错误。 This error can occur when accessing components on an entity that doesn't have them. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidEntityError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidEntityError.md. # Class: InvalidEntityError entity error **`Beta`** 当实体无效时抛出的错误。可能发生在访问已移除实体的组件时。 The error called when an entity is invalid. This can occur when accessing components on a removed entity. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### id > `readonly` **id**: `string` **`Early Execution`** **`Beta`** #### Remarks 当前无效实体的 id。 The id of the entity that is now invalid. *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### type > `readonly` **type**: `string` **`Early Execution`** **`Beta`** #### Remarks 当前无效实体的类型。 The type of the entity that is now invalid. *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [EntitySpawnError](/server/classes/EntitySpawnError.md) - [InvalidEntityComponentError](/server/classes/InvalidEntityComponentError.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidItemStackError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidItemStackError.md. # Class: InvalidItemStackError item error **`Beta`** 当某个物品无效时抛出的错误。例如访问已移除物品的组件时可能会发生此错误。 The error called when an item is invalid. This can occur when accessing components on a removed item. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### itemType > `readonly` **itemType**: [`ItemType`](/server/classes/ItemType.md) **`Early Execution`** **`Beta`** #### Remarks 该物品现已无效时的物品类型。 The type of the item that is now invalid. *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidIteratorError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidIteratorError.md. # Class: InvalidIteratorError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidPotionDeliveryTypeError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidPotionDeliveryTypeError.md. # Class: InvalidPotionDeliveryTypeError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidPotionEffectTypeError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidPotionEffectTypeError.md. # Class: InvalidPotionEffectTypeError effect error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidStructureError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidStructureError.md. # Class: InvalidStructureError error **`Beta`** 当结构无效时抛出。结构在被删除后将变为无效。 Thrown when a Structure is invalid. A structure becomes invalid when it is deleted. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidWaypointError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidWaypointError.md. # Class: InvalidWaypointError error **`Beta`** 在对无效的路径点执行操作时抛出。当路径点被移除或其追踪的实体不再有效时,路径点将变为无效。 Error thrown when attempting to perform operations on an invalid waypoint. A waypoint becomes invalid when it is removed or when the entity it tracks is no longer valid. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/InvalidWaypointTextureSelectorError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/InvalidWaypointTextureSelectorError.md. # Class: InvalidWaypointTextureSelectorError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemCompleteUseAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemCompleteUseAfterEvent.md. # Class: ItemCompleteUseAfterEvent event **`Beta`** 包含与可蓄力物品完成蓄力相关的信息。 Contains information related to a chargeable item completing being charged. ## Properties ### itemStack > `readonly` **itemStack**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 返回已完成蓄力的物品堆。 Returns the item stack that has completed charging. *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回触发此物品事件的源实体。 Returns the source entity that triggered this item event. *** ### useDuration > `readonly` **useDuration**: `number` **`Beta`** #### Remarks 返回距蓄力完成周期还剩余的时长(以刻为单位)。 Returns the time, in ticks, for the remaining duration left before the charge completes its cycle. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemCompleteUseAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemCompleteUseAfterEventSignal.md. # Class: ItemCompleteUseAfterEventSignal event **`Beta`** 管理与可蓄力物品完成蓄力相关联的回调。 Manages callbacks that are connected to the completion of charging for a chargeable item. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加当可蓄力物品完成蓄力时会被调用的回调。 Adds a callback that will be called when a chargeable item completes charging. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除当可蓄力物品完成蓄力时不再被调用的回调。 Removes a callback from being called when a chargeable item completes charging. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemComponentBeforeDurabilityDamageEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemComponentBeforeDurabilityDamageEvent.md. # Class: ItemComponentBeforeDurabilityDamageEvent event damage component **`Beta`** 包含物品因击中实体而受损前的相关信息。 Contains information regarding an item before it is damaged from hitting an entity. ## Properties ### attackingEntity > `readonly` **attackingEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 发起攻击的实体。 The attacking entity. *** ### durabilityDamage > **durabilityDamage**: `number` **`Beta`** #### Remarks 事件发生时对物品耐久度造成的损耗。 The damage applied to the item's durability when the event occurs. *** ### hitEntity > `readonly` **hitEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 被击中的实体。 The entity being hit. *** ### itemStack? > `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 用于击中实体的物品堆。 The item stack used to hit the entity. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemComponentConsumeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemComponentConsumeEvent.md. # Class: ItemComponentConsumeEvent event component **`Beta`** 包含与食物被消耗相关的信息。 Contains information related to a food item being consumed. ## Properties ### itemStack > `readonly` **itemStack**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 被消耗的物品堆。 The item stack that was consumed. *** ### source > `readonly` **source**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 消耗该物品的源实体。 The source entity that consumed the item. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemComponentHitEntityEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemComponentHitEntityEvent.md. # Class: ItemComponentHitEntityEvent event entity component **`Beta`** 包含使用物品击中实体时的相关信息。 Contains information regarding when an item is used to hit an entity. ## Properties ### attackingEntity > `readonly` **attackingEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 发起攻击的实体。 The attacking entity. *** ### hadEffect > `readonly` **hadEffect**: `boolean` **`Beta`** #### Remarks 此次击打是否命中或产生了任何效果。 Whether the hit landed or had any effect. *** ### hitEntity > `readonly` **hitEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 被击中的实体。 The entity being hit. *** ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 用于击中实体的物品堆。 The item stack used to hit the entity. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemComponentMineBlockEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemComponentMineBlockEvent.md. # Class: ItemComponentMineBlockEvent event block component **`Beta`** 包含使用物品挖掘方块的相关信息。 Contains information regarding the mining of a block using an item. ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 此事件影响的方块。 The block impacted by this event. *** ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 用于挖掘方块的物品堆。 The item stack used to mine the block. *** ### minedBlockPermutation > `readonly` **minedBlockPermutation**: [`BlockPermutation`](/server/classes/BlockPermutation.md) **`Beta`** #### Remarks 被挖掘方块的方块状态(BlockPermutation)。 The block permutation that was mined. *** ### source > `readonly` **source**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 挖掘方块的实体。 The entity that mined the block. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemComponentRegistry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemComponentRegistry.md. # Class: ItemComponentRegistry component **`Beta`** 提供为物品注册自定义组件的功能。 Provides the functionality for registering custom components for items. ## Methods ### registerCustomComponent() > **registerCustomComponent**(`name`, `itemCustomComponent`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### name `string` 表示该自定义组件的 ID,必须包含命名空间。该 ID 可在物品 JSON 配置的 'minecraft:custom\_components' 物品组件下指定。 ##### itemCustomComponent [`ItemCustomComponent`](/server/interfaces/ItemCustomComponent.md) 当使用此自定义组件 ID 的物品上发生对应事件时,将被调用的事件函数集合。 #### Returns `void` #### Remarks 注册一个可在物品 JSON 配置中使用的物品自定义组件。 Registers an item custom component that can be used in item JSON configuration. #### Throws This function can throw errors. [CustomComponentInvalidRegistryError](/server/classes/CustomComponentInvalidRegistryError.md) [EngineError](/common/classes/EngineError.md) [ItemCustomComponentAlreadyRegisteredError](/server/classes/ItemCustomComponentAlreadyRegisteredError.md) [ItemCustomComponentReloadNewComponentError](/server/classes/ItemCustomComponentReloadNewComponentError.md) [ItemCustomComponentReloadNewEventError](/server/classes/ItemCustomComponentReloadNewEventError.md) [ItemCustomComponentReloadVersionError](/server/classes/ItemCustomComponentReloadVersionError.md) [NamespaceNameError](/server/classes/NamespaceNameError.md) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemComponentUseEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemComponentUseEvent.md. # Class: ItemComponentUseEvent event component **`Beta`** 包含与物品使用相关的信息。 Contains information regarding the use of an item. ## Properties ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 物品被使用时的物品堆。 The item stack when the item was used. *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 使用该物品的玩家。 The player who used the item. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemCustomComponentAlreadyRegisteredError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemCustomComponentAlreadyRegisteredError.md. # Class: ItemCustomComponentAlreadyRegisteredError error component **`Beta`** 在尝试使用已注册过的名称注册物品自定义组件时抛出。 Thrown when trying to register an item custom component with a name that has already been registered. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [CustomComponentInvalidRegistryError](/server/classes/CustomComponentInvalidRegistryError.md) - [CustomComponentNameError](/server/classes/CustomComponentNameError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemCustomComponentReloadNewComponentError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemCustomComponentReloadNewComponentError.md. # Class: ItemCustomComponentReloadNewComponentError error component **`Beta`** 在使用 /reload 命令后,尝试注册此前未注册过的物品自定义组件时抛出。 Thrown after using the /reload command when trying to register a previously unregistered item custom component. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [CustomComponentInvalidRegistryError](/server/classes/CustomComponentInvalidRegistryError.md) - [CustomComponentNameError](/server/classes/CustomComponentNameError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemCustomComponentReloadNewEventError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemCustomComponentReloadNewEventError.md. # Class: ItemCustomComponentReloadNewEventError event error component **`Beta`** 在使用 /reload 命令后,当尝试注册一个此前已注册但用于处理新事件的物品自定义组件时抛出。 Thrown after using the /reload command when trying to register a previously registered item custom component that handles a new event. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemCustomComponentReloadVersionError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemCustomComponentReloadVersionError.md. # Class: ItemCustomComponentReloadVersionError error component **`Beta`** 在使用 /reload 命令后,尝试使用较新的 API 版本注册先前已注册过的物品自定义组件时抛出。 Thrown after using the /reload command when trying to register a previously registered item custom component with a newer API version. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [CustomComponentInvalidRegistryError](/server/classes/CustomComponentInvalidRegistryError.md) - [CustomComponentNameError](/server/classes/CustomComponentNameError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemReleaseUseAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemReleaseUseAfterEvent.md. # Class: ItemReleaseUseAfterEvent event **`Beta`** 包含与可蓄力物品在玩家结束使用并释放建造动作时相关的信息。 Contains information related to a chargeable item when the player has finished using the item and released the build action. ## Properties ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 返回触发此物品事件的物品堆。 Returns the item stack that triggered this item event. *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回触发此物品事件的源实体。 Returns the source entity that triggered this item event. *** ### useDuration > `readonly` **useDuration**: `number` **`Beta`** #### Remarks 返回距蓄力完成周期还剩余的时长(以刻为单位)。 Returns the time, in ticks, for the remaining duration left before the charge completes its cycle. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemReleaseUseAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemReleaseUseAfterEventSignal.md. # Class: ItemReleaseUseAfterEventSignal event **`Beta`** 管理与可蓄力物品停止蓄力事件相关联的回调。 Manages callbacks that are connected to the releasing of charging for a chargeable item. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,当可蓄力物品停止蓄力时将被调用。 Adds a callback that will be called when a chargeable item is released from charging. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使可蓄力物品停止蓄力时不再被调用。 Removes a callback from being called when a chargeable item is released from charging. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemStack.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemStack.md. # Class: ItemStack item **`Beta`** 定义一个物品集合。 Defines a collection of items. ## Examples **itemStacks.ts** ```typescript import { ItemStack, DimensionLocation } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function itemStacks(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const oneItemLoc = { x: targetLocation.x + targetLocation.y + 3, y: 2, z: targetLocation.z + 1 }; const fiveItemsLoc = { x: targetLocation.x + 1, y: targetLocation.y + 2, z: targetLocation.z + 1 }; const diamondPickaxeLoc = { x: targetLocation.x + 2, y: targetLocation.y + 2, z: targetLocation.z + 4 }; const oneEmerald = new ItemStack(MinecraftItemTypes.Emerald, 1); const onePickaxe = new ItemStack(MinecraftItemTypes.DiamondPickaxe, 1); const fiveEmeralds = new ItemStack(MinecraftItemTypes.Emerald, 5); log(`Spawning an emerald at (${oneItemLoc.x}, ${oneItemLoc.y}, ${oneItemLoc.z})`); targetLocation.dimension.spawnItem(oneEmerald, oneItemLoc); log(`Spawning five emeralds at (${fiveItemsLoc.x}, ${fiveItemsLoc.y}, ${fiveItemsLoc.z})`); targetLocation.dimension.spawnItem(fiveEmeralds, fiveItemsLoc); log(`Spawning a diamond pickaxe at (${diamondPickaxeLoc.x}, ${diamondPickaxeLoc.y}, ${diamondPickaxeLoc.z})`); targetLocation.dimension.spawnItem(onePickaxe, diamondPickaxeLoc); } ``` **givePlayerEquipment.ts** ```typescript import { world, ItemStack, EntityEquippableComponent, EquipmentSlot, EntityComponentTypes, DimensionLocation, } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function givePlayerEquipment(targetLocation: DimensionLocation) { const players = world.getAllPlayers(); const armorStandLoc = { x: targetLocation.x, y: targetLocation.y, z: targetLocation.z + 4 }; const armorStand = players[0].dimension.spawnEntity(MinecraftItemTypes.ArmorStand, armorStandLoc); const equipmentCompPlayer = players[0].getComponent(EntityComponentTypes.Equippable) as EntityEquippableComponent; if (equipmentCompPlayer) { equipmentCompPlayer.setEquipment(EquipmentSlot.Head, new ItemStack(MinecraftItemTypes.GoldenHelmet)); equipmentCompPlayer.setEquipment(EquipmentSlot.Chest, new ItemStack(MinecraftItemTypes.IronChestplate)); equipmentCompPlayer.setEquipment(EquipmentSlot.Legs, new ItemStack(MinecraftItemTypes.DiamondLeggings)); equipmentCompPlayer.setEquipment(EquipmentSlot.Feet, new ItemStack(MinecraftItemTypes.NetheriteBoots)); equipmentCompPlayer.setEquipment(EquipmentSlot.Mainhand, new ItemStack(MinecraftItemTypes.WoodenSword)); equipmentCompPlayer.setEquipment(EquipmentSlot.Offhand, new ItemStack(MinecraftItemTypes.Shield)); } const equipmentCompArmorStand = armorStand.getComponent(EntityComponentTypes.Equippable) as EntityEquippableComponent; if (equipmentCompArmorStand) { equipmentCompArmorStand.setEquipment(EquipmentSlot.Head, new ItemStack(MinecraftItemTypes.GoldenHelmet)); equipmentCompArmorStand.setEquipment(EquipmentSlot.Chest, new ItemStack(MinecraftItemTypes.IronChestplate)); equipmentCompArmorStand.setEquipment(EquipmentSlot.Legs, new ItemStack(MinecraftItemTypes.DiamondLeggings)); equipmentCompArmorStand.setEquipment(EquipmentSlot.Feet, new ItemStack(MinecraftItemTypes.NetheriteBoots)); equipmentCompArmorStand.setEquipment(EquipmentSlot.Mainhand, new ItemStack(MinecraftItemTypes.WoodenSword)); equipmentCompArmorStand.setEquipment(EquipmentSlot.Offhand, new ItemStack(MinecraftItemTypes.Shield)); } } ``` **spawnFeatherItem.ts** ```typescript import { ItemStack, DimensionLocation } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function spawnFeatherItem(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const featherItem = new ItemStack(MinecraftItemTypes.Feather, 1); targetLocation.dimension.spawnItem(featherItem, targetLocation); log(`New feather created at ${targetLocation.x}, ${targetLocation.y}, ${targetLocation.z}!`); } ``` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ItemStack**(`itemType`, `amount?`): `ItemStack` **`Beta`** #### Parameters ##### itemType `string` | [`ItemType`](/server/classes/ItemType.md) 要创建的物品类型。参见 @minecraft/vanilla-data.MinecraftItemTypes 枚举以获取 Minecraft 中标准物品类型的列表。 Type of item to create. See the @minecraft/vanilla-data.MinecraftItemTypes enumeration for a list of standard item types in Minecraft experiences. ##### amount? `number` 放入物品堆的物品数量,介于 1-255 之间。提供的值会被限制 在该物品的最大堆叠数量以内。注意某些物品的物品堆中只能有 一个物品。 Number of items to place in the stack, between 1-255. The provided value will be clamped to the item's maximum stack size. Note that certain items can only have one item in the stack. Defaults to: 1 Bounds: \[1, 255] #### Returns `ItemStack` #### Remarks 创建一个可在世界中使用的物品堆新实例。 Creates a new instance of a stack of items for use in the world. #### Throws Throws if `itemType` is invalid, or if `amount` is outside the range of 1-255. ## Properties ### amount > **amount**: `number` **`World Mutation`** **`Beta`** #### Remarks 物品堆中的物品数量。有效值范围为 1-255。提供的值会被 限制在该物品的最大堆叠数量以内。 Number of the items in the stack. Valid values range between 1-255. The provided value will be clamped to the item's maximum stack size. Bounds: \[1, 255] #### Throws Throws if the value is outside the range of 1-255. *** ### isStackable > `readonly` **isStackable**: `boolean` **`Beta`** #### Remarks 返回该物品是否可堆叠。当物品的最大堆叠数量大于 1 且不 包含任何自定义数据或属性时,该物品被视为可堆叠。 Returns whether the item is stackable. An item is considered stackable if the item's maximum stack size is greater than 1 and the item does not contain any custom data or properties. *** ### keepOnDeath > **keepOnDeath**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 获取或设置该物品是否在死亡时保留。 Gets or sets whether the item is kept on death. *** ### localizationKey > `readonly` **localizationKey**: `string` **`Beta`** #### Remarks 用于在 .lang 文件中本地化该物品名称的键。 Key for the localization of this items's name used in .lang files. #### Throws This property can throw when used. [EngineError](/common/classes/EngineError.md) *** ### lockMode > **lockMode**: [`ItemLockMode`](/server/enums/ItemLockMode.md) **`World Mutation`** **`Beta`** #### Remarks 获取或设置该物品的锁定模式。默认值为 `ItemLockMode.none`。 Gets or sets the item's lock mode. The default value is `ItemLockMode.none`. *** ### maxAmount > `readonly` **maxAmount**: `number` **`Beta`** #### Remarks 最大堆叠数量。该值因物品类型而异。例如,火把的最大堆叠 数量为 64,而鸡蛋的最大堆叠数量为 16。 The maximum stack size. This value varies depending on the type of item. For example, torches have a maximum stack size of 64, while eggs have a maximum stack size of 16. *** ### nameTag? > `optional` **nameTag?**: `string` **`World Mutation`** **`Beta`** #### Remarks 该物品堆的给定名称。名称标签会在悬停于物品上时显示。将 名称标签设置为空字符串或 `undefined` 会移除名称标签。 Given name of this stack of items. The name tag is displayed when hovering over the item. Setting the name tag to an empty string or `undefined` will remove the name tag. #### Throws Throws if the length exceeds 255 characters. *** ### type > `readonly` **type**: [`ItemType`](/server/classes/ItemType.md) **`Beta`** #### Remarks 该物品的类型。 The type of the item. *** ### typeId > `readonly` **typeId**: `string` **`Beta`** #### Remarks 该物品堆的物品类型标识符。若未指定命名空间,则默认使用 'minecraft:'。例如 'wheat' 或 'apple'。 Identifier of the type of items for the stack. If a namespace is not specified, 'minecraft:' is assumed. Examples include 'wheat' or 'apple'. *** ### weight > `readonly` **weight**: `number` **`Beta`** #### Remarks 物品堆中所有物品的总重量,加上由 `Storage Item` 组件定义 的物品容器内所有物品的重量。每个物品的重量可通过 `Storage Weight Modifier` 组件修改。 The total weight of all items in the stack plus the weight of all items in the items container which is defined with the `Storage Item` component. The weight per item can be modified by the `Storage Weight Modifier` component. ## Methods ### clearDynamicProperties() > **clearDynamicProperties**(): `void` **`Beta`** #### Returns `void` #### Remarks 清除已在该物品堆上设置的所有动态属性。 Clears all dynamic properties that have been set on this item stack. *** ### clone() > **clone**(): `ItemStack` **`Beta`** #### Returns `ItemStack` 返回该物品堆的一个副本。 Returns a copy of this item stack. #### Remarks 创建该物品堆的精确副本,包括任何自定义数据或属性。 Creates an exact copy of the item stack, including any custom data or properties. *** ### getCanDestroy() > **getCanDestroy**(): `string`\[] **`World Mutation`** **`Beta`** #### Returns `string`\[] #### Remarks 获取该物品在冒险模式下可破坏的方块类型列表。 Get the list of block types this item can break in Adventure mode. *** ### getCanPlaceOn() > **getCanPlaceOn**(): `string`\[] **`World Mutation`** **`Beta`** #### Returns `string`\[] #### Remarks 获取该物品在冒险模式下可放置于其上的方块类型列表。 Get the list of block types this item can be placed on in Adventure mode. *** ### getComponent() > **getComponent**\<`T`>(`componentId`): [`ItemComponentReturnType`](/server/types/ItemComponentReturnType.md)\<`T`> | `undefined` **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` #### Parameters ##### componentId `T` 组件的标识符(例如 'minecraft:food')。若未指定命名空间 前缀,则默认使用 'minecraft:'。可用的组件 ID 包括 [ItemComponentTypes](/server/enums/ItemComponentTypes.md) 枚举中的组件,以及通过 [ItemComponentRegistry](/server/classes/ItemComponentRegistry.md) 注册的自定义组件 ID。 The identifier of the component (e.g., 'minecraft:food'). If no namespace prefix is specified, 'minecraft:' is assumed. Available component IDs are those in the [ItemComponentTypes](/server/enums/ItemComponentTypes.md) enum and custom component IDs registered with the [ItemComponentRegistry](/server/classes/ItemComponentRegistry.md). #### Returns [`ItemComponentReturnType`](/server/types/ItemComponentReturnType.md)\<`T`> | `undefined` 若该组件存在于物品堆上则返回该组件,否则返回 undefined。 Returns the component if it exists on the item stack, otherwise undefined. #### Remarks 获取物品堆的某个组件(表示附加功能)。 Gets a component (that represents additional capabilities) for an item stack. #### Example **giveHurtDiamondSword.ts** ```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); } } } ``` *** ### getComponents() > **getComponents**(): [`ItemComponent`](/server/classes/ItemComponent.md)\[] **`Beta`** #### Returns [`ItemComponent`](/server/classes/ItemComponent.md)\[] #### Remarks 返回该物品堆上存在的所有脚本组件。 Returns all scripting components that are present on this item stack. *** ### getDynamicProperty() > **getDynamicProperty**(`identifier`): `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` **`Beta`** #### Parameters ##### identifier `string` 属性标识符。 The property identifier. #### Returns `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` 返回该属性的值,若属性尚未设置则返回 undefined。 Returns the value for the property, or undefined if the property has not been set. #### Remarks 返回一个属性值。 Returns a property value. *** ### getDynamicPropertyIds() > **getDynamicPropertyIds**(): `string`\[] **`Beta`** #### Returns `string`\[] 一个字符串数组,包含该实体上已设置的动态属性。 A string array of the dynamic properties set on this entity. #### Remarks 返回已在该实体上使用的可用动态属性标识符集合。 Returns the available set of dynamic property identifiers that have been used on this entity. *** ### getDynamicPropertyTotalByteCount() > **getDynamicPropertyTotalByteCount**(): `number` **`Beta`** #### Returns `number` #### Remarks 返回当前为该实体存储的所有动态属性的总大小(以字节为 单位)。这包括键和值两者的大小。该值可用于诊断性能警告 迹象——例如,若某个实体关联了数兆字节的动态属性,它在 各种设备上加载时可能会很慢。 Returns the total size, in bytes, of all the dynamic properties that are currently stored for this entity. This includes the size of both the key and the value. This can be useful for diagnosing performance warning signs - if, for example, an entity has many megabytes of associated dynamic properties, it may be slow to load on various devices. *** ### getLore() > **getLore**(): `string`\[] **`Beta`** #### Returns `string`\[] lore 行的数组。若该物品没有 lore,则返回空数组。 An array of lore lines. If the item does not have lore, returns an empty array. #### Remarks 返回物品堆的 lore 值——一个次要显示字符串。 Returns the lore value - a secondary display string - for an ItemStack. *** ### getRawLore() > **getRawLore**(): [`RawMessage`](/server/interfaces/RawMessage.md)\[] **`Beta`** #### Returns [`RawMessage`](/server/interfaces/RawMessage.md)\[] lore 行的数组。若该物品没有 lore,则返回空数组。 An array of lore lines. If the item does not have lore, returns an empty array. #### Remarks 返回物品堆的 lore 值——一个次要显示字符串。字符串类型的 lore 行会被转换为 [RawMessage](/server/interfaces/RawMessage.md) 并置于 [RawMessage.text](/server/interfaces/RawMessage.md#text) 之下。 Returns the lore value - a secondary display string - for an ItemStack. String lore lines will be converted to a [RawMessage](/server/interfaces/RawMessage.md) and put under [RawMessage.text](/server/interfaces/RawMessage.md#text). *** ### getTags() > **getTags**(): `string`\[] **`Beta`** #### Returns `string`\[] #### Remarks 返回与该物品堆关联的标签集合。 Returns a set of tags associated with this item stack. *** ### hasComponent() > **hasComponent**(`componentId`): `boolean` **`Beta`** #### Parameters ##### componentId `string` 要获取的组件的标识符(例如 'minecraft:food')。若未指定 命名空间前缀,则默认使用 'minecraft:'。 The identifier of the component (e.g., 'minecraft:food') to retrieve. If no namespace prefix is specified, 'minecraft:' is assumed. #### Returns `boolean` #### Remarks 若指定组件存在于该物品堆上,则返回 true。 Returns true if the specified component is present on this item stack. *** ### hasTag() > **hasTag**(`tag`): `boolean` **`Beta`** #### Parameters ##### tag `string` 要搜索的标签。 Tag to search for. #### Returns `boolean` 若该物品堆关联了此标签则返回 true,否则返回 false。 True if the Item Stack has the tag associated with it, else false. #### Remarks 检查该物品堆是否关联了特定标签。 Checks whether this item stack has a particular tag associated with it. *** ### isStackableWith() > **isStackableWith**(`itemStack`): `boolean` **`Beta`** #### Parameters ##### itemStack `ItemStack` 用于检查堆叠兼容性的物品堆。 ItemStack to check stacking compatibility with. #### Returns `boolean` 若该物品堆可与传入的 itemStack 堆叠则返回 true。对于不可 堆叠的物品返回 false。 True if the Item Stack is stackable with the itemStack passed in. False for non-stackable items. #### Remarks 返回该物品堆是否可与给定的 `itemStack` 堆叠。这通过比较 物品类型以及与物品堆关联的任何自定义数据和属性来确定。 每个物品堆的数量不在考虑范围内,但对于不可堆叠的物品, 此方法始终返回 false。 Returns whether this item stack can be stacked with the given `itemStack`. This is determined by comparing the item type and any custom data and properties associated with the item stacks. The amount of each item stack is not taken into consideration, but for non-stackable items this will always return false. *** ### matches() > **matches**(`itemName`, `states?`): `boolean` **`Beta`** #### Parameters ##### itemName `string` 物品的标识符。 Identifier of the item. ##### states? `Record`\<`string`, `string` | `number` | `boolean`> 仅适用于方块。可选的一组状态用于比较。若未指定 states, 则匹配将在更宽泛的类型集合上进行检查。 Applicable only for blocks. An optional set of states to compare against. If states is not specified, matches checks against the set of types more broadly. #### Returns `boolean` 返回一个布尔值,表示指定物品是否匹配。 Returns a boolean whether the specified item matches. #### Remarks 版本安全的物品匹配检查方式。 Version safe way of checking if an item matches. *** ### setCanDestroy() > **setCanDestroy**(`blockIdentifiers?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockIdentifiers? `string`\[] 该物品可破坏的方块类型的字符串列表。 String list of block types that the item can destroy. #### Returns `void` #### Remarks 该物品在冒险模式下可破坏的方块类型列表。方块名称会显示 在物品的提示信息中。将值设置为 undefined 会清空该列表。 The list of block types this item can break in Adventure mode. The block names are displayed in the item's tooltip. Setting the value to undefined will clear the list. #### Throws Throws if any of the provided block identifiers are invalid. #### Example **giveDestroyRestrictedPickaxe.ts** ```typescript import { world, ItemStack, EntityInventoryComponent, DimensionLocation } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function giveDestroyRestrictedPickaxe(targetLocation: DimensionLocation) { for (const player of world.getAllPlayers()) { const specialPickaxe = new ItemStack(MinecraftItemTypes.DiamondPickaxe); specialPickaxe.setCanDestroy([MinecraftItemTypes.Cobblestone, MinecraftItemTypes.Obsidian]); const inventory = player.getComponent('inventory') as EntityInventoryComponent; if (inventory === undefined || inventory.container === undefined) { return; } inventory.container.addItem(specialPickaxe); } } ``` *** ### setCanPlaceOn() > **setCanPlaceOn**(`blockIdentifiers?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockIdentifiers? `string`\[] 该物品可放置于其上的方块类型的字符串列表。 String list of block types that the item can be placed on. #### Returns `void` #### Remarks 该物品在冒险模式下可放置于其上的方块类型列表。这仅适用于 方块物品。方块名称会显示在物品的提示信息中。将值设置为 undefined 会清空该列表。 The list of block types this item can be placed on in Adventure mode. This is only applicable to block items. The block names are displayed in the item's tooltip. Setting the value to undefined will clear the list. #### Throws Throws if any of the provided block identifiers are invalid. #### Example **givePlaceRestrictedGoldBlock.ts** ```typescript import { world, ItemStack, EntityInventoryComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function givePlaceRestrictedGoldBlock(targetLocation: DimensionLocation) { for (const player of world.getAllPlayers()) { const specialGoldBlock = new ItemStack(MinecraftItemTypes.GoldBlock); specialGoldBlock.setCanPlaceOn([MinecraftItemTypes.GrassBlock, MinecraftItemTypes.Dirt]); const inventory = player.getComponent(EntityComponentTypes.Inventory) as EntityInventoryComponent; if (inventory === undefined || inventory.container === undefined) { return; } inventory.container.addItem(specialGoldBlock); } } ``` *** ### setDynamicProperties() > **setDynamicProperties**(`values`): `void` **`Beta`** #### Parameters ##### values `Record`\<`string`, `boolean` | `number` | `string` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined`> 要设置的动态属性的键值对 Record。若数据值为 null,则会 移除该属性。 A Record of key value pairs of the dynamic properties to set. If the data value is null, it will remove that property instead. #### Returns `void` #### Remarks 一次性设置多个动态属性及其对应的值。 Sets multiple dynamic properties with specific values. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) *** ### setDynamicProperty() > **setDynamicProperty**(`identifier`, `value?`): `void` **`Beta`** #### Parameters ##### identifier `string` 属性标识符。 The property identifier. ##### value? `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) 要设置的属性的数据值。若值为 null,则会移除该属性。 Data value of the property to set. If the value is null, it will remove the property instead. #### Returns `void` #### Remarks 将指定属性设置为某个值。注意:此函数仅对不可堆叠的物品 有效。 Sets a specified property to a value. Note: This function only works with non-stackable items. #### Throws Throws if the item stack is stackable. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) *** ### setLore() > **setLore**(`loreList?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### loreList? (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[] lore 行的列表。列表中每个元素代表新的一行。lore 行的最大 数量为 20。lore 行的最大长度为 50 个字符。 List of lore lines. Each element in the list represents a new line. The maximum lore line count is 20. The maximum lore line length is 50 characters. #### Returns `void` #### Remarks 设置物品堆的 lore 值——一个次要显示字符串。若设置为空 字符串或 undefined,则会清空 lore 列表。 Sets the lore value - a secondary display string - for an ItemStack. The lore list is cleared if set to an empty string or undefined. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) Error #### Example **diamondAwesomeSword.ts** ```typescript import { EntityComponentTypes, ItemStack, Player } from '@minecraft/server'; import { MinecraftItemTypes } from '@minecraft/vanilla-data'; function giveAwesomeSword(player: Player) { const diamondAwesomeSword = new ItemStack(MinecraftItemTypes.DiamondSword, 1); diamondAwesomeSword.setLore(['§c§lDiamond Sword of Awesome§r', '+10 coolness', '§p+4 shiny§r']); // hover over/select the item in your inventory to see the lore. const inventory = player.getComponent(EntityComponentTypes.Inventory); if (inventory === undefined || inventory.container === undefined) { return; } inventory.container.setItem(0, diamondAwesomeSword); } ``` ## 同领域相关 - [InvalidItemStackError](/server/classes/InvalidItemStackError.md) - [ItemLockMode](/server/enums/ItemLockMode.md) - [ItemType](/server/classes/ItemType.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [CollectionTreeEntryItemType](/server-editor/enums/CollectionTreeEntryItemType.md) - [CoreActionBarItemType](/server-editor/enums/CoreActionBarItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemStartUseAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemStartUseAfterEvent.md. # Class: ItemStartUseAfterEvent event **`Beta`** 包含与可蓄力物品开始蓄力相关的信息。 Contains information related to a chargeable item starting to be charged. ## Properties ### itemStack > `readonly` **itemStack**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 正在开始蓄力的受影响的物品堆。 The impacted item stack that is starting to be charged. *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回触发此物品事件的源实体。 Returns the source entity that triggered this item event. *** ### useDuration > `readonly` **useDuration**: `number` **`Beta`** #### Remarks 返回距蓄力完成周期还剩余的时长(以刻为单位)。 Returns the time, in ticks, for the remaining duration left before the charge completes its cycle. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemStartUseAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemStartUseAfterEventSignal.md. # Class: ItemStartUseAfterEventSignal event **`Beta`** 管理与可蓄力物品开始蓄力事件相关联的回调。 Manages callbacks that are connected to the start of charging for a chargeable item. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,当可蓄力物品开始蓄力时将被调用。 Adds a callback that will be called when a chargeable item starts charging. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使可蓄力物品开始蓄力时不再被调用。 Removes a callback from being called when a chargeable item starts charging. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemStartUseOnAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemStartUseOnAfterEvent.md. # Class: ItemStartUseOnAfterEvent event **`Beta`** 包含有关在方块上使用物品的信息。玩家按下“使用物品/放置方块”按钮并成功使用物品或放置方块时触发此事件。在执行建造操作时,仅对交互的第一个方块触发。注意:此事件不能与锄头或斧头物品一起使用。 Contains information related to an item being used on a block. This event fires when a player presses the the Use Item / Place Block button to successfully use an item or place a block. Fires for the first block that is interacted with when performing a build action. Note: This event cannot be used with Hoe or Axe items. ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 使用物品的方块。 The block that the item is used on. *** ### blockFace > `readonly` **blockFace**: [`Direction`](/server/enums/Direction.md) **`Beta`** #### Remarks 正在使用物品的方块面。 The face of the block that an item is being used on. *** ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 开始使用的受影响物品堆。在某些游戏场景中可能为 `undefined`,例如空手按下按钮时。 The impacted item stack that is starting to be used. Can be undefined in some gameplay scenarios like pushing a button with an empty hand. *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回触发此物品事件的来源实体。 Returns the source entity that triggered this item event. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemStartUseOnAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemStartUseOnAfterEventSignal.md. # Class: ItemStartUseOnAfterEventSignal event **`Beta`** 管理与物品开始被用于方块事件相关联的回调。 Manages callbacks that are connected to an item starting being used on a block event. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,当物品被用于方块时将被调用。 Adds a callback that will be called when an item is used on a block. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使物品被用于方块时不再被调用。 Removes a callback from being called when an item is used on a block. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemStopUseAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemStopUseAfterEvent.md. # Class: ItemStopUseAfterEvent event **`Beta`** 包含与可蓄力物品结束使用周期、或玩家释放该物品的使用动作相关的信息。 Contains information related to a chargeable item has finished an items use cycle, or when the player has released the use action with the item. ## Properties ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 正在停止蓄力的受影响的物品堆。 当传送到不同维度时 ItemStopUseAfterEvent 也可能被触发, 此时该值可能为 undefined。 The impacted item stack that is stopping being charged. ItemStopUseAfterEvent can be called when teleporting to a different dimension and this can be undefined. *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回触发此物品事件的源实体。 Returns the source entity that triggered this item event. *** ### useDuration > `readonly` **useDuration**: `number` **`Beta`** #### Remarks 返回距蓄力完成周期还剩余的时长(以刻为单位)。 Returns the time, in ticks, for the remaining duration left before the charge completes its cycle. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemStopUseAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemStopUseAfterEventSignal.md. # Class: ItemStopUseAfterEventSignal event **`Beta`** 管理与带有已注册的 minecraft:chargeable 组件的物品停止蓄力事件相关联的回调。 Manages callbacks that are connected to the stopping of charging for an item that has a registered minecraft:chargeable component. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,当可蓄力物品停止蓄力时将被调用。 Adds a callback that will be called when a chargeable item stops charging. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使可蓄力物品停止蓄力时不再被调用。 Removes a callback from being called when a chargeable item stops charging. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemStopUseOnAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemStopUseOnAfterEvent.md. # Class: ItemStopUseOnAfterEvent event **`Beta`** 包含与已停止对某方块使用的物品相关的信息。当玩家按 下「使用物品/放置方块」按钮成功使用物品或放置方块时, 会触发此事件。如果放置了多个方块,则此事件仅在放置 开始的瞬间触发一次。注意:此事件不能与锄或斧物品一起使用。 Contains information related to an item that has stopped being used on a block. This event fires when a player successfully uses an item or places a block by pressing the Use Item / Place Block button. If multiple blocks are placed, this event will only occur once at the beginning of the block placement. Note: This event cannot be used with Hoe or Axe items. ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 物品所作用的目标方块。 The block that the item is used on. *** ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 正在作用于方块的受影响的物品堆。 The impacted item stack that is being used on a block. *** ### source > `readonly` **source**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 返回触发此物品事件的源实体。 Returns the source entity that triggered this item event. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemStopUseOnAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemStopUseOnAfterEventSignal.md. # Class: ItemStopUseOnAfterEventSignal event **`Beta`** 管理与物品停止对方块使用事件相关联的回调。 Manages callbacks that are connected to an item stops used on a block event. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,当物品停止对某方块使用时将被调用。 Adds a callback that will be called when an item stops being used on a block. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使物品被用于方块时不再被调用。 Removes a callback from being called when an item is used on a block. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemType.md. # Class: ItemType item **`Beta`** 表示物品的类型,例如 Wool。 Represents the type of an item - for example, Wool. ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 返回该物品类型的标识符,例如 'minecraft:apple'。 Returns the identifier of the item type - for example, 'minecraft:apple'. *** ### localizationKey > `readonly` **localizationKey**: `string` **`Beta`** #### Remarks 用于 .lang 文件中对该 ItemType 名称进行本地化的键。 Key for the localization of this ItemType's name used in .lang files. ## 同领域相关 - [InvalidItemStackError](/server/classes/InvalidItemStackError.md) - [ItemLockMode](/server/enums/ItemLockMode.md) - [ItemStack](/server/classes/ItemStack.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [CollectionTreeEntryItemType](/server-editor/enums/CollectionTreeEntryItemType.md) - [CoreActionBarItemType](/server-editor/enums/CoreActionBarItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemTypes.md. # Class: ItemTypes **`Beta`** 返回在 Minecraft 中注册的物品类型集合。 Returns the set of item types registered within Minecraft. ## Methods ### get() > `static` **get**(`itemId`): [`ItemType`](/server/classes/ItemType.md) | `undefined` **`Beta`** #### Parameters ##### itemId `string` #### Returns [`ItemType`](/server/classes/ItemType.md) | `undefined` #### Remarks 若 Minecraft 中存在相应物品类型,则返回该物品类型。 Returns a specific item type, if available within Minecraft. *** ### getAll() > `static` **getAll**(): [`ItemType`](/server/classes/ItemType.md)\[] **`Beta`** #### Returns [`ItemType`](/server/classes/ItemType.md)\[] #### Remarks 获取 Minecraft 中注册的所有可用物品类型。 Retrieves all available item types registered within Minecraft. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemUseAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemUseAfterEventSignal.md. # Class: ItemUseAfterEventSignal event **`Beta`** 管理与物品使用事件相关联的回调。 Manages callbacks that are connected to an item use event. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,当物品被使用时将被调用。 Adds a callback that will be called when an item is used. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使物品被使用时不再被调用。 Removes a callback from being called when an item is used. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ItemUseBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemUseBeforeEventSignal.md. # Class: ItemUseBeforeEventSignal event **`Beta`** 管理物品使用前触发的回调。 Manages callbacks that fire before an item is used. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip This closure is called with restricted-execution privilege. ::: #### Returns :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks 添加一个回调,在物品被使用之前将被调用。 Adds a callback that will be called before an item is used. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks 移除一个回调,使物品被使用之前不再被调用。 Removes a callback from being called before an item is used. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LeverActionAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LeverActionAfterEventSignal.md. # Class: LeverActionAfterEventSignal event **`Beta`** 管理与拉杆移动(激活或停用)相关的回调。 Manages callbacks that are connected to lever moves (activates or deactivates). ## Example **leverActionEvent.ts** ```typescript import { world, system, BlockPermutation, LeverActionAfterEvent, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function leverActionEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // set up a lever const cobblestone = targetLocation.dimension.getBlock(targetLocation); const lever = targetLocation.dimension.getBlock({ x: targetLocation.x, y: targetLocation.y + 1, z: targetLocation.z, }); if (cobblestone === undefined || lever === undefined) { log('Could not find block at location.'); return -1; } cobblestone.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.Cobblestone)); lever.setPermutation( BlockPermutation.resolve(MinecraftBlockTypes.Lever).withState('lever_direction', 'up_north_south') ); world.afterEvents.leverAction.subscribe((leverActionEvent: LeverActionAfterEvent) => { const eventLoc = leverActionEvent.block.location; if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y + 1 && eventLoc.z === targetLocation.z) { log('Lever activate event at tick ' + system.currentTick); } }); } ``` ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,当拉杆被移动(激活或停用)时将被调用。 Adds a callback that will be called when a lever is moved (activates or deactivates). *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个回调,使其在拉杆被移动(激活或停用)时不再被调用。 Removes a callback from being called when a lever is moved (activates or deactivates). ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LinearSpline.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LinearSpline.md. # Class: LinearSpline **`Beta`** 在点之间线性插值的样条线。 A spline that linearly interpolates between points. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new LinearSpline**(): `LinearSpline` **`Beta`** #### Returns `LinearSpline` ## Properties ### controlPoints > **controlPoints**: [`Vector3`](/server/interfaces/Vector3.md)\[] **`World Mutation`** **`Beta`** #### Remarks 线性样条线的控制点。 Control points for the Linear spline. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LocationInUnloadedChunkError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LocationInUnloadedChunkError.md. # Class: LocationInUnloadedChunkError error **`Beta`** 当指定位置或边界区域所在的区块未加载时抛出。 Thrown when the chunk for provided location or bounding area is not loaded. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LocationOutOfWorldBoundariesError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LocationOutOfWorldBoundariesError.md. # Class: LocationOutOfWorldBoundariesError world error **`Beta`** 当提供的位置或边界区域超出维度的最小或最大高度时抛出。 Thrown when a provided location or bounding area is outside the minimum or maximum dimension height. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LocatorBar.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LocatorBar.md. # Class: LocatorBar **`Beta`** 管理玩家定位栏上显示的路径点集合。允许添加、移除和查询路径点,具有最大容量限制。 定位栏中的无效路径点将在下一个游戏刻自动移除。这包括与已从世界中移除的实体绑定的路径点。 注意:你可以使用 `playerWaypoints` [GameRule](/server/enums/GameRule.md) 控制是否自动将玩家路径点添加到定位栏。接受的值有 `off`(玩家不显示在定位栏上)和 `everyone`(所有玩家在定位栏上可见)。 注意:你只能修改、移除或查询由此包添加的路径点。 Manages the collection of waypoints displayed on a player's locator bar. Allows adding, removing, and querying waypoints with a maximum capacity limit. Invalid waypoints in the locator bar will be automatically removed in the next tick. This includes waypoints tied to entities that have been removed from the world. Note: You can control whether vanilla player waypoints are automatically added to the locator bar using the `playerWaypoints` [GameRule](/server/enums/GameRule.md). Accepted values are `off` (players are not shown on the locator bar) and `everyone` (all players are visible on the locator bar). Note: You can only modify, remove, or query waypoints that were added by this pack. ## Example **sharedWaypoint.ts** ```typescript /* import { world, LocationWaypoint, WaypointTextureSelector, WaypointTexture } from "@minecraft/server" function sharedWaypoint() { const players = world.getAllPlayers(); if (players.length < 2) { console.warn("Need at least 2 players for this example."); return; } const playerA = players[0]; const playerB = players[1]; // Create a single waypoint at a specific location const textureSelector: WaypointTextureSelector = { textureBoundsList: [ { lowerBound: 0, texture: WaypointTexture.Circle } ] }; const waypoint = new LocationWaypoint( { dimension: playerA.dimension, x: 100, y: 64, z: 100 }, textureSelector, { red: 1, green: 0, blue: 0 } // Initially red ); // Add the same waypoint to both players' locator bars playerA.locatorBar.addWaypoint(waypoint); playerB.locatorBar.addWaypoint(waypoint); // Change the color - this affects both players waypoint.color = { red: 0, green: 1, blue: 0 }; // Now green for both players } */ ``` ## Properties ### count > `readonly` **count**: `number` **`Beta`** #### Remarks 定位栏中当前的路径点数量。 The current number of waypoints in the locator bar. *** ### maxCount > `readonly` **maxCount**: `number` **`Beta`** #### Remarks 可以添加到定位栏的最大路径点数量。 The maximum number of waypoints that can be added to the locator bar. ## Methods ### addWaypoint() > **addWaypoint**(`waypoint`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### waypoint [`Waypoint`](/server/classes/Waypoint.md) 要添加到定位栏的 [Waypoint](/server/classes/Waypoint.md)。 The [Waypoint](/server/classes/Waypoint.md) to add to the locator bar. #### Returns `void` #### Remarks 将路径点添加到定位栏。如果路径点已存在、已达到最大路径点限制或路径点无效,则抛出错误。 Adds a waypoint to the locator bar. Throws an error if the waypoint already exists, the maximum waypoint limit has been reached, or the waypoint is invalid. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidWaypointError](/server/classes/InvalidWaypointError.md) [LocatorBarError](/server/classes/LocatorBarError.md) *** ### getAllWaypoints() > **getAllWaypoints**(): [`Waypoint`](/server/classes/Waypoint.md)\[] **`World Mutation`** **`Beta`** #### Returns [`Waypoint`](/server/classes/Waypoint.md)\[] #### Remarks 返回当前定位栏中所有路径点的数组。 Returns an array of all waypoints currently in the locator bar. *** ### hasWaypoint() > **hasWaypoint**(`waypoint`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### waypoint [`Waypoint`](/server/classes/Waypoint.md) 要检查的 [Waypoint](/server/classes/Waypoint.md)。 The [Waypoint](/server/classes/Waypoint.md) to check for. #### Returns `boolean` #### Remarks 检查指定的路径点是否存在于定位栏中。 Checks whether the specified waypoint exists in the locator bar. *** ### removeAllWaypoints() > **removeAllWaypoints**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 从定位栏中移除所有路径点,将其完全清空。 Removes all waypoints from the locator bar, clearing it completely. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### removeWaypoint() > **removeWaypoint**(`waypoint`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### waypoint [`Waypoint`](/server/classes/Waypoint.md) 要从定位栏中移除的 [Waypoint](/server/classes/Waypoint.md)。 The [Waypoint](/server/classes/Waypoint.md) to remove from the locator bar. #### Returns `void` #### Remarks 从定位栏中移除指定路径点。如果路径点不存在于定位栏中,则返回错误。 Removes a specific waypoint from the locator bar. Returns an error if the waypoint does not exist in the locator bar. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [LocatorBarError](/server/classes/LocatorBarError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LocatorBarError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LocatorBarError.md. # Class: LocatorBarError error **`Beta`** 当定位栏操作失败时抛出的错误。包含指示错误具体原因的原因代码。 Error thrown when a locator bar operation fails. Contains a reason code indicating the specific cause of the error. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### reason > `readonly` **reason**: [`LocatorBarErrorReason`](/server/enums/LocatorBarErrorReason.md) **`Early Execution`** **`Beta`** #### Remarks 指示定位栏操作失败原因的 `LocatorBarErrorReason` 代码。 The [LocatorBarErrorReason](/server/enums/LocatorBarErrorReason.md) code that indicates why the locator bar operation failed. *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootPool.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootPool.md. # Class: LootPool **`Beta`** 条目的集合,每个条目单独决定战利品掉落。可以包含决定掉落结果的数值,包括投掷次数、额外投掷次数和层级。 A collection of entries which individually determine loot drops. Can contain values determining drop outcomes, including rolls, bonus rolls and tiers. ## Properties ### bonusRolls > `readonly` **bonusRolls**: `NumberRange` **`Beta`** #### Remarks 返回基于玩家幸运等级战利品池将额外投掷的次数,表示为从最小到最大投掷次数的范围。 Returns the number of extra times a loot pool will be rolled based on the player's luck level, represented as a range from minimum to maximum rolls. *** ### conditions > `readonly` **conditions**: [`LootItemCondition`](/server/classes/LootItemCondition.md)\[] **`Beta`** *** ### entries > `readonly` **entries**: [`LootPoolEntry`](/server/classes/LootPoolEntry.md)\[] **`Beta`** #### Remarks 获取战利品池中包含的所有战利品池条目的完整列表。 Gets a complete list of all loot pool entries contained in the loot pool. *** ### rolls > `readonly` **rolls**: `NumberRange` **`Beta`** #### Remarks 返回战利品池将投掷的次数,表示为从最小到最大投掷次数的范围。 Returns the number of times a loot pool will be rolled, represented as a range from minimum to maximum rolls. *** ### tiers? > `readonly` `optional` **tiers?**: [`LootPoolTiers`](/server/classes/LootPoolTiers.md) **`Beta`** #### Remarks 获取给定战利品表的战利品池层级值(如果存在)。 Gets the loot pool tier values for a given table if they exist. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootPoolTiers.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootPoolTiers.md. # Class: LootPoolTiers **`Beta`** 表示在分层战利品池中决定战利品掉落的值。分层战利品池中的潜在掉落物是有序的,并通过此对象中的值控制的逻辑进行选择。 Represents the values which determine loot drops in a tiered loot pool. Potential drops from tiered loot pools are ordered, and chosen via logic controlled by the values in this object. ## Properties ### bonusChance > `readonly` **bonusChance**: `number` **`Beta`** #### Remarks 每次额外投掷尝试升级掉落物品层级的机会。 The chance for each bonus roll attempt to upgrade the tier of the dropped item. *** ### bonusRolls > `readonly` **bonusRolls**: `number` **`Beta`** #### Remarks 战利品掉落升级其层级的尝试次数,从而增加其在战利品池条目数组中的位置,产生更高级别的掉落。 The number of attempts for the loot drop to upgrade its tier, thereby incrementing its position in the loot pool entry array, resulting in a higher tier drop. *** ### initialRange > `readonly` **initialRange**: `number` **`Beta`** #### Remarks 表示确定掉落哪个战利品层级的起始点上界。下界始终为 1。例如,值为 3 将导致层级掉落逻辑从战利品池条目数组中 1 到 3 之间的随机选择位置开始。 Represents the upper bound for the starting point in determining which tier of loot to drop. The lower bound is always 1. For example, a value of 3 would result in the tier drop logic starting at a randomly selected position in the loot pool entry array between 1 and 3. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootTable.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootTable.md. # Class: LootTable **`Beta`** 表示单个战利品表,决定杀死生物、破坏方块、填充容器等时生成哪些物品。 Represents a single Loot Table, which determines what items are generated when killing a mob, breaking a block, filling a container, and more. ## Properties ### path > `readonly` **path**: `string` **`Beta`** #### Remarks 返回表示此战利品表的 JSON 文件的路径。不包括文件扩展名或 `loot_tables/` 文件夹前缀。示例:`entities/creeper`。 Returns the path to the JSON file that represents this loot table. Does not include file extension, or 'loot\_tables/' folder prefix. Example: `entities/creeper`. *** ### pools > `readonly` **pools**: [`LootPool`](/server/classes/LootPool.md)\[] **`Beta`** #### Remarks 返回给定战利品表上的战利品池数组。 Returns the array of loot pools on a given loot table. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/LootTableManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/LootTableManager.md. # Class: LootTableManager **`Beta`** 战利品表相关 API 的管理器。可根据方块和实体的战利品表生成掉落物。 Manager for Loot Table related APIs. Allows for generation of drops from blocks and entities according to their loot tables. ## Methods ### generateLootFromBlock() > **generateLootFromBlock**(`block`, `tool?`): [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` **`Beta`** #### Parameters ##### block [`Block`](/server/classes/Block.md) 要生成战利品的方块。 The block to generate loot from. ##### tool? [`ItemStack`](/server/classes/ItemStack.md) 可选。用于挖掘的工具。 Optional. The tool to use in the looting operation. #### Returns [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` 战利品掉落事件中掉落的物品堆数组。若没有掉落物则为空数组;若所提供的工具不足以挖掘该方块,则返回 undefined。 An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped, or undefined if the provided tool is insufficient to mine the block. #### Remarks 模拟挖掘行为,根据给定的方块生成战利品。 Generates loot from a given block as if it had been mined. #### Throws 当方块位于未加载的区块中,或方块位置超出世界边界时抛出。 Throws if the block is in an unloaded chunk, or if the block's position is outside of world bounds. [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError.md) [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) [UnloadedChunksError](/server/classes/UnloadedChunksError.md) *** ### generateLootFromBlockPermutation() > **generateLootFromBlockPermutation**(`blockPermutation`, `tool?`): [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` **`Beta`** #### Parameters ##### blockPermutation [`BlockPermutation`](/server/classes/BlockPermutation.md) ##### tool? [`ItemStack`](/server/classes/ItemStack.md) 可选。用于挖掘的工具。 Optional. The tool to use in the looting operation. #### Returns [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` 战利品掉落事件中掉落的物品堆数组。若没有掉落物则为空数组;若所提供的工具不足以挖掘该方块,则返回 undefined。 An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped, or undefined if the provided tool is insufficient to mine the block. #### Remarks 模拟挖掘行为,根据给定的方块状态(BlockPermutation)生成战利品。 Generates loot from a given block permutation as if it had been mined. *** ### generateLootFromBlockType() > **generateLootFromBlockType**(`scriptBlockType`, `tool?`): [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` **`Beta`** #### Parameters ##### scriptBlockType [`BlockType`](/server/classes/BlockType.md) ##### tool? [`ItemStack`](/server/classes/ItemStack.md) 可选。用于挖掘的工具。 Optional. The tool to use in the looting operation. #### Returns [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` 战利品掉落事件中掉落的物品堆数组。若没有掉落物则为空数组;若所提供的工具不足以挖掘该方块,则返回 undefined。 An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped, or undefined if the provided tool is insufficient to mine the block. #### Remarks 模拟挖掘行为,根据给定的方块类型生成战利品。 Generates loot from a given block type as if it had been mined. *** ### generateLootFromEntity() > **generateLootFromEntity**(`entity`, `tool?`): [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` **`Beta`** #### Parameters ##### entity [`Entity`](/server/classes/Entity.md) ##### tool? [`ItemStack`](/server/classes/ItemStack.md) 可选。用于击杀的工具。 Optional. The tool to use in the looting operation. #### Returns [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` 战利品掉落事件中掉落的物品堆数组。若没有掉落物则为空数组;若实体无效则返回 undefined。 An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped, or undefined if the entity was invalid. #### Remarks 模拟击杀行为,根据给定的实体生成战利品。 Generates loot from given a entity as if it had been killed. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### generateLootFromEntityType() > **generateLootFromEntityType**(`entityType`, `tool?`): [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` **`Beta`** #### Parameters ##### entityType [`EntityType`](/server/classes/EntityType.md) ##### tool? [`ItemStack`](/server/classes/ItemStack.md) 可选。用于击杀的工具。 Optional. The tool to use in the looting operation. #### Returns [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` 战利品掉落事件中掉落的物品堆数组。若没有掉落物则为空数组。 An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped. #### Remarks 模拟击杀行为,根据给定的实体类型生成战利品。 Generates loot from given a entity type as if it had been killed. *** ### generateLootFromTable() > **generateLootFromTable**(`lootTable`, `tool?`): [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` **`Beta`** #### Parameters ##### lootTable [`LootTable`](/server/classes/LootTable.md) ##### tool? [`ItemStack`](/server/classes/ItemStack.md) 可选。用于挖掘的工具。 Optional. The tool to use in the looting operation. #### Returns [`ItemStack`](/server/classes/ItemStack.md)\[] | `undefined` 战利品掉落事件中掉落的物品堆数组。若没有掉落物则为空数组;若所提供的工具不足以挖掘该方块,则返回 undefined。 An array of item stacks dropped from the loot drop event. Can be empty if no loot dropped, or undefined if the provided tool is insufficient to mine the block. #### Remarks 根据给定的战利品表(LootTable)生成战利品。 Generates loot from a given LootTable. *** ### getLootTable() > **getLootTable**(`path`): [`LootTable`](/server/classes/LootTable.md) | `undefined` **`Beta`** #### Parameters ##### path `string` 要获取的战利品表路径。不含文件扩展名,也不含 `loot_tables/` 前缀。例如:`entities/creeper`。 Path to the table to retrieve. Does not include file extension, or 'loot\_tables/' folder prefix. Example: `entities/creeper`. #### Returns [`LootTable`](/server/classes/LootTable.md) | `undefined` 若找到对应的战利品表则返回该 LootTable,若所提供的路径不存在对应战利品表则返回 `undefined`。 Returns a LootTable if one is found, or `undefined` if the provided path does not correspond to an existing loot table. #### Remarks 从当前关卡的注册表中获取单个战利品表。 Retrieves a single loot table from the level's current registry. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/MessageReceiveAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/MessageReceiveAfterEvent.md. # Class: MessageReceiveAfterEvent event **`Beta`** 一个特定的当前内部事件,用于将消息从客户端传递到服务器。 A specific currently-internal event used for passing messages from client to server. ## Properties ### id > `readonly` **id**: `string` **`Beta`** 消息标识符。 #### Remarks The message identifier. *** ### message > `readonly` **message**: `string` **`Beta`** 消息内容。 #### Remarks The message. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 发送消息的玩家。 #### Remarks The player who sent the message. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/MolangVariableMap.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/MolangVariableMap.md. # Class: MolangVariableMap **`Beta`** 包含一组额外的变量值,用于进一步定义渲染和动画的工作方式。 Contains a set of additional variable values for further defining how rendering and animations function. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new MolangVariableMap**(): `MolangVariableMap` **`Beta`** #### Returns `MolangVariableMap` ## Methods ### setColorRGB() > **setColorRGB**(`variableName`, `color`): `void` **`Beta`** 向 Molang 添加以下变量: - `.r` - 红色颜色值 \[0-1] - `.g` - 绿色颜色值 \[0-1] - `.b` - 蓝色颜色值 \[0-1] #### Parameters ##### variableName `string` ##### color [`RGB`](/server/interfaces/RGB.md) #### Returns `void` #### Remarks Adds the following variables to Molang: - `.r` - Red color value \[0-1] - `.g` - Green color value \[0-1] - `.b` - Blue color value \[0-1] #### Throws This function can throw errors. *** ### setColorRGBA() > **setColorRGBA**(`variableName`, `color`): `void` **`Beta`** 向 Molang 添加以下变量: - `.r` - 红色颜色值 \[0-1] - `.g` - 绿色颜色值 \[0-1] - `.b` - 蓝色颜色值 \[0-1] - `.a` - Alpha(透明度)颜色值 \[0-1] #### Parameters ##### variableName `string` ##### color [`RGBA`](/server/interfaces/RGBA.md) #### Returns `void` #### Remarks Adds the following variables to Molang: - `.r` - Red color value \[0-1] - `.g` - Green color value \[0-1] - `.b` - Blue color value \[0-1] - `.a` - Alpha (transparency) color value \[0-1] #### Throws This function can throw errors. *** ### setFloat() > **setFloat**(`variableName`, `number`): `void` **`Beta`** 在 Molang 变量映射中设置一个数值(小数)。 #### Parameters ##### variableName `string` 要设置的浮点数的名称。 Name of the float-based number to set. ##### number `number` 要为基于 Molang 的变量设置的值。 Value for the Molang-based variable to set. #### Returns `void` #### Remarks Sets a numeric (decimal) value within the Molang variable map. #### Throws This function can throw errors. *** ### setSpeedAndDirection() > **setSpeedAndDirection**(`variableName`, `speed`, `direction`): `void` **`Beta`** 向 Molang 添加以下变量: - `.speed` - 提供的速度数值 - `.direction_x` - 提供的 [Vector3](/server/interfaces/Vector3.md) 中的 X 值 - `.direction_y` - 提供的 [Vector3](/server/interfaces/Vector3.md) 中的 Y 值 - `.direction_z` - 提供的 [Vector3](/server/interfaces/Vector3.md) 中的 Z 值 #### Parameters ##### variableName `string` ##### speed `number` ##### direction [`Vector3`](/server/interfaces/Vector3.md) #### Returns `void` #### Remarks Adds the following variables to Molang: - `.speed` - Speed number provided - `.direction_x` - X value from the [Vector3](/server/interfaces/Vector3.md) provided - `.direction_y` - Y value from the [Vector3](/server/interfaces/Vector3.md) provided - `.direction_z` - Z value from the [Vector3](/server/interfaces/Vector3.md) provided #### Throws This function can throw errors. *** ### setVector3() > **setVector3**(`variableName`, `vector`): `void` **`Beta`** 向 Molang 添加以下变量: - `.x` - 提供的 [Vector3](/server/interfaces/Vector3.md) 中的 X 值 - `.y` - 提供的 [Vector3](/server/interfaces/Vector3.md) 中的 Y 值 - `.z` - 提供的 [Vector3](/server/interfaces/Vector3.md) 中的 Z 值 #### Parameters ##### variableName `string` ##### vector [`Vector3`](/server/interfaces/Vector3.md) #### Returns `void` #### Remarks Adds the following variables to Molang: - `.x` - X value from the [Vector3](/server/interfaces/Vector3.md) provided - `.y` - Y value from the [Vector3](/server/interfaces/Vector3.md) provided - `.z` - Z value from the [Vector3](/server/interfaces/Vector3.md) provided #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/NamespaceNameError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/NamespaceNameError.md. # Class: NamespaceNameError error **`Beta`** 当名称需要命名空间且在验证该命名空间时发生错误时抛出。 Thrown when a name requires a namespace and an error occurs when validating that namespace ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### reason > `readonly` **reason**: [`NamespaceNameErrorReason`](/server/enums/NamespaceNameErrorReason.md) **`Early Execution`** **`Beta`** #### Remarks *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PackSettingChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PackSettingChangeAfterEvent.md. # Class: PackSettingChangeAfterEvent event **`Beta`** 发生更改的包设置名称和值。 Pack setting name and value that changed. ## Properties ### settingName > `readonly` **settingName**: `string` **`Beta`** 设置的名称。 #### Remarks The name of the setting. *** ### settingValue > `readonly` **settingValue**: `string` | `number` | `boolean` **`Beta`** 设置的值。 #### Remarks The value of the setting. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PackSettingChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PackSettingChangeAfterEventSignal.md. # Class: PackSettingChangeAfterEventSignal event **`Beta`** 管理连接到包设置更改事件的回调。 Manages callbacks that are connected to pack setting change events. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PistonActivateAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PistonActivateAfterEventSignal.md. # Class: PistonActivateAfterEventSignal event **`Beta`** 管理与活塞激活相关的回调。 Manages callbacks that are connected to piston activations. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks #### Example **pistonAfterEvent.ts** ```typescript import { world, system, BlockPermutation, BlockPistonState, PistonActivateAfterEvent, DimensionLocation, } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function pistonAfterEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { // set up a couple of piston blocks const piston = targetLocation.dimension.getBlock(targetLocation); const button = targetLocation.dimension.getBlock({ x: targetLocation.x, y: targetLocation.y + 1, z: targetLocation.z, }); if (piston === undefined || button === undefined) { log('Could not find block at location.'); return -1; } piston.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.Piston).withState('facing_direction', 3)); button.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.AcaciaButton).withState('facing_direction', 1)); world.afterEvents.pistonActivate.subscribe((pistonEvent: PistonActivateAfterEvent) => { const eventLoc = pistonEvent.piston.block.location; if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y && eventLoc.z === targetLocation.z) { log( 'Piston event at ' + system.currentTick + (pistonEvent.piston.isMoving ? ' Moving' : '') + (pistonEvent.piston.state === BlockPistonState.Expanding ? ' Expanding' : '') + (pistonEvent.piston.state === BlockPistonState.Expanded ? ' Expanded' : '') + (pistonEvent.piston.state === BlockPistonState.Retracting ? ' Retracting' : '') + (pistonEvent.piston.state === BlockPistonState.Retracted ? ' Retracted' : '') ); } }); } ``` *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除在活塞伸出或缩回时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a piston expands or retracts. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlaceJigsawError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlaceJigsawError.md. # Class: PlaceJigsawError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerAimAssist.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerAimAssist.md. # Class: PlayerAimAssist player **`Beta`** 用于玩家瞄准辅助相关 API 的容器。 A container for APIs related to player aim-assist. ## Properties ### settings? > `readonly` `optional` **settings?**: [`PlayerAimAssistSettings`](/server/interfaces/PlayerAimAssistSettings.md) **`Beta`** 玩家当前激活的瞄准辅助设置,如果未激活则为 `undefined`。 #### Remarks The player's currently active aim-assist settings, or undefined if not active. ## Methods ### set() > **set**(`settings?`): `void` **`World Mutation`** **`Beta`** 设置玩家的瞄准辅助设置。 #### Parameters ##### settings? [`PlayerAimAssistSettings`](/server/interfaces/PlayerAimAssistSettings.md) 要为玩家激活的瞄准辅助设置,如果为 `undefined`,则瞄准辅助将被禁用。 Aim-assist settings to activate for the player, if undefined aim-assist will be disabled. #### Returns `void` #### Remarks Sets the player's aim-assist settings. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [EngineError](/common/classes/EngineError.md) Error [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [NamespaceNameError](/server/classes/NamespaceNameError.md) ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerBreakBlockAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerBreakBlockAfterEventSignal.md. # Class: PlayerBreakBlockAfterEventSignal event player block **`Beta`** 管理与玩家破坏方块时相关的回调。 Manages callbacks that are connected to when a player breaks a block. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个在方块被玩家破坏时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` ##### options? [`BlockEventOptions`](/server/interfaces/BlockEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a block is broken by a player. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除在玩家破坏方块时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a player breaks a block. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) - [PlayerBreakBlockBeforeEventSignal](/server/classes/PlayerBreakBlockBeforeEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerBreakBlockBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerBreakBlockBeforeEventSignal.md. # Class: PlayerBreakBlockBeforeEventSignal event player block **`Beta`** 管理与玩家破坏方块前相关的回调。 Manages callbacks that are connected to before a player breaks a block. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个在方块被玩家破坏之前调用的回调。 #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限调用。 This closure is called with restricted-execution privilege. ::: ##### options? [`BlockEventOptions`](/server/interfaces/BlockEventOptions.md) #### Returns :::tip 以受限执行权限调用的闭包。 Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks Adds a callback that will be called before a block is broken by a player. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除在玩家破坏方块之前调用的回调。 #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限调用。 This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks Removes a callback from being called before a player breaks a block. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerButtonInputAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerButtonInputAfterEvent.md. # Class: PlayerButtonInputAfterEvent event player **`Beta`** 玩家按下按钮时的事件数据。 Event data for when a player presses a button. ## Properties ### button > `readonly` **button**: [`InputButton`](/server/enums/InputButton.md) **`Beta`** 此事件涉及的按钮。 #### Remarks The button this event is about. *** ### newButtonState > `readonly` **newButtonState**: [`ButtonState`](/server/enums/ButtonState.md) **`Beta`** 此按钮转移到的状态。 #### Remarks The state that this button transferred to. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 执行输入事件的玩家。 #### Remarks The player that performed the input event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerButtonInputAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerButtonInputAfterEventSignal.md. # Class: PlayerButtonInputAfterEventSignal event player **`Beta`** 管理与玩家输入相关的回调。 Manages callbacks that are connected to player inputs. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个在玩家执行输入后调用的回调。 #### Parameters ##### callback (`arg0`) => `void` ##### options? [`InputEventOptions`](/server/interfaces/InputEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called after the player performs an input. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除在玩家执行输入后调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called after the player performs an input. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerCancelBreakingBlockAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerCancelBreakingBlockAfterEventSignal.md. # Class: PlayerCancelBreakingBlockAfterEventSignal event player block **`Beta`** ## Preview 管理与玩家取消破坏方块时相关的回调。 Manages callbacks that are connected to when a player cancels breaking a block. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个在玩家取消破坏方块时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` ##### options? [`PlayerBreakingBlockEventOptions`](/server/interfaces/PlayerBreakingBlockEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a player cancels breaking a block. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除在玩家取消破坏方块时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a player cancels breaking a block. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerDimensionChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerDimensionChangeAfterEvent.md. # Class: PlayerDimensionChangeAfterEvent event player dimension **`Beta`** 包含玩家维度已更改的相关信息。 Contains information related to changes to a player's dimension having been changed. ## Properties ### fromDimension > `readonly` **fromDimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** 玩家正在切换的源维度。 #### Remarks The dimension the player is changing from. *** ### fromLocation > `readonly` **fromLocation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** 玩家在切换维度前的位置。 #### Remarks The location the player was at before changing dimensions. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 正在切换维度的玩家句柄。 #### Remarks Handle to the player that is changing dimensions. *** ### toDimension > `readonly` **toDimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** 玩家正在切换到的目标维度。 #### Remarks The dimension that the player is changing to. *** ### toLocation > `readonly` **toLocation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** 玩家切换维度后将生成的位置。 #### Remarks The location the player will spawn to after changing dimensions. ## 同领域相关 - [PlayerDimensionChangeAfterEventSignal](/server/classes/PlayerDimensionChangeAfterEventSignal.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerDimensionChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerDimensionChangeAfterEventSignal.md. # Class: PlayerDimensionChangeAfterEventSignal event player dimension **`Beta`** 管理与玩家维度切换成功后的回调。 Manages callbacks that are connected to successful player dimension changes. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 为玩家维度切换后事件订阅指定的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Subscribes the specified callback to a player dimension change after event. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 从玩家维度切换后事件中移除指定的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes the specified callback from a player dimension change after event. ## 同领域相关 - [PlayerDimensionChangeAfterEvent](/server/classes/PlayerDimensionChangeAfterEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerEmoteAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerEmoteAfterEvent.md. # Class: PlayerEmoteAfterEvent event player **`Beta`** ## Properties ### personaPieceId > `readonly` **personaPieceId**: `string` **`Beta`** *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerEmoteAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerEmoteAfterEventSignal.md. # Class: PlayerEmoteAfterEventSignal event player **`Beta`** 管理连接到玩家表情事件后的回调。 Manages callbacks that are connected to after a player emote event. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerGameModeChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerGameModeChangeAfterEvent.md. # Class: PlayerGameModeChangeAfterEvent event player **`Beta`** 包含玩家游戏模式更改后的事件相关信息。 Contains information regarding an event after a players game mode is changed. ## Properties ### fromGameMode > `readonly` **fromGameMode**: [`GameMode`](/server/enums/GameMode.md) **`Beta`** 更改前的游戏模式。 #### Remarks The previous game mode before the change. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 此事件的源玩家。 #### Remarks Source Player for this event. *** ### toGameMode > `readonly` **toGameMode**: [`GameMode`](/server/enums/GameMode.md) **`Beta`** 更改后的当前游戏模式。 #### Remarks The current game mode after the change. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerGameModeChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerGameModeChangeAfterEventSignal.md. # Class: PlayerGameModeChangeAfterEventSignal event player **`Beta`** 管理与玩家游戏模式更改后相关的回调。 Manages callbacks that are connected to after a players game mode is changed. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个在玩家游戏模式更改后调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called after a players game mode is changed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除在玩家游戏模式更改后调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called after a players game mode is changed. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerGameModeChangeBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerGameModeChangeBeforeEvent.md. # Class: PlayerGameModeChangeBeforeEvent event player **`Beta`** 包含玩家与实体交互前的事件相关信息。 Contains information regarding an event before a player interacts with an entity. ## Properties ### cancel > **cancel**: `boolean` **`Beta`** 如果设置为 `true`,游戏模式更改将被取消。 #### Remarks If set to true the game mode change will be cancelled. *** ### fromGameMode > `readonly` **fromGameMode**: [`GameMode`](/server/enums/GameMode.md) **`Beta`** 当前的游戏模式。 #### Remarks The current game mode. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 此事件的源玩家。 #### Remarks Source Player for this event. *** ### toGameMode > **toGameMode**: [`GameMode`](/server/enums/GameMode.md) **`Beta`** 要更改到的游戏模式。 #### Remarks The game mode being changed to. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerGameModeChangeBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerGameModeChangeBeforeEventSignal.md. # Class: PlayerGameModeChangeBeforeEventSignal event player **`Beta`** 管理与玩家游戏模式更改前相关的回调。 Manages callbacks that are connected to before a players game mode is changed. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个在玩家游戏模式更改前调用的回调。 #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限调用。 This closure is called with restricted-execution privilege. ::: #### Returns :::tip 以受限执行权限调用的闭包。 Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks Adds a callback that will be called before a players game mode is changed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除在玩家游戏模式更改前调用的回调。 #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限调用。 This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks Removes a callback from being called before a players game mode is changed. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerHotbarSelectedSlotChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerHotbarSelectedSlotChangeAfterEvent.md. # Class: PlayerHotbarSelectedSlotChangeAfterEvent event player **`Beta`** 包含玩家切换选择的快捷栏槽位后的事件相关信息。 Contains information regarding an event after changing the selected hotbar slot for a player. ## Properties ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 所选新槽位的物品堆。 #### Remarks The item stack of the new slot selected. *** ### newSlotSelected > `readonly` **newSlotSelected**: `number` **`Beta`** 所选的新快捷栏槽位索引。 #### Remarks The new hotbar slot index selected. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 此事件的源玩家。 #### Remarks Source Player for this event. *** ### previousSlotSelected > `readonly` **previousSlotSelected**: `number` **`Beta`** 先前选择的快捷栏槽位索引。 #### Remarks The previous hotbar slot index selected. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerHotbarSelectedSlotChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerHotbarSelectedSlotChangeAfterEventSignal.md. # Class: PlayerHotbarSelectedSlotChangeAfterEventSignal event player **`Beta`** 管理与玩家选择的快捷栏槽位更改后相关的回调。 Manages callbacks that are connected after a player selected hotbar slot is changed. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个在玩家选择的快捷栏槽位更改后调用的回调。 #### Parameters ##### callback (`arg0`) => `void` 此事件触发时调用的函数回调。 Function callback that is called when this event fires. ##### options? [`HotbarEventOptions`](/server/interfaces/HotbarEventOptions.md) 事件订阅的附加过滤选项。 Additional filtering options for the event subscription. #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called after a player selected hotbar slot is changed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除在玩家选择的快捷栏槽位更改后调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called after a player selected hotbar slot is changed. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInputModeChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInputModeChangeAfterEvent.md. # Class: PlayerInputModeChangeAfterEvent event player **`Beta`** 玩家输入模式更改时的事件数据。 Event data for when a player input mode changes. ## Properties ### newInputModeUsed > `readonly` **newInputModeUsed**: [`InputMode`](/server/enums/InputMode.md) **`Beta`** #### Remarks 玩家使用的新输入模式。 The new input mode used by the player. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 输入模式发生更改的玩家。 The player that had an input mode change. *** ### previousInputModeUsed > `readonly` **previousInputModeUsed**: [`InputMode`](/server/enums/InputMode.md) **`Beta`** #### Remarks 玩家之前使用的输入模式。 The previous input mode used by the player. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInputModeChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInputModeChangeAfterEventSignal.md. # Class: PlayerInputModeChangeAfterEventSignal event player **`Beta`** 管理连接到玩家输入模式更改的回调。 Manages callbacks that are connected to player input mode. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个将在玩家输入模式更改后调用的回调。 Adds a callback that will be called after the player input mode changes. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在玩家输入模式更改后调用的回调。 Removes a callback from being called after the player input mode changes. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInputPermissionCategoryChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInputPermissionCategoryChangeAfterEvent.md. # Class: PlayerInputPermissionCategoryChangeAfterEvent event player permission **`Beta`** 包含关于玩家输入权限更改后事件的信息。 Contains information regarding an event after a players input permissions change. ## Properties ### category > `readonly` **category**: [`InputPermissionCategory`](/server/enums/InputPermissionCategory.md) **`Beta`** #### Remarks 已更改的输入权限类别。 The category of input permissions that have changed. *** ### enabled > `readonly` **enabled**: `boolean` **`Beta`** #### Remarks 玩家输入权限的启用/禁用状态。 The enabled/disabled state of the players input permissions. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 输入权限已被更改的玩家。 The player that has had their input permissions changed. ## 同领域相关 - [PlayerInputPermissionCategoryChangeAfterEventSignal](/server/classes/PlayerInputPermissionCategoryChangeAfterEventSignal.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInputPermissionCategoryChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInputPermissionCategoryChangeAfterEventSignal.md. # Class: PlayerInputPermissionCategoryChangeAfterEventSignal event player permission **`Beta`** 管理连接到玩家输入权限更改后事件的回调。 Manages callbacks that are connected to after a players input permissions change. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个将在玩家输入权限更改后调用的回调。 Adds a callback that will be called after a players input permissions change. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在玩家输入权限更改后调用的回调。 Removes a callback from being called after a players input permissions change. ## 同领域相关 - [PlayerInputPermissionCategoryChangeAfterEvent](/server/classes/PlayerInputPermissionCategoryChangeAfterEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInputPermissions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInputPermissions.md. # Class: PlayerInputPermissions player **`Beta`** 包含启用/禁用玩家输入权限的 API。 Contains APIs to enable/disable player input permissions. ## Methods ### isPermissionCategoryEnabled() > **isPermissionCategoryEnabled**(`permissionCategory`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### permissionCategory [`InputPermissionCategory`](/server/enums/InputPermissionCategory.md) #### Returns `boolean` #### Remarks 返回输入权限是否已启用。 Returns true if an input permission is enabled. #### Throws This function can throw errors. *** ### setPermissionCategory() > **setPermissionCategory**(`permissionCategory`, `isEnabled`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### permissionCategory [`InputPermissionCategory`](/server/enums/InputPermissionCategory.md) ##### isEnabled `boolean` #### Returns `void` #### Remarks 启用或禁用某项输入权限。启用时输入将正常工作,禁用时则不工作。 Enable or disable an input permission. When enabled the input will work, when disabled will not work. #### Throws This function can throw errors. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInteractWithBlockAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInteractWithBlockAfterEvent.md. # Class: PlayerInteractWithBlockAfterEvent event player block **`Beta`** 包含关于玩家成功与方块交互后事件的信息。 Contains information regarding an event after a player successfully interacts with a block. ## Properties ### beforeItemStack? > `readonly` `optional` **beforeItemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 交互成功前的物品堆,如果为空手则为 `undefined`。 The ItemStack before the interaction succeeded, or undefined if hand is empty. *** ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 将要被交互的方块。 The block that will be interacted with. *** ### blockFace > `readonly` **blockFace**: [`Direction`](/server/enums/Direction.md) **`Beta`** #### Remarks 正在被交互的方块面。 The face of the block that is being interacted with. *** ### faceLocation > `readonly` **faceLocation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 相对于方块底部西北角的位置,物品将放置在此处。 Location relative to the bottom north-west corner of the block where the item is placed. *** ### isFirstEvent > `readonly` **isFirstEvent**: `boolean` **`Beta`** #### Remarks 如果事件是在玩家首次按下交互按钮时触发的,此值为 `true`;如果是按住交互按钮时触发的事件,则为 `false`。 This value will be true if the event was triggered on players initial interaction button press and false on events triggered from holding the interaction button. *** ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 交互成功后的物品堆,如果为空手则为 `undefined`。 The ItemStack after the interaction succeeded, or undefined if hand is empty. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 此事件的源玩家。 Source Player for this event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInteractWithBlockAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInteractWithBlockAfterEventSignal.md. # Class: PlayerInteractWithBlockAfterEventSignal event player block **`Beta`** 管理与玩家与方块交互后相关的回调。 Manages callbacks that are connected to after a player interacts with a block. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个将在玩家与方块交互后调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called after a player interacts with a block. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除一个在玩家与方块交互后调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called after a player interacts with a block. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInteractWithBlockBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInteractWithBlockBeforeEvent.md. # Class: PlayerInteractWithBlockBeforeEvent event player block **`Beta`** 包含有关玩家与方块交互之前的事件信息。 Contains information regarding an event before a player interacts with a block. ## Properties ### block > `readonly` **block**: [`Block`](/server/classes/Block.md) **`Beta`** 将被交互的方块。 #### Remarks The block that will be interacted with. *** ### blockFace > `readonly` **blockFace**: [`Direction`](/server/enums/Direction.md) **`Beta`** 正在被交互的方块面。 #### Remarks The face of the block that is being interacted with. *** ### cancel > **cancel**: `boolean` **`Beta`** 如果设置为 `true`,交互将被取消。 #### Remarks If set to true the interaction will be cancelled. *** ### faceLocation > `readonly` **faceLocation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** 相对于方块底部西北角的物品放置位置。 #### Remarks Location relative to the bottom north-west corner of the block where the item is placed. *** ### isFirstEvent > `readonly` **isFirstEvent**: `boolean` **`Beta`** 如果事件是在玩家初始交互按钮按下时触发的,则为 `true`;如果在按住交互按钮时触发的事件,则为 `false`。 #### Remarks This value will be true if the event was triggered on players initial interaction button press and false on events triggered from holding the interaction button. *** ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 交互中正在使用的物品堆,如果为空手则为 `undefined`。 #### Remarks The item stack that is being used in the interaction, or undefined if empty hand. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 此事件的源玩家。 #### Remarks Source Player for this event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInteractWithBlockBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInteractWithBlockBeforeEventSignal.md. # Class: PlayerInteractWithBlockBeforeEventSignal event player block **`Beta`** 管理在玩家与方块交互之前相关的回调。 Manages callbacks that are connected to before a player interacts with a block. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个将在玩家与方块交互之前调用的回调。 #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包将以受限执行权限调用。 This closure is called with restricted-execution privilege. ::: #### Returns :::tip 以受限执行权限调用的闭包。 Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks Adds a callback that will be called before a player interacts with a block. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除一个在玩家与方块交互之前调用的回调。 #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包将以受限执行权限调用。 This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks Removes a callback from being called before a player interacts with a block. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInteractWithEntityAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInteractWithEntityAfterEvent.md. # Class: PlayerInteractWithEntityAfterEvent event player entity **`Beta`** 包含有关玩家成功与实体交互之后的事件信息。 Contains information regarding an event after a player successfully interacts with an entity. ## Properties ### beforeItemStack? > `readonly` `optional` **beforeItemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 交互成功前的物品堆,如果为空手则为 `undefined`。 #### Remarks The ItemStack before the interaction succeeded, or undefined if hand is empty. *** ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 交互成功后的物品堆,如果为空手则为 `undefined`。 #### Remarks The ItemStack after the interaction succeeded, or undefined if hand is empty. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 此事件的源玩家。 #### Remarks Source Player for this event. *** ### target > `readonly` **target**: [`Entity`](/server/classes/Entity.md) **`Beta`** 将被交互的实体。 #### Remarks The entity that will be interacted with. ## 同领域相关 - [PlayerInteractWithEntityAfterEventSignal](/server/classes/PlayerInteractWithEntityAfterEventSignal.md) - [PlayerInteractWithEntityBeforeEvent](/server/classes/PlayerInteractWithEntityBeforeEvent.md) - [PlayerInteractWithEntityBeforeEventSignal](/server/classes/PlayerInteractWithEntityBeforeEventSignal.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInteractWithEntityAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInteractWithEntityAfterEventSignal.md. # Class: PlayerInteractWithEntityAfterEventSignal event player entity **`Beta`** 管理连接到玩家与实体交互后事件的回调。 Manages callbacks that are connected to after a player interacts with an entity. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个将在玩家与实体交互后调用的回调。 Adds a callback that will be called after a player interacts with an entity. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在玩家与实体交互后调用的回调。 Removes a callback from being called after a player interacts with an entity. ## 同领域相关 - [PlayerInteractWithEntityAfterEvent](/server/classes/PlayerInteractWithEntityAfterEvent.md) - [PlayerInteractWithEntityBeforeEvent](/server/classes/PlayerInteractWithEntityBeforeEvent.md) - [PlayerInteractWithEntityBeforeEventSignal](/server/classes/PlayerInteractWithEntityBeforeEventSignal.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInteractWithEntityBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInteractWithEntityBeforeEvent.md. # Class: PlayerInteractWithEntityBeforeEvent event player entity **`Beta`** 包含关于玩家与实体交互前事件的信息。 Contains information regarding an event before a player interacts with an entity. ## Properties ### cancel > **cancel**: `boolean` **`Beta`** #### Remarks 如果设置为 `true`,交互将被取消。 If set to true the interaction will be cancelled. *** ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Remarks 交互中正在使用的物品堆,如果为空手则为 `undefined`。 The item stack that is being used in the interaction, or undefined if empty hand. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 此事件的源玩家。 Source Player for this event. *** ### target > `readonly` **target**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 将要被交互的实体。 The entity that will be interacted with. ## 同领域相关 - [PlayerInteractWithEntityAfterEvent](/server/classes/PlayerInteractWithEntityAfterEvent.md) - [PlayerInteractWithEntityAfterEventSignal](/server/classes/PlayerInteractWithEntityAfterEventSignal.md) - [PlayerInteractWithEntityBeforeEventSignal](/server/classes/PlayerInteractWithEntityBeforeEventSignal.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInteractWithEntityBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInteractWithEntityBeforeEventSignal.md. # Class: PlayerInteractWithEntityBeforeEventSignal event player entity **`Beta`** 管理连接到玩家与实体交互前事件的回调。 Manages callbacks that are connected to before a player interacts with an entity. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包将以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns :::tip 以受限执行权限调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks 添加一个将在玩家与实体交互前调用的回调。 Adds a callback that will be called before a player interacts with an entity. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks 移除一个在玩家与实体交互前调用的回调。 Removes a callback from being called before a player interacts with an entity. ## 同领域相关 - [PlayerInteractWithEntityAfterEvent](/server/classes/PlayerInteractWithEntityAfterEvent.md) - [PlayerInteractWithEntityAfterEventSignal](/server/classes/PlayerInteractWithEntityAfterEventSignal.md) - [PlayerInteractWithEntityBeforeEvent](/server/classes/PlayerInteractWithEntityBeforeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInventoryItemChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInventoryItemChangeAfterEvent.md. # Class: PlayerInventoryItemChangeAfterEvent event player inventory **`Beta`** 包含有关玩家库存物品更改之后的事件信息。 Contains information regarding an event after a player's inventory item changes. ## Properties ### beforeItemStack? > `readonly` `optional` **beforeItemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 之前的物品堆。 #### Remarks The previous item stack. *** ### inventoryType > `readonly` **inventoryType**: [`PlayerInventoryType`](/server/enums/PlayerInventoryType.md) **`Beta`** 库存类型。 #### Remarks Inventory type. *** ### itemStack? > `readonly` `optional` **itemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 新的物品堆。 #### Remarks The new item stack. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 此事件的源玩家。 #### Remarks Source Player for this event. *** ### slot > `readonly` **slot**: `number` **`Beta`** 发生更改的槽位索引。 #### Remarks The slot index with the change. ## 同领域相关 - [PlayerInventoryItemChangeAfterEventSignal](/server/classes/PlayerInventoryItemChangeAfterEventSignal.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerInventoryItemChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInventoryItemChangeAfterEventSignal.md. # Class: PlayerInventoryItemChangeAfterEventSignal event player inventory **`Beta`** 管理玩家库存物品更改后相关的回调。 Manages callbacks that are connected after a player's inventory item is changed. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个将在玩家库存物品更改后调用的回调。 #### Parameters ##### callback (`arg0`) => `void` 此事件触发时调用的函数回调。 Function callback that is called when this event fires. ##### options? [`InventoryItemEventOptions`](/server/interfaces/InventoryItemEventOptions.md) 事件订阅的其他过滤选项。 Additional filtering options for the event subscription. #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called after a player's inventory item is changed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除一个在玩家库存物品更改后调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called after a player's inventory item is changed. ## 同领域相关 - [PlayerInventoryItemChangeAfterEvent](/server/classes/PlayerInventoryItemChangeAfterEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerJoinAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerJoinAfterEvent.md. # Class: PlayerJoinAfterEvent event player **`Beta`** 包含有关已加入的玩家信息。有关玩家首次在游戏中生成后可能返回的更详细信息,请参见 playerSpawn 事件。 Contains information regarding a player that has joined. See the playerSpawn event for more detailed information that could be returned after the first time a player has spawned within the game. ## Properties ### playerId > `readonly` **playerId**: `string` **`Beta`** 加入游戏的不透明字符串标识符。 #### Remarks Opaque string identifier of the player that joined the game. *** ### playerName > `readonly` **playerName**: `string` **`Beta`** 已加入的玩家名称。 #### Remarks Name of the player that has joined. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerJoinAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerJoinAfterEventSignal.md. # Class: PlayerJoinAfterEventSignal event player **`Beta`** 管理与玩家加入世界相关的回调。 Manages callbacks that are connected to a player joining the world. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个将在玩家加入世界时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a player joins the world. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除一个在玩家加入世界时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a player joins the world. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerLeaveAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerLeaveAfterEvent.md. # Class: PlayerLeaveAfterEvent event player **`Beta`** 包含关于已离开世界玩家的信息。 Contains information regarding a player that has left the world. ## Properties ### playerId > `readonly` **playerId**: `string` **`Beta`** #### Remarks 已离开世界玩家的不透明字符串标识符。 Opaque string identifier of the player that has left the event. *** ### playerName > `readonly` **playerName**: `string` **`Beta`** #### Remarks 已离开世界玩家的名称。 Player that has left the world. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerLeaveAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerLeaveAfterEventSignal.md. # Class: PlayerLeaveAfterEventSignal event player **`Beta`** 管理连接到玩家离开世界事件的回调。 Manages callbacks that are connected to a player leaving the world. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个将在玩家离开世界时调用的回调。 Adds a callback that will be called when a player leaves the world. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在玩家离开世界时调用的回调。 Removes a callback from being called when a player leaves the world. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerLeaveBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerLeaveBeforeEvent.md. # Class: PlayerLeaveBeforeEvent event player **`Beta`** 包含关于正在离开世界玩家的信息。 Contains information regarding a player that is leaving the world. ## Properties ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 正在离开的玩家。 The leaving player. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerLeaveBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerLeaveBeforeEventSignal.md. # Class: PlayerLeaveBeforeEventSignal event player **`Beta`** 管理连接到玩家离开世界事件的回调。 Manages callbacks that are connected to a player leaving the world. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包将以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns :::tip 以受限执行权限调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks 添加一个将在玩家离开世界时调用的回调。 Adds a callback that will be called when a player leaves the world. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks 移除一个将在玩家离开世界时调用的回调。 Removes a callback that will be called when a player leaves the world. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerPlaceBlockAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerPlaceBlockAfterEventSignal.md. # Class: PlayerPlaceBlockAfterEventSignal event player block **`Beta`** 管理与玩家放置方块时相关的回调。 Manages callbacks that are connected to when a block is placed by a player. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个将在玩家放置方块时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` ##### options? [`BlockEventOptions`](/server/interfaces/BlockEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a block is placed by a player. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除一个在玩家放置方块时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when an block is placed by a player. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerPlaceBlockBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerPlaceBlockBeforeEventSignal.md. # Class: PlayerPlaceBlockBeforeEventSignal event player block **`Beta`** 管理连接到玩家放置方块前事件的回调。 Manages callbacks that are connected to before a block is placed by a player. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包将以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: ##### options? [`BlockEventOptions`](/server/interfaces/BlockEventOptions.md) #### Returns :::tip 以受限执行权限调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks 添加一个将在玩家放置方块前调用的回调。 Adds a callback that will be called before a block is placed by a player. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限被调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks 移除一个在玩家放置方块前调用的回调。 Removes a callback from being called before an block is placed by a player. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerSpawnAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerSpawnAfterEvent.md. # Class: PlayerSpawnAfterEvent event player **`Beta`** 包含关于玩家生成的更多信息的事件。 An event that contains more information about a player spawning. ## Properties ### initialSpawn > **initialSpawn**: `boolean` **`World Mutation`** **`Beta`** 如果为 `true`,这是玩家加入游戏后的首次生成。 #### Remarks If true, this is the initial spawn of a player after joining the game. *** ### player > **player**: [`Player`](/server/classes/Player.md) **`World Mutation`** **`Beta`** 表示加入游戏的玩家对象。 #### Remarks Object that represents the player that joined the game. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerSpawnAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerSpawnAfterEventSignal.md. # Class: PlayerSpawnAfterEventSignal event player **`Beta`** 注册一个在玩家在世界中生成(或重生后)并完全准备好时触发的事件。 Registers an event when a player is spawned (or re-spawned after death) and fully ready within the world. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 为此特定事件类型注册一个新的事件接收器。 Registers a new event receiver for this particular type of event. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 取消注册一个玩家生成事件的事件接收器。 De-registers an event receiver for the player spawn event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerStartBreakingBlockAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerStartBreakingBlockAfterEventSignal.md. # Class: PlayerStartBreakingBlockAfterEventSignal event player block **`Beta`** ## Preview 管理与玩家开始破坏方块时相关的回调。 Manages callbacks that are connected to when a player starts breaking a block. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个将在玩家开始破坏方块时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` ##### options? [`PlayerBreakingBlockEventOptions`](/server/interfaces/PlayerBreakingBlockEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a player starts breaking a block. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除一个在玩家开始破坏方块时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a player starts breaking a block. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerSwingStartAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerSwingStartAfterEvent.md. # Class: PlayerSwingStartAfterEvent event player **`Beta`** 包含有关玩家开始挥动手臂的信息。 Contains information regarding a player starting to swing their arm. ## Properties ### heldItemStack? > `readonly` `optional` **heldItemStack?**: [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** 玩家在挥动开始时持有的物品堆。 #### Remarks The item stack being held by the player at the start of their swing. *** ### player > `readonly` **player**: [`Player`](/server/classes/Player.md) **`Beta`** 此事件的源玩家。 #### Remarks Source Player for this event. *** ### swingSource > `readonly` **swingSource**: [`EntitySwingSource`](/server/enums/EntitySwingSource.md) **`Beta`** 玩家挥动的来源,参见 [EntitySwingSource](/server/enums/EntitySwingSource.md)。 #### Remarks The source of the Player swing, see [EntitySwingSource](/server/enums/EntitySwingSource.md). ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerSwingStartAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerSwingStartAfterEventSignal.md. # Class: PlayerSwingStartAfterEventSignal event player **`Beta`** 管理与玩家开始挥动手臂(例如攻击、使用物品、交互)时相关的回调。 Manages callbacks that are connected to when a player starts to swing their arm (e.g. attacking, using an item, interacting). ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个将在玩家开始挥动手臂(例如攻击、使用物品、交互)时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` ##### options? [`PlayerSwingEventOptions`](/server/interfaces/PlayerSwingEventOptions.md) #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a player starts to swing their arm (e.g. attacking, using an item, interacting). *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除一个在玩家开始挥动手臂(例如攻击、使用物品、交互)时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a player starts to swing their arm (e.g. attacking, using an item, interacting). ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerUseNameTagAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerUseNameTagAfterEvent.md. # Class: PlayerUseNameTagAfterEvent event player **`Beta`** 包含有关玩家成功使用有命名的命名标签物品命名实体的相关信息。 Contains information related to when a player successfully names an Entity with a named Name Tag item. ## Properties ### entityNamed > **entityNamed**: [`Entity`](/server/classes/Entity.md) **`World Mutation`** **`Beta`** 被玩家命名的实体。 #### Remarks The entity that was named by the player. *** ### newName > **newName**: `string` **`World Mutation`** **`Beta`** 玩家给实体的新名称。 #### Remarks The new name that the player has given to the entity. *** ### player > **player**: [`Player`](/server/classes/Player.md) **`World Mutation`** **`Beta`** 使用命名标签的玩家的句柄。 #### Remarks Handle to the player that used the name tag. *** ### previousName? > `optional` **previousName?**: `string` **`World Mutation`** **`Beta`** 玩家使用命名标签之前实体的先前名称。如果实体之前未命名,则为 `undefined`。 #### Remarks The previous name of the entity before the player used the name tag. This will be undefined if the entity was not previously named. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PlayerUseNameTagAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerUseNameTagAfterEventSignal.md. # Class: PlayerUseNameTagAfterEventSignal event player **`Beta`** 管理连接到玩家使用命名过的命名牌物品成功命名实体事件的回调。 Manages callbacks that are connected to when a player successfully names an Entity with a named Name Tag item. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 将指定回调订阅到玩家使用命名牌后事件。 Subscribes the specified callback to a player use name tag after event. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 从玩家使用命名牌后事件中移除指定回调。 Removes the specified callback from a player use name tag after event. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PotionDeliveryType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PotionDeliveryType.md. # Class: PotionDeliveryType **`Beta`** 表示药水效果是如何被施加的。 Represents how the potion effect is delivered. ## Properties ### id > `readonly` **id**: `string` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PotionEffectType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PotionEffectType.md. # Class: PotionEffectType effect **`Beta`** 表示一种药水效果类型,例如治疗或跳跃提升。 Represents a type of potion effect - like healing or leaping. ## Properties ### durationTicks? > `readonly` `optional` **durationTicks?**: `number` **`Beta`** #### Remarks 效果应用于实体时的持续时间(以刻为单位)。`undefined` 表示效果不会过期。 Duration of the effect when applied to an entity in ticks. Undefined means the effect does not expire. #### Throws This property can throw when used. [EngineError](/common/classes/EngineError.md) *** ### id > `readonly` **id**: `string` **`Beta`** ## 同领域相关 - [Effect](/server/classes/Effect.md) - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent.md) - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal.md) - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent.md) - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal.md) - [EffectType](/server/classes/EffectType.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Potions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Potions.md. # Class: Potions **`Beta`** 用于访问所有药水效果类型、传递类型以及创建药水。 Used for accessing all potion effect types, delivery types, and creating potions. ## Methods ### getAllDeliveryTypes() > `static` **getAllDeliveryTypes**(): [`PotionDeliveryType`](/server/classes/PotionDeliveryType.md)\[] **`Beta`** #### Returns [`PotionDeliveryType`](/server/classes/PotionDeliveryType.md)\[] 所有已注册传递类型句柄的数组。 Array of all registered delivery type handles. #### Remarks 获取所有已注册的药水传递类型的句柄。 Retrieves handles for all registered potion delivery types. *** ### getAllEffectTypes() > `static` **getAllEffectTypes**(): [`PotionEffectType`](/server/classes/PotionEffectType.md)\[] **`Beta`** #### Returns [`PotionEffectType`](/server/classes/PotionEffectType.md)\[] 所有已注册效果类型句柄的数组。 Array of all registered effect type handles. #### Remarks 获取所有已注册的药水效果的类型句柄。 Retrieves all type handle for all registered potion effects. *** ### getDeliveryType() > `static` **getDeliveryType**(`potionDeliveryId`): [`PotionDeliveryType`](/server/classes/PotionDeliveryType.md) | `undefined` **`Beta`** #### Parameters ##### potionDeliveryId `string` #### Returns [`PotionDeliveryType`](/server/classes/PotionDeliveryType.md) | `undefined` 包装有效传递 ID 的类型句柄,如果传递 ID 无效则返回 `undefined`。 A type handle wrapping the valid delivery id, or undefined for an invalid delivery id. #### Remarks 获取指定药水传递 ID 的类型句柄。 Retrieves a type handle for a specified potion delivery id. *** ### getEffectType() > `static` **getEffectType**(`potionEffectId`): [`PotionEffectType`](/server/classes/PotionEffectType.md) | `undefined` **`Beta`** #### Parameters ##### potionEffectId `string` 有效的药水效果 ID。请参见 @minecraft/vanilla-data.MinecraftPotionEffectTypes。 A valid potion effect id. See @minecraft/vanilla-data.MinecraftPotionEffectTypes #### Returns [`PotionEffectType`](/server/classes/PotionEffectType.md) | `undefined` 包装有效效果 ID 的类型句柄,如果效果 ID 无效则返回 `undefined`。 A type handle wrapping the valid effect id, or undefined for an invalid effect id. #### Remarks 获取指定药水效果 ID 的类型句柄。 Retrieves a type handle for a specified potion effect id. *** ### resolve() > `static` **resolve**\<`T`, `U`>(`potionEffectType`, `potionDeliveryType`): [`ItemStack`](/server/classes/ItemStack.md) **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` = `MinecraftPotionEffectTypes` ##### U `U` _extends_ `string` = `MinecraftPotionDeliveryTypes` #### Parameters ##### potionEffectType [`PotionEffectType`](/server/classes/PotionEffectType.md) | `T` ##### potionDeliveryType [`PotionDeliveryType`](/server/classes/PotionDeliveryType.md) | `U` #### Returns [`ItemStack`](/server/classes/ItemStack.md) #### Remarks 根据效果和传递类型创建药水。 Creates a potion given an effect and delivery type. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidPotionDeliveryTypeError](/server/classes/InvalidPotionDeliveryTypeError.md) [InvalidPotionEffectTypeError](/server/classes/InvalidPotionEffectTypeError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PressurePlatePopAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PressurePlatePopAfterEventSignal.md. # Class: PressurePlatePopAfterEventSignal event **`Beta`** 管理与压力板复位时相关的回调。 Manages callbacks that are connected to when a pressure plate is popped. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个将在压力板复位时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a pressure plate is popped. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除一个在压力板复位时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a pressure plate is popped. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PressurePlatePushAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PressurePlatePushAfterEventSignal.md. # Class: PressurePlatePushAfterEventSignal event **`Beta`** 管理连接到压力板触发事件的回调。 Manages callbacks that are connected to when a pressure plate is pushed. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个将在压力板触发时调用的回调。 Adds a callback that will be called when a pressure plate is pushed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在压力板触发时调用的回调。 Removes a callback from being called when a pressure plate is pushed. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PrimitiveShapeError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PrimitiveShapeError.md. # Class: PrimitiveShapeError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/PrimitiveShapesManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PrimitiveShapesManager.md. # Class: PrimitiveShapesManager **`Beta`** Primitive Shapes class used to allow adding and removing text primitives to the world. ## Properties ### maxShapes > `readonly` **maxShapes**: `number` **`Beta`** #### Remarks This is the maximum number of allowed primitive shapes. ## Methods ### addText() > **addText**(`text`, `dimension?`): `void` **`Beta`** #### Parameters ##### text [`TextPrimitive`](/server/classes/TextPrimitive.md) The text primitive to be added. ##### dimension? [`Dimension`](/server/classes/Dimension.md) #### Returns `void` #### Remarks Adds a new text primitive to the world. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [PrimitiveShapeError](/server/classes/PrimitiveShapeError.md) *** ### getShapes() > **getShapes**(`options?`): [`PrimitiveShape`](/server/classes/PrimitiveShape.md)\[] **`Beta`** #### Parameters ##### options? [`PrimitiveShapeQueryOptions`](/server/interfaces/PrimitiveShapeQueryOptions.md) Optional options for querying existing shapes to narrow down the results. #### Returns [`PrimitiveShape`](/server/classes/PrimitiveShape.md)\[] #### Remarks Fetches and queries all primitive shapes stored in the manager and returns the results as an array of shape handles. *** ### removeAll() > **removeAll**(): `void` **`Beta`** #### Returns `void` #### Remarks Removes all text primitives from the world. *** ### removeText() > **removeText**(`text`): `void` **`Beta`** #### Parameters ##### text [`TextPrimitive`](/server/classes/TextPrimitive.md) #### Returns `void` #### Remarks Removes an instance of a text primitive from the world. This is equivalent to calling remove on the text itself. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ProjectileHitBlockAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ProjectileHitBlockAfterEvent.md. # Class: ProjectileHitBlockAfterEvent event block **`Beta`** 包含与抛射物击中方块相关的信息。 Contains information related to a projectile hitting a block. ## Properties ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 此抛射物撞击发生的维度。 Dimension where this projectile hit took place. *** ### hitVector > `readonly` **hitVector**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 抛射物击中方块时的方向向量。 Direction vector of the projectile as it hit a block. *** ### location > `readonly` **location**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 抛射物撞击发生的位置。 Location where the projectile hit occurred. *** ### projectile > `readonly` **projectile**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 击中方块的抛射物实体。 Entity for the projectile that hit a block. *** ### source? > `readonly` `optional` **source?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 发射抛射物的可选源实体。 Optional source entity that fired the projectile. ## Methods ### getBlockHit() > **getBlockHit**(): [`BlockHitInformation`](/server/interfaces/BlockHitInformation.md) **`World Mutation`** **`Beta`** #### Returns [`BlockHitInformation`](/server/interfaces/BlockHitInformation.md) #### Remarks 包含关于抛射物击中的方块的附加信息。 Contains additional information about the block that was hit by the projectile. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ProjectileHitBlockAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ProjectileHitBlockAfterEventSignal.md. # Class: ProjectileHitBlockAfterEventSignal event block **`Beta`** 管理与弹射物击中方块时相关的回调。 Manages callbacks that are connected to when a projectile hits a block. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个将在弹射物击中方块时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a projectile hits a block. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除一个在弹射物击中方块时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a projectile hits a block. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ProjectileHitEntityAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ProjectileHitEntityAfterEvent.md. # Class: ProjectileHitEntityAfterEvent event entity **`Beta`** 包含与弹射物击中实体相关的信息。 Contains information related to a projectile hitting an entity. ## Properties ### dimension > `readonly` **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** 弹射物击中发生的维度。 #### Remarks Dimension where this projectile hit took place. *** ### hitVector > `readonly` **hitVector**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** 弹射物击中实体时的方向向量。 #### Remarks Direction vector of the projectile as it hit an entity. *** ### location > `readonly` **location**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** 弹射物击中的位置。 #### Remarks Location where the projectile hit occurred. *** ### projectile > `readonly` **projectile**: [`Entity`](/server/classes/Entity.md) **`Beta`** 击中实体的弹射物实体。 #### Remarks Entity for the projectile that hit an entity. *** ### source? > `readonly` `optional` **source?**: [`Entity`](/server/classes/Entity.md) **`Beta`** 发射弹射物的可选源实体。 #### Remarks Optional source entity that fired the projectile. ## Methods ### getEntityHit() > **getEntityHit**(): [`EntityHitInformation`](/server/interfaces/EntityHitInformation.md) **`World Mutation`** **`Beta`** 包含有关被击中的实体的附加信息。 #### Returns [`EntityHitInformation`](/server/interfaces/EntityHitInformation.md) #### Remarks Contains additional information about an entity that was hit. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ProjectileHitEntityAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ProjectileHitEntityAfterEventSignal.md. # Class: ProjectileHitEntityAfterEventSignal event entity **`Beta`** 管理与弹射物击中实体时相关的回调。 Manages callbacks that are connected to when a projectile hits an entity. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** 添加一个将在弹射物击中实体时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a projectile hits an entity. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** 移除一个在弹射物击中实体时调用的回调。 #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a projectile hits an entity. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/RawMessageError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/RawMessageError.md. # Class: RawMessageError chat error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Scoreboard.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Scoreboard.md. # Class: Scoreboard scoreboard **`Beta`** 表示记分板。其上包含了记分项和分数持有者。 Contains objectives and participants for the scoreboard. ## Example **updateScoreboard.ts** ```typescript import { world, DisplaySlotId, ObjectiveSortOrder, DimensionLocation } from '@minecraft/server'; function updateScoreboard(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const scoreboardObjectiveId = 'scoreboard_demo_objective'; const scoreboardObjectiveDisplayName = 'Demo Objective'; const players = world.getPlayers(); // Ensure a new objective. let objective = world.scoreboard.getObjective(scoreboardObjectiveId); if (!objective) { objective = world.scoreboard.addObjective(scoreboardObjectiveId, scoreboardObjectiveDisplayName); } // get the scoreboard identity for player 0 const player0Identity = players[0].scoreboardIdentity; if (player0Identity === undefined) { log('Could not get a scoreboard identity for player 0.'); return -1; } // initialize player score to 100; objective.setScore(player0Identity, 100); world.scoreboard.setObjectiveAtDisplaySlot(DisplaySlotId.Sidebar, { objective: objective, sortOrder: ObjectiveSortOrder.Descending, }); const playerScore = objective.getScore(player0Identity) ?? 0; // score should now be 110. objective.setScore(player0Identity, playerScore + 10); } ``` ## Methods ### addObjective() > **addObjective**(`objectiveId`, `displayName?`): [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md) **`World Mutation`** **`Beta`** #### Parameters ##### objectiveId `string` 记分项名称。 ##### displayName? `string` 记分项的显示名称。 #### Returns [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md) 创建的记分项对象。 #### Remarks 在记分板上添加一个新的记分项。 Adds a new objective to the scoreboard. #### Throws 若同名记分项已存在时,抛出 `"Failed to add objective 'objectiveId' as it is already being tracked"`。 #### Example **updateScoreboard.ts** ```typescript import { world, DisplaySlotId, ObjectiveSortOrder, DimensionLocation } from '@minecraft/server'; function updateScoreboard(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const scoreboardObjectiveId = 'scoreboard_demo_objective'; const scoreboardObjectiveDisplayName = 'Demo Objective'; const players = world.getPlayers(); // Ensure a new objective. let objective = world.scoreboard.getObjective(scoreboardObjectiveId); if (!objective) { objective = world.scoreboard.addObjective(scoreboardObjectiveId, scoreboardObjectiveDisplayName); } // get the scoreboard identity for player 0 const player0Identity = players[0].scoreboardIdentity; if (player0Identity === undefined) { log('Could not get a scoreboard identity for player 0.'); return -1; } // initialize player score to 100; objective.setScore(player0Identity, 100); world.scoreboard.setObjectiveAtDisplaySlot(DisplaySlotId.Sidebar, { objective: objective, sortOrder: ObjectiveSortOrder.Descending, }); const playerScore = objective.getScore(player0Identity) ?? 0; // score should now be 110. objective.setScore(player0Identity, playerScore + 10); } ``` *** ### clearObjectiveAtDisplaySlot() > **clearObjectiveAtDisplaySlot**(`displaySlotId`): [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### displaySlotId [`DisplaySlotId`](/server/enums/DisplaySlotId.md) 显示位置。 #### Returns [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md) | `undefined` 先前正显示的记分项,为空时返回 `null`。 #### Remarks 清除显示位置上正在显示的记分项。 Clears the objective that occupies a display slot. *** ### getObjective() > **getObjective**(`objectiveId`): [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md) | `undefined` **`Beta`** #### Parameters ##### objectiveId `string` 记分项名称。 Identifier of the objective. #### Returns [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md) | `undefined` 指定的记分项对象。不存在时返回 `null`。 #### Remarks 获取名称为 `objectiveId` 的记分项对象。 Returns a specific objective (by id). *** ### getObjectiveAtDisplaySlot() > **getObjectiveAtDisplaySlot**(`displaySlotId`): [`ScoreboardObjectiveDisplayOptions`](/server/interfaces/ScoreboardObjectiveDisplayOptions.md) | `undefined` **`Beta`** #### Parameters ##### displaySlotId [`DisplaySlotId`](/server/enums/DisplaySlotId.md) 显示位置。 #### Returns [`ScoreboardObjectiveDisplayOptions`](/server/interfaces/ScoreboardObjectiveDisplayOptions.md) | `undefined` 位于指定显示位置的记分项显示配置。为空时返回 `null`。 #### Remarks 获取位于指定显示位置上的记分项对象与显示配置。 Returns an objective that occupies the specified display slot. *** ### getObjectives() > **getObjectives**(): [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md)\[] **`Beta`** #### Returns [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md)\[] 所有记分项对象组成的数组。 #### Remarks 获取记分板上的已定义的所有记分项。 Returns all defined objectives. *** ### getParticipants() > **getParticipants**(): [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md)\[] **`Beta`** #### Returns [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md)\[] 所有分数持有者对象组成的数组。 #### Remarks 获取所有已经定义的分数持有者。 Returns all defined scoreboard identities. *** ### removeObjective() > **removeObjective**(`objectiveId`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### objectiveId `string` | [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md) 记分项对象或名称。 #### Returns `boolean` 总是返回 `true`。 #### Remarks 从记分板上移除指定的记分项。 Removes an objective from the scoreboard. #### Throws 若指定的记分项不存在时,抛出 `"Failed to find the objective specified"`。 *** ### setObjectiveAtDisplaySlot() > **setObjectiveAtDisplaySlot**(`displaySlotId`, `objectiveDisplaySetting`): [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### displaySlotId [`DisplaySlotId`](/server/enums/DisplaySlotId.md) 显示位置。 ##### objectiveDisplaySetting [`ScoreboardObjectiveDisplayOptions`](/server/interfaces/ScoreboardObjectiveDisplayOptions.md) 记分项显示配置。 #### Returns [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md) | `undefined` 显示位上先前显示的记分项对象。先前未显示记分项时,返回 `undefined`。 Returns the previous `ScoreboardObjective` set at the display slot, if no objective was previously set it returns `undefined`. #### Remarks 设置指定的显示位置显示的记分项与其他显示配置。 Sets an objective into a display slot with specified additional display settings. #### Throws 若记分项无效,抛出 `"Failed to set invalid objective at DisplaySlot"`。 ## 同领域相关 - [ScoreboardIdentity](/server/classes/ScoreboardIdentity.md) - [ScoreboardIdentityType](/server/enums/ScoreboardIdentityType.md) - [ScoreboardObjective](/server/classes/ScoreboardObjective.md) - [ScoreboardObjectiveDisplayOptions](/server/interfaces/ScoreboardObjectiveDisplayOptions.md) - [ScoreboardScoreInfo](/server/classes/ScoreboardScoreInfo.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ScoreboardIdentity.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ScoreboardIdentity.md. # Class: ScoreboardIdentity scoreboard **`Beta`** 表示记分板上的分数持有者。 Contains an identity of the scoreboard item. ## Properties ### displayName > `readonly` **displayName**: `string` **`Beta`** #### Remarks 此分数持有者在玩家视角显示的名称。 Returns the player-visible name of this identity. *** ### id > `readonly` **id**: `number` **`Beta`** #### Remarks 此分数持有者的 ID。 Identifier of the scoreboard identity. *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 如果 ScoreboardIdentity 引用仍然有效,则返回 true。 Returns true if the ScoreboardIdentity reference is still valid. *** ### type > `readonly` **type**: [`ScoreboardIdentityType`](/server/enums/ScoreboardIdentityType.md) **`Beta`** #### Remarks 此分数持有者的类型。 Type of the scoreboard identity. ## Methods ### getEntity() > **getEntity**(): [`Entity`](/server/classes/Entity.md) | `undefined` **`Beta`** #### Returns [`Entity`](/server/classes/Entity.md) | `undefined` 对应的实体对象。虚拟玩家类型的分数持有者会返回 `undefined`。 #### Remarks 返回此分数持有者对应的实体对象(仅当此分数持有者是一个实体或者玩家时)。 If the scoreboard identity is an entity or player, returns the entity that this scoreboard item corresponds to. #### Throws 若实体不存在时,抛出。 ## 同领域相关 - [Scoreboard](/server/classes/Scoreboard.md) - [ScoreboardIdentityType](/server/enums/ScoreboardIdentityType.md) - [ScoreboardObjective](/server/classes/ScoreboardObjective.md) - [ScoreboardObjectiveDisplayOptions](/server/interfaces/ScoreboardObjectiveDisplayOptions.md) - [ScoreboardScoreInfo](/server/classes/ScoreboardScoreInfo.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ScoreboardObjective.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ScoreboardObjective.md. # Class: ScoreboardObjective scoreboard **`Beta`** 表示记分板上的记分项。包含了分数持有者和各自的分数。 Contains objectives and participants for the scoreboard. ## Properties ### displayName > `readonly` **displayName**: `string` **`Beta`** #### Remarks 此记分项的显示名称。 Returns the player-visible name of this scoreboard objective. #### Throws 若记分项无效,则抛出。 *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 此记分项的名称。 Identifier of the scoreboard objective. #### Throws 若记分项无效,则抛出。 *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 如果此 ScoreboardObjective 引用仍然有效,则返回 true。 Returns true if the ScoreboardObjective reference is still valid. ## Methods ### addScore() > **addScore**(`participant`, `scoreToAdd`): `number` **`World Mutation`** **`Beta`** #### Parameters ##### participant `string` | [`Entity`](/server/classes/Entity.md) | [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md) 要对其应用记分项分数增加的分数持有者。 Participant to apply the scoreboard value addition to. ##### scoreToAdd `number` #### Returns `number` #### Remarks 为给定分数持有者和记分项添加分数。 Adds a score to the given participant and objective. #### Throws This function can throw errors. *** ### getParticipants() > **getParticipants**(): [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md)\[] **`Beta`** #### Returns [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md)\[] 由分数持有者对象组成的数组。 #### Remarks 返回此记分项上已记录的分数持有者。 Returns all objective participant identities. #### Throws 若记分项无效时,抛出。 *** ### getScore() > **getScore**(`participant`): `number` | `undefined` **`Beta`** #### Parameters ##### participant `string` | [`Entity`](/server/classes/Entity.md) | [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md) 分数持有者。 Identifier of the participant to retrieve a score for. #### Returns `number` | `undefined` 指定分数持有者的分数。 #### Remarks 获取指定分数持有者的分数。 Returns a specific score for a participant. #### Throws 若此记分项上未记录分数持有者的分数,抛出 `"Failed to retrieve score for ''"`。 若记分项无效时,抛出。 *** ### getScores() > **getScores**(): [`ScoreboardScoreInfo`](/server/classes/ScoreboardScoreInfo.md)\[] **`Beta`** #### Returns [`ScoreboardScoreInfo`](/server/classes/ScoreboardScoreInfo.md)\[] 由分数信息对象组成的数组。 #### Remarks 获取记分项上记录的所有分数信息。 Returns specific scores for this objective for all participants. #### Throws 若记分项无效时,抛出。 *** ### hasParticipant() > **hasParticipant**(`participant`): `boolean` **`Beta`** #### Parameters ##### participant `string` | [`Entity`](/server/classes/Entity.md) | [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md) #### Returns `boolean` #### Remarks 返回指定身份是否是该记分项的分数持有者。 Returns if the specified identity is a participant of the scoreboard objective. #### Throws This function can throw errors. *** ### removeParticipant() > **removeParticipant**(`participant`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### participant `string` | [`Entity`](/server/classes/Entity.md) | [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md) 要从该记分项追踪中移除的分数持有者。 Participant to remove from being tracked with this objective. #### Returns `boolean` #### Remarks 从该记分项中移除一个分数持有者。 Removes a participant from this scoreboard objective. #### Throws This function can throw errors. *** ### setScore() > **setScore**(`participant`, `score`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### participant `string` | [`Entity`](/server/classes/Entity.md) | [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md) 分数持有者的身份。 Identity of the participant. ##### score `number` 新的分数。 New value of the score. #### Returns `void` #### Remarks 为分数持有者设置分数。 Sets a score for a participant. #### Throws This function can throw errors. ## 同领域相关 - [Scoreboard](/server/classes/Scoreboard.md) - [ScoreboardIdentity](/server/classes/ScoreboardIdentity.md) - [ScoreboardIdentityType](/server/enums/ScoreboardIdentityType.md) - [ScoreboardObjectiveDisplayOptions](/server/interfaces/ScoreboardObjectiveDisplayOptions.md) - [ScoreboardScoreInfo](/server/classes/ScoreboardScoreInfo.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ScoreboardScoreInfo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ScoreboardScoreInfo.md. # Class: ScoreboardScoreInfo scoreboard **`Beta`** 表示分数信息。包含了分数持有者以及它在记分板上的对应的分数。 Contains a pair of a scoreboard participant and its respective score. ## Properties ### participant > `readonly` **participant**: [`ScoreboardIdentity`](/server/classes/ScoreboardIdentity.md) **`Beta`** #### Remarks 分数归属的分数持有者。 This scoreboard participant for this score. *** ### score > `readonly` **score**: `number` **`Beta`** #### Remarks 该记分项上分数持有者的分数。 Score value of the identity for this objective. ## 同领域相关 - [Scoreboard](/server/classes/Scoreboard.md) - [ScoreboardIdentity](/server/classes/ScoreboardIdentity.md) - [ScoreboardIdentityType](/server/enums/ScoreboardIdentityType.md) - [ScoreboardObjective](/server/classes/ScoreboardObjective.md) - [ScoreboardObjectiveDisplayOptions](/server/interfaces/ScoreboardObjectiveDisplayOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ScreenDisplay.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ScreenDisplay.md. # Class: ScreenDisplay **`Beta`** 包含关于显示在屏幕上的用户界面元素的信息。 Contains information about user interface elements that are showing up on the screen. ## Examples **setTitle.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function setTitle(targetLocation: DimensionLocation) { const players = world.getPlayers(); if (players.length > 0) { players[0].onScreenDisplay.setTitle('§o§6Fancy Title§r'); } } ``` **setTitleAndSubtitle.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function setTitleAndSubtitle(targetLocation: DimensionLocation) { const players = world.getPlayers(); players[0].onScreenDisplay.setTitle('Chapter 1', { stayDuration: 100, fadeInDuration: 2, fadeOutDuration: 4, subtitle: 'Trouble in Block Town', }); } ``` **countdown.ts** ```typescript import { world, system, DimensionLocation } from '@minecraft/server'; function countdown(targetLocation: DimensionLocation) { const players = world.getPlayers(); players[0].onScreenDisplay.setTitle('Get ready!', { stayDuration: 220, fadeInDuration: 2, fadeOutDuration: 4, subtitle: '10', }); let countdown = 10; const intervalId = system.runInterval(() => { countdown--; players[0].onScreenDisplay.updateSubtitle(countdown.toString()); if (countdown == 0) { system.clearRun(intervalId); } }, 20); } ``` ## Properties ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks 返回当前对此屏幕显示管理器对象的引用是否有效且可用。 Returns true if the current reference to this screen display manager object is valid and functional. ## Methods ### getHiddenHudElements() > **getHiddenHudElements**(): [`HudElement`](/server/enums/HudElement.md)\[] **`World Mutation`** **`Beta`** #### Returns [`HudElement`](/server/enums/HudElement.md)\[] #### Remarks #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### hideAllExcept() > **hideAllExcept**(`hudElements?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### hudElements? [`HudElement`](/server/enums/HudElement.md)\[] #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### isForcedHidden() > **isForcedHidden**(`hudElement`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### hudElement [`HudElement`](/server/enums/HudElement.md) #### Returns `boolean` #### Remarks #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### resetHudElementsVisibility() > **resetHudElementsVisibility**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### setActionBar() > **setActionBar**(`text`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### text `string` | [`RawMessage`](/server/interfaces/RawMessage.md) | (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[] 操作栏文本的新值。 New value for the action bar text. #### Returns `void` #### Remarks 设置操作栏文本 —— 一段显示在标题下方和快捷栏上方的文本。 Set the action bar text - a piece of text that displays beneath the title and above the hot-bar. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [RawMessageError](/server/classes/RawMessageError.md) *** ### setHudVisibility() > **setHudVisibility**(`visible`, `hudElements?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### visible [`HudVisibility`](/server/enums/HudVisibility.md) 是否将 HUD 元素设置为不可见,或恢复为默认状态。 Whether to set the HUD element to invisible, or to reset it back to its default. ##### hudElements? [`HudElement`](/server/enums/HudElement.md)\[] 可选的 HUD 元素列表,用于配置可见性。 Optional list of HUD elements to configure visibility for. #### Returns `void` #### Remarks 设置平视显示器(HUD)特定元素的可见性。 Sets visibility of a particular element of the heads up display (HUD). #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### setTitle() > **setTitle**(`title`, `options?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### title `string` | [`RawMessage`](/server/interfaces/RawMessage.md) | (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[] ##### options? [`TitleDisplayOptions`](/server/interfaces/TitleDisplayOptions.md) #### Returns `void` #### Remarks 使标题显示在玩家的屏幕显示上。如果设置为空字符串将清除标题。可以选择指定额外的副标题以及淡入、停留和淡出时间。 Will cause a title to show up on the player's on screen display. Will clear the title if set to empty string. You can optionally specify an additional subtitle as well as fade in, stay and fade out times. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [RawMessageError](/server/classes/RawMessageError.md) #### Examples **setTitle.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function setTitle(targetLocation: DimensionLocation) { const players = world.getPlayers(); if (players.length > 0) { players[0].onScreenDisplay.setTitle('§o§6Fancy Title§r'); } } ``` **setTitleAndSubtitle.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function setTitleAndSubtitle(targetLocation: DimensionLocation) { const players = world.getPlayers(); players[0].onScreenDisplay.setTitle('Chapter 1', { stayDuration: 100, fadeInDuration: 2, fadeOutDuration: 4, subtitle: 'Trouble in Block Town', }); } ``` **countdown.ts** ```typescript import { world, system, DimensionLocation } from '@minecraft/server'; function countdown(targetLocation: DimensionLocation) { const players = world.getPlayers(); players[0].onScreenDisplay.setTitle('Get ready!', { stayDuration: 220, fadeInDuration: 2, fadeOutDuration: 4, subtitle: '10', }); let countdown = 10; const intervalId = system.runInterval(() => { countdown--; players[0].onScreenDisplay.updateSubtitle(countdown.toString()); if (countdown == 0) { system.clearRun(intervalId); } }, 20); } ``` *** ### updateSubtitle() > **updateSubtitle**(`subtitle`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### subtitle `string` | [`RawMessage`](/server/interfaces/RawMessage.md) | (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[] #### Returns `void` #### Remarks 如果副标题先前已通过 setTitle 方法显示,则更新副标题。 Updates the subtitle if the subtitle was previously displayed via the setTitle method. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) [RawMessageError](/server/classes/RawMessageError.md) #### Example **countdown.ts** ```typescript import { world, system, DimensionLocation } from '@minecraft/server'; function countdown(targetLocation: DimensionLocation) { const players = world.getPlayers(); players[0].onScreenDisplay.setTitle('Get ready!', { stayDuration: 220, fadeInDuration: 2, fadeOutDuration: 4, subtitle: '10', }); let countdown = 10; const intervalId = system.runInterval(() => { countdown--; players[0].onScreenDisplay.updateSubtitle(countdown.toString()); if (countdown == 0) { system.clearRun(intervalId); } }, 20); } ``` [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ScriptEventCommandMessageAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ScriptEventCommandMessageAfterEvent.md. # Class: ScriptEventCommandMessageAfterEvent event **`Beta`** 返回关于 /scriptevent 命令调用的附加数据。 Returns additional data about a /scriptevent command invocation. ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks 此 ScriptEvent 命令消息的标识符。 Identifier of this ScriptEvent command message. *** ### initiator? > `readonly` `optional` **initiator?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 如果此命令是通过 NPC 发起的,则返回发起 NPC 对话的实体。 If this command was initiated via an NPC, returns the entity that initiated the NPC dialogue. *** ### message > `readonly` **message**: `string` **`Beta`** #### Remarks 通过脚本事件命令传递的可选附加数据。 Optional additional data passed in with the script event command. *** ### sourceBlock? > `readonly` `optional` **sourceBlock?**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 如果此命令是通过方块(如命令方块)触发的,则为源方块。 Source block if this command was triggered via a block (e.g., a commandblock.) *** ### sourceEntity? > `readonly` `optional` **sourceEntity?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 如果此命令是由实体(如 NPC)触发的,则为源实体。 Source entity if this command was triggered by an entity (e.g., a NPC). *** ### sourceType > `readonly` **sourceType**: [`ScriptEventSource`](/server/enums/ScriptEventSource.md) **`Beta`** #### Remarks 返回触发此命令的源类型。 Returns the type of source that fired this command. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ScriptEventCommandMessageAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ScriptEventCommandMessageAfterEventSignal.md. # Class: ScriptEventCommandMessageAfterEventSignal event **`Beta`** 允许注册一个响应入站 /scriptevent 命令的事件处理器。 Allows for registering an event handler that responds to inbound /scriptevent commands. ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` ##### options? [`ScriptEventMessageFilterOptions`](/server/interfaces/ScriptEventMessageFilterOptions.md) #### Returns (`arg0`) => `void` #### Remarks 注册一个新的 ScriptEvent 处理器。 Registers a new ScriptEvent handler. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 取消订阅 ScriptEvent 事件的特定处理器。 Unsubscribes a particular handler for a ScriptEvent event. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Seat.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Seat.md. # Class: Seat **`Beta`** 描述此可骑乘实体上的特定座位位置。 Describes a particular seating position on this rideable entity. ## Properties ### lockRiderRotation > `readonly` **lockRiderRotation**: `number` **`Beta`** #### Remarks 骑乘者在骑乘此实体时允许旋转的角度(以度为单位)。 Angle in degrees that a rider is allowed to rotate while riding this entity. *** ### maxRiderCount > `readonly` **maxRiderCount**: `number` **`Beta`** #### Remarks 此座位可支持的最大骑乘者数量。 A maximum number of riders that this seat can support. *** ### minRiderCount > `readonly` **minRiderCount**: `number` **`Beta`** #### Remarks 如果需要填充此座位,可放置在此座位位置的最小骑乘者数量。 A minimum number of riders that can be placed in this seat position, if this seat is to be filled. *** ### position > `readonly` **position**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 此座位的实际位置,相对于实体的位置。 Physical location of this seat, relative to the entity's location. *** ### seatRotation > `readonly` **seatRotation**: `number` **`Beta`** #### Remarks 旋转骑乘者的角度(以度为单位)。 Angle in degrees to rotate riders by. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ServerMessageAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ServerMessageAfterEventSignal.md. # Class: ServerMessageAfterEventSignal event **`Beta`** 管理消息传递到服务器的回调。此事件目前尚未完全实现,不应使用。 Manages callbacks that are message passing to a server. This event is not currently fully implemented, and should not be used. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个将在内部消息传递时调用的回调。 Adds a callback that will be called when an internal message is passed. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个在内部消息传递时调用的回调。 Removes a callback from being called when an internal message is passed. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ShutdownBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ShutdownBeforeEventSignal.md. # Class: ShutdownBeforeEventSignal event **`Beta`** 为调用者提供了一个可适应的接口,用于订阅在游戏世界关闭前触发的事件。此事件发生在玩家离开之后,但在世界关闭之前。 Provides an adaptable interface for callers to subscribe to an event that fires before the game world shuts down. This event occurs after players have left, but before the world has closed. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 事件触发时调用的函数回调。此闭包以受限执行权限被调用。 ::: :::tip Function callback that is called when this event fires. This closure is called with restricted-execution privilege. ::: #### Returns :::tip 以受限执行权限调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks 为此事件添加一个新的订阅者回调。 Adds a new subscriber callback to this event. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 先前传递给 subscribe 方法的函数闭包。此闭包以受限执行权限被调用。 ::: :::tip Function closure that was previously passed to the subscribe method. This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks 移除先前通过 subscribe 方法订阅的回调。 Removes a subscriber callback previously subscribed to via the subscribe method. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/ShutdownEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ShutdownEvent.md. # Class: ShutdownEvent event **`Beta`** 游戏世界关闭时分发的事件对象。 The event object that gets dispatched when the game world is shutting down. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SoundCompletedAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SoundCompletedAfterEvent.md. # Class: SoundCompletedAfterEvent event sound **`Beta`** 包含关于声音声明时长已结束的信息。 Contains information about a sound thats declared duration elapsed. ## Properties ### soundInstanceId > `readonly` **soundInstanceId**: `string` **`Beta`** #### Remarks 已完成的音频实例的标识符。与播放声音时返回的 `SoundInstance` 的 `id` 属性匹配。 Identifier of the sound instance that completed. Matches the `id` property of the `SoundInstance` returned when the sound was played. ## 同领域相关 - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SoundCompletedAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SoundCompletedAfterEventSignal.md. # Class: SoundCompletedAfterEventSignal event sound **`Beta`** 管理当被追踪声音的声明时长结束时触发的回调。 Manages callbacks that are invoked when a tracked sound's declared duration elapses. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks 添加一个回调,当被追踪声音的声明时长结束时将被调用。 Adds a callback that will be invoked when a tracked sound's declared duration elapses. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks 移除一个先前注册的、在追踪声音声明时长结束时调用的回调。 Removes a callback from being invoked when a tracked sound's declared duration elapses. ## 同领域相关 - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SoundDefinition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SoundDefinition.md. # Class: SoundDefinition sound **`Beta`** 关于在 sound\_definitions.json 文件中声明的音效的静态元数据。 Static metadata about a sound declared in a sound\_definitions.json file. ## Properties ### durationInfo? > `readonly` `optional` **durationInfo?**: [`SoundDefinitionDurationInfo`](/server/interfaces/SoundDefinitionDurationInfo.md) **`Beta`** #### Remarks 为此音效声明的持续时间元数据。当音效定义未指定持续时间时为 `undefined`。 Duration metadata declared for this sound. Undefined when the sound definition does not specify a duration. *** ### musicInfo? > `readonly` `optional` **musicInfo?**: [`SoundDefinitionMusicInfo`](/server/interfaces/SoundDefinitionMusicInfo.md) **`Beta`** #### Remarks 为此音效声明的音乐元数据。当音效定义未指定 music\_info 块时为 `undefined`。 Music metadata declared for this sound. Undefined when the sound definition does not specify a music\_info block. *** ### soundEventId > `readonly` **soundEventId**: `string` **`Beta`** #### Remarks 此定义所声明的音效事件标识符,格式为 'namespace:name'。 Identifier of the sound event this definition declares, in the form 'namespace:name'. *** ### tags? > `readonly` `optional` **tags?**: `Record`\<`string`, `string`\[]> **`Beta`** #### Remarks 为此音效声明的标签元数据,以记录形式将每个标签名称映射到其声明的值。使用单个字符串值声明的标签将作为单元素数组暴露。当音效定义未指定任何标签时为 `undefined`。 Tag metadata declared for this sound, as a record mapping each tag name to its declared values. A tag declared with a single string value is exposed as a single-element array. Undefined when the sound definition does not specify any tags. ## 同领域相关 - [PlayerSoundOptions](/server/interfaces/PlayerSoundOptions.md) - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent.md) - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal.md) - [SoundDefinitionDurationInfo](/server/interfaces/SoundDefinitionDurationInfo.md) - [SoundDefinitionFilter](/server/interfaces/SoundDefinitionFilter.md) - [SoundDefinitionMusicInfo](/server/interfaces/SoundDefinitionMusicInfo.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SoundDefinitionRegistry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SoundDefinitionRegistry.md. # Class: SoundDefinitionRegistry sound **`Beta`** 提供对当前世界加载的音效定义的只读访问。 Provides read-only access to the sound definitions loaded for the current world. ## Methods ### getDefinitions() > **getDefinitions**(`filter?`): [`SoundDefinition`](/server/classes/SoundDefinition.md)\[] **`Beta`** #### Parameters ##### filter? [`SoundDefinitionFilter`](/server/interfaces/SoundDefinitionFilter.md) 应用于每个定义的可选筛选条件。省略时返回所有定义。 Optional filter applied to each definition. When omitted, every definition is returned. #### Returns [`SoundDefinition`](/server/classes/SoundDefinition.md)\[] 所有符合筛选条件的音效定义,或未提供筛选条件时的所有音效定义。 All sound definitions matching the filter, or every sound definition when no filter is supplied. #### Remarks 返回注册表中的音效定义,可选择通过筛选条件缩小范围。 Returns the sound definitions in the registry, optionally narrowed by a filter. #### Throws 如果 filter.minDuration 大于 filter.maxDuration 将抛出错误。 An error will be thrown if filter.minDuration is greater than filter.maxDuration. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) ## 同领域相关 - [PlayerSoundOptions](/server/interfaces/PlayerSoundOptions.md) - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent.md) - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal.md) - [SoundDefinition](/server/classes/SoundDefinition.md) - [SoundDefinitionDurationInfo](/server/interfaces/SoundDefinitionDurationInfo.md) - [SoundDefinitionFilter](/server/interfaces/SoundDefinitionFilter.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SoundDurationInfo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SoundDurationInfo.md. # Class: SoundDurationInfo sound **`Beta`** 提供声明了时长的声音的时长和播放信息。 Provides duration and playback information for a sound whose definition declares a duration. ## Properties ### duration > `readonly` **duration**: `number` **`Beta`** #### Remarks 获取声音的总时长(以秒为单位)。 Gets the total duration of the sound in seconds. *** ### isActive > `readonly` **isActive**: `boolean` **`Beta`** #### Remarks 获取声音是否仍被追踪。 Gets whether the sound is still being tracked. ## Methods ### getPlaybackPosition() > **getPlaybackPosition**(): `number` **`World Mutation`** **`Beta`** #### Returns `number` 已播放的时间(以秒为单位)。 Elapsed playback time in seconds. #### Remarks 返回声音开始播放以来的已播放时间(以秒为单位)。 Returns the elapsed playback time of the sound, in seconds, since it started playing. ## 同领域相关 - [PlayerSoundOptions](/server/interfaces/PlayerSoundOptions.md) - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent.md) - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal.md) - [SoundDefinition](/server/classes/SoundDefinition.md) - [SoundDefinitionDurationInfo](/server/interfaces/SoundDefinitionDurationInfo.md) - [SoundDefinitionFilter](/server/interfaces/SoundDefinitionFilter.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SoundInstance.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SoundInstance.md. # Class: SoundInstance sound **`Beta`** 表示已播放音效的句柄。在音效播放期间需要通过此句柄来控制音效(例如调用 `stop`、`setVolume`、`setPitch`、`fade` 或 `seekTo`)。无限循环音效(通过 `loop: -1` 启动)会在最后一个 `SoundInstance` 引用被丢弃时自动停止;只要音效需要继续播放,就应保留此句柄。 Represents a handle to a sound that has been played. The handle is required to control the sound while it is playing (for example, to call `stop`, `setVolume`, `setPitch`, `fade`, or `seekTo`). Infinitely-looping sounds (started with `loop: -1`) stop automatically when the last `SoundInstance` reference is dropped; retain the handle for as long as the sound should keep playing. ## Properties ### durationInfo? > `readonly` `optional` **durationInfo?**: [`SoundDurationInfo`](/server/classes/SoundDurationInfo.md) **`Beta`** #### Remarks 获取此音效的持续时间和播放信息。 Gets duration and playback information for this sound. *** ### id 实验性 > `readonly` **id**: `string` **`Beta`** #### Remarks 此音效实例的唯一标识符。 Unique identifier of this sound instance. *** ### recipient? > `readonly` `optional` **recipient?**: [`Player`](/server/classes/Player.md) **`Beta`** #### Remarks 获取此音效为其播放的玩家。 Gets the player this sound was played for. *** ### soundEventId 实验性 > `readonly` **soundEventId**: `string` **`Beta`** #### Remarks 获取此实例启动时使用的音效事件标识符。 Gets the identifier of the sound event this instance was started with. ## Methods ### fade() > **fade**(`duration`, `targetVolume`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### duration `number` 淡变的持续时间(以秒为单位)。必须为非负值。 Duration of the fade in seconds. Must be non-negative. Minimum value: 0 ##### targetVolume `number` 淡变到的目标音量。必须为非负值。 Volume to fade to. Must be non-negative. Minimum value: 0 #### Returns `void` #### Remarks 将当前音效实例从当前音量渐变为指定音量,持续指定时间。要从静音淡入,请先调用 `setVolume(0.0)`;要淡出,请传入目标音量 `0.0`。 Fades this sound instance from its current volume to the target volume over the specified duration. To fade in from silence, call `setVolume(0.0)` first; to fade out, pass a target volume of `0.0`. *** ### pause() > **pause**(): `void` **`Beta`** **`World Mutation`** #### Returns `void` #### Remarks 暂停此音效。 Pauses this sound. *** ### resume() > **resume**(): `void` **`Beta`** **`World Mutation`** #### Returns `void` #### Remarks 暂停后恢复此音效。 Resumes this sound after a pause. *** ### seekTo() > **seekTo**(`seconds`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### seconds `number` 要跳转到的位置(以秒为单位)。必须为非负值。 Position to seek to in seconds. Must be non-negative. Minimum value: 0 #### Returns `void` #### Remarks 设置此音效实例的播放位置。 Sets the playback position of this sound instance. *** ### setPitch() > **setPitch**(`pitch`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### pitch `number` 0.01 到 10.0 之间的音高倍率。值为 1.0 表示正常音高。 Pitch multiplier between 0.01 and 10.0. A value of 1.0 is normal pitch. Bounds: \[0.009999999776482582, 10] #### Returns `void` #### Remarks 设置此音效实例的音高。 Sets the pitch of this sound instance. *** ### setVolume() > **setVolume**(`volume`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### volume `number` 0.0 到 10.0 之间的音量级别。 Volume level between 0.0 and 10.0. Bounds: \[0, 10] #### Returns `void` #### Remarks 设置此音效实例的音量。 Sets the volume of this sound instance. *** ### stop() > **stop**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Preview #### Remarks 停止此音效实例的播放。 Stops this sound instance from playing. ## 同领域相关 - [PlayerSoundOptions](/server/interfaces/PlayerSoundOptions.md) - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent.md) - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal.md) - [SoundDefinition](/server/classes/SoundDefinition.md) - [SoundDefinitionDurationInfo](/server/interfaces/SoundDefinitionDurationInfo.md) - [SoundDefinitionFilter](/server/interfaces/SoundDefinitionFilter.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/StartupBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/StartupBeforeEventSignal.md. # Class: StartupBeforeEventSignal event **`Beta`** 管理连接到启动前事件的回调。 Manages callbacks that are connected to before a startup event. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以早期执行权限被调用。 ::: This closure is called with early-execution privilege. #### Returns :::tip 以早期执行权限调用的闭包。 ::: Closure that is called with early-execution privilege. (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以早期执行权限被调用。 ::: This closure is called with early-execution privilege. #### Returns `void` #### Remarks ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/StartupEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/StartupEvent.md. # Class: StartupEvent event **`Beta`** ## Properties ### blockComponentRegistry > `readonly` **blockComponentRegistry**: [`BlockComponentRegistry`](/server/classes/BlockComponentRegistry.md) **`Early Execution`** **`Beta`** #### Remarks *** ### customCommandRegistry > `readonly` **customCommandRegistry**: [`CustomCommandRegistry`](/server/classes/CustomCommandRegistry.md) **`Early Execution`** **`Beta`** #### Remarks *** ### dimensionRegistry > `readonly` **dimensionRegistry**: [`DimensionRegistry`](/server/classes/DimensionRegistry.md) **`Early Execution`** **`Beta`** #### Remarks *** ### itemComponentRegistry > `readonly` **itemComponentRegistry**: [`ItemComponentRegistry`](/server/classes/ItemComponentRegistry.md) **`Early Execution`** **`Beta`** #### Remarks ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/StructureManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/StructureManager.md. # Class: StructureManager **`Beta`** Structure 相关 API 的管理器。包括用于创建、获取、放置和删除 Structure 的 API。 Manager for Structure related APIs. Includes APIs for creating, getting, placing and deleting Structures. ## Methods ### createEmpty() > **createEmpty**(`identifier`, `size`, `saveMode?`): [`Structure`](/server/classes/Structure.md) **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` 结构的名称。有效的标识符必须包含命名空间且必须唯一。 The name of the structure. A valid identifier must include a namespace and must be unique. ##### size [`Vector3`](/server/interfaces/Vector3.md) 结构的大小。例如,要创建一个单方块结构,大小应为 \{x:1, y:1, z:1}。 The size of the structure. For example, to create a single block structure the size should be \{x:1, y:1, z:1}. ##### saveMode? [`StructureSaveMode`](/server/enums/StructureSaveMode.md) 创建时结构的保存方式。默认为 StructureSaveMode.Memory。 How the Structure should be saved upon creation. Defaults to StructureSaveMode.Memory. Defaults to: 0 #### Returns [`Structure`](/server/classes/Structure.md) 返回新创建的 Structure。 Returns the newly created Structure. #### Remarks 在内存中创建一个空的 Structure。使用 [Structure.setBlockPermutation](/server/classes/Structure.md#setblockpermutation) 填充结构中的方块,并使用 [Structure.saveAs](/server/classes/Structure.md#saveas) 保存更改。 Creates an empty Structure in memory. Use [Structure.setBlockPermutation](/server/classes/Structure.md#setblockpermutation) to populate the structure with blocks and save changes with [Structure.saveAs](/server/classes/Structure.md#saveas). #### Throws 如果标识符无效则抛出。有效的标识符必须包含命名空间且必须唯一。 Throws if the identifier is invalid. A valid identifier must include a namespace and must be unique. [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### createFromWorld() > **createFromWorld**(`identifier`, `dimension`, `from`, `to`, `options?`): [`Structure`](/server/classes/Structure.md) **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` 结构的名称。有效的标识符必须包含命名空间且必须唯一。 The name of the structure. A valid identifier must include a namespace and must be unique. ##### dimension [`Dimension`](/server/classes/Dimension.md) 应从中读取方块的维度。 The dimension where the blocks should be read from. ##### from [`Vector3`](/server/interfaces/Vector3.md) ##### to [`Vector3`](/server/interfaces/Vector3.md) ##### options? [`StructureCreateOptions`](/server/interfaces/StructureCreateOptions.md) 从世界创建结构的附加选项。 Additional options for creating a structure from the world. #### Returns [`Structure`](/server/classes/Structure.md) 返回新创建的 Structure。 Returns the newly created Structure. #### Remarks 从世界中的方块创建一个新的 Structure。这在功能上等同于 /structure save 命令。 Creates a new Structure from blocks in the world. This is functionally equivalent to the /structure save command. #### Throws 如果标识符无效则抛出。有效的标识符必须包含命名空间且必须唯一。 如果结构边界超出最大大小则抛出。 如果结构边界包含世界边界之外的方块则抛出。 Throws if the identifier is invalid. A valid identifier must include a namespace and must be unique. Throws if the structure bounds exceed the maximum size. Throws if the structure bounds contains blocks outside the world bounds. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### delete() > **delete**(`structure`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### structure `string` | [`Structure`](/server/classes/Structure.md) 要删除的结构标识符或 Structure 对象。注意,Structure 对象在删除后将变为无效。 The structure identifier or Structure object that should be deleted. Note, a Structure object will become invalid after it is deleted. #### Returns `boolean` 返回结构是否已被移除。 Returns whether the structure was removed. #### Remarks 从内存和世界中删除一个结构(如果存在)。 Deletes a structure from memory and from the world if it exists. #### Throws 如果无法移除结构则抛出。例如,从行为包加载的结构。 Throws if a structure cannot be removed. For example, a structure loaded from a Behavior Pack. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### get() > **get**(`identifier`): [`Structure`](/server/classes/Structure.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` 要获取的结构的名称。 The name of the structure to get. #### Returns [`Structure`](/server/classes/Structure.md) | `undefined` 如果结构存在则返回 Structure,否则返回 `undefined`。 Returns a Structure if it exists, otherwise undefined. #### Remarks 获取已保存到内存或世界中的 Structure。 Gets a Structure that is saved to memory or the world. *** ### getPackStructureIds() > **getPackStructureIds**(): `string`\[] **`World Mutation`** **`Beta`** #### Returns `string`\[] 结构标识符列表。 The list of structure identifiers. #### Remarks 返回行为包中包含的所有结构列表。不包括保存到世界或内存中的结构。 Returns a list of all structures contained in behavior packs. Does not include structures saved to the world or in memory. *** ### getWorldStructureIds() > **getWorldStructureIds**(): `string`\[] **`World Mutation`** **`Beta`** #### Returns `string`\[] 结构标识符列表。 The list of structure identifiers. #### Remarks 返回所有保存到世界和内存中的结构列表。不包括行为包中包含的结构。 Returns a list of all structures saved to the world and to memory. Does not include structures contained in behavior packs. *** ### place() > **place**(`structure`, `dimension`, `location`, `options?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### structure `string` | [`Structure`](/server/classes/Structure.md) 结构的标识符或 Structure 对象。 The structure's identifier or a Structure object. ##### dimension [`Dimension`](/server/classes/Dimension.md) 应放置结构的维度。 The dimension where the Structure should be placed. ##### location [`Vector3`](/server/interfaces/Vector3.md) 维度中应放置结构的位置。 The location within the dimension where the Structure should be placed. ##### options? [`StructurePlaceOptions`](/server/interfaces/StructurePlaceOptions.md) Structure 放置的附加选项。 Additional options for Structure placement. #### Returns `void` #### Remarks 在世界中放置一个结构。放置在未加载区块中的结构将被排队等待加载。 Places a structure in the world. Structures placed in unloaded chunks will be queued for loading. #### Throws 如果完整性值超出 \[0,1] 范围则抛出。 如果完整性种子无效则抛出。 如果放置位置包含世界边界之外的方块则抛出。 Throws if the integrity value is outside of the range \[0,1] Throws if the integrity seed is invalid. Throws if the placement location contains blocks that are outside the world bounds. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### placeJigsaw() > **placeJigsaw**(`pool`, `targetJigsaw`, `maxDepth`, `dimension`, `location`, `options?`): [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) **`World Mutation`** **`Beta`** #### Parameters ##### pool `string` 起始模板池的标识符。 The identifier of the template pool to start from. ##### targetJigsaw `string` 起始拼图方块的名称。此方块必须至少包含在起始池结构模板之一中。 The name of the jigsaw block to start from. This block must be included in at least one of the starting pool structure templates. ##### maxDepth `number` 拼图结构的最大递归深度。 The maximum recursion depth for the jigsaw structure. Bounds: \[1, 20] ##### dimension [`Dimension`](/server/classes/Dimension.md) 放置拼图结构的维度。 The dimension to place the jigsaw structure in. ##### location [`Vector3`](/server/interfaces/Vector3.md) 拼图结构将开始生成的位置,相对于 targetJigsaw 方块。 The location where the jigsaw structure will begin generating relative to the targetJigsaw block. ##### options? [`JigsawPlaceOptions`](/server/interfaces/JigsawPlaceOptions.md) 生成拼图结构时使用的可选设置。 Optional settings to use when generating the jigsaw structure. #### Returns [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) 返回表示拼图结构最大边界的 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象。 Returns a [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) object which represents the maximum bounds of the jigsaw structure. #### Remarks 在世界中放置部分拼图结构。这有利于调试拼图方块之间的连接。 Places a partial jigsaw structure in the world. This is useful for debugging connections between jigsaw blocks. #### Throws 如果 maxDepth 超出 \[1,20] 范围则抛出。 如果由于无效参数或拼图配置导致生成失败则抛出。 如果放置位置包含世界边界之外的方块则抛出。 Throws if maxDepth is outside of the range \[1,20] Throws if generation fails due to invalid parameters or jigsaw configuration. Throws if the placement location contains blocks that are outside the world bounds. [PlaceJigsawError](/server/classes/PlaceJigsawError.md) *** ### placeJigsawStructure() > **placeJigsawStructure**(`identifier`, `dimension`, `location`, `options?`): [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` 拼图结构的标识符。 The identifier of the jigsaw structure. ##### dimension [`Dimension`](/server/classes/Dimension.md) 放置拼图结构的维度。 The dimension to place the jigsaw structure in. ##### location [`Vector3`](/server/interfaces/Vector3.md) 拼图结构将开始生成的位置。注意,除非设置了 ignoreStarJigsawStructurePlaceOptions ignoreStartHeight 选项,否则 y 值将被结构的起始高度覆盖。 The location where the jigsaw structure will begin generating. Note that the y value will be overridden by the structure's start height unless the ignoreStarJigsawStructurePlaceOptions ignoreStartHeight option is set. ##### options? [`JigsawStructurePlaceOptions`](/server/interfaces/JigsawStructurePlaceOptions.md) 生成拼图结构时使用的可选设置。 Optional settings to use when generating the jigsaw structure. #### Returns [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) 返回表示拼图结构最大边界的 [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) 对象。 Returns a [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) object which represents the maximum bounds of the jigsaw structure. #### Remarks 在世界中放置一个拼图结构。 Places a jigsaw structure in the world. #### Throws 如果由于无效参数或拼图配置导致生成失败则抛出。 如果放置位置包含世界边界之外的方块则抛出。 Throws if generation fails due to invalid parameters or jigsaw configuration. Throws if the placement location contains blocks that are outside the world bounds. [PlaceJigsawError](/server/classes/PlaceJigsawError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/System.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/System.md. # Class: System **`Beta`** 提供系统级事件和函数的类。 A class that provides system-level events and functions. ## Properties ### afterEvents > `readonly` **afterEvents**: [`SystemAfterEvents`](/server/classes/SystemAfterEvents.md) **`Early Execution`** **`Beta`** #### Remarks 返回系统级操作的后置事件集合。 Returns a collection of after-events for system-level operations. *** ### beforeEvents > `readonly` **beforeEvents**: [`SystemBeforeEvents`](/server/classes/SystemBeforeEvents.md) **`Early Execution`** **`Beta`** #### Remarks 返回系统级操作的前置事件集合。 Returns a collection of before-events for system-level operations. *** ### currentTick > `readonly` **currentTick**: `number` **`Early Execution`** **`Beta`** #### Remarks 表示服务器当前的世界刻数。 Represents the current world tick of the server. *** ### isEditorWorld > `readonly` **isEditorWorld**: `boolean` **`Early Execution`** **`Beta`** #### Remarks 如果这是一个当前已加载编辑器的世界,则返回 `true`,否则返回 `false`。 Returns true if this is a world where the editor is currently loaded, returns false otherwise. *** ### serverSystemInfo > `readonly` **serverSystemInfo**: [`SystemInfo`](/server/classes/SystemInfo.md) **`Early Execution`** **`Beta`** #### Remarks 包含服务器的设备信息。 Contains the device information for the server. ## Methods ### clearJob() > **clearJob**(`jobId`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### jobId `number` 从 [System.runJob](#runjob) 返回的作业 ID。 The job ID returned from [System.runJob](#runjob). #### Returns `void` #### Remarks 取消通过 [System.runJob](#runjob) 排队的作业的执行。 Cancels the execution of a job queued via [System.runJob](#runjob). *** ### clearRun() > **clearRun**(`runId`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### runId `number` #### Returns `void` #### Remarks 取消先前通过 [System.run](#run) 安排的函数运行的执行。 Cancels the execution of a function run that was previously scheduled via [System.run](#run). *** ### run() > **run**(`callback`): `number` **`Early Execution`** **`Beta`** #### Parameters ##### callback () => `void` 在下一个游戏刻运行的函数回调。 Function callback to run at the next game tick. #### Returns `number` 一个不透明标识符,可与 `clearRun` 函数一起使用以取消此运行的执行。 An opaque identifier that can be used with the `clearRun` function to cancel the execution of this run. #### Remarks 在下一个可用的未来时间运行指定的函数。这通常用于实现延迟行为和游戏循环。在事件处理程序的上下文中运行时,通常会在事件发生的同一刻结束时运行代码。在其他代码(system.run 回调)中运行时,该函数将在下一刻运行。但请注意,根据系统负载,不能保证在同一刻或下一刻运行。 Runs a specified function at the next available future time. This is frequently used to implement delayed behaviors and game loops. When run within the context of an event handler, this will generally run the code at the end of the same tick where the event occurred. When run in other code (a system.run callout), this will run the function in the next tick. Note, however, that depending on load on the system, running in the same or next tick is not guaranteed. #### Example **trapTick.ts** ```typescript import { world, system } from '@minecraft/server'; function trapTick() { try { // Minecraft runs at 20 ticks per second. if (system.currentTick % 1200 === 0) { world.sendMessage('Another minute passes...'); } } catch (e) { console.warn('Error: ' + e); } system.run(trapTick); } ``` *** ### runInterval() > **runInterval**(`callback`, `tickInterval?`): `number` **`Early Execution`** **`Beta`** #### Parameters ##### callback () => `void` 在此间隔发生时将运行的功能代码。 Functional code that will run when this interval occurs. ##### tickInterval? `number` 回调被调用的间隔刻数。 An interval of every N ticks that the callback will be called upon. #### Returns `number` 一个不透明句柄,可与 clearRun 方法一起使用以停止此函数的间隔运行。 An opaque handle that can be used with the clearRun method to stop the run of this function on an interval. #### Remarks 按间隔运行一组代码。 Runs a set of code on an interval. #### Example **every30Seconds.ts** ```typescript import { world, system, DimensionLocation } from '@minecraft/server'; function every30Seconds(targetLocation: DimensionLocation) { const intervalRunIdentifier = Math.floor(Math.random() * 10000); system.runInterval(() => { world.sendMessage('This is an interval run ' + intervalRunIdentifier + ' sending a message every 30 seconds.'); }, 600); } ``` *** ### runJob() > **runJob**(`generator`): `number` **`Early Execution`** **`Beta`** #### Parameters ##### generator `Generator`\<`void`, `void`, `void`> 要运行的生成器实例。 The instance of the generator to run. #### Returns `number` 一个不透明句柄,可与 [System.clearJob](#clearjob) 一起使用以停止此生成器的运行。 An opaque handle that can be used with [System.clearJob](#clearjob) to stop the run of this generator. #### Remarks 将生成器排队直到完成。生成器将在每刻获得一个时间片,并将运行直到它让出或完成。 Queues a generator to run until completion. The generator will be given a time slice each tick, and will be run until it yields or completes. #### Example **cubeGenerator.ts** ```typescript import { system, BlockPermutation, DimensionLocation } from '@minecraft/server'; function cubeGenerator(targetLocation: DimensionLocation) { const blockPerm = BlockPermutation.resolve('minecraft:cobblestone'); system.runJob(blockPlacingGenerator(blockPerm, targetLocation, 15)); } function* blockPlacingGenerator(blockPerm: BlockPermutation, startingLocation: DimensionLocation, size: number) { for (let x = startingLocation.x; x < startingLocation.x + size; x++) { for (let y = startingLocation.y; y < startingLocation.y + size; y++) { for (let z = startingLocation.z; z < startingLocation.z + size; z++) { const block = startingLocation.dimension.getBlock({ x: x, y: y, z: z }); if (block) { block.setPermutation(blockPerm); } yield; } } } } ``` *** ### runTimeout() > **runTimeout**(`callback`, `tickDelay?`): `number` **`Early Execution`** **`Beta`** #### Parameters ##### callback () => `void` 此超时发生时将运行的功能代码。 Functional code that will run when this timeout occurs. ##### tickDelay? `number` 调用间隔前的时间(以刻为单位)。 Amount of time, in ticks, before the interval will be called. #### Returns `number` 一个不透明句柄,可与 clearRun 方法一起使用以停止此函数的间隔运行。 An opaque handle that can be used with the clearRun method to stop the run of this function on an interval. #### Remarks 在由 tickDelay 指定的未来时间运行一组代码。 Runs a set of code at a future time specified by tickDelay. *** ### sendScriptEvent() > **sendScriptEvent**(`id`, `message`): `void` **`Beta`** #### Parameters ##### id `string` 要发送的消息的标识符。这是自定义的,具体取决于你在世界中安装的行为包和内容。 Identifier of the message to send. This is custom and dependent on the kinds of behavior packs and content you may have installed within the world. ##### message `string` 要发送的消息的数据组件。这是自定义的,具体取决于你在世界中安装的行为包和内容。 Data component of the message to send. This is custom and dependent on the kinds of behavior packs and content you may have installed within the world. #### Returns `void` #### Remarks 使用指定的消息 ID 和负载在脚本内触发事件。 Causes an event to fire within script with the specified message ID and payload. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [NamespaceNameError](/server/classes/NamespaceNameError.md) *** ### waitTicks() > **waitTicks**(`ticks`): `Promise`\<`void`> **`Early Execution`** **`Beta`** #### Parameters ##### ticks `number` 要等待的刻数。最小值为 1。 The amount of ticks to wait. Minimum value is 1. #### Returns `Promise`\<`void`> 在指定刻数过去后解析的 Promise。 A promise that is resolved when the specified amount of ticks have occurred. #### Remarks waitTicks 返回一个在请求的刻数后解析的 Promise。 waitTicks returns a promise that resolves after the requested number of ticks. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SystemAfterEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SystemAfterEvents.md. # Class: SystemAfterEvents event **`Beta`** 提供在 Minecraft 更广泛的脚本系统内触发的一组事件。 Provides a set of events that fire within the broader scripting system within Minecraft. ## Properties ### scriptEventReceive > `readonly` **scriptEventReceive**: [`ScriptEventCommandMessageAfterEventSignal`](/server/classes/ScriptEventCommandMessageAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks 当 /scriptevent 命令被设置时触发的事件。这为命令和其他系统提供了一种在脚本中触发行为的方式。 An event that fires when a /scriptevent command is set. This provides a way for commands and other systems to trigger behavior within script. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/SystemBeforeEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/SystemBeforeEvents.md. # Class: SystemBeforeEvents event **`Beta`** 一组在实际操作发生前触发的事件。在大多数情况下,你可以取消或修改即将发生的事件。注意,在 before 事件中,任何修改游戏状态的 API 将无法运行并会抛出错误。 A set of events that fire before an actual action occurs. In most cases, you can potentially cancel or modify the impending event. Note that in before events any APIs that modify gameplay state will not function and will throw an error. ## Properties ### shutdown > `readonly` **shutdown**: [`ShutdownBeforeEventSignal`](/server/classes/ShutdownBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### startup > `readonly` **startup**: [`StartupBeforeEventSignal`](/server/classes/StartupBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### watchdogTerminate 实验性 > `readonly` **watchdogTerminate**: [`WatchdogTerminateBeforeEventSignal`](/server/classes/WatchdogTerminateBeforeEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks 当脚本监视狗关闭服务器时触发。这可能是由于使用了过多内存,或导致了显著的减速或卡顿。要阻止关闭,请将事件的 cancel 属性设置为 `true`。 Fires when the scripting watchdog shuts down the server. The can be due to using too much memory, or by causing significant slowdown or hang. To prevent shutdown, set the event's cancel property to true. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/TargetBlockHitAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/TargetBlockHitAfterEventSignal.md. # Class: TargetBlockHitAfterEventSignal event block **`Beta`** Manages callbacks that are connected to when a target block is hit. 管理与标靶方块被击中时相关的回调。 ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a target block is hit. 添加一个回调,当目标方块被击中时调用。 *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a target block is hit. 移除一个在目标方块被击中时调用的回调。 ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/TickingAreaError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/TickingAreaError.md. # Class: TickingAreaError error **`Beta`** The error returned from invalid [TickingAreaManager](/server/classes/TickingAreaManager.md) method calls. 从无效的 [TickingAreaManager](/server/classes/TickingAreaManager.md) 方法调用返回的错误。 ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### reason > `readonly` **reason**: [`TickingAreaErrorReason`](/server/enums/TickingAreaErrorReason.md) **`Early Execution`** **`Beta`** #### Remarks The specific reason that the error was thrown. 抛出该错误的具体原因。 *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/TickingAreaManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/TickingAreaManager.md. # Class: TickingAreaManager **`Beta`** This manager is used to add, remove or query temporary ticking areas to a dimension. These ticking areas are limited by a fixed amount of ticking chunks per pack independent of the command limits. Cannot modify or query ticking areas added by other packs or commands. 该管理器用于向维度添加、移除或查询临时常加载区域。这些常加载区域受每个包固定数量的常加载区块限制,独立于命令限制。无法修改或查询由其他包或命令添加的常加载区域。 ## Properties ### chunkCount > `readonly` **chunkCount**: `number` **`Beta`** #### Remarks The number of currently ticking chunks in this manager. 此管理器中当前常加载的区块数量。 *** ### maxChunkCount > `readonly` **maxChunkCount**: `number` **`Beta`** #### Remarks The maximum number of allowed ticking chunks. Overlapping ticking area chunks do count towards total. 允许的最大常加载区块数量。重叠的常加载区域区块会计入总数。 ## Methods ### createTickingArea() > **createTickingArea**(`identifier`, `options`): `Promise`\<`void`> **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` ##### options [`TickingAreaOptions`](/server/interfaces/TickingAreaOptions.md) #### Returns `Promise`\<`void`> #### Remarks Creates a ticking area. Promise will return when all the chunks in the area are loaded and ticking. 创建一个常加载区域。当区域中所有区块都已加载并开始常加载时,Promise 将返回。 #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [TickingAreaError](/server/classes/TickingAreaError.md) *** ### getAllTickingAreas() > **getAllTickingAreas**(): [`TickingArea`](/server/interfaces/TickingArea.md)\[] **`World Mutation`** **`Beta`** #### Returns [`TickingArea`](/server/interfaces/TickingArea.md)\[] #### Remarks Gets all ticking areas added by this manager. 获取此管理器添加的所有常加载区域。 #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### getTickingArea() > **getTickingArea**(`identifier`): [`TickingArea`](/server/interfaces/TickingArea.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` | [`TickingArea`](/server/interfaces/TickingArea.md) #### Returns [`TickingArea`](/server/interfaces/TickingArea.md) | `undefined` #### Remarks Tries to get specific ticking area by identifier. 尝试通过标识符获取特定的常加载区域。 #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### hasCapacity() > **hasCapacity**(`options`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### options [`TickingAreaOptions`](/server/interfaces/TickingAreaOptions.md) #### Returns `boolean` #### Remarks Returns true if the manager has enough chunk capacity for the ticking area and false otherwise. Will also return false if the length or width exceeds the 255 chunk limit. 如果管理器有足够的区块容量来容纳常加载区域,则返回 `true`,否则返回 `false`。如果长度或宽度超过 255 个区块的限制,也会返回 `false`。 *** ### hasTickingArea() > **hasTickingArea**(`identifier`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` #### Returns `boolean` #### Remarks Returns true if the identifier is already in the manager and false otherwise. 如果标识符已存在于管理器中,则返回 `true`,否则返回 `false`。 *** ### removeAllTickingAreas() > **removeAllTickingAreas**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Removes all ticking areas added by this manager. 移除此管理器添加的所有常加载区域。 #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### removeTickingArea() > **removeTickingArea**(`identifier`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` | [`TickingArea`](/server/interfaces/TickingArea.md) #### Returns `void` #### Remarks Removes specific ticking area by unique identifier. 通过唯一标识符移除特定的常加载区域。 #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [TickingAreaError](/server/classes/TickingAreaError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/Trigger.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/Trigger.md. # Class: Trigger **`Beta`** Represents a trigger for firing an event. 表示用于触发事件的触发器。 ## Constructors \{#constructors} ### Constructor \{#constructor} > **new Trigger**(`eventName`): `Trigger` **`Beta`** #### Parameters ##### eventName `string` #### Returns `Trigger` #### Remarks Creates a new trigger. 创建一个新的触发器。 ## Properties ### eventName > **eventName**: `string` **`Beta`** #### Remarks Event name of the trigger. 触发器的事件名称。 [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/TripWireTripAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/TripWireTripAfterEventSignal.md. # Class: TripWireTripAfterEventSignal event **`Beta`** Manages callbacks that are connected to when a trip wire is tripped. 管理与绊线被触发时相关的回调。 ## Example **tripWireTripEvent.ts** ```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 : '') ); } }); } ``` ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when a trip wire is tripped. 添加一个回调,当绊线被触发时调用。 *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when a trip wire is tripped. 移除一个在绊线被触发时调用的回调。 ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/UnloadedChunksError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/UnloadedChunksError.md. # Class: UnloadedChunksError error **`Beta`** Error thrown when the specified area contains one or more unloaded chunks. 当指定区域包含一个或多个未加载的区块时抛出的错误。 ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/WatchdogTerminateBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/WatchdogTerminateBeforeEvent.md. # Class: WatchdogTerminateBeforeEvent event **`Beta`** Contains information related to a script watchdog termination. 包含与脚本看门狗终止相关的信息。 ## Properties ### cancel > **cancel**: `boolean` **`Beta`** #### Remarks If set to true, cancels the termination of the script runtime. Note that depending on server configuration settings, cancellation of the termination may not be allowed. 如果设置为 `true`,取消脚本运行时的终止。请注意,根据服务器配置设置,可能不允许取消终止。 *** ### terminateReason > `readonly` **terminateReason**: [`WatchdogTerminateReason`](/server/enums/WatchdogTerminateReason.md) **`Beta`** #### Remarks Contains the reason why a script runtime is to be terminated. 包含脚本运行时将被终止的原因。 ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/WatchdogTerminateBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/WatchdogTerminateBeforeEventSignal.md. # Class: WatchdogTerminateBeforeEventSignal event **`Beta`** Manages callbacks that are connected to a callback that will be called when a script runtime is being terminated due to a violation of the performance watchdog system. 管理与回调连接的回调,当脚本运行时因违反性能看门狗系统而被终止时,将调用该回调。 ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip This closure is called with restricted-execution privilege. ::: :::tip 此闭包以受限执行权限调用。 ::: #### Returns :::tip Closure that is called with restricted-execution privilege. ::: :::tip 以受限执行权限调用的闭包。 ::: (`arg0`) => `void` #### Remarks Adds a callback that will be called when a script runtime is being terminated due to a violation of the performance watchdog system. 添加一个回调,当脚本运行时因违反性能看门狗系统而被终止时调用。 *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip This closure is called with restricted-execution privilege. ::: :::tip 此闭包以受限执行权限调用。 ::: #### Returns `void` #### Remarks Removes a callback from being called when a script runtime is being terminated due to a violation of the performance watchdog system. 移除一个在脚本运行时因违反性能看门狗系统而被终止时调用的回调。 ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/WeatherChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/WeatherChangeAfterEvent.md. # Class: WeatherChangeAfterEvent event **`Beta`** Contains information related to changes in weather in the environment. 包含与环境中天气变化相关的信息。 ## Properties ### dimension > `readonly` **dimension**: `string` **`Beta`** #### Remarks Dimension in which the weather has changed. 天气发生变化的维度。 *** ### newWeather > `readonly` **newWeather**: [`WeatherType`](/server/enums/WeatherType.md) **`Beta`** #### Remarks The weather type after the weather was changed. 天气变化后的天气类型。 *** ### previousWeather > `readonly` **previousWeather**: [`WeatherType`](/server/enums/WeatherType.md) **`Beta`** #### Remarks The weather type before the weather was changed. 天气变化前的天气类型。 ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/WeatherChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/WeatherChangeAfterEventSignal.md. # Class: WeatherChangeAfterEventSignal event **`Beta`** Manages callbacks that are connected to weather changing. 管理与天气变化相关的回调。 ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Adds a callback that will be called when weather changes. 添加一个回调,当天气变化时调用。 *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes a callback from being called when weather changes. 移除一个在天气变化时调用的回调。 ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/WeatherChangeBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/WeatherChangeBeforeEvent.md. # Class: WeatherChangeBeforeEvent event **`Beta`** Contains information related to changes in weather in the environment. 包含与环境中天气变化相关的信息。 ## Properties ### cancel > **cancel**: `boolean` **`Beta`** #### Remarks If set to true the weather change will be cancelled. 如果设置为 `true`,天气变化将被取消。 *** ### duration > **duration**: `number` **`Beta`** #### Remarks Sets the duration of the new weather (in ticks). 设置新天气的持续时间(以刻为单位)。 *** ### newWeather > **newWeather**: [`WeatherType`](/server/enums/WeatherType.md) **`Beta`** #### Remarks The type of weather that will be applied. 将应用的天气类型。 *** ### previousWeather > `readonly` **previousWeather**: [`WeatherType`](/server/enums/WeatherType.md) **`Beta`** #### Remarks The type of weather that it was prior to the event being fired. 事件触发之前的天气类型。 ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/WeatherChangeBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/WeatherChangeBeforeEventSignal.md. # Class: WeatherChangeBeforeEventSignal event **`Beta`** Manages callbacks that are connected to before weather changing. 管理与天气变化前相关的回调。 ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip This closure is called with restricted-execution privilege. ::: :::tip 此闭包以受限执行权限调用。 ::: #### Returns :::tip Closure that is called with restricted-execution privilege. ::: :::tip 以受限执行权限调用的闭包。 ::: (`arg0`) => `void` #### Remarks Adds a callback that will be called before weather changes. 添加一个回调,将在天气变化前调用。 *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip This closure is called with restricted-execution privilege. ::: :::tip 此闭包以受限执行权限调用。 ::: #### Returns `void` #### Remarks Removes a callback from being called before weather changes. 移除一个在天气变化前调用的回调。 ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/World.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/World.md. # Class: World world **`Beta`** 表示一个世界。包含了世界的各种状态,即一系列维度以及 Minecraft 的环境。 A class that wraps the state of a world - a set of dimensions and the environment of Minecraft. ## Properties ### afterEvents > `readonly` **afterEvents**: [`WorldAfterEvents`](/server/classes/WorldAfterEvents.md) **`Early Execution`** **`Beta`** #### Remarks 包含适用于整个世界的一组事件。事件回调以延迟方式调用,且以读写模式执行。 Contains a set of events that are applicable to the entirety of the world. Event callbacks are called in a deferred manner. Event callbacks are executed in read-write mode. *** ### allowCheats 实验性 > **allowCheats**: `boolean` **`Beta`** **`World Mutation`** #### Remarks 启用或禁用作弊功能。 Enables or disables cheats. *** ### beforeEvents > `readonly` **beforeEvents**: [`WorldBeforeEvents`](/server/classes/WorldBeforeEvents.md) **`Early Execution`** **`Beta`** #### Remarks :::tip 包含适用于整个世界的一组事件。事件回调以立即方式调用,且以只读模式执行。 ::: :::tip Contains a set of events that are applicable to the entirety of the world. Event callbacks are called immediately. Event callbacks are executed in read-only mode. ::: #### Example **customCommand.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function customCommand(targetLocation: DimensionLocation) { const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => { if (eventData.message.includes('cancel')) { // Cancel event if the message contains "cancel" eventData.cancel = true; } else { const args = eventData.message.split(' '); if (args.length > 0) { switch (args[0].toLowerCase()) { case 'echo': // Send a modified version of chat message world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`); break; case 'help': world.sendMessage(`Available commands: echo `); break; } } } }); } ``` *** ### gameRules > `readonly` **gameRules**: [`GameRules`](/server/classes/GameRules.md) **`Beta`** #### Remarks 适用于该世界的游戏规则。 The game rules that apply to the world. *** ### isHardcore > `readonly` **isHardcore**: `boolean` **`Beta`** *** ### primitiveShapesManager > `readonly` **primitiveShapesManager**: [`PrimitiveShapesManager`](/server/classes/PrimitiveShapesManager.md) **`Beta`** #### Remarks 用于在世界中添加和移除原始文本对象的管理器。 Manager for adding and removing primitive text objects in the world. *** ### scoreboard > `readonly` **scoreboard**: [`Scoreboard`](/server/classes/Scoreboard.md) **`Beta`** #### Remarks 全局的、唯一的记分板对象。 Returns the general global scoreboard that applies to the world. *** ### seed > `readonly` **seed**: `string` **`Beta`** #### Remarks 世界的种子。 The world seed. *** ### soundDefinitionRegistry 实验性 > `readonly` **soundDefinitionRegistry**: [`SoundDefinitionRegistry`](/server/classes/SoundDefinitionRegistry.md) **`Beta`** #### Remarks 提供对当前世界已加载的声音定义的只读访问。 Provides read-only access to the sound definitions loaded for this world. *** ### structureManager > `readonly` **structureManager**: [`StructureManager`](/server/classes/StructureManager.md) **`Beta`** #### Remarks 返回与 [Structure](/server/classes/Structure.md) 相关 API 的管理器。 Returns the manager for [Structure](/server/classes/Structure.md) related APIs. *** ### tickingAreaManager > `readonly` **tickingAreaManager**: [`TickingAreaManager`](/server/classes/TickingAreaManager.md) **`Beta`** #### Remarks 用于添加、移除和查询资源包专用的常加载区域的管理器。 Manager for adding, removing and querying pack specific ticking areas. ## Methods ### broadcastClientMessage() > **broadcastClientMessage**(`id`, `value`): `void` **`Beta`** **`World Mutation`** #### Parameters ##### id `string` 消息的标识符。 The message identifier. ##### value `string` 消息内容。 The message. #### Returns `void` #### Remarks 一个仅供内部使用的方法,用于在客户端与服务端之间广播特定消息。 A method that is internal-only, used for broadcasting specific messages between client and server. *** ### clearDynamicProperties() > **clearDynamicProperties**(): `void` **`Beta`** #### Returns `void` #### Remarks 清除该行为包在世界中所声明的一组动态属性。 Clears the set of dynamic properties declared for this behavior pack within the world. *** ### getAbsoluteTime() > **getAbsoluteTime**(): `number` **`Beta`** #### Returns `number` 自游戏开始以来流逝的时间,以刻为单位。 #### Remarks 获取自游戏开始以来流逝的时间(计算公式:`day*24000+daytime`)。 时间的流逝受到游戏规则 `dodaylightcycle` 的影响。 Returns the absolute time since the start of the world. *** ### getAimAssist() > **getAimAssist**(): [`AimAssistRegistry`](/server/classes/AimAssistRegistry.md) **`Beta`** #### Returns [`AimAssistRegistry`](/server/classes/AimAssistRegistry.md) #### Remarks 该世界中可用的瞄准辅助预设与类别。 The aim-assist presets and categories that can be used in the world. *** ### getAllPlayers() > **getAllPlayers**(): [`Player`](/server/classes/Player.md)\[] **`Beta`** #### Returns [`Player`](/server/classes/Player.md)\[] 返回包含了游戏中所有玩家的对象的数组。 #### Remarks 获取一个包含了游戏中所有玩家的对象的数组。 Returns an array of all active players within the world. #### Throws This function can throw errors. [CommandError](/server/classes/CommandError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### getDay() > **getDay**(): `number` **`Beta`** #### Returns `number` 当前天数,由世界时间除以每天的刻数得出。新世界的天数为 0。 The current day, determined by the world time divided by the number of ticks per day. New worlds start at day 0. #### Remarks 返回当前天数。 Returns the current day. *** ### getDefaultSpawnLocation() > **getDefaultSpawnLocation**(): [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Returns [`Vector3`](/server/interfaces/Vector3.md) 主世界默认的出生点位置。默认情况下 Y 坐标为 32767,表示玩家出生高度不固定,将由周围方块决定。 The default Overworld spawn location. By default, the Y coordinate is 32767, indicating a player's spawn height is not fixed and will be determined by surrounding blocks. #### Remarks 返回主世界默认的出生点位置。 Returns the default Overworld spawn location. *** ### getDifficulty() > **getDifficulty**(): [`Difficulty`](/server/enums/Difficulty.md) **`Beta`** #### Returns [`Difficulty`](/server/enums/Difficulty.md) 返回世界难度。 Returns the world difficulty. #### Remarks 从世界中获取难度。 Gets the difficulty from the world. *** ### getDimension() > **getDimension**(`dimensionId`): [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Parameters ##### dimensionId `string` 要获取的维度的标识符。 The name of the dimension. For example, "overworld", "nether" or "the\_end". #### Returns [`Dimension`](/server/classes/Dimension.md) 与 `dimensionId` 关联的维度对象。 The requested dimension #### Remarks 由 `dimensionId` 获取维度对象。 Returns a dimension object. #### Throws 若 `dimensionId` 不与任何维度关联,抛出 `"Dimension '' is invalid"`。 Throws if the given dimension name is invalid *** ### getDynamicProperty() > **getDynamicProperty**(`identifier`): `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` **`Beta`** #### Parameters ##### identifier `string` 动态属性的标识符。 The property identifier. #### Returns `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined` 返回动态属性 `identifier` 的值。属性的值尚未设定时,返回 `undefined`。 Returns the value for the property, or undefined if the property has not been set. #### Remarks 获取由 `identifier` 指定的世界中已定义的动态属性的值。 Returns a property value. #### Throws 若并未注册以 `identifier` 为标识符的动态属性,抛出 `"Dynamic Property '' is not defined"` 。 Throws if the given dynamic property identifier is not defined. #### Examples **incrementDynamicProperty.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function incrementDynamicProperty(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { let number = world.getDynamicProperty('samplelibrary:number'); log('Current value is: ' + number); if (number === undefined) { number = 0; } if (typeof number !== 'number') { log('Number is of an unexpected type.'); return -1; } world.setDynamicProperty('samplelibrary:number', number + 1); } ``` **incrementDynamicPropertyInJsonBlob.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function incrementDynamicPropertyInJsonBlob( log: (message: string, status?: number) => void, targetLocation: DimensionLocation ) { let paintStr = world.getDynamicProperty('samplelibrary:longerjson'); let paint: { color: string; intensity: number } | undefined = undefined; log('Current value is: ' + paintStr); if (paintStr === undefined) { paint = { color: 'purple', intensity: 0, }; } else { if (typeof paintStr !== 'string') { log('Paint is of an unexpected type.'); return -1; } try { paint = JSON.parse(paintStr); } catch (e) { log('Error parsing serialized struct.'); return -1; } } if (!paint) { log('Error parsing serialized struct.'); return -1; } paint.intensity++; paintStr = JSON.stringify(paint); // be very careful to ensure your serialized JSON str cannot exceed limits world.setDynamicProperty('samplelibrary:longerjson', paintStr); } ``` *** ### getDynamicPropertyIds() > **getDynamicPropertyIds**(): `string`\[] **`Beta`** #### Returns `string`\[] 处于活跃状态的动态属性标识符的字符串数组。 A string array of active dynamic property identifiers. #### Remarks 获取在世界中已设置的动态属性标识符集合。 Gets a set of dynamic property identifiers that have been set in this world. *** ### getDynamicPropertyTotalByteCount() > **getDynamicPropertyTotalByteCount**(): `number` **`Beta`** #### Returns `number` #### Remarks 获取动态属性的总字节数。可用于自行分析,确保不会存储过大的动态属性集合。 Gets the total byte count of dynamic properties. This could potentially be used for your own analytics to ensure you're not storing gigantic sets of dynamic properties. *** ### getEntity() > **getEntity**(`id`): [`Entity`](/server/classes/Entity.md) | `undefined` **`Beta`** #### Parameters ##### id `string` 实体的 id。 The id of the entity. #### Returns [`Entity`](/server/classes/Entity.md) | `undefined` 所请求的实体对象。 The requested entity object. #### Remarks 根据提供的 id 获取实体。 Returns an entity based on the provided id. #### Throws 若提供的实体 id 无效,则抛出错误。 Throws if the given entity id is invalid. *** ### getLootTableManager() > **getLootTableManager**(): [`LootTableManager`](/server/classes/LootTableManager.md) **`Beta`** #### Returns [`LootTableManager`](/server/classes/LootTableManager.md) 一个包含多种战利品生成方法的战利品表管理器。 A loot table manager with a variety of loot generation methods. #### Remarks 返回一个可从各种来源生成战利品的管理器。 Returns a manager capable of generating loot from an assortment of sources. *** ### getMoonPhase() > **getMoonPhase**(): [`MoonPhase`](/server/enums/MoonPhase.md) **`Beta`** #### Returns [`MoonPhase`](/server/enums/MoonPhase.md) #### Remarks 返回当前时间的月相(MoonPhase)。 Returns the MoonPhase for the current time. *** ### getPackSettings() > **getPackSettings**(): `Record`\<`string`, `boolean` | `number` | `string`> **`Early Execution`** **`Beta`** #### Returns `Record`\<`string`, `boolean` | `number` | `string`> #### Remarks 返回由资源包设置项的名称和值构成的映射。 Returns a map of pack setting name and value pairs. *** ### getPlayers() > **getPlayers**(`options?`): [`Player`](/server/classes/Player.md)\[] **`Beta`** #### Parameters ##### options? [`EntityQueryOptions`](/server/interfaces/EntityQueryOptions.md) 可选的参数,用作于筛选指定条件的玩家。 注意,不能使用接口中的 `type`、`location`、`maxDistance`、`minDistance` 或 `volume` 属性。 Additional options that can be used to filter the set of players returned. #### Returns [`Player`](/server/classes/Player.md)\[] A player array. #### Remarks 列出世界上的玩家,可使用 `options` 指定的实体查询选项对其进行筛选。 Returns a set of players based on a set of conditions defined via the EntityQueryOptions set of filter criteria. #### Throws 若向 `options` 传入的对象含有 `type` 属性,抛出 `"command.generic.invalidPlayerType"`。 若向 `options` 传入的对象含有 `location`、`maxDistance`、`minDistance` 或 `volume` 属性,抛出 `"EntityQueryOptions property '' is incompatible with function world.getPlayers"`。 Throws if the provided EntityQueryOptions are invalid. [CommandError](/server/classes/CommandError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### getTimeOfDay() > **getTimeOfDay**(): `number` **`Beta`** #### Returns `number` 当前一天中的时间,以刻为单位,为 `0` 至 `24000` 之间的整数。 The time of day, in ticks, between 0 and 24000. #### Remarks 返回当前一天中的时间。 Returns the time of day. *** ### playMusic() > **playMusic**(`trackId`, `musicOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### trackId `string` 声音项目的标识符,要求声音项目的类别为音乐(`category: music`)。 ##### musicOptions? [`MusicOptions`](/server/interfaces/MusicOptions.md) 可选,指定播放音乐使用的附加参数。 #### Returns `void` #### Remarks 停止正在播放的音乐,并开始向玩家播放指定音乐。播放类别不为音乐的声音项目不会有任何效果。 Plays a particular music track for all players. #### Throws This function can throw errors. [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError.md) #### Example **playMusicAndSound.ts** ```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); } ``` *** ### queueMusic() > **queueMusic**(`trackId`, `musicOptions?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### trackId `string` 声音项目的标识符,要求声音项目的类别为音乐(`category: music`)。 Identifier of the music track to play. ##### musicOptions? [`MusicOptions`](/server/interfaces/MusicOptions.md) 可选,指定播放音乐使用的附加参数。 Additional options for the music track. #### Returns `void` #### Remarks 将音乐添加到播放列表。如果没有任何正在播放的音乐,将会开始播放音乐。播放列表中的音乐将会按照添加顺序播放(需要更多测试)。 Queues an additional music track for players. If a track is not playing, a music track will play. #### Throws An error will be thrown if volume is less than 0.0. An error will be thrown if fade is less than 0.0. [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError.md) *** ### sendMessage() > **sendMessage**(`message`): `void` **`Beta`** #### Parameters ##### message `string` | [`RawMessage`](/server/interfaces/RawMessage.md) | (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[] 将要广播的一段消息。 这段消息可能是一段字符串,或者符合 `RawMessage` 接口的对象,或是这两种类型的组合。 The message to be displayed. #### Returns `void` #### Remarks 向所有玩家广播一条消息。 Sends a message to all players. #### Throws 该方法在 `message` 格式不正确时会抛出错误。例如 `score` 的 `name` 为空字符串时。 This method can throw if the provided [RawMessage](/server/interfaces/RawMessage.md) is in an invalid format. For example, if an empty `name` string is provided to `score`. *** ### setAbsoluteTime() > **setAbsoluteTime**(`absoluteTime`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### absoluteTime `number` 世界时间,以刻为单位。 The world time, in ticks. #### Returns `void` #### Remarks 设置世界时间。 Sets the world time. *** ### setDefaultSpawnLocation() > **setDefaultSpawnLocation**(`spawnLocation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### spawnLocation [`Vector3`](/server/interfaces/Vector3.md) 出生点的位置。注意假定其位于主世界(overworld)中。 Location of the spawn point. Note that this is assumed to be within the overworld dimension. #### Returns `void` #### Remarks 为所有玩家设置一个默认出生点位置。 Sets a default spawn location for all players. #### Throws 若提供的出生点位置超出世界边界,则抛出错误。 Throws if the provided spawn location is out of bounds. Error [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) *** ### setDifficulty() > **setDifficulty**(`difficulty`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### difficulty [`Difficulty`](/server/enums/Difficulty.md) 想要设置的世界难度。 The difficulty we want to set the world to. #### Returns `void` #### Remarks 设置世界难度。 Sets the worlds difficulty. *** ### setDynamicProperties() > **setDynamicProperties**(`values`): `void` **`Beta`** #### Parameters ##### values `Record`\<`string`, `boolean` | `number` | `string` | [`Vector3`](/server/interfaces/Vector3.md) | `undefined`> 由键值对组成的记录,每个条目对应一个动态属性。若数据值为 null,则会移除该属性。 A Record of key value pairs of the dynamic properties to set. If the data value is null, it will remove that property instead. #### Returns `void` #### Remarks 同时设置多个动态属性为指定值。 Sets multiple dynamic properties with specific values. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) *** ### setDynamicProperty() > **setDynamicProperty**(`identifier`, `value?`): `void` **`Beta`** #### Parameters ##### identifier `string` 动态属性的标识符。 The property identifier. ##### value? `string` | `number` | `boolean` | [`Vector3`](/server/interfaces/Vector3.md) 要设定的值,值的类型必须与动态属性注册的类型相同。若值为 null,该属性将被移除。 Data value of the property to set. If the value is null, it will remove the property instead. #### Returns `void` #### Remarks 为世界动态属性 `identifier` 设置一个值。 Sets a specified property to a value. #### Throws 若并未注册以 `identifier` 为标识符的动态属性,抛出 `"Dynamic Property '' is not defined"`。 若动态属性的类型不符合值的类型,抛出 `"Type mismatch for dynamic property ''"`。 若动态属性的类型为字符串,且值在使用 UTF-8 编码后的字节长度大于动态属性所允许的最大长度,抛出 `"Maximum string length exceeded (/) for dynamic property ''"`。 Throws if the given dynamic property identifier is not defined. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) #### Examples **incrementDynamicProperty.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function incrementDynamicProperty(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { let number = world.getDynamicProperty('samplelibrary:number'); log('Current value is: ' + number); if (number === undefined) { number = 0; } if (typeof number !== 'number') { log('Number is of an unexpected type.'); return -1; } world.setDynamicProperty('samplelibrary:number', number + 1); } ``` **incrementDynamicPropertyInJsonBlob.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function incrementDynamicPropertyInJsonBlob( log: (message: string, status?: number) => void, targetLocation: DimensionLocation ) { let paintStr = world.getDynamicProperty('samplelibrary:longerjson'); let paint: { color: string; intensity: number } | undefined = undefined; log('Current value is: ' + paintStr); if (paintStr === undefined) { paint = { color: 'purple', intensity: 0, }; } else { if (typeof paintStr !== 'string') { log('Paint is of an unexpected type.'); return -1; } try { paint = JSON.parse(paintStr); } catch (e) { log('Error parsing serialized struct.'); return -1; } } if (!paint) { log('Error parsing serialized struct.'); return -1; } paint.intensity++; paintStr = JSON.stringify(paint); // be very careful to ensure your serialized JSON str cannot exceed limits world.setDynamicProperty('samplelibrary:longerjson', paintStr); } ``` *** ### setTimeOfDay() > **setTimeOfDay**(`timeOfDay`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### timeOfDay `number` 一天内的时间,以刻为单位,介于 0 至 24000 之间。 The time of day, in ticks, between 0 and 24000. #### Returns `void` #### Remarks 设置一天内的时间。 Sets the time of day. #### Throws 若提供的一天内的时间不在有效范围内,则抛出错误。 Throws if the provided time of day is not within the valid range. *** ### stopMusic() > **stopMusic**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 停止客户端中正在播放的所有音乐曲目(需要更多测试)。 Stops any music tracks from playing. ## 同领域相关 - [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) - [WorldAfterEvents](/server/classes/WorldAfterEvents.md) - [WorldBeforeEvents](/server/classes/WorldBeforeEvents.md) - [WorldLoadAfterEvent](/server/classes/WorldLoadAfterEvent.md) - [WorldLoadAfterEventSignal](/server/classes/WorldLoadAfterEventSignal.md) - [WorldSoundOptions](/server/interfaces/WorldSoundOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/WorldAfterEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/WorldAfterEvents.md. # Class: WorldAfterEvents event world **`Beta`** Contains a set of events that are available across the scope of the World. 包含一组在世界范围内可用的事件。 ## Properties ### blockContainerClosed > `readonly` **blockContainerClosed**: [`BlockContainerClosedAfterEventSignal`](/server/classes/BlockContainerClosedAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a block container is closed. 此事件在方块容器关闭时触发。 *** ### blockContainerOpened > `readonly` **blockContainerOpened**: [`BlockContainerOpenedAfterEventSignal`](/server/classes/BlockContainerOpenedAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a block container is opened. 此事件在方块容器打开时触发。 *** ### blockExplode > `readonly` **blockExplode**: [`BlockExplodeAfterEventSignal`](/server/classes/BlockExplodeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires for each BlockLocation destroyed by an explosion. It is fired after the blocks have already been destroyed. 此事件针对爆炸摧毁的每个方块位置触发。该事件在方块已被摧毁后触发。 *** ### buttonPush > `readonly` **buttonPush**: [`ButtonPushAfterEventSignal`](/server/classes/ButtonPushAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a button is pushed. 此事件在按钮被按下时触发。 *** ### chatSend 实验性 > `readonly` **chatSend**: [`ChatSendAfterEventSignal`](/server/classes/ChatSendAfterEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks This event is triggered after a chat message has been broadcast or sent to players. 此事件在聊天消息已广播或发送给玩家后触发。 *** ### dataDrivenEntityTrigger > `readonly` **dataDrivenEntityTrigger**: [`DataDrivenEntityTriggerAfterEventSignal`](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event is fired when an entity event has been triggered that will update the component definition state of an entity. 此事件在已触发将更新实体组件定义状态的实体事件时触发。 *** ### effectAdd > `readonly` **effectAdd**: [`EffectAddAfterEventSignal`](/server/classes/EffectAddAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an effect, like poisoning, is added to an entity. 此事件在效果(如中毒)被添加到实体时触发。 *** ### entityContainerClosed > `readonly` **entityContainerClosed**: [`EntityContainerClosedAfterEventSignal`](/server/classes/EntityContainerClosedAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an entity container is closed. 此事件在实体容器关闭时触发。 *** ### entityContainerOpened > `readonly` **entityContainerOpened**: [`EntityContainerOpenedAfterEventSignal`](/server/classes/EntityContainerOpenedAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an entity container is opened. 此事件在实体容器打开时触发。 *** ### entityDie > `readonly` **entityDie**: [`EntityDieAfterEventSignal`](/server/classes/EntityDieAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an entity dies. 此事件在实体死亡时触发。 *** ### entityHeal > `readonly` **entityHeal**: [`EntityHealAfterEventSignal`](/server/classes/EntityHealAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### entityHealthChanged > `readonly` **entityHealthChanged**: [`EntityHealthChangedAfterEventSignal`](/server/classes/EntityHealthChangedAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when entity health changes in any degree. 此事件在实体生命值发生任何程度的变化时触发。 *** ### entityHitBlock > `readonly` **entityHitBlock**: [`EntityHitBlockAfterEventSignal`](/server/classes/EntityHitBlockAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an entity hits (that is, melee attacks) a block. 此事件在实体击打(即近战攻击)方块时触发。 *** ### entityHitEntity > `readonly` **entityHitEntity**: [`EntityHitEntityAfterEventSignal`](/server/classes/EntityHitEntityAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an entity hits (that is, melee attacks) another entity. 此事件在实体击打(即近战攻击)另一个实体时触发。 *** ### entityHurt > `readonly` **entityHurt**: [`EntityHurtAfterEventSignal`](/server/classes/EntityHurtAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an entity is hurt (takes damage). 此事件在实体受伤(受到伤害)时触发。 *** ### entityItemDrop > `readonly` **entityItemDrop**: [`EntityItemDropAfterEventSignal`](/server/classes/EntityItemDropAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an entity drops items. 此事件在实体掉落物品时触发。 *** ### entityItemPickup > `readonly` **entityItemPickup**: [`EntityItemPickupAfterEventSignal`](/server/classes/EntityItemPickupAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an entity picks up items. 此事件在实体拾取物品时触发。 *** ### entityLoad > `readonly` **entityLoad**: [`EntityLoadAfterEventSignal`](/server/classes/EntityLoadAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks Fires when an entity is loaded. 此事件在实体加载时触发。 *** ### entityRemove > `readonly` **entityRemove**: [`EntityRemoveAfterEventSignal`](/server/classes/EntityRemoveAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks Fires when an entity is removed (for example, potentially unloaded, or removed after being killed). 此事件在实体被移除时触发(例如,可能被卸载,或在被击杀后被移除)。 *** ### entitySpawn > `readonly` **entitySpawn**: [`EntitySpawnAfterEventSignal`](/server/classes/EntitySpawnAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an entity is spawned. 此事件在实体生成时触发。 *** ### entityStartSneaking 实验性 > `readonly` **entityStartSneaking**: [`EntityStartSneakingAfterEventSignal`](/server/classes/EntityStartSneakingAfterEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks This event fires when an entity starts sneaking. 此事件在实体开始潜行时触发。 *** ### entityStopSneaking 实验性 > `readonly` **entityStopSneaking**: [`EntityStopSneakingAfterEventSignal`](/server/classes/EntityStopSneakingAfterEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks This event fires when an entity stops sneaking. 此事件在实体停止潜行时触发。 *** ### entityTamed 实验性 > `readonly` **entityTamed**: [`EntityTamedAfterEventSignal`](/server/classes/EntityTamedAfterEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks This event fires when an entity is tamed. 此事件在实体被驯服时触发。 *** ### entityUpgrade > `readonly` **entityUpgrade**: [`EntityUpgradeAfterEventSignal`](/server/classes/EntityUpgradeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### explosion > `readonly` **explosion**: [`ExplosionAfterEventSignal`](/server/classes/ExplosionAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event is fired after an explosion occurs. 此事件在爆炸发生后触发。 *** ### gameRuleChange > `readonly` **gameRuleChange**: [`GameRuleChangeAfterEventSignal`](/server/classes/GameRuleChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a world.gameRules property has changed. 此事件在 `world.gameRules` 属性发生更改时触发。 *** ### itemCompleteUse > `readonly` **itemCompleteUse**: [`ItemCompleteUseAfterEventSignal`](/server/classes/ItemCompleteUseAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a chargeable item completes charging. 此事件在可充能物品完成充能时触发。 *** ### itemReleaseUse > `readonly` **itemReleaseUse**: [`ItemReleaseUseAfterEventSignal`](/server/classes/ItemReleaseUseAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a chargeable item is released from charging. 此事件在可充能物品从充能状态释放时触发。 *** ### itemStartUse > `readonly` **itemStartUse**: [`ItemStartUseAfterEventSignal`](/server/classes/ItemStartUseAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a chargeable item starts charging. 此事件在可充能物品开始充能时触发。 *** ### itemStartUseOn > `readonly` **itemStartUseOn**: [`ItemStartUseOnAfterEventSignal`](/server/classes/ItemStartUseOnAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a player successfully uses an item or places a block by pressing the Use Item / Place Block button. If multiple blocks are placed, this event will only occur once at the beginning of the block placement. Note: This event cannot be used with Hoe or Axe items. 此事件在玩家通过按下使用物品/放置方块按钮成功使用物品或放置方块时触发。如果放置了多个方块,此事件将仅在方块放置开始时触发一次。注意:此事件不能与锄或斧类物品一起使用。 *** ### itemStopUse > `readonly` **itemStopUse**: [`ItemStopUseAfterEventSignal`](/server/classes/ItemStopUseAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a chargeable item stops charging. 此事件在可充能物品停止充能时触发。 *** ### itemStopUseOn > `readonly` **itemStopUseOn**: [`ItemStopUseOnAfterEventSignal`](/server/classes/ItemStopUseOnAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a player releases the Use Item / Place Block button after successfully using an item. Note: This event cannot be used with Hoe or Axe items. 此事件在玩家成功使用物品后松开使用物品/放置方块按钮时触发。注意:此事件不能与锄或斧类物品一起使用。 *** ### itemUse > `readonly` **itemUse**: [`ItemUseAfterEventSignal`](/server/classes/ItemUseAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an item is successfully used by a player. 此事件在物品被玩家成功使用时触发。 *** ### leverAction > `readonly` **leverAction**: [`LeverActionAfterEventSignal`](/server/classes/LeverActionAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks A lever has been pulled. 拉杆已被拉动。 *** ### messageReceive 实验性 > `readonly` **messageReceive**: [`ServerMessageAfterEventSignal`](/server/classes/ServerMessageAfterEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks This event is an internal implementation detail, and is otherwise not currently functional. 此事件是一个内部实现细节,目前不具备其他功能。 *** ### packSettingChange 实验性 > `readonly` **packSettingChange**: [`PackSettingChangeAfterEventSignal`](/server/classes/PackSettingChangeAfterEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks This event is triggered when a pack setting is changed. 此事件在包设置发生更改时触发。 *** ### pistonActivate > `readonly` **pistonActivate**: [`PistonActivateAfterEventSignal`](/server/classes/PistonActivateAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a piston expands or retracts. 此事件在活塞伸出或缩回时触发。 *** ### playerBreakBlock > `readonly` **playerBreakBlock**: [`PlayerBreakBlockAfterEventSignal`](/server/classes/PlayerBreakBlockAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires for a block that is broken by a player. 此事件针对玩家破坏的方块触发。 *** ### playerButtonInput > `readonly` **playerButtonInput**: [`PlayerButtonInputAfterEventSignal`](/server/classes/PlayerButtonInputAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an [InputButton](/server/enums/InputButton.md) state is changed. 此事件在 [InputButton](/server/enums/InputButton.md) 状态发生更改时触发。 *** ### playerCancelBreakingBlock > `readonly` **playerCancelBreakingBlock**: [`PlayerCancelBreakingBlockAfterEventSignal`](/server/classes/PlayerCancelBreakingBlockAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Preview #### Remarks This event fires when a player cancels breaking a block. 此事件在玩家取消破坏方块时触发。 *** ### playerDimensionChange > `readonly` **playerDimensionChange**: [`PlayerDimensionChangeAfterEventSignal`](/server/classes/PlayerDimensionChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks Fires when a player moved to a different dimension. 此事件在玩家移动到不同维度时触发。 *** ### playerEmote > `readonly` **playerEmote**: [`PlayerEmoteAfterEventSignal`](/server/classes/PlayerEmoteAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### playerGameModeChange > `readonly` **playerGameModeChange**: [`PlayerGameModeChangeAfterEventSignal`](/server/classes/PlayerGameModeChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### playerHotbarSelectedSlotChange > `readonly` **playerHotbarSelectedSlotChange**: [`PlayerHotbarSelectedSlotChangeAfterEventSignal`](/server/classes/PlayerHotbarSelectedSlotChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a player's selected slot changes. 此事件在玩家选中的槽位发生更改时触发。 *** ### playerInputModeChange > `readonly` **playerInputModeChange**: [`PlayerInputModeChangeAfterEventSignal`](/server/classes/PlayerInputModeChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a player's [InputMode](/server/enums/InputMode.md) changes. 此事件在玩家的 [InputMode](/server/enums/InputMode.md) 发生更改时触发。 *** ### playerInputPermissionCategoryChange > `readonly` **playerInputPermissionCategoryChange**: [`PlayerInputPermissionCategoryChangeAfterEventSignal`](/server/classes/PlayerInputPermissionCategoryChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a players input permissions change. 此事件在玩家的输入权限发生更改时触发。 *** ### playerInteractWithBlock > `readonly` **playerInteractWithBlock**: [`PlayerInteractWithBlockAfterEventSignal`](/server/classes/PlayerInteractWithBlockAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks An event for when a player interacts with a block. 玩家与方块交互时的事件。 *** ### playerInteractWithEntity > `readonly` **playerInteractWithEntity**: [`PlayerInteractWithEntityAfterEventSignal`](/server/classes/PlayerInteractWithEntityAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a player interacts with an entity. 此事件在玩家与实体交互时触发。 *** ### playerInventoryItemChange > `readonly` **playerInventoryItemChange**: [`PlayerInventoryItemChangeAfterEventSignal`](/server/classes/PlayerInventoryItemChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when an item gets added or removed to the player's inventory. 此事件在物品被添加到玩家物品栏或从玩家物品栏移除时触发。 *** ### playerJoin > `readonly` **playerJoin**: [`PlayerJoinAfterEventSignal`](/server/classes/PlayerJoinAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a player joins a world. See also playerSpawn for another related event you can trap for when a player is spawned the first time within a world. 此事件在玩家加入世界时触发。另请参阅 `playerSpawn`,了解另一个相关事件,可用于捕获玩家首次在世界中生成的情况。 *** ### playerLeave > `readonly` **playerLeave**: [`PlayerLeaveAfterEventSignal`](/server/classes/PlayerLeaveAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a player leaves a world. 此事件在玩家离开世界时触发。 *** ### playerPlaceBlock > `readonly` **playerPlaceBlock**: [`PlayerPlaceBlockAfterEventSignal`](/server/classes/PlayerPlaceBlockAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires for a block that is placed by a player. 此事件针对玩家放置的方块触发。 *** ### playerSpawn > `readonly` **playerSpawn**: [`PlayerSpawnAfterEventSignal`](/server/classes/PlayerSpawnAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a player spawns or respawns. Note that an additional flag within this event will tell you whether the player is spawning right after join vs. a respawn. 此事件在玩家生成或重生时触发。请注意,此事件中的一个额外标志将告诉你玩家是加入后立即生成还是重生。 *** ### playerStartBreakingBlock > `readonly` **playerStartBreakingBlock**: [`PlayerStartBreakingBlockAfterEventSignal`](/server/classes/PlayerStartBreakingBlockAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Preview #### Remarks This event fires when a player starts breaking a block. 此事件在玩家开始破坏方块时触发。 *** ### playerSwingStart > `readonly` **playerSwingStart**: [`PlayerSwingStartAfterEventSignal`](/server/classes/PlayerSwingStartAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### playerUseNameTag 实验性 > `readonly` **playerUseNameTag**: [`PlayerUseNameTagAfterEventSignal`](/server/classes/PlayerUseNameTagAfterEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks An event for when a player uses a named name tag on an entity. 玩家在实体上使用已命名的命名牌时的事件。 *** ### pressurePlatePop > `readonly` **pressurePlatePop**: [`PressurePlatePopAfterEventSignal`](/server/classes/PressurePlatePopAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks A pressure plate has popped back up (i.e., there are no entities on the pressure plate.) 压力板已弹起(即压力板上没有任何实体)。 *** ### pressurePlatePush > `readonly` **pressurePlatePush**: [`PressurePlatePushAfterEventSignal`](/server/classes/PressurePlatePushAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks A pressure plate has pushed (at least one entity has moved onto a pressure plate.) 压力板已被压下(至少有一个实体移动到了压力板上)。 *** ### projectileHitBlock > `readonly` **projectileHitBlock**: [`ProjectileHitBlockAfterEventSignal`](/server/classes/ProjectileHitBlockAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a projectile hits a block. 此事件在抛射物击中方块时触发。 *** ### projectileHitEntity > `readonly` **projectileHitEntity**: [`ProjectileHitEntityAfterEventSignal`](/server/classes/ProjectileHitEntityAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event fires when a projectile hits an entity. 此事件在抛射物击中实体时触发。 *** ### soundCompleted 实验性 > `readonly` **soundCompleted**: [`SoundCompletedAfterEventSignal`](/server/classes/SoundCompletedAfterEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks A tracked sound's declared duration elapsed. 已跟踪的声明的持续时间已过去。 *** ### targetBlockHit > `readonly` **targetBlockHit**: [`TargetBlockHitAfterEventSignal`](/server/classes/TargetBlockHitAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks A target block was hit. 标靶方块已被击中。 *** ### tripWireTrip > `readonly` **tripWireTrip**: [`TripWireTripAfterEventSignal`](/server/classes/TripWireTripAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks A trip wire was tripped. 绊线已被触发。 *** ### weatherChange > `readonly` **weatherChange**: [`WeatherChangeAfterEventSignal`](/server/classes/WeatherChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event will be triggered when the weather changes within Minecraft. 此事件将在 Minecraft 内天气变化时触发。 *** ### worldLoad > `readonly` **worldLoad**: [`WorldLoadAfterEventSignal`](/server/classes/WorldLoadAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks ## 同领域相关 - [WorldBeforeEvents](/server/classes/WorldBeforeEvents.md) - [WorldLoadAfterEvent](/server/classes/WorldLoadAfterEvent.md) - [WorldLoadAfterEventSignal](/server/classes/WorldLoadAfterEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/WorldBeforeEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/WorldBeforeEvents.md. # Class: WorldBeforeEvents event world **`Beta`** 表示一系列触发于实际动作发生之前的事件。通常来说,即将触发的事件可被修改或取消。 但请注意,在 before 类事件过程中,能够改变游戏状态的 API 将失效,试图调用将会抛出错误。 (例如:dimension.spawnEntity) A set of events that fire before an actual action occurs. In most cases, you can potentially cancel or modify the impending event. Note that in before events any APIs that modify gameplay state will not function and will throw an error. (e.g., dimension.spawnEntity) ## Properties ### chatSend 实验性 > `readonly` **chatSend**: [`ChatSendBeforeEventSignal`](/server/classes/ChatSendBeforeEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks 此事件在聊天消息被广播或发送给玩家之后触发。 This event is triggered after a chat message has been broadcast or sent to players. #### Example **customCommand.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function customCommand(targetLocation: DimensionLocation) { const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => { if (eventData.message.includes('cancel')) { // Cancel event if the message contains "cancel" eventData.cancel = true; } else { const args = eventData.message.split(' '); if (args.length > 0) { switch (args[0].toLowerCase()) { case 'echo': // Send a modified version of chat message world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`); break; case 'help': world.sendMessage(`Available commands: echo `); break; } } } }); } ``` *** ### effectAdd > `readonly` **effectAdd**: [`EffectAddBeforeEventSignal`](/server/classes/EffectAddBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks 此事件在某个效果被添加到实体之后触发。 This event is triggered after an event has been added to an entity. *** ### entityHeal > `readonly` **entityHeal**: [`EntityHealBeforeEventSignal`](/server/classes/EntityHealBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### entityHurt > `readonly` **entityHurt**: [`EntityHurtBeforeEventSignal`](/server/classes/EntityHurtBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### entityItemPickup > `readonly` **entityItemPickup**: [`EntityItemPickupBeforeEventSignal`](/server/classes/EntityItemPickupBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks 此事件在实体被拾取物品之前触发。 This event fires before an entity picks up an item. *** ### entityRemove > `readonly` **entityRemove**: [`EntityRemoveBeforeEventSignal`](/server/classes/EntityRemoveBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks 在实体从世界中被移除之前触发(例如,被卸载或在被杀死后被 移除)。 Fires before an entity is removed from the world (for example, unloaded or removed after being killed.) *** ### entityTamed 实验性 > `readonly` **entityTamed**: [`EntityTamedBeforeEventSignal`](/server/classes/EntityTamedBeforeEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks 在实体被驯服之前触发。 Fires before an entity is tamed. *** ### explosion > `readonly` **explosion**: [`ExplosionBeforeEventSignal`](/server/classes/ExplosionBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks 此事件在爆炸发生之后触发。 This event is fired after an explosion occurs. *** ### itemUse > `readonly` **itemUse**: [`ItemUseBeforeEventSignal`](/server/classes/ItemUseBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks 此事件在物品被玩家成功使用时触发。 This event fires when an item is successfully used by a player. *** ### playerBreakBlock > `readonly` **playerBreakBlock**: [`PlayerBreakBlockBeforeEventSignal`](/server/classes/PlayerBreakBlockBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks 此事件在方块被玩家破坏之前触发。 This event fires before a block is broken by a player. *** ### playerGameModeChange > `readonly` **playerGameModeChange**: [`PlayerGameModeChangeBeforeEventSignal`](/server/classes/PlayerGameModeChangeBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### playerInteractWithBlock > `readonly` **playerInteractWithBlock**: [`PlayerInteractWithBlockBeforeEventSignal`](/server/classes/PlayerInteractWithBlockBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks 在玩家与方块交互之前触发。 Fires before a player interacts with a block. *** ### playerInteractWithEntity > `readonly` **playerInteractWithEntity**: [`PlayerInteractWithEntityBeforeEventSignal`](/server/classes/PlayerInteractWithEntityBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks 在玩家与实体交互之前触发。 Fires before a player interacts with an entity. *** ### playerLeave > `readonly` **playerLeave**: [`PlayerLeaveBeforeEventSignal`](/server/classes/PlayerLeaveBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks 在玩家离开游戏时触发。 Fires when a player leaves the game. *** ### playerPlaceBlock 实验性 > `readonly` **playerPlaceBlock**: [`PlayerPlaceBlockBeforeEventSignal`](/server/classes/PlayerPlaceBlockBeforeEventSignal.md) **`Beta`** **`Early Execution`** #### Remarks 此事件在方块被玩家放置之前触发。 This event fires before a block is placed by a player. *** ### weatherChange > `readonly` **weatherChange**: [`WeatherChangeBeforeEventSignal`](/server/classes/WeatherChangeBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks ## 同领域相关 - [WorldAfterEvents](/server/classes/WorldAfterEvents.md) - [WorldLoadAfterEvent](/server/classes/WorldLoadAfterEvent.md) - [WorldLoadAfterEventSignal](/server/classes/WorldLoadAfterEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/WorldLoadAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/WorldLoadAfterEvent.md. # Class: WorldLoadAfterEvent event world **`Beta`** ## 同领域相关 - [WorldAfterEvents](/server/classes/WorldAfterEvents.md) - [WorldBeforeEvents](/server/classes/WorldBeforeEvents.md) - [WorldLoadAfterEventSignal](/server/classes/WorldLoadAfterEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/classes/WorldLoadAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/WorldLoadAfterEventSignal.md. # Class: WorldLoadAfterEventSignal event world **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [WorldAfterEvents](/server/classes/WorldAfterEvents.md) - [WorldBeforeEvents](/server/classes/WorldBeforeEvents.md) - [WorldLoadAfterEvent](/server/classes/WorldLoadAfterEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BlockFilter.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BlockFilter.md. # Interface: BlockFilter block **`Beta`** 根据类型、标签或置换来包含或排除方块的选项。 如果没有添加包含选项,将选择所有未被排除选项拒绝的方块。 如果至少添加了一个包含选项,方块必须匹配至少一个包含选项才能不被拒绝。 Options to include or exclude blocks based on type, tag or permutation. If no include options are added it will select all blocks that are not rejected by the exclude options. If at least one include option is added the block must match one of the include options to not be rejected. ## Extended by - [`BlockQueryOptions`](/server/interfaces/BlockQueryOptions.md) - [`BlockRaycastOptions`](/server/interfaces/BlockRaycastOptions.md) ## Properties ### excludePermutations? > `optional` **excludePermutations?**: [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] **`Beta`** #### Remarks 如果匹配其中任何一个,过滤器应拒绝的方块置换数组。 Array of block permutations that the filter should reject if any matches. *** ### excludeTags? > `optional` **excludeTags?**: `string`\[] **`Beta`** #### Remarks 如果匹配其中任何一个,过滤器应拒绝的方块标签数组。 Array of block tags that the filter should reject if any matches. *** ### excludeTypes? > `optional` **excludeTypes?**: `string`\[] **`Beta`** #### Remarks 如果匹配其中任何一个,过滤器应拒绝的方块类型数组。 Array of block types that the filter should reject if any matches. *** ### includePermutations? > `optional` **includePermutations?**: [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] **`Beta`** #### Remarks 如果至少匹配其中一个,过滤器应选择的方块置换数组。 Array of block permutations that the filter should select if at least one matches. *** ### includeTags? > `optional` **includeTags?**: `string`\[] **`Beta`** #### Remarks 如果至少匹配其中一个,过滤器应选择的方块标签数组。 Array of block tags that the filter should select if at least one matches. *** ### includeTypes? > `optional` **includeTypes?**: `string`\[] **`Beta`** #### Remarks 如果至少匹配其中一个,过滤器应选择的方块类型数组。 Array of block types that the filter should select if at least one matches. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BlockQueryOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BlockQueryOptions.md. # Interface: BlockQueryOptions block **`Beta`** 在体积中查询方块的选项。扩展了 `BlockFilter`,增加了基于距离坐标的额外排序和限制选项。 Options for querying blocks in a volume. Extends BlockFilter with additional sorting and limiting options based on distance from a location. ## Extends - [`BlockFilter`](/server/interfaces/BlockFilter.md) ## Properties ### closest? > `optional` **closest?**: `number` **`Beta`** #### Remarks 如果指定,则返回距离坐标最近的 N 个方块。必须大于 0。不能与 `farthest` 同时使用。需要设置 `location`。 If specified, returns the closest N blocks to the location. Must be greater than 0. Cannot be used with farthest. Requires location to be set. *** ### excludePermutations? > `optional` **excludePermutations?**: [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] **`Beta`** #### Remarks 如果匹配其中任何一个,过滤器应拒绝的方块置换数组。 Array of block permutations that the filter should reject if any matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`excludePermutations`](/server/interfaces/BlockFilter.md#excludepermutations) *** ### excludeTags? > `optional` **excludeTags?**: `string`\[] **`Beta`** #### Remarks 如果匹配其中任何一个,过滤器应拒绝的方块标签数组。 Array of block tags that the filter should reject if any matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`excludeTags`](/server/interfaces/BlockFilter.md#excludetags) *** ### excludeTypes? > `optional` **excludeTypes?**: `string`\[] **`Beta`** #### Remarks 如果匹配其中任何一个,过滤器应拒绝的方块类型数组。 Array of block types that the filter should reject if any matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`excludeTypes`](/server/interfaces/BlockFilter.md#excludetypes) *** ### farthest? > `optional` **farthest?**: `number` **`Beta`** #### Remarks 如果指定,则返回距离坐标最远的 N 个方块。必须大于 0。不能与 `closest` 同时使用。需要设置 `location`。 If specified, returns the farthest N blocks from the location. Must be greater than 0. Cannot be used with closest. Requires location to be set. *** ### includePermutations? > `optional` **includePermutations?**: [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] **`Beta`** #### Remarks 如果至少匹配其中一个,过滤器应选择的方块置换数组。 Array of block permutations that the filter should select if at least one matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`includePermutations`](/server/interfaces/BlockFilter.md#includepermutations) *** ### includeTags? > `optional` **includeTags?**: `string`\[] **`Beta`** #### Remarks 如果至少匹配其中一个,过滤器应选择的方块标签数组。 Array of block tags that the filter should select if at least one matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`includeTags`](/server/interfaces/BlockFilter.md#includetags) *** ### includeTypes? > `optional` **includeTypes?**: `string`\[] **`Beta`** #### Remarks 如果至少匹配其中一个,过滤器应选择的方块类型数组。 Array of block types that the filter should select if at least one matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`includeTypes`](/server/interfaces/BlockFilter.md#includetypes) *** ### location? > `optional` **location?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 用作最近或最远距离计算的参考点位置。当指定了 `closest` 或 `farthest` 时需要设置。 Location used as the reference point for closest or farthest distance calculations. Required when closest or farthest is specified. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BlockRaycastOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BlockRaycastOptions.md. # Interface: BlockRaycastOptions block **`Beta`** 包含配置方块射线投射查询的额外选项。 Contains additional options for configuring a block raycast query. ## Extends - [`BlockFilter`](/server/interfaces/BlockFilter.md) ## Properties ### excludePermutations? > `optional` **excludePermutations?**: [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] **`Beta`** #### Remarks 如果匹配其中任何一个,过滤器应拒绝的方块置换数组。 Array of block permutations that the filter should reject if any matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`excludePermutations`](/server/interfaces/BlockFilter.md#excludepermutations) *** ### excludeTags? > `optional` **excludeTags?**: `string`\[] **`Beta`** #### Remarks 如果匹配其中任何一个,过滤器应拒绝的方块标签数组。 Array of block tags that the filter should reject if any matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`excludeTags`](/server/interfaces/BlockFilter.md#excludetags) *** ### excludeTypes? > `optional` **excludeTypes?**: `string`\[] **`Beta`** #### Remarks 如果匹配其中任何一个,过滤器应拒绝的方块类型数组。 Array of block types that the filter should reject if any matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`excludeTypes`](/server/interfaces/BlockFilter.md#excludetypes) *** ### includeLiquidBlocks? > `optional` **includeLiquidBlocks?**: `boolean` **`Beta`** #### Remarks 如果为 `true`,液体方块将被视为可以"阻挡"射线投射的方块。 If true, liquid blocks will be considered as blocks that 'stop' the raycast. *** ### includePassableBlocks? > `optional` **includePassableBlocks?**: `boolean` **`Beta`** #### Remarks 如果为 `true`,像藤蔓和花朵这类可穿过的方块将被视为可以"阻挡"射线投射的方块。 If true, passable blocks like vines and flowers will be considered as blocks that 'stop' the raycast. *** ### includePermutations? > `optional` **includePermutations?**: [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] **`Beta`** #### Remarks 如果至少匹配其中一个,过滤器应选择的方块置换数组。 Array of block permutations that the filter should select if at least one matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`includePermutations`](/server/interfaces/BlockFilter.md#includepermutations) *** ### includeTags? > `optional` **includeTags?**: `string`\[] **`Beta`** #### Remarks 如果至少匹配其中一个,过滤器应选择的方块标签数组。 Array of block tags that the filter should select if at least one matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`includeTags`](/server/interfaces/BlockFilter.md#includetags) *** ### includeTypes? > `optional` **includeTypes?**: `string`\[] **`Beta`** #### Remarks 如果至少匹配其中一个,过滤器应选择的方块类型数组。 Array of block types that the filter should select if at least one matches. #### Inherited from [`BlockFilter`](/server/interfaces/BlockFilter.md).[`includeTypes`](/server/interfaces/BlockFilter.md#includetypes) *** ### maxDistance? > `optional` **maxDistance?**: `number` **`Beta`** #### Remarks 处理射线投射的最大距离,以方块为单位。 Maximum distance, in blocks, to process the raycast. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityFilter.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityFilter.md. # Interface: EntityFilter entity **`Beta`** 包含筛选实体的选项。 Contains options for filtering entities. ## Extended by - [`EntityQueryOptions`](/server/interfaces/EntityQueryOptions.md) - [`EntityRaycastOptions`](/server/interfaces/EntityRaycastOptions.md) ## Properties ### excludeFamilies? > `optional` **excludeFamilies?**: `string`\[] **`Beta`** #### Remarks 排除匹配一个或多个指定系列的实体。 Excludes entities that match one or more of the specified families. *** ### excludeGameModes? > `optional` **excludeGameModes?**: [`GameMode`](/server/enums/GameMode.md)\[] **`Beta`** #### Remarks 如果实体的特定游戏模式与指定游戏模式匹配,则排除该实体。 Excludes entities if have a specific gamemode that matches the specified gamemode. *** ### excludeNames? > `optional` **excludeNames?**: `string`\[] **`Beta`** #### Remarks 排除名称与指定值之一匹配的实体。 Excludes entities that have a name that match one of the specified values. *** ### excludeTags? > `optional` **excludeTags?**: `string`\[] **`Beta`** #### Remarks 排除带有与指定值之一匹配的标签的实体。 Excludes entities with a tag that matches one of the specified values. *** ### excludeTypes? > `optional` **excludeTypes?**: `string`\[] **`Beta`** #### Remarks 排除如果它们是指定类型之一的实体。 Excludes entities if they are one of the specified types. *** ### families? > `optional` **families?**: `string`\[] **`Beta`** #### Remarks 如果指定,则包含匹配所有指定系列的实体。 If specified, includes entities that match all of the specified families. *** ### gameMode? > `optional` **gameMode?**: [`GameMode`](/server/enums/GameMode.md) **`Beta`** #### Remarks 如果指定,则包含游戏模式与指定游戏模式匹配的实体。 If specified, includes entities with a gamemode that matches the specified gamemode. *** ### maxHorizontalRotation? > `optional` **maxHorizontalRotation?**: `number` **`Beta`** #### Remarks 如果指定,则仅包含水平旋转角度最多为此值的实体。 If specified, will only include entities that have at most this horizontal rotation. *** ### maxLevel? > `optional` **maxLevel?**: `number` **`Beta`** #### Remarks 如果定义,仅返回等级最多为此值的玩家。 If defined, only players that have at most this level are returned. *** ### maxVerticalRotation? > `optional` **maxVerticalRotation?**: `number` **`Beta`** #### Remarks 如果指定,仅返回垂直旋转角度最多为此值的实体。 If specified, only entities that have at most this vertical rotation are returned. *** ### minHorizontalRotation? > `optional` **minHorizontalRotation?**: `number` **`Beta`** #### Remarks 如果指定,将仅包含水平旋转角度至少为此值的实体。 If specified, will only include entities that have at a minimum this horizontal rotation. *** ### minLevel? > `optional` **minLevel?**: `number` **`Beta`** #### Remarks 如果定义,仅返回等级至少为此值的玩家。 If defined, only players that have at least this level are returned. *** ### minVerticalRotation? > `optional` **minVerticalRotation?**: `number` **`Beta`** #### Remarks 如果指定,将仅包含垂直旋转角度至少为此值的实体。 If specified, will only include entities that have at least this vertical rotation. *** ### name? > `optional` **name?**: `string` **`Beta`** #### Remarks 包含具有指定名称的实体。 Includes entities with the specified name. *** ### propertyOptions? > `optional` **propertyOptions?**: [`EntityQueryPropertyOptions`](/server/interfaces/EntityQueryPropertyOptions.md)\[] **`Beta`** *** ### scoreOptions? > `optional` **scoreOptions?**: [`EntityQueryScoreOptions`](/server/interfaces/EntityQueryScoreOptions.md)\[] **`Beta`** #### Remarks 获取/设置一组带有特定计分板目标过滤器的 `EntityQueryScoreOptions` 对象。 Gets/sets a collection of EntityQueryScoreOptions objects with filters for specific scoreboard objectives. *** ### tags? > `optional` **tags?**: `string`\[] **`Beta`** #### Remarks 包含匹配所有指定标签的实体。 Includes entities that match all of the specified tags. *** ### type? > `optional` **type?**: `string` **`Beta`** #### Remarks 如果定义,则包含匹配此类型的实体。 If defined, entities that match this type are included. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityQueryOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityQueryOptions.md. # Interface: EntityQueryOptions entity **`Beta`** 包含在区域内选择实体的选项。 ## Examples **blockConditional.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; function blockConditional(targetLocation: DimensionLocation) { targetLocation.dimension .getEntities({ type: 'fox', }) .filter(entity => { const block = targetLocation.dimension.getBlock({ x: entity.location.x, y: entity.location.y - 1, z: entity.location.z, }); return block !== undefined && block.matches('minecraft:stone'); }) .forEach(entity => { targetLocation.dimension.spawnEntity('salmon', entity.location); }); } ``` **findEntitiesHavingPropertyEqualsTo.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function findEntitiesHavingPropertyEqualsTo(targetLocation: DimensionLocation) { // Minecraft bees have a has_nectar boolean property const queryOption: EntityQueryOptions = { propertyOptions: [{ propertyId: 'minecraft:has_nectar', value: { equals: true } }], }; const entities = targetLocation.dimension.getEntities(queryOption); } ``` **playSoundChained.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; function playSoundChained(targetLocation: DimensionLocation) { const targetPlayers = targetLocation.dimension.getPlayers(); const originEntities = targetLocation.dimension.getEntities({ type: 'armor_stand', name: 'myArmorStand', tags: ['dummyTag1'], excludeTags: ['dummyTag2'], }); originEntities.forEach(entity => { targetPlayers.forEach(player => { player.playSound('raid.horn'); }); }); } ``` **setScoreboardChained.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; function setScoreboardChained(targetLocation: DimensionLocation) { const objective = world.scoreboard.addObjective('scoreObjective1', 'dummy'); targetLocation.dimension .getEntities({ type: 'armor_stand', name: 'myArmorStand', }) .forEach(entity => { if (entity.scoreboardIdentity !== undefined) { objective.setScore(entity.scoreboardIdentity, -1); } }); } ``` **summonMobChained.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; function summonMobChained(targetLocation: DimensionLocation) { const armorStandArray = targetLocation.dimension.getEntities({ type: 'armor_stand', }); const playerArray = targetLocation.dimension.getPlayers({ location: { x: 0, y: -60, z: 0 }, closest: 4, maxDistance: 15, }); armorStandArray.forEach(entity => { playerArray.forEach(player => { targetLocation.dimension.spawnEntity('pig', { x: player.location.x + 1, y: player.location.y, z: player.location.z, }); }); }); } ``` **bounceSkeletons.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function bounceSkeletons(targetLocation: DimensionLocation) { const mobs = ['creeper', 'skeleton', 'sheep']; // create some sample mob data for (let i = 0; i < 10; i++) { targetLocation.dimension.spawnEntity(mobs[i % mobs.length], targetLocation); } const eqo: EntityQueryOptions = { type: 'skeleton', }; for (const entity of targetLocation.dimension.getEntities(eqo)) { entity.applyKnockback(0, 0, 0, 1); } } ``` **tagsQuery.ts** ```typescript import { EntityQueryOptions, DimensionLocation } from '@minecraft/server'; function tagsQuery(targetLocation: DimensionLocation) { const mobs = ['creeper', 'skeleton', 'sheep']; // create some sample mob data for (let i = 0; i < 10; i++) { const mobTypeId = mobs[i % mobs.length]; const entity = targetLocation.dimension.spawnEntity(mobTypeId, targetLocation); entity.addTag('mobparty.' + mobTypeId); } const eqo: EntityQueryOptions = { tags: ['mobparty.skeleton'], }; for (const entity of targetLocation.dimension.getEntities(eqo)) { entity.kill(); } } ``` **testThatEntityIsFeatherItem.ts** ```typescript import { EntityItemComponent, EntityComponentTypes, DimensionLocation } from '@minecraft/server'; function testThatEntityIsFeatherItem( log: (message: string, status?: number) => void, targetLocation: DimensionLocation ) { const items = targetLocation.dimension.getEntities({ location: targetLocation, maxDistance: 20, }); for (const item of items) { const itemComp = item.getComponent(EntityComponentTypes.Item) as EntityItemComponent; if (itemComp) { if (itemComp.itemStack.typeId.endsWith('feather')) { log('Success! Found a feather', 1); } } } } ``` ## Extends - [`EntityFilter`](/server/interfaces/EntityFilter.md) ## Properties ### closest? > `optional` **closest?**: `number` **`Beta`** #### Remarks 限制返回的实体数量,按照此属性指定的最近 N 个实体来选择。查询选项对象上也必须指定 `location` 值。 Limits the number of entities to return, opting for the closest N entities as specified by this property. The location value must also be specified on the query options object. *** ### excludeFamilies? > `optional` **excludeFamilies?**: `string`\[] **`Beta`** #### Remarks 排除匹配一个或多个指定系列的实体。 Excludes entities that match one or more of the specified families. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`excludeFamilies`](/server/interfaces/EntityFilter.md#excludefamilies) *** ### excludeGameModes? > `optional` **excludeGameModes?**: [`GameMode`](/server/enums/GameMode.md)\[] **`Beta`** #### Remarks 如果实体的特定游戏模式与指定游戏模式匹配,则排除该实体。 Excludes entities if have a specific gamemode that matches the specified gamemode. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`excludeGameModes`](/server/interfaces/EntityFilter.md#excludegamemodes) *** ### excludeNames? > `optional` **excludeNames?**: `string`\[] **`Beta`** #### Remarks 排除名称与指定值之一匹配的实体。 Excludes entities that have a name that match one of the specified values. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`excludeNames`](/server/interfaces/EntityFilter.md#excludenames) *** ### excludeTags? > `optional` **excludeTags?**: `string`\[] **`Beta`** #### Remarks 排除带有与指定值之一匹配的标签的实体。 Excludes entities with a tag that matches one of the specified values. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`excludeTags`](/server/interfaces/EntityFilter.md#excludetags) *** ### excludeTypes? > `optional` **excludeTypes?**: `string`\[] **`Beta`** #### Remarks 排除如果它们是指定类型之一的实体。 Excludes entities if they are one of the specified types. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`excludeTypes`](/server/interfaces/EntityFilter.md#excludetypes) *** ### families? > `optional` **families?**: `string`\[] **`Beta`** #### Remarks 如果指定,则包含匹配所有指定系列的实体。 If specified, includes entities that match all of the specified families. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`families`](/server/interfaces/EntityFilter.md#families) *** ### farthest? > `optional` **farthest?**: `number` **`Beta`** #### Remarks 限制返回的实体数量,按照此属性指定的最远 N 个实体来选择。查询选项对象上也必须指定 `location` 值。 Limits the number of entities to return, opting for the farthest N entities as specified by this property. The location value must also be specified on the query options object. *** ### gameMode? > `optional` **gameMode?**: [`GameMode`](/server/enums/GameMode.md) **`Beta`** #### Remarks 如果指定,则包含游戏模式与指定游戏模式匹配的实体。 If specified, includes entities with a gamemode that matches the specified gamemode. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`gameMode`](/server/interfaces/EntityFilter.md#gamemode) *** ### location? > `optional` **location?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 向查询添加一个种子位置,与 `closest`、`farthest`、`limit`、`volume` 和 `distance` 属性配合使用。 Adds a seed location to the query that is used in conjunction with closest, farthest, limit, volume, and distance properties. *** ### maxDistance? > `optional` **maxDistance?**: `number` **`Beta`** #### Remarks 如果指定,则包含距离 `location` 属性中指定位置小于此距离的实体。 If specified, includes entities that are less than this distance away from the location specified in the location property. *** ### maxHorizontalRotation? > `optional` **maxHorizontalRotation?**: `number` **`Beta`** #### Remarks 如果指定,则仅包含水平旋转角度最多为此值的实体。 If specified, will only include entities that have at most this horizontal rotation. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`maxHorizontalRotation`](/server/interfaces/EntityFilter.md#maxhorizontalrotation) *** ### maxLevel? > `optional` **maxLevel?**: `number` **`Beta`** #### Remarks 如果定义,仅返回等级最多为此值的玩家。 If defined, only players that have at most this level are returned. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`maxLevel`](/server/interfaces/EntityFilter.md#maxlevel) *** ### maxVerticalRotation? > `optional` **maxVerticalRotation?**: `number` **`Beta`** #### Remarks 如果指定,仅返回垂直旋转角度最多为此值的实体。 If specified, only entities that have at most this vertical rotation are returned. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`maxVerticalRotation`](/server/interfaces/EntityFilter.md#maxverticalrotation) *** ### minDistance? > `optional` **minDistance?**: `number` **`Beta`** #### Remarks 如果指定,则包含距离 `location` 属性中指定位置至少为此距离的实体。 If specified, includes entities that are least this distance away from the location specified in the location property. *** ### minHorizontalRotation? > `optional` **minHorizontalRotation?**: `number` **`Beta`** #### Remarks 如果指定,将仅包含水平旋转角度至少为此值的实体。 If specified, will only include entities that have at a minimum this horizontal rotation. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`minHorizontalRotation`](/server/interfaces/EntityFilter.md#minhorizontalrotation) *** ### minLevel? > `optional` **minLevel?**: `number` **`Beta`** #### Remarks 如果定义,仅返回等级至少为此值的玩家。 If defined, only players that have at least this level are returned. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`minLevel`](/server/interfaces/EntityFilter.md#minlevel) *** ### minVerticalRotation? > `optional` **minVerticalRotation?**: `number` **`Beta`** #### Remarks 如果指定,将仅包含垂直旋转角度至少为此值的实体。 If specified, will only include entities that have at least this vertical rotation. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`minVerticalRotation`](/server/interfaces/EntityFilter.md#minverticalrotation) *** ### name? > `optional` **name?**: `string` **`Beta`** #### Remarks 包含具有指定名称的实体。 Includes entities with the specified name. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`name`](/server/interfaces/EntityFilter.md#name) *** ### propertyOptions? > `optional` **propertyOptions?**: [`EntityQueryPropertyOptions`](/server/interfaces/EntityQueryPropertyOptions.md)\[] **`Beta`** #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`propertyOptions`](/server/interfaces/EntityFilter.md#propertyoptions) *** ### scoreOptions? > `optional` **scoreOptions?**: [`EntityQueryScoreOptions`](/server/interfaces/EntityQueryScoreOptions.md)\[] **`Beta`** #### Remarks 获取/设置一组带有特定计分板目标过滤器的 `EntityQueryScoreOptions` 对象。 Gets/sets a collection of EntityQueryScoreOptions objects with filters for specific scoreboard objectives. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`scoreOptions`](/server/interfaces/EntityFilter.md#scoreoptions) *** ### tags? > `optional` **tags?**: `string`\[] **`Beta`** #### Remarks 包含匹配所有指定标签的实体。 Includes entities that match all of the specified tags. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`tags`](/server/interfaces/EntityFilter.md#tags) *** ### type? > `optional` **type?**: `string` **`Beta`** #### Remarks 如果定义,则包含匹配此类型的实体。 If defined, entities that match this type are included. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`type`](/server/interfaces/EntityFilter.md#type) *** ### volume? > `optional` **volume?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 与 `location` 结合使用,指定一个要包含的实体的长方体体积。 In conjunction with location, specified a cuboid volume of entities to include. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityRaycastOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityRaycastOptions.md. # Interface: EntityRaycastOptions entity **`Beta`** 包含实体射线投射操作的额外选项。 Contains additional options for an entity raycast operation. ## Extends - [`EntityFilter`](/server/interfaces/EntityFilter.md) ## Properties ### excludeFamilies? > `optional` **excludeFamilies?**: `string`\[] **`Beta`** #### Remarks 排除匹配一个或多个指定系列的实体。 Excludes entities that match one or more of the specified families. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`excludeFamilies`](/server/interfaces/EntityFilter.md#excludefamilies) *** ### excludeGameModes? > `optional` **excludeGameModes?**: [`GameMode`](/server/enums/GameMode.md)\[] **`Beta`** #### Remarks 如果实体的特定游戏模式与指定游戏模式匹配,则排除该实体。 Excludes entities if have a specific gamemode that matches the specified gamemode. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`excludeGameModes`](/server/interfaces/EntityFilter.md#excludegamemodes) *** ### excludeNames? > `optional` **excludeNames?**: `string`\[] **`Beta`** #### Remarks 排除名称与指定值之一匹配的实体。 Excludes entities that have a name that match one of the specified values. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`excludeNames`](/server/interfaces/EntityFilter.md#excludenames) *** ### excludeTags? > `optional` **excludeTags?**: `string`\[] **`Beta`** #### Remarks 排除带有与指定值之一匹配的标签的实体。 Excludes entities with a tag that matches one of the specified values. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`excludeTags`](/server/interfaces/EntityFilter.md#excludetags) *** ### excludeTypes? > `optional` **excludeTypes?**: `string`\[] **`Beta`** #### Remarks 排除如果它们是指定类型之一的实体。 Excludes entities if they are one of the specified types. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`excludeTypes`](/server/interfaces/EntityFilter.md#excludetypes) *** ### families? > `optional` **families?**: `string`\[] **`Beta`** #### Remarks 如果指定,则包含匹配所有指定系列的实体。 If specified, includes entities that match all of the specified families. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`families`](/server/interfaces/EntityFilter.md#families) *** ### gameMode? > `optional` **gameMode?**: [`GameMode`](/server/enums/GameMode.md) **`Beta`** #### Remarks 如果指定,则包含游戏模式与指定游戏模式匹配的实体。 If specified, includes entities with a gamemode that matches the specified gamemode. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`gameMode`](/server/interfaces/EntityFilter.md#gamemode) *** ### ignoreBlockCollision? > `optional` **ignoreBlockCollision?**: `boolean` **`Beta`** #### Remarks 如果为 `true`,方块将不被视为可以"阻挡"射线投射的方块。 If true, blocks will not be considered as blocks that 'stop' the raycast. *** ### includeLiquidBlocks? > `optional` **includeLiquidBlocks?**: `boolean` **`Beta`** #### Remarks 如果为 `true`,液体方块将被视为可以"阻挡"射线投射的方块。 If true, liquid blocks will be considered as blocks that 'stop' the raycast. *** ### includePassableBlocks? > `optional` **includePassableBlocks?**: `boolean` **`Beta`** #### Remarks 如果为 `true`,像藤蔓和花朵这类可穿过的方块将被视为可以"阻挡"射线投射的方块。 If true, passable blocks like vines and flowers will be considered as blocks that 'stop' the raycast. *** ### maxDistance? > `optional` **maxDistance?**: `number` **`Beta`** #### Remarks 处理射线投射的最大距离,以方块为单位。 Maximum distance, in blocks, to process the raycast. *** ### maxHorizontalRotation? > `optional` **maxHorizontalRotation?**: `number` **`Beta`** #### Remarks 如果指定,则仅包含水平旋转角度最多为此值的实体。 If specified, will only include entities that have at most this horizontal rotation. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`maxHorizontalRotation`](/server/interfaces/EntityFilter.md#maxhorizontalrotation) *** ### maxLevel? > `optional` **maxLevel?**: `number` **`Beta`** #### Remarks 如果定义,仅返回等级最多为此值的玩家。 If defined, only players that have at most this level are returned. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`maxLevel`](/server/interfaces/EntityFilter.md#maxlevel) *** ### maxVerticalRotation? > `optional` **maxVerticalRotation?**: `number` **`Beta`** #### Remarks 如果指定,仅返回垂直旋转角度最多为此值的实体。 If specified, only entities that have at most this vertical rotation are returned. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`maxVerticalRotation`](/server/interfaces/EntityFilter.md#maxverticalrotation) *** ### minHorizontalRotation? > `optional` **minHorizontalRotation?**: `number` **`Beta`** #### Remarks 如果指定,将仅包含水平旋转角度至少为此值的实体。 If specified, will only include entities that have at a minimum this horizontal rotation. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`minHorizontalRotation`](/server/interfaces/EntityFilter.md#minhorizontalrotation) *** ### minLevel? > `optional` **minLevel?**: `number` **`Beta`** #### Remarks 如果定义,仅返回等级至少为此值的玩家。 If defined, only players that have at least this level are returned. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`minLevel`](/server/interfaces/EntityFilter.md#minlevel) *** ### minVerticalRotation? > `optional` **minVerticalRotation?**: `number` **`Beta`** #### Remarks 如果指定,将仅包含垂直旋转角度至少为此值的实体。 If specified, will only include entities that have at least this vertical rotation. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`minVerticalRotation`](/server/interfaces/EntityFilter.md#minverticalrotation) *** ### name? > `optional` **name?**: `string` **`Beta`** #### Remarks 包含具有指定名称的实体。 Includes entities with the specified name. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`name`](/server/interfaces/EntityFilter.md#name) *** ### propertyOptions? > `optional` **propertyOptions?**: [`EntityQueryPropertyOptions`](/server/interfaces/EntityQueryPropertyOptions.md)\[] **`Beta`** #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`propertyOptions`](/server/interfaces/EntityFilter.md#propertyoptions) *** ### scoreOptions? > `optional` **scoreOptions?**: [`EntityQueryScoreOptions`](/server/interfaces/EntityQueryScoreOptions.md)\[] **`Beta`** #### Remarks 获取/设置一组带有特定计分板目标过滤器的 `EntityQueryScoreOptions` 对象。 Gets/sets a collection of EntityQueryScoreOptions objects with filters for specific scoreboard objectives. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`scoreOptions`](/server/interfaces/EntityFilter.md#scoreoptions) *** ### tags? > `optional` **tags?**: `string`\[] **`Beta`** #### Remarks 包含匹配所有指定标签的实体。 Includes entities that match all of the specified tags. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`tags`](/server/interfaces/EntityFilter.md#tags) *** ### type? > `optional` **type?**: `string` **`Beta`** #### Remarks 如果定义,则包含匹配此类型的实体。 If defined, entities that match this type are included. #### Inherited from [`EntityFilter`](/server/interfaces/EntityFilter.md).[`type`](/server/interfaces/EntityFilter.md#type) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityVisibilityRules.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityVisibilityRules.md. # Interface: EntityVisibilityRules entity **`Beta`** 根据它所追踪实体的状态控制路径点的可见性。这些规则允许通过实体条件(如潜行、隐形和死亡状态)来过滤路径点的可见性。 Controls when a waypoint is visible based on the state of the entity it tracks. These rules allow filtering waypoint visibility by entity conditions like sneaking, invisibility, and death state. ## Extended by - [`PlayerVisibilityRules`](/server/interfaces/PlayerVisibilityRules.md) ## Properties ### showDead? > `optional` **showDead?**: `boolean` **`Beta`** #### Remarks 控制当被追踪实体死亡时是否显示路径点。如果未定义,默认为 `true`。 Controls whether the waypoint is shown when the tracked entity is dead. If undefined, defaults to true. *** ### showInvisible? > `optional` **showInvisible?**: `boolean` **`Beta`** #### Remarks 控制当被追踪实体隐形时是否显示路径点。如果未定义,默认为 `true`。 Controls whether the waypoint is shown when the tracked entity is invisible. If undefined, defaults to true. *** ### showSneaking? > `optional` **showSneaking?**: `boolean` **`Beta`** #### Remarks 控制当被追踪实体潜行时是否显示路径点。如果未定义,默认为 `true`。 Controls whether the waypoint is shown when the tracked entity is sneaking. If undefined, defaults to true. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/PlayerVisibilityRules.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/PlayerVisibilityRules.md. # Interface: PlayerVisibilityRules player **`Beta`** 根据玩家特定状态控制路径点的可见性。扩展了 [EntityVisibilityRules](/server/interfaces/EntityVisibilityRules.md),增加了针对玩家专属状态(如隐藏模式和旁观者模式)的额外规则。 Controls when a waypoint is visible based on player-specific states. Extends [EntityVisibilityRules](/server/interfaces/EntityVisibilityRules.md) with additional rules for player-only states like hidden mode and spectator mode. ## Extends - [`EntityVisibilityRules`](/server/interfaces/EntityVisibilityRules.md) ## Properties ### showDead? > `optional` **showDead?**: `boolean` **`Beta`** #### Remarks 控制当被追踪实体死亡时是否显示路径点。如果未定义,默认为 `true`。 Controls whether the waypoint is shown when the tracked entity is dead. If undefined, defaults to true. #### Inherited from [`EntityVisibilityRules`](/server/interfaces/EntityVisibilityRules.md).[`showDead`](/server/interfaces/EntityVisibilityRules.md#showdead) *** ### showHidden? > `optional` **showHidden?**: `boolean` **`Beta`** #### Remarks 控制当被追踪的玩家处于隐藏状态时是否显示路径点。如果未定义,默认为 `true`。 Controls whether the waypoint is shown when the tracked player is hidden. If undefined, defaults to true. *** ### showInvisible? > `optional` **showInvisible?**: `boolean` **`Beta`** #### Remarks 控制当被追踪实体隐形时是否显示路径点。如果未定义,默认为 `true`。 Controls whether the waypoint is shown when the tracked entity is invisible. If undefined, defaults to true. #### Inherited from [`EntityVisibilityRules`](/server/interfaces/EntityVisibilityRules.md).[`showInvisible`](/server/interfaces/EntityVisibilityRules.md#showinvisible) *** ### showSneaking? > `optional` **showSneaking?**: `boolean` **`Beta`** #### Remarks 控制当被追踪实体潜行时是否显示路径点。如果未定义,默认为 `true`。 Controls whether the waypoint is shown when the tracked entity is sneaking. If undefined, defaults to true. #### Inherited from [`EntityVisibilityRules`](/server/interfaces/EntityVisibilityRules.md).[`showSneaking`](/server/interfaces/EntityVisibilityRules.md#showsneaking) *** ### showSpectator? > `optional` **showSpectator?**: `boolean` **`Beta`** #### Remarks 控制当被追踪的玩家处于旁观者模式时是否显示路径点。如果未定义,默认为 `true`。 Controls whether the waypoint is shown when the tracked player is in spectator mode. If undefined, defaults to true. *** ### showSpectatorToSpectator? > `optional` **showSpectatorToSpectator?**: `boolean` **`Beta`** #### Remarks 控制当旁观者正在查看另一位旁观者玩家时是否显示路径点。如果未定义,默认为 `true`。 Controls whether the waypoint is shown when a spectator is viewing another spectator player. If undefined, defaults to true. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/RGB.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/RGB.md. # Interface: RGB **`Beta`** 表示 Minecraft 中完全可自定义的颜色。 Represents a fully customizable color within Minecraft. ## Extended by - [`RGBA`](/server/interfaces/RGBA.md) ## Properties ### blue > **blue**: `number` **`Beta`** #### Remarks 确定颜色的蓝色分量。有效值在 0 到 1.0 之间。 Determines a color's blue component. Valid values are between 0 and 1.0. *** ### green > **green**: `number` **`Beta`** #### Remarks 确定颜色的绿色分量。有效值在 0 到 1.0 之间。 Determines a color's green component. Valid values are between 0 and 1.0. *** ### red > **red**: `number` **`Beta`** #### Remarks 确定颜色的红色分量。有效值在 0 到 1.0 之间。 Determines a color's red component. Valid values are between 0 and 1.0. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/RGBA.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/RGBA.md. # Interface: RGBA **`Beta`** 表示 Minecraft 中完全可自定义的颜色。 Represents a fully customizable color within Minecraft. ## Extends - [`RGB`](/server/interfaces/RGB.md) ## Properties ### alpha > **alpha**: `number` **`Beta`** #### Remarks 确定颜色的 alpha(不透明度)分量。有效值在 0(透明)到 1.0(不透明)之间。 Determines a color's alpha (opacity) component. Valid values are between 0 (transparent) and 1.0 (opaque). *** ### blue > **blue**: `number` **`Beta`** #### Remarks 确定颜色的蓝色分量。有效值在 0 到 1.0 之间。 Determines a color's blue component. Valid values are between 0 and 1.0. #### Inherited from [`RGB`](/server/interfaces/RGB.md).[`blue`](/server/interfaces/RGB.md#blue) *** ### green > **green**: `number` **`Beta`** #### Remarks 确定颜色的绿色分量。有效值在 0 到 1.0 之间。 Determines a color's green component. Valid values are between 0 and 1.0. #### Inherited from [`RGB`](/server/interfaces/RGB.md).[`green`](/server/interfaces/RGB.md#green) *** ### red > **red**: `number` **`Beta`** #### Remarks 确定颜色的红色分量。有效值在 0 到 1.0 之间。 Determines a color's red component. Valid values are between 0 and 1.0. #### Inherited from [`RGB`](/server/interfaces/RGB.md).[`red`](/server/interfaces/RGB.md#red) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/AABB.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/AABB.md. # Interface: AABB **`Beta`** 轴对齐的包围盒。 Axis-aligned bounding box. ## Properties ### center > **center**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 盒体的中心点。 The centerpoint of the box. *** ### extent > **extent**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 从中心点到盒体边界的绝对距离。相当于盒体长度、高度和宽度的一半。始终被视为正值。 Absolute distance from the centerpoint to the bounds of the box. Equivalent to half of the box's length, height and width. Will always be treated as positive. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/AnimationOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/AnimationOptions.md. # Interface: AnimationOptions animation **`Beta`** 用于创建相机动画。 Used to create camera animations. ## Properties ### animation > **animation**: [`SplineAnimation`](/server/interfaces/SplineAnimation.md) **`Beta`** #### Remarks 相机动画的关键帧。 Key frames for the camera animation. *** ### totalTimeSeconds > **totalTimeSeconds**: `number` **`Beta`** #### Remarks 相机动画的总时长,以秒为单位。 Total time of the camera animation in seconds. ## 同领域相关 - [PlayAnimationOptions](/server/interfaces/PlayAnimationOptions.md) - [SplineAnimation](/server/interfaces/SplineAnimation.md) - [StructureAnimationMode](/server/enums/StructureAnimationMode.md) - [ImageAnimationData](/server-editor/types/ImageAnimationData.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BiomeFilter.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BiomeFilter.md. # Interface: BiomeFilter biome **`Beta`** ## Properties ### excludeBiomes? > `optional` **excludeBiomes?**: `string`\[] **`Beta`** *** ### excludeTags? > `optional` **excludeTags?**: `string`\[] **`Beta`** *** ### includeBiomes? > `optional` **includeBiomes?**: `string`\[] **`Beta`** *** ### includeTags? > `optional` **includeTags?**: `string`\[] **`Beta`** ## 同领域相关 - [BiomeSearchOptions](/server/interfaces/BiomeSearchOptions.md) - [BiomeType](/server/classes/BiomeType.md) - [BiomeTypes](/server/classes/BiomeTypes.md) - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BiomeSearchOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BiomeSearchOptions.md. # Interface: BiomeSearchOptions biome **`Beta`** ## Preview 包含用于 `dimension.findNearestBiome` API 搜索的额外选项。 Contains additional options for searches for the dimension.findNearestBiome API. ## Properties ### boundingSize? > `optional` **boundingSize?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 要在其中搜索的包围体积大小。 Bounding volume size to look within. ## 同领域相关 - [BiomeFilter](/server/interfaces/BiomeFilter.md) - [BiomeType](/server/classes/BiomeType.md) - [BiomeTypes](/server/classes/BiomeTypes.md) - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BlockBoundingBox.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BlockBoundingBox.md. # Interface: BlockBoundingBox block **`Beta`** `BlockBoundingBox` 是一个接口,表示一个轴对齐的矩形 AABB。 `BlockBoundingBox` 假设它在创建时处于有效状态(min \<= max),但无法保证这一点(除非使用相关的 [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) 工具函数创建)。 min/max 坐标表示矩形对角相对的顶点。 `BlockBoundingBox` 并不表示方块——它与任何类型无关,只是一个数学结构——因此一个 ( 0,0,0 ) -> ( 0,0,0 ) 的矩形其大小为 ( 0,0,0 )(与非常相似的 [BlockVolume](/server/classes/BlockVolume.md) 对象不同)。 A BlockBoundingBox is an interface to an object which represents an AABB aligned rectangle. The BlockBoundingBox assumes that it was created in a valid state (min \<= max) but cannot guarantee it (unless it was created using the associated [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) utility functions. The min/max coordinates represent the diametrically opposite corners of the rectangle. The BlockBoundingBox is not a representation of blocks - it has no association with any type, it is just a mathematical construct - so a rectangle with ( 0,0,0 ) -> ( 0,0,0 ) has a size of ( 0,0,0 ) (unlike the very similar [BlockVolume](/server/classes/BlockVolume.md) object) ## Properties ### max > **max**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 一个 [Vector3](/server/interfaces/Vector3.md),表示矩形的最大角。 A [Vector3](/server/interfaces/Vector3.md) that represents the largest corner of the rectangle *** ### min > **min**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 一个 [Vector3](/server/interfaces/Vector3.md),表示矩形的最小角。 A [Vector3](/server/interfaces/Vector3.md) that represents the smallest corner of the rectangle ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BlockContainerAccessEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BlockContainerAccessEventOptions.md. # Interface: BlockContainerAccessEventOptions event block inventory **`Beta`** 用于过滤方块容器访问事件的选项。 Options used to filter block container access events. ## Properties ### accessSourceFilter? > `optional` **accessSourceFilter?**: [`ContainerAccessSourceFilter`](/server/interfaces/ContainerAccessSourceFilter.md) **`Beta`** #### Remarks 如果存在,将过滤哪些容器访问源可以触发该事件。 If present will filter which container access sources can trigger the event. *** ### blockFilter? > `optional` **blockFilter?**: [`BlockFilter`](/server/interfaces/BlockFilter.md) **`Beta`** #### Remarks 如果存在,将过滤哪些容器方块可以触发该事件。 If present will filter which container blocks can trigger the event. ## 同领域相关 - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BlockCustomComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BlockCustomComponent.md. # Interface: BlockCustomComponent block component **`Beta`** 包含将为方块触发的一组事件。 此对象必须使用 `BlockRegistry` 进行绑定。 Contains a set of events that will be raised for a block. This object must be bound using the BlockRegistry. ## Properties ### beforeOnPlayerPlace? > `optional` **beforeOnPlayerPlace?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentPlayerPlaceBeforeEvent`](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 该函数将在玩家放置方块之前被调用。 This function will be called before a player places the block. *** ### onBlockStateChange? > `optional` **onBlockStateChange?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentBlockStateChangeEvent`](/server/classes/BlockComponentBlockStateChangeEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` *** ### onBreak? > `optional` **onBreak?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentBlockBreakEvent`](/server/classes/BlockComponentBlockBreakEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 该函数将在特定方块被破坏时被调用。 方块置换的变化不会触发此事件。 仅当使用破坏模式更改方块置换时,`Fill` 命令和 `SetBlock` 命令才会触发此事件。 具有 `minecraft:replaceable` 组件的自定义方块在被替换时不会触发此事件。 This function will be called when a specific block is destroyed. Changes in block permutations will not trigger this event. Fill Command and SetBlock Command can trigger this event when changing a block permutation only when using destroy mode. Custom blocks with the "minecraft:replaceable" component will not trigger the event when replaced. *** ### onEntity? > `optional` **onEntity?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentEntityEvent`](/server/classes/BlockComponentEntityEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 该函数将在世界中的实体向此方块触发事件时被调用。 This function will be called when an entity fires an event to this block in the world. *** ### onEntityFallOn? > `optional` **onEntityFallOn?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentEntityFallOnEvent`](/server/classes/BlockComponentEntityFallOnEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 该函数将在实体落到此自定义组件所绑定的方块上时被调用。 This function will be called when an entity falls onto the block that this custom component is bound to. *** ### onPlace? > `optional` **onPlace?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentOnPlaceEvent`](/server/classes/BlockComponentOnPlaceEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 该函数将在此自定义组件所绑定的方块被放置时被调用。 This function will be called when the block that this custom component is bound to is placed. *** ### onPlayerBreak? > `optional` **onPlayerBreak?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentPlayerBreakEvent`](/server/classes/BlockComponentPlayerBreakEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` *** ### onPlayerInteract? > `optional` **onPlayerInteract?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentPlayerInteractEvent`](/server/classes/BlockComponentPlayerInteractEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 该函数将在玩家成功与此自定义组件所绑定的方块交互时被调用。 This function will be called when a player sucessfully interacts with the block that this custom component is bound to. *** ### onRandomTick? > `optional` **onRandomTick?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentRandomTickEvent`](/server/classes/BlockComponentRandomTickEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 该函数将在方块随机 tick 时被调用。 This function will be called when a block randomly ticks. *** ### onRedstoneUpdate? > `optional` **onRedstoneUpdate?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentRedstoneUpdateEvent`](/server/classes/BlockComponentRedstoneUpdateEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 当发生 `onRedstoneUpdate` 引擎事件时,如果方块具有 `minecraft:redstone_consumer` 组件且红石信号强度 >= 该组件的 `min_power` 字段,则将调用此函数。 This function will be called when an 'onRedstoneUpdate' engine event occurs if the block has a `minecraft:redstone_consumer` component and the redstone signal strength is >= to the components `min_power` field. *** ### onStepOff? > `optional` **onStepOff?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentStepOffEvent`](/server/classes/BlockComponentStepOffEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 该函数将在实体离开此自定义组件所绑定的方块时被调用。 This function will be called when an entity steps off the block that this custom component is bound to. *** ### onStepOn? > `optional` **onStepOn?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentStepOnEvent`](/server/classes/BlockComponentStepOnEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 该函数将在实体踏上此自定义组件所绑定的方块时被调用。 This function will be called when an entity steps onto the block that this custom component is bound to. *** ### onTick? > `optional` **onTick?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`BlockComponentTickEvent`](/server/classes/BlockComponentTickEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 该函数将在方块 tick 时被调用。 This function will be called when a block ticks. ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BlockEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BlockEventOptions.md. # Interface: BlockEventOptions event block **`Beta`** 包含注册方块事件的可选参数。 Contains optional parameters for registering a block event. ## Properties ### blockTypes? > `optional` **blockTypes?**: `string`\[] **`Beta`** #### Remarks 如果设置了此值,则仅当受影响的方块类型与此参数匹配时才会触发此事件。 If this value is set, this event will only fire if the impacted block's type matches this parameter. *** ### permutations? > `optional` **permutations?**: [`BlockPermutation`](/server/classes/BlockPermutation.md)\[] **`Beta`** #### Remarks 如果设置了此值,则仅当受影响的方块置换与此参数匹配时才会触发此事件。 If this value is set, this event will only fire if the impacted block's permutation matches this parameter. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BlockFillOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BlockFillOptions.md. # Interface: BlockFillOptions block **`Beta`** 包含方块填充操作的额外选项。 Contains additional options for a block fill operation. ## Properties ### blockFilter? > `optional` **blockFilter?**: [`BlockFilter`](/server/interfaces/BlockFilter.md) **`Beta`** #### Remarks 指定后,填充操作将包括/排除添加到方块过滤器中的方块。 When specified, the fill operation will include / exclude the blocks added to the block filter. *** ### ignoreChunkBoundErrors? > `optional` **ignoreChunkBoundErrors?**: `boolean` **`Beta`** #### Remarks 当为 `true` 时,如果部分填充体积超出已加载区块边界,`fillBlocks` 不会报错,而是仅填充位于已加载区块边界内的方块,并忽略边界外的方块。 When true fillBlocks will not error if part of the fill volume is outside of loaded chunks bounds. Instead it will just fill the blocks that are inside the loaded chunk bounds and ignoring blocks outside. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BlockHitInformation.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BlockHitInformation.md. # Interface: BlockHitInformation block **`Beta`** 包含方块被击中事件的更多信息。 Contains more information for events where a block is hit. ## Properties ### block > **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 被击中的方块。 Block that was hit. *** ### face > **face**: [`Direction`](/server/enums/Direction.md) **`Beta`** #### Remarks 被击中的方块面。 Face of the block that was hit. *** ### faceLocation > **faceLocation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 相对于方块底部西北角的位置。 Location relative to the bottom north-west corner of the block. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/BlockRaycastHit.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/BlockRaycastHit.md. # Interface: BlockRaycastHit block **`Beta`** 包含方块射线投射命中结果的信息。 Contains information for block raycast hit results. ## Properties ### block > **block**: [`Block`](/server/classes/Block.md) **`Beta`** #### Remarks 被命中的方块。 Block that was hit. *** ### face > **face**: [`Direction`](/server/enums/Direction.md) **`Beta`** #### Remarks 被命中的方块面。 Face of the block that was hit. *** ### faceLocation > **faceLocation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 相对于方块底部西北角的命中位置。 Hit location relative to the bottom north-west corner of the block. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraAttachOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraAttachOptions.md. # Interface: CameraAttachOptions **`Beta`** 用于将相机附加到非玩家实体上。 Used to attach the camera to a non player entity. ## Properties ### entity > **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 设置一个相机要追踪的非玩家实体。 Set a non player entity for the camera to target. *** ### locator > **locator**: [`EntityAttachPoint`](/server/enums/EntityAttachPoint.md) **`Beta`** #### Remarks 您要追踪的实体的位置(例如头部、脚部、眼睛)。 The location of the entity that you want to target (eg. head, feet, eyes). [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraFadeOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraFadeOptions.md. # Interface: CameraFadeOptions **`Beta`** 用于启动全屏颜色淡入淡出。 Used to initiate a full-screen color fade. ## Properties ### fadeColor? > `optional` **fadeColor?**: [`RGB`](/server/interfaces/RGB.md) **`Beta`** #### Remarks 要使用的淡入淡出颜色。 Fade color to use. *** ### fadeTime? > `optional` **fadeTime?**: [`CameraFadeTimeOptions`](/server/interfaces/CameraFadeTimeOptions.md) **`Beta`** #### Remarks 淡入、保持和淡出的时间,以秒为单位。 Time in seconds for the fade-in, hold, and fade-out seconds. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraFadeTimeOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraFadeTimeOptions.md. # Interface: CameraFadeTimeOptions **`Beta`** 包含淡入淡出过渡的时间。 Contains timings for a fade transition. ## Properties ### fadeInTime > **fadeInTime**: `number` **`Beta`** #### Remarks 淡入的时间,以秒为单位。 Time, in seconds, for a fade-in. *** ### fadeOutTime > **fadeOutTime**: `number` **`Beta`** #### Remarks 淡出的时间,以秒为单位。 Time, in seconds, for a fade-out. *** ### holdTime > **holdTime**: `number` **`Beta`** #### Remarks 保持全屏颜色的时间,以秒为单位。 Time, in seconds, to hold the full screen color. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraFixedBoomOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraFixedBoomOptions.md. # Interface: CameraFixedBoomOptions **`Beta`** 控制第三人称吊臂预设的支点和偏移的选项。 Options to control pivot points and offsets of the third person boom preset. ## Properties ### entityOffset? > `optional` **entityOffset?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 将支点更改为距离玩家 \ 的位置。 Changes the pivot point to be \ away from the player. *** ### viewOffset? > `optional` **viewOffset?**: [`Vector2`](/server/interfaces/Vector2.md) **`Beta`** #### Remarks 将相机从中心偏移 \。 Offsets the camera from center by \. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraFovOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraFovOptions.md. # Interface: CameraFovOptions **`Beta`** 用于更改当前相机的视野。 Used to change the field of view of the current camera. ## Properties ### easeOptions? > `optional` **easeOptions?**: [`EaseOptions`](/server/interfaces/EaseOptions.md) **`Beta`** *** ### fov? > `optional` **fov?**: `number` **`Beta`** #### Remarks 设置视野的值。 Set a value for the field of view. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraSetFacingOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraSetFacingOptions.md. # Interface: CameraSetFacingOptions **`Beta`** ## Properties ### easeOptions? > `optional` **easeOptions?**: [`EaseOptions`](/server/interfaces/EaseOptions.md) **`Beta`** *** ### facingEntity > **facingEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** *** ### location? > `optional` **location?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraSetLocationOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraSetLocationOptions.md. # Interface: CameraSetLocationOptions **`Beta`** ## Properties ### easeOptions? > `optional` **easeOptions?**: [`EaseOptions`](/server/interfaces/EaseOptions.md) **`Beta`** *** ### location > **location**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraSetPosOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraSetPosOptions.md. # Interface: CameraSetPosOptions **`Beta`** ## Properties ### easeOptions? > `optional` **easeOptions?**: [`EaseOptions`](/server/interfaces/EaseOptions.md) **`Beta`** *** ### facingLocation > **facingLocation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** *** ### location? > `optional` **location?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraSetRotOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraSetRotOptions.md. # Interface: CameraSetRotOptions **`Beta`** ## Properties ### easeOptions? > `optional` **easeOptions?**: [`EaseOptions`](/server/interfaces/EaseOptions.md) **`Beta`** *** ### location? > `optional` **location?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** *** ### rotation > **rotation**: [`Vector2`](/server/interfaces/Vector2.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraShakeOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraShakeOptions.md. # Interface: CameraShakeOptions **`Beta`** 通过 `Camera.addShake` 对玩家相机应用相机抖动效果的选项。每次调用 `addShake` 都会为指定的 `type` 排队一个新的独立抖动事件;位置抖动和旋转抖动分别在各自的队列中独立跟踪并并发运行。任何时刻的渲染强度是该类型所有活动事件强度的总和,上限为 `4.0`。事件在 `duration` 时间过后自然过期。 Options for applying a camera shake effect to a player's camera via `Camera.addShake`. Each call to `addShake` queues a new independent shake event for the specified `type`; positional and rotational shakes are tracked in separate queues and run concurrently. The rendered intensity at any moment is the sum of all active events' intensities for that type, capped at `4.0`. Events expire naturally when their `duration` elapses. ## Properties ### duration > **duration**: `number` **`Beta`** #### Remarks 此抖动事件的持续时间,以秒为单位。必须为正值。 How long this shake event lasts, in seconds. Must be a positive value. *** ### intensity > **intensity**: `number` **`Beta`** #### Remarks 此抖动事件的强度。必须为正值,最大值为 `4.0`。同一 `type` 的多个活动事件强度会累加,上限为 `4.0`。 The intensity of this shake event. Must be a positive value with a maximum of `4.0`. Multiple active events of the same `type` are summed, capped at `4.0`. *** ### type > **type**: [`CameraShakeType`](/server/enums/CameraShakeType.md) **`Beta`** #### Remarks 要应用的相机抖动类型。位置抖动和旋转抖动维护各自独立的事件队列并并发应用,因此添加每种类型的抖动不会使它们相互干扰。 The type of camera shake to apply. Positional and rotational shakes maintain separate event queues and are applied concurrently, so adding a shake of each type does not cause them to interfere with one another. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CameraTargetOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CameraTargetOptions.md. # Interface: CameraTargetOptions **`Beta`** 用于使用自由相机瞄准一个实体。 Used to target an entity with a free camera. ## Properties ### offsetFromTargetCenter? > `optional` **offsetFromTargetCenter?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 设置一个从目标实体中心的 \ 偏移。 Set an \ offset from the target entity's center. *** ### targetEntity > **targetEntity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 您要瞄准的单个实体。 The singular entity you want to target. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/ContainerAccessSource.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ContainerAccessSource.md. # Interface: ContainerAccessSource inventory **`Beta`** 表示容器访问的来源。 Represents the source of a container access. ## Properties ### entity? > `optional` **entity?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 触发容器访问的实体。 The entity that triggered the container access. ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/ContainerAccessSourceFilter.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ContainerAccessSourceFilter.md. # Interface: ContainerAccessSourceFilter inventory **`Beta`** 用于过滤容器访问源的选项。 Options for use when filtering container access sources. ## Properties ### entityFilter? > `optional` **entityFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** #### Remarks 访问容器的源实体的过滤选项。 Filter options for the source entity accessing the container. ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/ContainerRules.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ContainerRules.md. # Interface: ContainerRules inventory **`Beta`** 在容器操作中若违反则会抛出错误的规则。 Rules that if broken on container operations will throw an error. ## Properties ### allowedItems > **allowedItems**: `string`\[] **`Beta`** #### Remarks 定义容器中唯一允许的物品。如果为空,则所有物品都允许放入容器。 Defines the items that are exclusively allowed in the container. If empty all items are allowed in the container. *** ### allowNestedStorageItems > **allowNestedStorageItems**: `boolean` **`Beta`** #### Remarks 确定其他存储物品是否可以放入该容器。 Determines whether other storage items can be placed into the container. *** ### bannedItems > **bannedItems**: `string`\[] **`Beta`** #### Remarks 定义容器中不允许的物品。 Defines the items that are not allowed in the container. *** ### weightLimit? > `optional` **weightLimit?**: `number` **`Beta`** #### Remarks 定义存储容器中所有物品的最大允许总重量。如果未定义,容器没有重量限制。 Defines the maximum allowed total weight of all items in the storage item container. If undefined container has no weight limit. ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CustomCommand.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CustomCommand.md. # Interface: CustomCommand **`Beta`** 定义自定义命令,包括名称、权限和参数。 Define the custom command, including name, permissions, and parameters. ## Properties ### cheatsRequired? > `optional` **cheatsRequired?**: `boolean` **`Beta`** #### Remarks 运行此命令需要开启作弊。默认为 `true`。 Cheats must be enabled to run this command. Defaults to true. *** ### description > **description**: `string` **`Beta`** #### Remarks 在命令行上显示的命令描述。 Command description as seen on the command line. *** ### mandatoryParameters? > `optional` **mandatoryParameters?**: [`CustomCommandParameter`](/server/interfaces/CustomCommandParameter.md)\[] **`Beta`** #### Remarks 必填命令参数列表。 List of mandatory command parameters. *** ### name > **name**: `string` **`Beta`** #### Remarks 命令的名称。需要命名空间。 The name of the command. A namespace is required. *** ### optionalParameters? > `optional` **optionalParameters?**: [`CustomCommandParameter`](/server/interfaces/CustomCommandParameter.md)\[] **`Beta`** #### Remarks 可选命令参数列表。 List of optional command parameters. *** ### permissionLevel > **permissionLevel**: [`CommandPermissionLevel`](/server/enums/CommandPermissionLevel.md) **`Beta`** #### Remarks 执行命令所需的权限等级。 The permission level required to execute the command. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CustomCommandParameter.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CustomCommandParameter.md. # Interface: CustomCommandParameter **`Beta`** 自定义命令预期的每个参数的定义。 Definition for each parameter expected by the custom command. ## Properties ### enumName? > `optional` **enumName?**: `string` **`Beta`** #### Remarks 当 [CustomCommandParamType](/server/enums/CustomCommandParamType.md) 为 `Enum` 时,可用于引用枚举名称。允许参数名称与枚举名称不同。 Can be used to reference the enum name when [CustomCommandParamType](/server/enums/CustomCommandParamType.md) is 'Enum'. Allows the parameter name to be different from the enum name. *** ### name > **name**: `string` **`Beta`** #### Remarks 参数在命令行上显示的名称。 The name of parameter as it appears on the command line. *** ### type > **type**: [`CustomCommandParamType`](/server/enums/CustomCommandParamType.md) **`Beta`** #### Remarks 参数的数据类型。 The data type of the parameter. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CustomCommandResult.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CustomCommandResult.md. # Interface: CustomCommandResult **`Beta`** 从自定义命令回调函数返回的接口。 Interface returned from custom command callback function. ## Properties ### message? > `optional` **message?**: `string` **`Beta`** #### Remarks 命令执行后显示在聊天中的消息。 Message displayed to chat after command execution. *** ### status > **status**: [`CustomCommandStatus`](/server/enums/CustomCommandStatus.md) **`Beta`** #### Remarks 命令执行成功或失败。决定状态消息的显示方式。 Command execution Success or Failure. Determines how the status message is displayed. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/CustomTexture.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/CustomTexture.md. # Interface: CustomTexture **`Beta`** ## Properties ### iconHeight > **iconHeight**: `number` **`Beta`** #### Remarks 图标的相对高度。值必须在 0.0 到 1.0 之间(含)。 The height of the icon, in relative units. Value must be between 0.0 and 1.0, inclusive. Bounds: \[0, 1] *** ### iconWidth > **iconWidth**: `number` **`Beta`** #### Remarks 图标的相对宽度。值必须在 0.0 到 1.0 之间(含)。 The width of the icon, in relative units. Value must be between 0.0 and 1.0, inclusive. Bounds: \[0, 1] *** ### path > **path**: `string` **`Beta`** #### Remarks 自定义纹理的资源路径。这应是一个有效的纹理资源字符串路径。 The resource path to the custom texture. This should be a valid string path to a texture asset. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/DefinitionModifier.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/DefinitionModifier.md. # Interface: DefinitionModifier **`Beta`** 包含对实体组件定义状态的一组更新。 Contains a set of updates to the component definition state of an entity. ## Properties ### addedComponentGroups > **addedComponentGroups**: `string`\[] **`Beta`** #### Remarks 获取通过此定义修改将要添加的组件组列表。 Retrieves the list of component groups that will be added via this definition modification. *** ### removedComponentGroups > **removedComponentGroups**: `string`\[] **`Beta`** #### Remarks 通过此定义修改将要移除的组件组列表。 The list of component groups that will be removed via this definition modification. *** ### triggers 实验性 > **triggers**: [`Trigger`](/server/classes/Trigger.md)\[] **`Beta`** #### Remarks 通过此更新将要触发的实体定义事件列表。 The list of entity definition events that will be fired via this update. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/DimensionLocation.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/DimensionLocation.md. # Interface: DimensionLocation dimension **`Beta`** 世界中的精确坐标,包含其维度和位置。 An exact coordinate within the world, including its dimension and location. ## Properties ### dimension > **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 此坐标关联的维度。 Dimension that this coordinate is associated with. *** ### x > **x**: `number` **`Beta`** #### Remarks 此维度位置的 X 分量。 X component of this dimension-location. *** ### y > **y**: `number` **`Beta`** #### Remarks 此维度位置的 Y 分量。 Y component of this dimension-location. *** ### z > **z**: `number` **`Beta`** #### Remarks 此维度位置的 Z 分量。 Z component of this dimension-location. ## 同领域相关 - [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError.md) - [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError.md) - [CustomDimensionNameError](/server/classes/CustomDimensionNameError.md) - [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError.md) - [Dimension](/server/classes/Dimension.md) - [DimensionRegistry](/server/classes/DimensionRegistry.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EaseOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EaseOptions.md. # Interface: EaseOptions **`Beta`** 包含与位置和/或旋转之间缓动相关的选项。 Contains options associated with easing between positions and/or rotations. ## Properties ### easeTime? > `optional` **easeTime?**: `number` **`Beta`** #### Remarks 缓动操作的时间。 Time for the ease operation. *** ### easeType? > `optional` **easeType?**: [`EasingType`](/server/enums/EasingType.md) **`Beta`** #### Remarks 要使用的缓动操作类型。 Type of ease operation to use. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/Enchantment.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/Enchantment.md. # Interface: Enchantment **`Beta`** 此接口表示应用于物品的特定等级附魔。 This interface represents a specific leveled enchantment that is applied to an item. ## Properties ### level > **level**: `number` **`Beta`** #### Remarks 此附魔实例的等级。 The level of this enchantment instance. *** ### type > **type**: [`EnchantmentType`](/server/classes/EnchantmentType.md) **`Beta`** #### Remarks 此实例的附魔类型。 The enchantment type of this instance. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityApplyDamageByProjectileOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityApplyDamageByProjectileOptions.md. # Interface: EntityApplyDamageByProjectileOptions entity damage **`Beta`** 通过抛射物造成伤害时的额外选项。 Additional options for when damage has been applied via a projectile. ## Properties ### damagingEntity? > `optional` **damagingEntity?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 可选的发射抛射物的实体。 Optional entity that fired the projectile. *** ### damagingProjectile > **damagingProjectile**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 造成伤害的抛射物。 Projectile that caused damage. ## 同领域相关 - [EntityApplyDamageOptions](/server/interfaces/EntityApplyDamageOptions.md) - [EntityDamageCause](/server/enums/EntityDamageCause.md) - [EntityDamageSource](/server/interfaces/EntityDamageSource.md) - [EntityHealthChangedAfterEvent](/server/classes/EntityHealthChangedAfterEvent.md) - [EntityHealthChangedAfterEventSignal](/server/classes/EntityHealthChangedAfterEventSignal.md) - [EntityHealthComponent](/server/classes/EntityHealthComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityApplyDamageOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityApplyDamageOptions.md. # Interface: EntityApplyDamageOptions entity damage **`Beta`** 伤害事件的附加描述和元数据。 Additional descriptions and metadata for a damage event. ## Properties ### cause > **cause**: [`EntityDamageCause`](/server/enums/EntityDamageCause.md) **`Beta`** #### Remarks 伤害的底层原因。 Underlying cause of the damage. *** ### damagingEntity? > `optional` **damagingEntity?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 可选的造成伤害的实体。 Optional entity that caused the damage. ## 同领域相关 - [EntityApplyDamageByProjectileOptions](/server/interfaces/EntityApplyDamageByProjectileOptions.md) - [EntityDamageCause](/server/enums/EntityDamageCause.md) - [EntityDamageSource](/server/interfaces/EntityDamageSource.md) - [EntityHealthChangedAfterEvent](/server/classes/EntityHealthChangedAfterEvent.md) - [EntityHealthChangedAfterEventSignal](/server/classes/EntityHealthChangedAfterEventSignal.md) - [EntityHealthComponent](/server/classes/EntityHealthComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityContainerAccessEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityContainerAccessEventOptions.md. # Interface: EntityContainerAccessEventOptions event entity inventory **`Beta`** 用于过滤实体容器访问事件的选项。 Options used to filter entity container access events. ## Properties ### accessSourceFilter? > `optional` **accessSourceFilter?**: [`ContainerAccessSourceFilter`](/server/interfaces/ContainerAccessSourceFilter.md) **`Beta`** #### Remarks 如果存在,将过滤哪些容器访问源可以触发该事件。 If present will filter which container access sources can trigger the event. *** ### entityFilter? > `optional` **entityFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** #### Remarks 如果存在,将过滤哪些实体容器可以触发该事件。 If present will filter which entity containers can trigger the event. ## 同领域相关 - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) - [EntityContainerClosedAfterEventSignal](/server/classes/EntityContainerClosedAfterEventSignal.md) - [EntityContainerOpenedAfterEvent](/server/classes/EntityContainerOpenedAfterEvent.md) - [EntityContainerOpenedAfterEventSignal](/server/classes/EntityContainerOpenedAfterEventSignal.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityDamageSource.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityDamageSource.md. # Interface: EntityDamageSource entity damage **`Beta`** 提供关于伤害如何应用于实体的信息。 Provides information about how damage has been applied to an entity. ## Properties ### cause > **cause**: [`EntityDamageCause`](/server/enums/EntityDamageCause.md) **`Beta`** #### Remarks 伤害的原因枚举。 Cause enumeration of damage. *** ### damagingEntity? > `optional` **damagingEntity?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 可选的造成伤害的实体。 Optional entity that caused the damage. *** ### damagingProjectile? > `optional` **damagingProjectile?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 可能造成伤害的可选抛射物。 Optional projectile that may have caused damage. ## 同领域相关 - [EntityApplyDamageByProjectileOptions](/server/interfaces/EntityApplyDamageByProjectileOptions.md) - [EntityApplyDamageOptions](/server/interfaces/EntityApplyDamageOptions.md) - [EntityDamageCause](/server/enums/EntityDamageCause.md) - [EntityHealthChangedAfterEvent](/server/classes/EntityHealthChangedAfterEvent.md) - [EntityHealthChangedAfterEventSignal](/server/classes/EntityHealthChangedAfterEventSignal.md) - [EntityHealthComponent](/server/classes/EntityHealthComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityDataDrivenTriggerEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityDataDrivenTriggerEventOptions.md. # Interface: EntityDataDrivenTriggerEventOptions event entity **`Beta`** 指定用于注册实体数据驱动触发事件时使用的额外过滤器。 Specifies additional filters that are used in registering a data driven trigger event for entities. ## Properties ### entities? > `optional` **entities?**: [`Entity`](/server/classes/Entity.md)\[] **`Beta`** #### Remarks 如果设置了此值,则仅当实体与此集合中的实体匹配时才会触发此事件。 If this value is set, this event will only fire for entities that match the entities within this collection. *** ### entityTypes? > `optional` **entityTypes?**: `string`\[] **`Beta`** #### Remarks 如果设置了此值,则仅当受影响的实体类型与此参数匹配时才会触发此事件。 If this value is set, this event will only fire if the impacted entities' type matches this parameter. *** ### eventTypes? > `optional` **eventTypes?**: `string`\[] **`Beta`** #### Remarks 如果设置了此值,则仅当受影响的触发事件与此参数中列出的事件之一匹配时才会触发此事件。 If this value is set, this event will only fire if the impacted triggered event matches one of the events listed in this parameter. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityEffectOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityEffectOptions.md. # Interface: EntityEffectOptions entity effect **`Beta`** 包含实体效果的附加选项。 Contains additional options for entity effects. ## Properties ### amplifier? > `optional` **amplifier?**: `number` **`Beta`** #### Remarks 效果的强度。 The strength of the effect. *** ### showParticles? > `optional` **showParticles?**: `boolean` **`Beta`** #### Remarks 如果为 `true`,效果作用于实体时会显示粒子。 If true, will show particles when effect is on the entity. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityEventOptions.md. # Interface: EntityEventOptions event entity **`Beta`** 包含注册实体事件的可选参数。 Contains optional parameters for registering an entity event. ## Properties ### entities? > `optional` **entities?**: [`Entity`](/server/classes/Entity.md)\[] **`Beta`** #### Remarks 如果设置了此值,则仅当实体与此集合中的实体匹配时才会触发此事件。 If this value is set, this event will only fire for entities that match the entities within this collection. *** ### entityTypes? > `optional` **entityTypes?**: `string`\[] **`Beta`** #### Remarks 如果设置了此值,则仅当受影响的实体类型与此参数匹配时才会触发此事件。 If this value is set, this event will only fire if the impacted entities' type matches this parameter. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityHealEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityHealEventOptions.md. # Interface: EntityHealEventOptions event entity **`Beta`** 包含注册实体治疗事件的可选参数。 Contains optional parameters for registering an entity heal event. ## Properties ### allowedHealCauses? > `optional` **allowedHealCauses?**: [`EntityHealCause`](/server/enums/EntityHealCause.md)\[] **`Beta`** #### Remarks 如果设置了此值,则仅当治疗原因匹配时才会触发此事件。 If this value is set, this event will only fire for healing causes that match. *** ### entityFilter? > `optional` **entityFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** #### Remarks 如果设置了此值,则仅当实体匹配时才会触发此事件。 If this value is set, this event will only fire for entities that match. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityHitInformation.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityHitInformation.md. # Interface: EntityHitInformation entity **`Beta`** 包含被击中的实体的附加信息。 Contains additional information about an entity that was hit. ## Properties ### entity? > `optional` **entity?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 被击中的实体。 Entity that was hit. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityHurtAfterEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityHurtAfterEventOptions.md. # Interface: EntityHurtAfterEventOptions event entity **`Beta`** 包含注册实体受伤后事件的可选参数。 Contains optional parameters for registering an entity hurt after event. ## Properties ### allowedDamageCauses? > `optional` **allowedDamageCauses?**: [`EntityDamageCause`](/server/enums/EntityDamageCause.md)\[] **`Beta`** #### Remarks 如果设置了此值,则仅当伤害原因匹配时才会触发此事件。 If this value is set, this event will only fire for damage causes that match. *** ### entities? > `optional` **entities?**: [`Entity`](/server/classes/Entity.md)\[] **`Beta`** #### Remarks 如果设置了此值,则仅当实体与此集合中的实体匹配时才会触发此事件。 If this value is set, this event will only fire for entities that match the entities within this collection. *** ### entityFilter? > `optional` **entityFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** #### Remarks 如果设置了此值,则仅当实体匹配时才会触发此事件。 If this value is set, this event will only fire for entities that match. *** ### entityTypes? > `optional` **entityTypes?**: `string`\[] **`Beta`** #### Remarks 如果设置了此值,则仅当受影响的实体类型与此参数匹配时才会触发此事件。 If this value is set, this event will only fire if the impacted entities' type matches this parameter. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityHurtBeforeEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityHurtBeforeEventOptions.md. # Interface: EntityHurtBeforeEventOptions event entity **`Beta`** 包含注册实体受伤前事件的可选参数。 Contains optional parameters for registering an entity hurt before event. ## Properties ### allowedDamageCauses? > `optional` **allowedDamageCauses?**: [`EntityDamageCause`](/server/enums/EntityDamageCause.md)\[] **`Beta`** #### Remarks 如果设置了此值,则仅当伤害原因匹配时才会触发此事件。 If this value is set, this event will only fire for damage causes that match. *** ### entityFilter? > `optional` **entityFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** #### Remarks 如果设置了此值,则仅当实体匹配时才会触发此事件。 If this value is set, this event will only fire for entities that match. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityItemDropEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityItemDropEventOptions.md. # Interface: EntityItemDropEventOptions event entity **`Beta`** 传递给 [EntityItemDropAfterEventSignal.subscribe](/server/classes/EntityItemDropAfterEventSignal.md#subscribe) 的接口,用于过滤哪些事件会传递给所提供的回调函数。 An interface that is passed into [EntityItemDropAfterEventSignal.subscribe](/server/classes/EntityItemDropAfterEventSignal.md#subscribe) that filters out which events are passed to the provided callback. ## Properties ### entityFilter? > `optional` **entityFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** #### Remarks 如果设置了此值,则仅当实体匹配时才会触发此事件。 If this value is set, this event will only fire for entities that match. *** ### itemFilter? > `optional` **itemFilter?**: [`ItemFilter`](/server/interfaces/ItemFilter.md) **`Beta`** #### Remarks 如果设置了此值,则仅当事件中的物品匹配时才会触发此事件。 If this value is set, this event will only fire if an item in the event matches. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityItemPickupEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityItemPickupEventOptions.md. # Interface: EntityItemPickupEventOptions event entity **`Beta`** 传递给 [EntityItemPickupAfterEventSignal.subscribe](/server/classes/EntityItemPickupAfterEventSignal.md#subscribe) 和 [EntityItemPickupBeforeEventSignal.subscribe](/server/classes/EntityItemPickupBeforeEventSignal.md#subscribe) 的接口,用于过滤哪些事件会传递给所提供的回调函数。 An interface that is passed into [EntityItemPickupAfterEventSignal.subscribe](/server/classes/EntityItemPickupAfterEventSignal.md#subscribe) and [EntityItemPickupBeforeEventSignal.subscribe](/server/classes/EntityItemPickupBeforeEventSignal.md#subscribe) that filters out which events are passed to the provided callback. ## Properties ### entityFilter? > `optional` **entityFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** #### Remarks 如果设置了此值,则仅当实体匹配时才会触发此事件。 If this value is set, this event will only fire for entities that match. *** ### itemFilter? > `optional` **itemFilter?**: [`ItemFilter`](/server/interfaces/ItemFilter.md) **`Beta`** #### Remarks 如果设置了此值,则仅当事件中的物品匹配时才会触发此事件。 If this value is set, this event will only fire if an item in the event matches. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityQueryPropertyOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityQueryPropertyOptions.md. # Interface: EntityQueryPropertyOptions entity **`Beta`** ## Properties ### exclude? > `optional` **exclude?**: `boolean` **`Beta`** *** ### propertyId > **propertyId**: `string` **`Beta`** *** ### value? > `optional` **value?**: `string` | `boolean` | [`EqualsComparison`](/server/interfaces/EqualsComparison.md) | [`GreaterThanComparison`](/server/interfaces/GreaterThanComparison.md) | [`GreaterThanOrEqualsComparison`](/server/interfaces/GreaterThanOrEqualsComparison.md) | [`LessThanComparison`](/server/interfaces/LessThanComparison.md) | [`LessThanOrEqualsComparison`](/server/interfaces/LessThanOrEqualsComparison.md) | [`NotEqualsComparison`](/server/interfaces/NotEqualsComparison.md) | [`RangeComparison`](/server/interfaces/RangeComparison.md) **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityQueryScoreOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityQueryScoreOptions.md. # Interface: EntityQueryScoreOptions entity **`Beta`** 包含根据目标的分数筛选玩家的额外选项。 Contains additional options for filtering players based on their score for an objective. ## Properties ### exclude? > `optional` **exclude?**: `boolean` **`Beta`** #### Remarks 如果设置为 `true`,则此分数范围内的实体和玩家将从查询结果中排除。 If set to true, entities and players within this score range are excluded from query results. *** ### maxScore? > `optional` **maxScore?**: `number` **`Beta`** #### Remarks 如果定义,仅包含分数等于或低于 `maxScore` 的玩家。 If defined, only players that have a score equal to or under maxScore are included. *** ### minScore? > `optional` **minScore?**: `number` **`Beta`** #### Remarks 如果定义,仅包含分数等于或高于 `minScore` 的玩家。 If defined, only players that have a score equal to or over minScore are included. *** ### objective? > `optional` **objective?**: `string` **`Beta`** #### Remarks 筛选的计分板目标标识符。 Identifier of the scoreboard objective to filter on. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityRaycastHit.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityRaycastHit.md. # Interface: EntityRaycastHit entity **`Beta`** 包含实体射线投射命中结果的信息。 Contains information for entity raycast hit results. ## Properties ### distance > **distance**: `number` **`Beta`** #### Remarks 从射线原点到实体边界的距离。 Distance from ray origin to entity bounds. *** ### entity > **entity**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 被击中的实体。 Entity that was hit. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntitySneakingChangedEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntitySneakingChangedEventOptions.md. # Interface: EntitySneakingChangedEventOptions event entity **`Beta`** 用于过滤实体开始潜行和停止潜行事件的选项。 Options used to filter entity start sneaking and stop sneaking events. ## Properties ### entityFilter? > `optional` **entityFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EntityTamedEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EntityTamedEventOptions.md. # Interface: EntityTamedEventOptions event entity **`Beta`** ## Preview Contains options for filtering entity tamed events. ## Properties ### entityFilter? > `optional` **entityFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** *** ### tamingEntityFilter? > `optional` **tamingEntityFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/EqualsComparison.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/EqualsComparison.md. # Interface: EqualsComparison **`Beta`** 等于运算符。 Equal to operator. ## Properties ### equals > **equals**: `string` | `number` | `boolean` **`Beta`** #### Remarks 进行比较的阈值。 Threshold value compared against. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/ExplosionOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ExplosionOptions.md. # Interface: ExplosionOptions **`Beta`** [Dimension.createExplosion](/server/classes/Dimension.md#createexplosion) 方法的附加配置选项。 ## Examples **createNoBlockExplosion.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { Vector3Utils } from '@minecraft/math'; function createNoBlockExplosion(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const explodeNoBlocksLoc = Vector3Utils.floor(Vector3Utils.add(targetLocation, { x: 1, y: 2, z: 1 })); log('Creating an explosion of radius 15 that does not break blocks.'); targetLocation.dimension.createExplosion(explodeNoBlocksLoc, 15, { breaksBlocks: false }); } ``` **createExplosions.ts** ```typescript import { DimensionLocation } from '@minecraft/server'; import { Vector3Utils } from '@minecraft/math'; function createExplosions(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const explosionLoc = Vector3Utils.add(targetLocation, { x: 0.5, y: 0.5, z: 0.5 }); log('Creating an explosion of radius 15 that causes fire.'); targetLocation.dimension.createExplosion(explosionLoc, 15, { causesFire: true }); const belowWaterLoc = Vector3Utils.add(targetLocation, { x: 3, y: 1, z: 3 }); log('Creating an explosion of radius 10 that can go underwater.'); targetLocation.dimension.createExplosion(belowWaterLoc, 10, { allowUnderwater: true }); } ``` ## Properties ### allowUnderwater? > `optional` **allowUnderwater?**: `boolean` **`Beta`** #### Remarks 爆炸是否也会影响水下区域。 Whether parts of the explosion also impact underwater. *** ### breaksBlocks? > `optional` **breaksBlocks?**: `boolean` **`Beta`** #### Remarks 爆炸是否会破坏爆炸半径内的方块。 Whether the explosion will break blocks within the blast radius. *** ### causesFire? > `optional` **causesFire?**: `boolean` **`Beta`** #### Remarks 如果为 `true`,爆炸会在爆炸半径内或附近伴随火焰。 If true, the explosion is accompanied by fires within or near the blast radius. *** ### source? > `optional` **source?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks 可选的爆炸来源。 Optional source of the explosion. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/GetBlocksStandingOnOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/GetBlocksStandingOnOptions.md. # Interface: GetBlocksStandingOnOptions **`Beta`** 包含 `getBlockStandingOn` 和 `getAllBlocksStandingOn` 的额外选项。 Contains additional options for getBlockStandingOn and getAllBlocksStandingOn. ## Properties ### blockFilter? > `optional` **blockFilter?**: [`BlockFilter`](/server/interfaces/BlockFilter.md) **`Beta`** #### Remarks 指定后,函数将根据方块过滤器来包括/排除返回的方块。 When specified, the function will include / exclude what block(s) are returned based on the block filter. *** ### ignoreThinBlocks? > `optional` **ignoreThinBlocks?**: `boolean` **`Beta`** #### Remarks 如果为 `true`,所有高度为 0.2 或更低的方块(如活板门和地毯)将被忽略,并返回其下方的方块。 If true, all blocks of height 0.2 or lower like trapdoors and carpets will be ignored, and the block underneath will be returned. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/GreaterThanComparison.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/GreaterThanComparison.md. # Interface: GreaterThanComparison **`Beta`** 大于运算符。 Greater than operator. ## Properties ### greaterThan > **greaterThan**: `number` **`Beta`** #### Remarks 进行比较的阈值。 Threshold value compared against. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/GreaterThanOrEqualsComparison.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/GreaterThanOrEqualsComparison.md. # Interface: GreaterThanOrEqualsComparison **`Beta`** 大于或等于运算符。 Greater than or equal to operator. ## Properties ### greaterThanOrEquals > **greaterThanOrEquals**: `number` **`Beta`** #### Remarks 进行比较的阈值。 Threshold value compared against. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/HotbarEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/HotbarEventOptions.md. # Interface: HotbarEventOptions event **`Beta`** 包含快捷栏事件的附加过滤选项。 Contains additional filtering options for hotbar events. ## Properties ### allowedSlots? > `optional` **allowedSlots?**: `number`\[] **`Beta`** #### Remarks 要考虑的插槽索引。值应在 0 到 8 之间(含)。如果未指定,则考虑所有插槽。 The slot indexes to consider. Values should be between 0 and 8, inclusive. If not specified, all slots are considered. Bounds: \[0, 8] ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/InputEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/InputEventOptions.md. # Interface: InputEventOptions event **`Beta`** 传递给 [PlayerButtonInputAfterEventSignal.subscribe](/server/classes/PlayerButtonInputAfterEventSignal.md#subscribe) 的接口,用于过滤哪些事件会传递给所提供的回调函数。 An interface that is passed into [PlayerButtonInputAfterEventSignal.subscribe](/server/classes/PlayerButtonInputAfterEventSignal.md#subscribe) that filters out which events are passed to the provided callback. ## Properties ### buttons? > `optional` **buttons?**: [`InputButton`](/server/enums/InputButton.md)\[] **`Beta`** #### Remarks 回调函数应针对的按钮。如果未定义,回调函数将针对所有按钮被调用。 The buttons the callback should be called for. If undefined, the callback will be called for all buttons. *** ### state? > `optional` **state?**: [`ButtonState`](/server/enums/ButtonState.md) **`Beta`** #### Remarks 回调函数应针对的状态。如果未定义,回调函数将针对所有按钮状态被调用。 The state the callback should be called for. If undefined, the callback will be called for all button states. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/InventoryItemEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/InventoryItemEventOptions.md. # Interface: InventoryItemEventOptions event inventory **`Beta`** 包含库存物品事件的额外过滤选项。 Contains additional filtering options for inventory item events. ## Properties ### allowedSlots? > `optional` **allowedSlots?**: `number`\[] **`Beta`** #### Remarks 要考虑的插槽索引。值应为正数。如果未指定,则考虑所有插槽。 The slot indexes to consider. Values should be positive numbers. If not specified, all slots are considered. Bounds: \[0, 1000] *** ### excludeItems? > `optional` **excludeItems?**: `string`\[] **`Beta`** #### Remarks 要排除的物品名称。 The names for the items to exclude. *** ### excludeTags? > `optional` **excludeTags?**: `string`\[] **`Beta`** #### Remarks 要排除的物品标签。 The item tags to exclude. *** ### ignoreQuantityChange? > `optional` **ignoreQuantityChange?**: `boolean` **`Beta`** #### Remarks 标记为仅忽略数量变化。`true` 表示忽略数量变化,`false` 表示不忽略数量变化。 Flag to specify to ignore quantity changes only. True to ignore quantity changes, false to not ignore quantity changes. *** ### includeItems? > `optional` **includeItems?**: `string`\[] **`Beta`** #### Remarks 要考虑的物品名称。 The item names to consider. *** ### includeTags? > `optional` **includeTags?**: `string`\[] **`Beta`** #### Remarks 要考虑的物品标签。 The item tags to consider. *** ### inventoryType? > `optional` **inventoryType?**: [`PlayerInventoryType`](/server/enums/PlayerInventoryType.md) **`Beta`** #### Remarks 要考虑的玩家库存类型。 The player inventory type to consider. ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/ItemCustomComponent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ItemCustomComponent.md. # Interface: ItemCustomComponent component **`Beta`** 包含将为物品触发的一组事件。 此对象必须使用 `ItemComponentRegistry` 进行绑定。 Contains a set of events that will be raised for an item. This object must be bound using the ItemComponentRegistry. ## Properties ### onBeforeDurabilityDamage? > `optional` **onBeforeDurabilityDamage?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`ItemComponentBeforeDurabilityDamageEvent`](/server/classes/ItemComponentBeforeDurabilityDamageEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 当包含此组件的物品击中实体并即将消耗耐久度时,将调用此函数。 This function will be called when an item containing this component is hitting an entity and about to take durability damage. *** ### onCompleteUse? > `optional` **onCompleteUse?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`ItemComponentCompleteUseEvent`](/server/classes/ItemComponentCompleteUseEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 当包含此组件的物品的使用时长完成时,将调用此函数。 This function will be called when an item containing this component's use duration was completed. *** ### onConsume? > `optional` **onConsume?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`ItemComponentConsumeEvent`](/server/classes/ItemComponentConsumeEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 当包含此组件的物品被实体食用时,将调用此函数。 This function will be called when an item containing this component is eaten by an entity. *** ### onHitEntity? > `optional` **onHitEntity?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`ItemComponentHitEntityEvent`](/server/classes/ItemComponentHitEntityEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 当包含此组件的物品用于击中另一个实体时,将调用此函数。 This function will be called when an item containing this component is used to hit another entity. *** ### onMineBlock? > `optional` **onMineBlock?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`ItemComponentMineBlockEvent`](/server/classes/ItemComponentMineBlockEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 当包含此组件的物品用于挖掘方块时,将调用此函数。 This function will be called when an item containing this component is used to mine a block. *** ### onUse? > `optional` **onUse?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`ItemComponentUseEvent`](/server/classes/ItemComponentUseEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 当包含此组件的物品被玩家使用时,将调用此函数。 This function will be called when an item containing this component is used by a player. *** ### onUseOn? > `optional` **onUseOn?**: (`arg0`, `arg1`) => `void` **`Beta`** #### Parameters ##### arg0 [`ItemComponentUseOnEvent`](/server/classes/ItemComponentUseOnEvent.md) ##### arg1 [`CustomComponentParameters`](/server/classes/CustomComponentParameters.md) #### Returns `void` #### Remarks 当包含此组件的物品在方块上被使用时,将调用此函数。 This function will be called when an item containing this component is used on a block. ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/ItemFilter.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ItemFilter.md. # Interface: ItemFilter **`Beta`** 包含过滤物品的选项。 Contains options for filtering items. ## Properties ### includeTypes? > `optional` **includeTypes?**: (`string` | [`ItemType`](/server/classes/ItemType.md))\[] **`Beta`** #### Remarks 如果定义,则包含与这些类型匹配的物品。 If defined, items that match these types are included. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/JigsawPlaceOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/JigsawPlaceOptions.md. # Interface: JigsawPlaceOptions **`Beta`** 为 [StructureManager.placeJigsaw](/server/classes/StructureManager.md#placejigsaw) 提供额外选项。 Provides additional options for [StructureManager.placeJigsaw](/server/classes/StructureManager.md#placejigsaw). ## Properties ### includeEntities? > `optional` **includeEntities?**: `boolean` **`Beta`** #### Remarks 结构中是否应包含实体。默认为 `true`。 Whether entities should be included in the structure. Defaults to true. *** ### keepJigsaws? > `optional` **keepJigsaws?**: `boolean` **`Beta`** #### Remarks 生成结构时是否保留拼图方块。默认为 `false`。 Whether the jigsaw blocks should be kept when generating the structure. Defaults to false. *** ### liquidSettings? > `optional` **liquidSettings?**: [`LiquidSettings`](/server/enums/LiquidSettings.md) **`Beta`** #### Remarks 指定如何处理可与水共存的方块与现有液体的重叠。默认为 `ApplyWaterlogging`。 Specifies how to handle waterloggable blocks overlapping with existing liquid. Defaults to `ApplyWaterlogging`. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/JigsawStructurePlaceOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/JigsawStructurePlaceOptions.md. # Interface: JigsawStructurePlaceOptions **`Beta`** 为 [StructureManager.placeJigsawStructure](/server/classes/StructureManager.md#placejigsawstructure) 提供额外选项。 Provides additional options for [StructureManager.placeJigsawStructure](/server/classes/StructureManager.md#placejigsawstructure). ## Properties ### ignoreStartHeight? > `optional` **ignoreStartHeight?**: `boolean` **`Beta`** #### Remarks 是否应忽略拼图结构定义中定义的起始高度,并使用指定的 y 坐标覆盖。默认为 `false`。 Whether the start height defined in the jigsaw structure definition should be ignored and overridden with the specified y coordinate. Defaults to false. *** ### includeEntities? > `optional` **includeEntities?**: `boolean` **`Beta`** #### Remarks 结构中是否应包含实体。默认为 `true`。 Whether entities should be included in the structure. Defaults to true. *** ### keepJigsaws? > `optional` **keepJigsaws?**: `boolean` **`Beta`** #### Remarks 生成结构时是否保留拼图方块。默认为 `false`。 Whether the jigsaw blocks should be kept when generating the structure. Defaults to false. *** ### liquidSettings? > `optional` **liquidSettings?**: [`LiquidSettings`](/server/enums/LiquidSettings.md) **`Beta`** #### Remarks 指定如何处理可与水共存的方块与现有液体的重叠。默认为 `ApplyWaterlogging`。 Specifies how to handle waterloggable blocks overlapping with existing liquid. Defaults to `ApplyWaterlogging`. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/LessThanComparison.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/LessThanComparison.md. # Interface: LessThanComparison **`Beta`** 小于运算符。 Less than operator. ## Properties ### lessThan > **lessThan**: `number` **`Beta`** #### Remarks 进行比较的阈值。 Threshold value compared against. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/LessThanOrEqualsComparison.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/LessThanOrEqualsComparison.md. # Interface: LessThanOrEqualsComparison **`Beta`** 小于或等于运算符。 Less than or equal to operator. ## Properties ### lessThanOrEquals > **lessThanOrEquals**: `number` **`Beta`** #### Remarks 进行比较的阈值。 Threshold value compared against. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/MusicOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/MusicOptions.md. # Interface: MusicOptions **`Beta`** 用于 [World.playMusic](/server/classes/World.md#playmusic)/[World.queueMusic](/server/classes/World.md#queuemusic) 方法的额外配置选项。 Additional configuration options for [World.playMusic](/server/classes/World.md#playmusic)/[World.queueMusic](/server/classes/World.md#queuemusic) methods. ## Properties ### fade? > `optional` **fade?**: `number` **`Beta`** #### Remarks 指定音乐播放结束时的淡出重叠量。 Specifies a fade overlap for music at the end of play. *** ### loop? > `optional` **loop?**: `boolean` **`Beta`** #### Remarks 如果设置为 `true`,此音乐曲目将重复播放。 If set to true, this music track will play repeatedly. *** ### volume? > `optional` **volume?**: `number` **`Beta`** #### Remarks 音乐的相对音量级别。 Relative volume level of the music. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/NotEqualsComparison.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/NotEqualsComparison.md. # Interface: NotEqualsComparison **`Beta`** 不等于运算符。 Not equal to operator. ## Properties ### notEquals > **notEquals**: `string` | `number` | `boolean` **`Beta`** #### Remarks 进行比较的阈值。 Threshold value compared against. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/PlayAnimationOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/PlayAnimationOptions.md. # Interface: PlayAnimationOptions animation **`Beta`** 包含动画播放方式的额外选项。 Contains additional options for how an animation is played. ## Properties ### blendOutTime? > `optional` **blendOutTime?**: `number` **`Beta`** #### Remarks 动画停止后淡出所需的时间。 Amount of time to fade out after an animation stops. *** ### controller? > `optional` **controller?**: `string` **`Beta`** #### Remarks 指定要在实体上使用的已定义的控制器。 Specifies a controller to use that has been defined on the entity. *** ### nextState? > `optional` **nextState?**: `string` **`Beta`** #### Remarks 指定要转换到的状态。 Specifies the state to transition to. *** ### players? > `optional` **players?**: [`Player`](/server/classes/Player.md)\[] **`Beta`** #### Remarks 动画对其可见的玩家列表。 A list of players the animation will be visible to. *** ### stopExpression? > `optional` **stopExpression?**: `string` **`Beta`** #### Remarks 指定此动画完成时应使用的 Molang 表达式。 Specifies a Molang expression for when this animation should complete. ## 同领域相关 - [AnimationOptions](/server/interfaces/AnimationOptions.md) - [SplineAnimation](/server/interfaces/SplineAnimation.md) - [StructureAnimationMode](/server/enums/StructureAnimationMode.md) - [ImageAnimationData](/server-editor/types/ImageAnimationData.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/PlayerAimAssistSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/PlayerAimAssistSettings.md. # Interface: PlayerAimAssistSettings player **`Beta`** 与玩家瞄准辅助相关的设置。 Settings relating to a player's aim-assist targeting. ## Properties ### distance? > `optional` **distance?**: `number` **`Beta`** #### Remarks 用于瞄准辅助的视距限制。 The view distance limit to use for aim-assist targeting. *** ### presetId > **presetId**: `string` **`Beta`** #### Remarks 要激活的瞄准辅助预设的 ID。必须包含命名空间。 The Id of the aim-assist preset to activate. Must have a namespace. *** ### targetMode? > `optional` **targetMode?**: [`AimAssistTargetMode`](/server/enums/AimAssistTargetMode.md) **`Beta`** #### Remarks 用于瞄准辅助的模式。 The mode to use for aim-assist targeting. *** ### viewAngle? > `optional` **viewAngle?**: [`Vector2`](/server/interfaces/Vector2.md) **`Beta`** #### Remarks 用于瞄准辅助的视角限制。 The view angle limit to use for aim-assist targeting. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/PlayerBreakingBlockEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/PlayerBreakingBlockEventOptions.md. # Interface: PlayerBreakingBlockEventOptions event player block **`Beta`** ## Preview 传递给 [PlayerStartBreakingBlockAfterEventSignal.subscribe](/server/classes/PlayerStartBreakingBlockAfterEventSignal.md#subscribe) 或 [PlayerCancelBreakingBlockAfterEventSignal.subscribe](/server/classes/PlayerCancelBreakingBlockAfterEventSignal.md#subscribe) 的接口,用于过滤哪些事件会传递给所提供的回调函数。 An interface that is passed into [PlayerStartBreakingBlockAfterEventSignal.subscribe](/server/classes/PlayerStartBreakingBlockAfterEventSignal.md#subscribe) or [PlayerCancelBreakingBlockAfterEventSignal.subscribe](/server/classes/PlayerCancelBreakingBlockAfterEventSignal.md#subscribe) that filters out which events are passed to the provided callback. ## Properties ### blockFilter? > `optional` **blockFilter?**: [`BlockFilter`](/server/interfaces/BlockFilter.md) **`Beta`** #### Remarks 回调函数应针对的 [BlockFilter](/server/interfaces/BlockFilter.md)。如果未定义,回调函数将针对所有方块被调用。 The [BlockFilter](/server/interfaces/BlockFilter.md) that the callback should be called for. If undefined, the callback will be called for all blocks. *** ### playerFilter? > `optional` **playerFilter?**: [`EntityFilter`](/server/interfaces/EntityFilter.md) **`Beta`** #### Remarks 回调函数应针对的 [EntityFilter](/server/interfaces/EntityFilter.md)。如果未定义,回调函数将针对所有玩家被调用。 The [EntityFilter](/server/interfaces/EntityFilter.md) that the callback should be called for. If undefined, the callback will be called for all players. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/PlayerSoundOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/PlayerSoundOptions.md. # Interface: PlayerSoundOptions player sound **`Beta`** 如何为玩家播放声音的额外选项。 Additional options for how a sound plays for a player. ## Properties ### location? > `optional` **location?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 声音的位置;如果未指定,则在玩家附近播放声音。 Location of the sound; if not specified, the sound is played near a player. *** ### loopCount? > `optional` **loopCount?**: `number` **`Beta`** #### Remarks 初始播放后额外重复该声音的次数。`0`(默认值)播放一次,`-1` 无限循环,正整数 `N` 总共播放 `N + 1` 次。例如,`loopCount: 1` 播放两次。循环次数在声音开始时固定,之后无法更改。使用 `-1` 时,请参阅 `SoundInstance` 了解句柄生命周期要求。 Number of additional times to repeat the sound after the initial play. `0` (the default) plays the sound once, `-1` loops it forever, and a positive integer `N` plays the sound `N + 1` times in total. For example, `loopCount: 1` plays the sound twice. The loop count is fixed when the sound starts and cannot be changed afterward. When using `-1`, see `SoundInstance` for handle lifetime requirements. *** ### pitch? > `optional` **pitch?**: `number` **`Beta`** #### Remarks 可选的音高。 Optional pitch of the sound. *** ### volume? > `optional` **volume?**: `number` **`Beta`** #### Remarks 可选的音量。 Optional volume of the sound. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/PlayerSwingEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/PlayerSwingEventOptions.md. # Interface: PlayerSwingEventOptions event player **`Beta`** 传递给 [@minecraft/server.PlayerSwingStartAfterEventSignal.subscribe](/server/classes/PlayerSwingStartAfterEventSignal.md#subscribe) 的接口,用于过滤哪些事件会传递给所提供的回调函数。 An interface that is passed into [@minecraft/server.PlayerSwingStartAfterEventSignal.subscribe](/server/classes/PlayerSwingStartAfterEventSignal.md#subscribe) that filters out which events are passed to the provided callback. ## Properties ### heldItemOption? > `optional` **heldItemOption?**: [`HeldItemOption`](/server/enums/HeldItemOption.md) **`Beta`** #### Remarks 回调函数应针对的持有物品选项。如果未定义,无论玩家手中是否持有物品,回调函数都会被调用。 The held item option that the callback should be called for. If undefined, the callback will be called whether or not the player is holding an item in their hand. *** ### swingSource? > `optional` **swingSource?**: [`EntitySwingSource`](/server/enums/EntitySwingSource.md) **`Beta`** #### Remarks 回调函数应针对的 [EntitySwingSource](/server/enums/EntitySwingSource.md)。如果未定义,回调函数将针对所有挥动来源被调用。 The [EntitySwingSource](/server/enums/EntitySwingSource.md) that the callback should be called for. If undefined, the callback will be called for all swing sources. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/PrimitiveShapeQueryOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/PrimitiveShapeQueryOptions.md. # Interface: PrimitiveShapeQueryOptions **`Beta`** Contains optional filters that control which primitive shapes are returned from a primitive shapes query. ## Properties ### attachedTo? > `optional` **attachedTo?**: [`Entity`](/server/classes/Entity.md) **`Beta`** #### Remarks If specified, only returns shapes attached to this entity. *** ### location? > `optional` **location?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks Adds a seed location to the query that is used in conjunction with distance properties. *** ### maxDistance? > `optional` **maxDistance?**: `number` **`Beta`** #### Remarks If specified, only includes shapes that are less than this distance away from the location specified in the location property. *** ### minDistance? > `optional` **minDistance?**: `number` **`Beta`** #### Remarks If specified, only includes shapes that are at least this distance away from the location specified in the location property. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/ProgressKeyFrame.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ProgressKeyFrame.md. # Interface: ProgressKeyFrame **`Beta`** 保存相机动画进度的关键帧。 Key frame that holds the progress of the camera animation. ## Properties ### alpha > **alpha**: `number` **`Beta`** #### Remarks 表示相机沿曲线的进度值。取值范围为 \[0.0, 1.0](包含两端)。 Value to denote how far along the curve the camera will be. Values are \[0.0, 1.0] inclusive. *** ### easingFunc? > `optional` **easingFunc?**: [`EasingType`](/server/enums/EasingType.md) **`Beta`** #### Remarks 该帧在位置变化中使用的可选缓动类型。 The optional easing type that the frame will use for position. *** ### timeSeconds > **timeSeconds**: `number` **`Beta`** #### Remarks 相机到达指定 alpha 值的时间值。 Time value that the camera will be at the given alpha. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/ProjectileShootOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ProjectileShootOptions.md. # Interface: ProjectileShootOptions **`Beta`** @minecraft/server.EntityProjectileComponent.shoot 的可选参数。 Optional arguments for @minecraft/server.EntityProjectileComponent.shoot. ## Properties ### uncertainty? > `optional` **uncertainty?**: `number` **`Beta`** #### Remarks 控制射击的精度。值为 0 表示完美精度。 Controls the accuracy of the shot. A value of 0 is perfect accuracy. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/RangeComparison.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/RangeComparison.md. # Interface: RangeComparison **`Beta`** 表示用于表达数字可能范围的上下界结构的运算符。 Operator represents a lower/upper bound structure for expressing a potential range of numbers. ## Properties ### lowerBound > **lowerBound**: `number` **`Beta`** #### Remarks 范围内的下界。 Lower bound within a range. *** ### upperBound > **upperBound**: `number` **`Beta`** #### Remarks 范围内的上界。 Upper bound within a range. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/RawMessage.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/RawMessage.md. # Interface: RawMessage chat **`Beta`** 定义一个用于更灵活处理的 JSON 结构。 Defines a JSON structure that is used for more flexible. ## Examples **addTranslatedSign.ts** ```typescript import { DimensionLocation, world, BlockPermutation, BlockComponentTypes } from '@minecraft/server'; function placeTranslatedSign(location: DimensionLocation, text: string) { const signBlock = location.dimension.getBlock(location); if (!signBlock) { console.warn('Could not find a block at specified location.'); return; } const signPerm = BlockPermutation.resolve('minecraft:standing_sign', { ground_sign_direction: 8 }); signBlock.setPermutation(signPerm); const signComponent = signBlock.getComponent(BlockComponentTypes.Sign); if (signComponent) { signComponent.setText({ translate: 'item.skull.player.name', with: [text] }); } else { console.error('Could not find a sign component on the block.'); } } placeTranslatedSign( { dimension: world.getDimension('overworld'), x: 0, y: 0, z: 0, }, 'Steve' ); ``` **showTranslatedMessageForm.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; import { MessageFormResponse, MessageFormData } from '@minecraft/server-ui'; function showTranslatedMessageForm(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); const messageForm = new MessageFormData() .title({ translate: 'permissions.removeplayer' }) .body({ translate: 'accessibility.list.or.two', with: ['Player 1', 'Player 2'] }) .button1('Player 1') .button2('Player 2'); messageForm .show(players[0]) .then((formData: MessageFormResponse) => { // player canceled the form, or another dialog was up and open. if (formData.canceled || formData.selection === undefined) { return; } log(`You selected ${formData.selection === 0 ? 'Player 1' : 'Player 2'}`); }) .catch((error: Error) => { log('Failed to show form: ' + error); return -1; }); } ``` **addTranslatedSign.ts** ```typescript import { world, BlockPermutation, BlockSignComponent, BlockComponentTypes, DimensionLocation } from '@minecraft/server'; import { MinecraftBlockTypes } from '@minecraft/vanilla-data'; function addTranslatedSign(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); const dim = players[0].dimension; const signBlock = dim.getBlock(targetLocation); if (!signBlock) { log('Could not find a block at specified location.'); return -1; } const signPerm = BlockPermutation.resolve(MinecraftBlockTypes.StandingSign, { ground_sign_direction: 8 }); signBlock.setPermutation(signPerm); const signComponent = signBlock.getComponent(BlockComponentTypes.Sign) as BlockSignComponent; signComponent?.setText({ translate: 'item.skull.player.name', with: [players[0].name] }); } ``` ## Properties ### rawtext? > `optional` **rawtext?**: `RawMessage`\[] **`Beta`** #### Remarks 提供当前消息的原始文本等效内容。 Provides a raw-text equivalent of the current message. *** ### score? > `optional` **score?**: [`RawMessageScore`](/server/interfaces/RawMessageScore.md) **`Beta`** #### Remarks 提供一个将被替换为分数值的令牌。 Provides a token that will get replaced with the value of a score. *** ### text? > `optional` **text?**: `string` **`Beta`** #### Remarks 提供一个要使用的字符串字面量值。 Provides a string literal value to use. *** ### translate? > `optional` **translate?**: `string` **`Beta`** #### Remarks 提供一个翻译令牌,如果客户端在玩家语言中有与该令牌匹配的可用资源,则会在客户端进行翻译。 Provides a translation token where, if the client has an available resource in the players' language which matches the token, will get translated on the client. *** ### with? > `optional` **with?**: `string`\[] | `RawMessage` **`Beta`** #### Remarks 翻译令牌的参数。可以是字符串数组,也可以是包含原始文本对象数组的 RawMessage。 Arguments for the translation token. Can be either an array of strings or RawMessage containing an array of raw text objects. ## 同领域相关 - [RawMessageError](/server/classes/RawMessageError.md) - [RawMessageScore](/server/interfaces/RawMessageScore.md) - [RawText](/server/interfaces/RawText.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/RawMessageScore.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/RawMessageScore.md. # Interface: RawMessageScore chat **`Beta`** 提供在原始消息中使用的分数令牌的描述。 Provides a description of a score token to use within a raw message. ## Properties ### name? > `optional` **name?**: `string` **`Beta`** #### Remarks 要匹配的分数值名称。 Name of the score value to match. *** ### objective? > `optional` **objective?**: `string` **`Beta`** #### Remarks 要匹配的分数值名称。 Name of the score value to match. ## 同领域相关 - [RawMessage](/server/interfaces/RawMessage.md) - [RawMessageError](/server/classes/RawMessageError.md) - [RawText](/server/interfaces/RawText.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/RawText.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/RawText.md. # Interface: RawText chat **`Beta`** 一个仅包含 `rawtext` 属性的 `RawMessage`。当序列化 `RawMessage` 时,内容会被放入 `rawtext` 属性中,因此在读取已保存的 RawMessage 时非常有用。请参阅 `BlockSignComponent.setText` 和 `BlockSignComponent.getRawText` 获取示例。 A `RawMessage` with only the `rawtext` property. When a `RawMessage` is serialized the contents are put into a rawtext property, so this is useful when reading saved RawMessages. See `BlockSignComponent.setText` and `BlockSignComponent.getRawText` for examples. ## Properties ### rawtext? > `optional` **rawtext?**: [`RawMessage`](/server/interfaces/RawMessage.md)\[] **`Beta`** #### Remarks 关联告示牌当前值的序列化内容。 A serialization of the current value of an associated sign. ## 同领域相关 - [RawMessage](/server/interfaces/RawMessage.md) - [RawMessageError](/server/classes/RawMessageError.md) - [RawMessageScore](/server/interfaces/RawMessageScore.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/RotationKeyFrame.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/RotationKeyFrame.md. # Interface: RotationKeyFrame **`Beta`** 保存相机动画旋转角度的关键帧。 Key frame that holds the rotation of the camera animation. ## Properties ### easingFunc? > `optional` **easingFunc?**: [`EasingType`](/server/enums/EasingType.md) **`Beta`** #### Remarks 该帧在旋转中使用的可选缓动类型。 The optional easing type that the frame will use for rotation. *** ### rotation > **rotation**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 相机旋转值。 Value of the rotation of the camera. *** ### timeSeconds > **timeSeconds**: `number` **`Beta`** #### Remarks 相机到达指定旋转角度的时间值。 Time value that the camera will be at the given rotation. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/ScoreboardObjectiveDisplayOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ScoreboardObjectiveDisplayOptions.md. # Interface: ScoreboardObjectiveDisplayOptions scoreboard **`Beta`** 表示记分项显示位置配置。描述了如何在记分板显示位置上显示记分项。 Contains additional options for how a scoreboard should be displayed within its display slot. ## Properties ### objective > **objective**: [`ScoreboardObjective`](/server/classes/ScoreboardObjective.md) **`Beta`** #### Remarks 要显示的记分项。 Objective to be displayed. *** ### sortOrder? > `optional` **sortOrder?**: [`ObjectiveSortOrder`](/server/enums/ObjectiveSortOrder.md) **`Beta`** #### Remarks 记分项条目的显示排序顺序。 The sort order to display the objective items within. ## 同领域相关 - [Scoreboard](/server/classes/Scoreboard.md) - [ScoreboardIdentity](/server/classes/ScoreboardIdentity.md) - [ScoreboardIdentityType](/server/enums/ScoreboardIdentityType.md) - [ScoreboardObjective](/server/classes/ScoreboardObjective.md) - [ScoreboardScoreInfo](/server/classes/ScoreboardScoreInfo.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/ScriptEventMessageFilterOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/ScriptEventMessageFilterOptions.md. # Interface: ScriptEventMessageFilterOptions event **`Beta`** 包含注册脚本事件回调的额外选项。 Contains additional options for registering a script event event callback. ## Properties ### namespaces > **namespaces**: `string`\[] **`Beta`** #### Remarks 用于过滤入站脚本事件消息的可选命名空间列表。 Optional list of namespaces to filter inbound script event messages. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/SoundDefinitionDurationInfo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/SoundDefinitionDurationInfo.md. # Interface: SoundDefinitionDurationInfo sound **`Beta`** 在声音定义中声明的持续时间元数据。 Duration metadata declared in a sound definition. ## Properties ### duration > **duration**: `number` **`Beta`** #### Remarks 声音定义中声明的总持续时长(以秒为单位)。 Total duration of the sound in seconds, as declared in the sound definition. ## 同领域相关 - [PlayerSoundOptions](/server/interfaces/PlayerSoundOptions.md) - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent.md) - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal.md) - [SoundDefinition](/server/classes/SoundDefinition.md) - [SoundDefinitionFilter](/server/interfaces/SoundDefinitionFilter.md) - [SoundDefinitionMusicInfo](/server/interfaces/SoundDefinitionMusicInfo.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/SoundDefinitionFilter.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/SoundDefinitionFilter.md. # Interface: SoundDefinitionFilter sound **`Beta`** 用于缩小一组声音定义范围的筛选条件。每个字段都是可选的,仅在定义时应用其约束;一个定义必须满足所有已定义的字段才能通过。 Criteria used to narrow a set of sound definitions. Each field is optional and applies its constraint only when defined; a definition must satisfy every defined field to pass. ## Properties ### artists? > `optional` **artists?**: `string`\[] **`Beta`** #### Remarks 要与定义中 `music_info.artist` 进行匹配的艺术家名称。比较不区分大小写。当定义为非空数组时,只有在其声明的艺术家与提供的值之一匹配时,定义才通过。当未定义时,不对艺术家施加约束。 Artist names to match against the definition's music\_info.artist. Comparison is case-insensitive. When defined as a non-empty array, a definition passes only when its declared artist matches one of the supplied values. When undefined, no constraint on artist is applied. *** ### genres? > `optional` **genres?**: `string`\[] **`Beta`** #### Remarks 要与定义中 `music_info.genres` 进行匹配的流派。比较不区分大小写。当定义为非空数组时,只有在其声明的至少一个流派与提供的值之一匹配时,定义才通过。当未定义时,不对流派施加约束。 Genres to match against the definition's music\_info.genres. Comparison is case-insensitive. When defined as a non-empty array, a definition passes only when at least one of its declared genres matches one of the supplied values. When undefined, no constraint on genres is applied. *** ### maxDuration? > `optional` **maxDuration?**: `number` **`Beta`** #### Remarks 以秒为单位的上限(包含)。当定义时,持续时间更长的定义以及未声明持续时间的定义将被排除。当未定义时,不应用上限。 Upper bound in seconds, inclusive. When defined, definitions with a longer duration and definitions without a declared duration are excluded. When undefined, no upper bound is applied. *** ### minDuration? > `optional` **minDuration?**: `number` **`Beta`** #### Remarks 以秒为单位的下限(包含)。当定义时,持续时间更短的定义以及未声明持续时间的定义将被排除。当未定义时,不应用下限。 Lower bound in seconds, inclusive. When defined, definitions with a shorter duration and definitions without a declared duration are excluded. When undefined, no lower bound is applied. *** ### moods? > `optional` **moods?**: `string`\[] **`Beta`** #### Remarks 要与定义中 `music_info.moods` 进行匹配的情绪。比较不区分大小写。当定义为非空数组时,只有在其声明的至少一个情绪与提供的值之一匹配时,定义才通过。当未定义时,不对情绪施加约束。 Moods to match against the definition's music\_info.moods. Comparison is case-insensitive. When defined as a non-empty array, a definition passes only when at least one of its declared moods matches one of the supplied values. When undefined, no constraint on moods is applied. *** ### tags? > `optional` **tags?**: `Record`\<`string`, `string`\[]> **`Beta`** #### Remarks 要与定义的标签进行匹配的标签约束。标签名称和值的比较不区分大小写。当定义为非空记录时,只有对于每个具有非空值数组的条目,该标签名称在定义中存在且至少有一个匹配值时,定义才通过。当未定义时,不对标签施加约束。 Tag constraints to match against the definition's tags. Comparisons of tag names and values are case-insensitive. When defined as a non-empty record, a definition passes only when, for each entry with a non-empty value array, the tag name is present on the definition with at least one matching value. When undefined, no constraint on tags is applied. *** ### titles? > `optional` **titles?**: `string`\[] **`Beta`** #### Remarks 要与定义中 `music_info.title` 进行匹配的标题。比较不区分大小写。当定义为非空数组时,只有在其声明的标题与提供的值之一匹配时,定义才通过。当未定义时,不对标题施加约束。 Titles to match against the definition's music\_info.title. Comparison is case-insensitive. When defined as a non-empty array, a definition passes only when its declared title matches one of the supplied values. When undefined, no constraint on title is applied. ## 同领域相关 - [PlayerSoundOptions](/server/interfaces/PlayerSoundOptions.md) - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent.md) - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal.md) - [SoundDefinition](/server/classes/SoundDefinition.md) - [SoundDefinitionDurationInfo](/server/interfaces/SoundDefinitionDurationInfo.md) - [SoundDefinitionMusicInfo](/server/interfaces/SoundDefinitionMusicInfo.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/SoundDefinitionMusicInfo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/SoundDefinitionMusicInfo.md. # Interface: SoundDefinitionMusicInfo sound **`Beta`** 在声音定义上声明的音乐元数据。每个字段都是可选的,当声音定义未为其声明值时,该字段为 `undefined`。 Music metadata declared on a sound definition. Each field is optional and is undefined when the sound definition does not declare a value for it. ## Properties ### artist? > `optional` **artist?**: `string` **`Beta`** #### Remarks 为此声音声明的艺术家。当未声明艺术家时为 `undefined`。 Artist declared for this sound. Undefined when no artist was declared. *** ### genres? > `optional` **genres?**: `string`\[] **`Beta`** #### Remarks 为此声音声明的流派。当未声明流派时为 `undefined`。 Genres declared for this sound. Undefined when no genres were declared. *** ### moods? > `optional` **moods?**: `string`\[] **`Beta`** #### Remarks 为此声音声明的情绪。当未声明情绪时为 `undefined`。 Moods declared for this sound. Undefined when no moods were declared. *** ### title? > `optional` **title?**: `string` **`Beta`** #### Remarks 为此声音声明的标题。当未声明标题时为 `undefined`。 Title declared for this sound. Undefined when no title was declared. ## 同领域相关 - [PlayerSoundOptions](/server/interfaces/PlayerSoundOptions.md) - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent.md) - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal.md) - [SoundDefinition](/server/classes/SoundDefinition.md) - [SoundDefinitionDurationInfo](/server/interfaces/SoundDefinitionDurationInfo.md) - [SoundDefinitionFilter](/server/interfaces/SoundDefinitionFilter.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/SpawnEntityOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/SpawnEntityOptions.md. # Interface: SpawnEntityOptions entity **`Beta`** 包含生成实体的额外选项。 Contains additional options for spawning an Entity. ## Properties ### initialPersistence? > `optional` **initialPersistence?**: `boolean` **`Beta`** #### Remarks 可选布尔值,决定此实体是否应在游戏世界中持久存在。持久化可防止实体自动消失。 Optional boolean which determines if this entity should persist in the game world. Persistence prevents the entity from automatically despawning. *** ### initialRotation? > `optional` **initialRotation?**: `number` **`Beta`** #### Remarks 可选参数,实体生成时设置的初始旋转角度(以度为单位)。 Optional initial rotation, in degrees, to set on the entity when it spawns. *** ### spawnEvent? > `optional` **spawnEvent?**: `string` **`Beta`** #### Remarks 可选参数,实体生成后要发送给实体的事件。 Optional spawn event to send to the entity after it is spawned. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/SplineAnimation.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/SplineAnimation.md. # Interface: SplineAnimation animation **`Beta`** 相机动画的关键帧集合。 Collection of key frames for camera animation. ## Properties ### progressKeyFrames > **progressKeyFrames**: [`ProgressKeyFrame`](/server/interfaces/ProgressKeyFrame.md)\[] **`Beta`** #### Remarks 相机沿指定曲线的进度关键帧。 Key frames for camera progress along a given curve. *** ### rotationKeyFrames > **rotationKeyFrames**: [`RotationKeyFrame`](/server/interfaces/RotationKeyFrame.md)\[] **`Beta`** #### Remarks 相机旋转关键帧。 Key frames for camera rotation. ## 同领域相关 - [AnimationOptions](/server/interfaces/AnimationOptions.md) - [PlayAnimationOptions](/server/interfaces/PlayAnimationOptions.md) - [StructureAnimationMode](/server/enums/StructureAnimationMode.md) - [ImageAnimationData](/server-editor/types/ImageAnimationData.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/StructureCreateOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/StructureCreateOptions.md. # Interface: StructureCreateOptions **`Beta`** 为 [StructureManager.createFromWorld](/server/classes/StructureManager.md#createfromworld) 提供额外的选项。 Provides additional options for [StructureManager.createFromWorld](/server/classes/StructureManager.md#createfromworld) ## Properties ### includeBlocks? > `optional` **includeBlocks?**: `boolean` **`Beta`** #### Remarks 方块是否应包含在结构中。默认为 `true`。 Whether blocks should be included in the structure. Defaults to true. *** ### includeEntities? > `optional` **includeEntities?**: `boolean` **`Beta`** #### Remarks 实体是否应包含在结构中。默认为 `true`。 Whether entities should be included in the structure. Defaults to true. *** ### saveMode? > `optional` **saveMode?**: [`StructureSaveMode`](/server/enums/StructureSaveMode.md) **`Beta`** #### Remarks 结构的保存方式。默认为 StructureSaveMode.World。 How the Structure should be saved. Defaults to StructureSaveMode.World. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/StructurePlaceOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/StructurePlaceOptions.md. # Interface: StructurePlaceOptions **`Beta`** 为 [StructureManager.place](/server/classes/StructureManager.md#place) 提供额外的选项。 Provides additional options for [StructureManager.place](/server/classes/StructureManager.md#place) ## Properties ### animationMode? > `optional` **animationMode?**: [`StructureAnimationMode`](/server/enums/StructureAnimationMode.md) **`Beta`** #### Remarks 放置时结构的动画方式。 How the Structure should be animated when placed. *** ### animationSeconds? > `optional` **animationSeconds?**: `number` **`Beta`** #### Remarks 动画持续多少秒。 How many seconds the animation should take. *** ### includeBlocks? > `optional` **includeBlocks?**: `boolean` **`Beta`** #### Remarks 方块是否应包含在结构中。默认为 `true`。 Whether blocks should be included in the structure. Defaults to true. *** ### includeEntities? > `optional` **includeEntities?**: `boolean` **`Beta`** #### Remarks 实体是否应包含在结构中。默认为 `true`。 Whether entities should be included in the structure. Defaults to true. *** ### integrity? > `optional` **integrity?**: `number` **`Beta`** #### Remarks 应放置方块的百分比。值为 1 将放置 100% 的方块,而值为 0 则不放置任何方块。方块根据 [StructurePlaceOptions.integritySeed](#integrityseed) 随机选择。 What percentage of blocks should be placed. A value of 1 will place 100% of the blocks while a value of 0 will place none. The blocks are chosen randomly based on the [StructurePlaceOptions.integritySeed](#integrityseed). *** ### integritySeed? > `optional` **integritySeed?**: `string` **`Beta`** #### Remarks 决定随机选择哪些方块进行放置的种子。默认为随机种子。 Seed that determines which blocks are randomly chosen to be placed. Defaults to a random seed. *** ### mirror? > `optional` **mirror?**: [`StructureMirrorAxis`](/server/enums/StructureMirrorAxis.md) **`Beta`** #### Remarks 放置时结构应沿哪些轴进行镜像。默认为 StructureMirrorAxis.None。 Which axes the Structure should be mirrored on when placed. Defaults to StructureMirrorAxis.None. *** ### rotation? > `optional` **rotation?**: [`StructureRotation`](/server/enums/StructureRotation.md) **`Beta`** #### Remarks 放置时结构的旋转方式。默认为 AxisAlignedRotation.None。 How the Structure should be rotated when placed. Defaults to AxisAlignedRotation.None. *** ### waterlogged? > `optional` **waterlogged?**: `boolean` **`Beta`** #### Remarks 放置时结构是否应被水淹没。默认为 `false`。如果为 `true`,则放置在水中时方块将被水淹没。 Whether the structure should be waterlogged when placed. Defaults to false. If true, blocks will become waterlogged when placed in water. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/TeleportOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/TeleportOptions.md. # Interface: TeleportOptions **`Beta`** 包含传送实体的额外选项。 Contains additional options for teleporting an entity. ## Examples **teleport.ts** ```typescript import { system, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function teleport(targetLocation: DimensionLocation) { const cow = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Cow, targetLocation); system.runTimeout(() => { cow.teleport( { x: targetLocation.x + 2, y: targetLocation.y + 2, z: targetLocation.z + 2 }, { facingLocation: targetLocation, } ); }, 20); } ``` **teleportMovement.ts** ```typescript import { system, DimensionLocation } from '@minecraft/server'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function teleportMovement(targetLocation: DimensionLocation) { const pig = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.Pig, targetLocation); let inc = 1; const runId = system.runInterval(() => { pig.teleport( { x: targetLocation.x + inc / 4, y: targetLocation.y + inc / 4, z: targetLocation.z + inc / 4 }, { facingLocation: targetLocation, } ); if (inc > 100) { system.clearRun(runId); } inc++; }, 4); } ``` ## Properties ### checkForBlocks? > `optional` **checkForBlocks?**: `boolean` **`Beta`** #### Remarks 是否检查传送后方块是否会阻挡实体。 Whether to check whether blocks will block the entity after teleport. *** ### dimension? > `optional` **dimension?**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 可能将实体移动到的维度。如果未指定,实体将在其所在的维度内传送。 Dimension to potentially move the entity to. If not specified, the entity is teleported within the dimension that they reside. *** ### facingLocation? > `optional` **facingLocation?**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 传送后实体应面向的位置。 Location that the entity should be facing after teleport. *** ### keepVelocity? > `optional` **keepVelocity?**: `boolean` **`Beta`** #### Remarks 传送后是否保留实体的速度。 Whether to retain the entities velocity after teleport. *** ### rotation? > `optional` **rotation?**: [`Vector2`](/server/interfaces/Vector2.md) **`Beta`** #### Remarks 传送后实体的旋转角度。 Rotation of the entity after teleport. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/TickingArea.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/TickingArea.md. # Interface: TickingArea **`Beta`** 提供关于特定常加载区域信息的上下文。 A context which provides information about a specific ticking area. ## Properties ### boundingBox > **boundingBox**: [`BlockBoundingBox`](/server/interfaces/BlockBoundingBox.md) **`Beta`** #### Remarks 包含常加载区域中所有常加载方块的边界框。 The box which contains all the ticking blocks in the ticking area. *** ### chunkCount > **chunkCount**: `number` **`Beta`** #### Remarks 常加载区域包含的区块数量。 The number of chunks that the ticking area contains. *** ### dimension > **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 常加载区域所在的维度。 The dimension the ticking area is located. *** ### identifier > **identifier**: `string` **`Beta`** #### Remarks 常加载区域的唯一标识符。 The unique identifier of the ticking area. *** ### isFullyLoaded > **isFullyLoaded**: `boolean` **`Beta`** #### Remarks 如果常加载区域的所有区块都已加载并处于常加载状态,则为 `true`,否则为 `false`。 Will be true if all the ticking areas chunks are loaded in ticking and false otherwise. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/TickingAreaOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/TickingAreaOptions.md. # Interface: TickingAreaOptions **`Beta`** 使用 [TickingAreaManager](/server/classes/TickingAreaManager.md) 创建常加载区域的选项。 Options to create a ticking area using the [TickingAreaManager](/server/classes/TickingAreaManager.md). ## Properties ### dimension > **dimension**: [`Dimension`](/server/classes/Dimension.md) **`Beta`** #### Remarks 常加载区域所在的维度。 The dimension the ticking area will be in. *** ### from > **from**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 边界框的一个角点方块位置。 Corner block location of the bounding box. *** ### to > **to**: [`Vector3`](/server/interfaces/Vector3.md) **`Beta`** #### Remarks 边界框的对角角点方块位置。 Opposite corner block location of the bounding box. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/TitleDisplayOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/TitleDisplayOptions.md. # Interface: TitleDisplayOptions **`Beta`** 包含显示标题和可选副标题的额外选项。 Contains additional options for displaying a title and optional subtitle. ## Properties ### fadeInDuration > **fadeInDuration**: `number` **`Beta`** #### Remarks 标题和副标题的淡入持续时间(以刻为单位)。每秒有 20 刻。使用 [TicksPerSecond](/server/variables/TicksPerSecond.md) 常量在刻和秒之间进行转换。 Fade-in duration for the title and subtitle, in ticks. There are 20 ticks per second. Use [TicksPerSecond](/server/variables/TicksPerSecond.md) constant to convert between ticks and seconds. *** ### fadeOutDuration > **fadeOutDuration**: `number` **`Beta`** #### Remarks 标题和副标题的淡出持续时间(以刻为单位)。每秒有 20 刻。使用 [TicksPerSecond](/server/variables/TicksPerSecond.md) 常量在刻和秒之间进行转换。 Fade-out time for the title and subtitle, in ticks. There are 20 ticks per second. Use [TicksPerSecond](/server/variables/TicksPerSecond.md) constant to convert between ticks and seconds. *** ### stayDuration > **stayDuration**: `number` **`Beta`** #### Remarks 标题和副标题的停留持续时间(以刻为单位)。每秒有 20 刻。使用 [TicksPerSecond](/server/variables/TicksPerSecond.md) 常量在刻和秒之间进行转换。 Amount of time for the title and subtitle to stay in place, in ticks. There are 20 ticks per second. Use [TicksPerSecond](/server/variables/TicksPerSecond.md) constant to convert between ticks and seconds. *** ### subtitle? > `optional` **subtitle?**: `string` | [`RawMessage`](/server/interfaces/RawMessage.md) | (`string` | [`RawMessage`](/server/interfaces/RawMessage.md))\[] **`Beta`** #### Remarks 可选的副标题文本。 Optional subtitle text. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/Vector2.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/Vector2.md. # Interface: Vector2 **`Beta`** 表示一个二维向量。 Represents a two-directional vector. ## Properties ### x > **x**: `number` **`Beta`** #### Remarks 二维向量的 X 分量。 X component of the two-dimensional vector. *** ### y > **y**: `number` **`Beta`** #### Remarks 二维向量的 Y 分量。 Y component of the two-dimensional vector. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/Vector3.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/Vector3.md. # Interface: Vector3 **`Beta`** 包含向量的描述。 Contains a description of a vector. ## Properties ### x > **x**: `number` **`Beta`** #### Remarks 此向量的 X 分量。 X component of this vector. *** ### y > **y**: `number` **`Beta`** #### Remarks 此向量的 Y 分量。 Y component of this vector. *** ### z > **z**: `number` **`Beta`** #### Remarks 此向量的 Z 分量。 Z component of this vector. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/VectorXZ.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/VectorXZ.md. # Interface: VectorXZ **`Beta`** ## Properties ### x > **x**: `number` **`Beta`** *** ### z > **z**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/WaypointTextureBounds.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/WaypointTextureBounds.md. # Interface: WaypointTextureBounds **`Beta`** 定义一个纹理及其应显示的距离范围。在 [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md) 内部使用,以创建基于距离的纹理切换。 Defines a texture and the distance range in which it should be displayed. Used within a [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector.md) to create distance-based texture switching. ## Properties ### lowerBound > **lowerBound**: `number` **`Beta`** #### Remarks 此纹理的下距离边界。当到路径点的距离大于此值时显示纹理。值必须大于或等于 0。 The lower distance bound for this texture. The texture is displayed when the distance to the waypoint is greater than this value. Value must be greater than or equal to 0. Minimum Value: 0 *** ### texture > **texture**: [`CustomTexture`](/server/interfaces/CustomTexture.md) | [`WaypointTexture`](/server/enums/WaypointTexture.md) **`Beta`** #### Remarks 在此距离范围内显示的 [WaypointTexture](/server/enums/WaypointTexture.md) 或 [CustomTexture](/server/interfaces/CustomTexture.md)。 The [WaypointTexture](/server/enums/WaypointTexture.md) or [CustomTexture](/server/interfaces/CustomTexture.md) to display within this distance range. *** ### upperBound? > `optional` **upperBound?**: `number` **`Beta`** #### Remarks 此纹理的上距离边界。当到路径点的距离小于或等于此值时显示纹理。如果未定义,则没有上限。值必须大于或等于 0。 The upper distance bound for this texture. The texture is displayed when the distance to the waypoint is less than or equal to this value. If undefined, there is no upper limit. Value must be greater than or equal to 0. Minimum Value: 0 [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/WaypointTextureSelector.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/WaypointTextureSelector.md. # Interface: WaypointTextureSelector **`Beta`** 定义路径点纹理如何根据距离变化。包含一个纹理边界列表,决定在不同距离范围内显示哪个纹理。 Defines how waypoint textures change based on distance. Contains a list of texture bounds that determine which texture is displayed at different distance ranges. ## Properties ### textureBoundsList > **textureBoundsList**: [`WaypointTextureBounds`](/server/interfaces/WaypointTextureBounds.md)\[] **`Beta`** #### Remarks 一个 [WaypointTextureBounds](/server/interfaces/WaypointTextureBounds.md) 数组,定义在不同距离范围内显示哪些纹理。系统会评估这些边界,根据到路径点的当前距离确定合适的纹理。列表的最大大小限制为 16。 An array of [WaypointTextureBounds](/server/interfaces/WaypointTextureBounds.md) that define which textures are displayed at different distance ranges. The system evaluates these bounds to determine the appropriate texture based on the current distance to the waypoint. The list has a maximum size limit of 16. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/interfaces/WorldSoundOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/interfaces/WorldSoundOptions.md. # Interface: WorldSoundOptions world sound **`Beta`** 包含 playSound 事件的额外选项。 Contains additional options for a playSound occurrence. ## Properties ### loopCount? > `optional` **loopCount?**: `number` **`Beta`** #### Remarks 首次播放后额外重复声音的次数。`0`(默认值)播放一次声音,`-1` 无限循环,正整数 `N` 总共播放 `N + 1` 次。例如,`loopCount: 1` 播放两次声音。循环次数在声音开始时固定,之后无法更改。使用 `-1` 时,请参阅 `SoundInstance` 了解句柄生命周期要求。 Number of additional times to repeat the sound after the initial play. `0` (the default) plays the sound once, `-1` loops it forever, and a positive integer `N` plays the sound `N + 1` times in total. For example, `loopCount: 1` plays the sound twice. The loop count is fixed when the sound starts and cannot be changed afterward. When using `-1`, see `SoundInstance` for handle lifetime requirements. *** ### pitch? > `optional` **pitch?**: `number` **`Beta`** #### Remarks 播放声音的音高。 Pitch of the sound played. *** ### volume? > `optional` **volume?**: `number` **`Beta`** #### Remarks 此声音被听到的相对音量和空间。 Relative volume and space by which this sound is heard. ## 同领域相关 - [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) - [PlayerSoundOptions](/server/interfaces/PlayerSoundOptions.md) - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent.md) - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal.md) - [SoundDefinition](/server/classes/SoundDefinition.md) - [SoundDefinitionDurationInfo](/server/interfaces/SoundDefinitionDurationInfo.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/AimAssistTargetMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/AimAssistTargetMode.md. # Enumeration: AimAssistTargetMode **`Beta`** 指定用于瞄准辅助的不同目标模式。 Specifies different targeting modes for use in aim-assist. ## Enumeration Members ### Angle > **Angle**: `"Angle"` **`Beta`** #### Remarks 基于角度的目标锁定。 Angle based targeting. *** ### Distance > **Distance**: `"Distance"` **`Beta`** #### Remarks 基于距离的目标锁定。 Distance based targeting. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/BlockComponentTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/BlockComponentTypes.md. # Enumeration: BlockComponentTypes block component **`Beta`** 可通过 Block.getComponent 函数访问的方块组件类型。 The types of block components that are accessible via function Block.getComponent. ## Enumeration Members ### DynamicProperties 实验性 > **DynamicProperties**: `"minecraft:dynamic_properties"` **`Beta`** *** ### FluidContainer > **FluidContainer**: `"minecraft:fluid_container"` **`Beta`** *** ### Instrument 实验性 > **Instrument**: `"minecraft:instrument_sound"` **`Beta`** *** ### Inventory > **Inventory**: `"minecraft:inventory"` **`Beta`** #### Remarks 表示世界中方块的库存。用于像箱子这样的方块。 Represents the inventory of a block in the world. Used with blocks like chests. *** ### MapColor > **MapColor**: `"minecraft:map_color"` **`Beta`** #### Remarks 表示方块在地图上显示时的颜色。 Represents the color of a block when displayed on a map. *** ### Movable > **Movable**: `"minecraft:movable"` **`Beta`** #### Remarks 表示可以移动的方块(例如活塞)。 Represents a block that can move (such as a piston). *** ### Piston > **Piston**: `"minecraft:piston"` **`Beta`** #### Remarks 当存在时,此方块具有类似活塞的行为。包含用于发现方块活塞状态的附加属性。 When present, this block has piston-like behavior. Contains additional properties for discovering block piston state. *** ### PrecipitationInteractions > **PrecipitationInteractions**: `"minecraft:precipitation_interactions"` **`Beta`** #### Remarks 表示方块与降水(如雨或雪)的交互方式。 Represents a how a block interacts with precipitation (such as rain or snow). *** ### RecordPlayer > **RecordPlayer**: `"minecraft:record_player"` **`Beta`** #### Remarks 表示可以播放唱片的方块。 Represents a block that can play a record. *** ### RedstoneProducer > **RedstoneProducer**: `"minecraft:redstone_producer"` **`Beta`** #### Remarks 表示可以输出红石信号的方块。 Represents a block that can output a redstone signal. *** ### Sign > **Sign**: `"minecraft:sign"` **`Beta`** #### Remarks 表示可以显示文本的方块。 Represents a block that can display text on it. ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/BlockPistonState.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/BlockPistonState.md. # Enumeration: BlockPistonState block **`Beta`** 描述方块活塞状态的枚举。 An enumeration describing the state of a block piston. ## Enumeration Members ### Expanded > **Expanded**: `"Expanded"` **`Beta`** #### Remarks 活塞是否完全伸出。 Whether the piston is fully expanded. *** ### Expanding > **Expanding**: `"Expanding"` **`Beta`** #### Remarks 活塞是否正在伸出过程中。 Whether the piston is in the process of expanding. *** ### Retracted > **Retracted**: `"Retracted"` **`Beta`** #### Remarks 活塞是否完全缩回。 Whether the piston is fully retracted. *** ### Retracting > **Retracting**: `"Retracting"` **`Beta`** #### Remarks 活塞是否正在缩回过程中。 Whether the piston is in the process of retracting. ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/BlockVolumeIntersection.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/BlockVolumeIntersection.md. # Enumeration: BlockVolumeIntersection block **`Beta`** 对两个 BlockVolume 对象进行相交测试的结果描述。 Description of the resulting intersection test on two BlockVolume objects ## Enumeration Members ### Contains > **Contains**: `1` **`Beta`** #### Remarks 体积 B 完全位于体积 A 内部。 Volume B resides completely inside Volume A *** ### Disjoint > **Disjoint**: `0` **`Beta`** #### Remarks 体积 B 与体积 A 没有交点。 Volume B has no intersection points with Volume A *** ### Intersects > **Intersects**: `2` **`Beta`** #### Remarks 体积 B 与体积 A 部分相交。 Volume B partially intersects Volume A ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/BookErrorReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/BookErrorReason.md. # Enumeration: BookErrorReason error **`Beta`** 与使用 [ItemBookComponent](/server/classes/ItemBookComponent.md) 相关的错误原因枚举。 An enum of error reasons relating to using [ItemBookComponent](/server/classes/ItemBookComponent.md). ## Enumeration Members ### ExceedsMaxPageLength > **ExceedsMaxPageLength**: `"ExceedsMaxPageLength"` **`Beta`** #### Remarks 请求的页面内容超过了最大页面长度 256。 The requested page content exceeds the max page length of 256\. *** ### ExceedsMaxPages > **ExceedsMaxPages**: `"ExceedsMaxPages"` **`Beta`** #### Remarks 无法创建页面,因为会超过最大页数 50。 The page could not be created as it would exceed the max page count of 50. *** ### ExceedsTitleLength > **ExceedsTitleLength**: `"ExceedsTitleLength"` **`Beta`** #### Remarks 正在签名的标题超过了最大标题长度 16。 The title being signed exceeds the maximum title length of 16\. ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookPageContentError](/server/classes/BookPageContentError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/ButtonState.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/ButtonState.md. # Enumeration: ButtonState **`Beta`** 键盘、控制器或触摸界面上的按钮状态。 The state of a button on a keyboard, controller, or touch interface. ## Enumeration Members ### Pressed > **Pressed**: `"Pressed"` **`Beta`** *** ### Released > **Released**: `"Released"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/CameraShakeType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/CameraShakeType.md. # Enumeration: CameraShakeType **`Beta`** 表示应用于摄像机的抖动类型。 Represents the type of shake to apply to the camera. ## Enumeration Members ### Positional > **Positional**: `"Positional"` **`Beta`** #### Remarks 一种位置抖动,使摄像机沿其轴移动。 A positional shake that moves the camera along its axes. *** ### Rotational > **Rotational**: `"Rotational"` **`Beta`** #### Remarks 一种旋转抖动,使摄像机绕其轴旋转。 A rotational shake that rotates the camera around its axes. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/CloneMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/CloneMode.md. # Enumeration: CloneMode **`Beta`** An enumeration for the clone modes used when cloning blocks. ## Enumeration Members ### Copy > **Copy**: `0` **`Beta`** #### Remarks Clones the blocks from the source region to the destination, leaving the source intact. *** ### ForceCopy > **ForceCopy**: `1` **`Beta`** #### Remarks Clones the blocks from the source region to the destination, allowing the source and destination regions to overlap. *** ### Move > **Move**: `2` **`Beta`** #### Remarks Clones the blocks from the source region to the destination and replaces the source region with air. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/CommandPermissionLevel.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/CommandPermissionLevel.md. # Enumeration: CommandPermissionLevel permission **`Beta`** 执行自定义命令所需的权限等级。 The required permission level to execute the custom command. ## Enumeration Members ### Admin > **Admin**: `2` **`Beta`** #### Remarks 任何操作员都可以运行此命令,但不包括命令方块。 Any operator can run this command, but NOT command blocks. *** ### Any > **Any**: `0` **`Beta`** #### Remarks 任何对象都可以运行此等级。 Anything can run this level. *** ### GameDirectors > **GameDirectors**: `1` **`Beta`** #### Remarks 任何操作员都可以运行此命令,包括命令方块。 Any operator can run this command, including command blocks. *** ### Host > **Host**: `3` **`Beta`** #### Remarks 任何服务器主机都可以运行此命令。 Any server host can run this command. *** ### Owner > **Owner**: `4` **`Beta`** #### Remarks 仅专用服务器可以运行此命令。 Only dedicated server can run this command. ## 同领域相关 - [InputPermissionCategory](/server/enums/InputPermissionCategory.md) - [PlayerInputPermissionCategoryChangeAfterEvent](/server/classes/PlayerInputPermissionCategoryChangeAfterEvent.md) - [PlayerInputPermissionCategoryChangeAfterEventSignal](/server/classes/PlayerInputPermissionCategoryChangeAfterEventSignal.md) - [PlayerPermissionLevel](/server/enums/PlayerPermissionLevel.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/ContainerRulesErrorReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/ContainerRulesErrorReason.md. # Enumeration: ContainerRulesErrorReason inventory error **`Beta`** 抛出 [@minecraft/server.ContainerRulesError](/server/classes/ContainerRulesError.md) 的原因。 Reasons that the [@minecraft/server.ContainerRulesError](/server/classes/ContainerRulesError.md) was thrown. ## Enumeration Members ### BannedItem > **BannedItem**: `"BannedItem"` **`Beta`** #### Remarks 当尝试添加已在 [ContainerRules.bannedItems](/server/interfaces/ContainerRules.md#banneditems) 中定义的物品时抛出。 Thrown when trying to add item that was defined in [ContainerRules.bannedItems](/server/interfaces/ContainerRules.md#banneditems). *** ### NestedStorageItem > **NestedStorageItem**: `"NestedStorageItem"` **`Beta`** #### Remarks 当尝试将带有 `Storage Item` 组件的物品添加到 [ContainerRules.allowNestedStorageItems](/server/interfaces/ContainerRules.md#allownestedstorageitems) 设置为 `false` 的容器时抛出。 Thrown when trying to add item with `Storage Item` component to container with [ContainerRules.allowNestedStorageItems](/server/interfaces/ContainerRules.md#allownestedstorageitems) set to false. *** ### NotAllowedItem > **NotAllowedItem**: `"NotAllowedItem"` **`Beta`** #### Remarks 当尝试添加未在非空 [ContainerRules.allowedItems](/server/interfaces/ContainerRules.md#alloweditems) 中定义的物品时抛出。 Thrown when trying to add item not defined in non-empty [ContainerRules.allowedItems](/server/interfaces/ContainerRules.md#alloweditems). *** ### OverWeightLimit > **OverWeightLimit**: `"OverWeightLimit"` **`Beta`** #### Remarks 当尝试添加物品导致容器重量超过 [ContainerRules.weightLimit](/server/interfaces/ContainerRules.md#weightlimit) 时抛出。 Thrown when trying to add item that pushed the containers weight over the [ContainerRules.weightLimit](/server/interfaces/ContainerRules.md#weightlimit). *** ### ZeroWeightItem > **ZeroWeightItem**: `"ZeroWeightItem"` **`Beta`** #### Remarks 当尝试添加由 `Storage Weight Modifier` 组件定义为零重量的物品到具有定义的 [ContainerRules.weightLimit](/server/interfaces/ContainerRules.md#weightlimit) 的容器时抛出。 Thrown when trying to add item with zero weight defined by the `Storage Weight Modifier` component to container with a defined [ContainerRules.weightLimit](/server/interfaces/ContainerRules.md#weightlimit) ## 同领域相关 - [ContainerRulesError](/server/classes/ContainerRulesError.md) - [InvalidContainerError](/server/classes/InvalidContainerError.md) - [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/ControlScheme.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/ControlScheme.md. # Enumeration: ControlScheme **`Beta`** 控制方案类型,定义玩家如何响应玩家输入进行移动。有关控制方案的更多详细信息,请参阅以下页面:[https://learn.microsoft.com/en-us/minecraft/creator/documents/controlschemes](https://learn.microsoft.com/en-us/minecraft/creator/documents/controlschemes) Control Scheme types which define how the player moves in response to player inputs. See the following page for more details on control schemes: [https://learn.microsoft.com/en-us/minecraft/creator/documents/controlschemes](https://learn.microsoft.com/en-us/minecraft/creator/documents/controlschemes) ## Enumeration Members ### CameraRelative > **CameraRelative**: `"CameraRelative"` **`Beta`** *** ### CameraRelativeStrafe > **CameraRelativeStrafe**: `"CameraRelativeStrafe"` **`Beta`** *** ### LockedPlayerRelativeStrafe > **LockedPlayerRelativeStrafe**: `"LockedPlayerRelativeStrafe"` **`Beta`** *** ### PlayerRelative > **PlayerRelative**: `"PlayerRelative"` **`Beta`** *** ### PlayerRelativeStrafe > **PlayerRelativeStrafe**: `"PlayerRelativeStrafe"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/CustomCommandErrorReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/CustomCommandErrorReason.md. # Enumeration: CustomCommandErrorReason error **`Beta`** 自定义命令注册失败的原因。 Reason why custom command registration failed. ## Enumeration Members ### AlreadyRegistered > **AlreadyRegistered**: `"AlreadyRegistered"` **`Beta`** #### Remarks 命令名称已注册。 Command name already registered. *** ### EnumDependencyMissing > **EnumDependencyMissing**: `"EnumDependencyMissing"` **`Beta`** #### Remarks 自定义命令引用了一个尚未注册的枚举。 Custom Command references an enum that has not been registered. *** ### NamespaceMismatch > **NamespaceMismatch**: `"NamespaceMismatch"` **`Beta`** #### Remarks 提供的自定义命令命名空间与此附加包之前的注册不匹配。 Supplied Custom Command namespace does not match previous registrations for this add-on. *** ### ParameterLimit > **ParameterLimit**: `"ParameterLimit"` **`Beta`** #### Remarks 在 CustomCommand 中定义了太多命令参数。 Too many command parameters defined in CustomCommand. *** ### RegistryInvalid > **RegistryInvalid**: `"RegistryInvalid"` **`Beta`** #### Remarks 在世界初始化事件之后无法访问自定义命令注册表。 Custom command registry can not be accessed after world initialized event. *** ### RegistryReadOnly > **RegistryReadOnly**: `"RegistryReadOnly"` **`Beta`** #### Remarks 重载期间不能重新定义命令参数。只有脚本闭包本身可以更改。 Command parameters cannot be redefined during reload. Only the script closure itself can be changed. *** ### UnexpectedEnumName 实验性 > **UnexpectedEnumName**: `"UnexpectedEnumName"` **`Beta`** #### Remarks 非枚举类型的命令参数不能使用 enumName。 Non enum type command parameters cannot use enumName. ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/CustomCommandParamType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/CustomCommandParamType.md. # Enumeration: CustomCommandParamType **`Beta`** 自定义命令接受的参数类型。 The types of paramaters accepted by a custom command. ## Enumeration Members ### BlockType > **BlockType**: `"BlockType"` **`Beta`** #### Remarks 方块类型参数提供 [BlockType](#blocktype)。 Block type parameter provides a [BlockType](#blocktype). *** ### Boolean > **Boolean**: `"Boolean"` **`Beta`** #### Remarks 布尔参数。 Boolean parameter. *** ### EntitySelector > **EntitySelector**: `"EntitySelector"` **`Beta`** #### Remarks 实体选择器参数提供 [Entity](/server/enums/CustomCommandSource.md#entity)。 Entity selector parameter provides an [Entity](/server/enums/CustomCommandSource.md#entity). *** ### EntityType > **EntityType**: `"EntityType"` **`Beta`** #### Remarks 实体类型参数提供 [EntityType](#entitytype)。 Entity type parameter provides an [EntityType](#entitytype). *** ### Enum > **Enum**: `"Enum"` **`Beta`** #### Remarks 命令枚举参数。 Command enum parameter. *** ### Float > **Float**: `"Float"` **`Beta`** #### Remarks 浮点数参数。 Float parameter. *** ### Integer > **Integer**: `"Integer"` **`Beta`** #### Remarks 整数参数。 Integer parameter. *** ### ItemType > **ItemType**: `"ItemType"` **`Beta`** #### Remarks 物品类型参数提供 [ItemType](#itemtype)。 Item type parameter provides an [ItemType](#itemtype). *** ### Location > **Location**: `"Location"` **`Beta`** #### Remarks 位置参数提供 [@minecraft/server.Vector3](/server/interfaces/Vector3.md)。 Location parameter provides a [@minecraft/server.Vector3](/server/interfaces/Vector3.md). *** ### PlayerSelector > **PlayerSelector**: `"PlayerSelector"` **`Beta`** #### Remarks 玩家选择器参数提供 [Player](/server/enums/ScoreboardIdentityType.md#player)。 Player selector parameter provides a [Player](/server/enums/ScoreboardIdentityType.md#player). *** ### String > **String**: `"String"` **`Beta`** #### Remarks 字符串参数。 String parameter. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/CustomCommandSource.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/CustomCommandSource.md. # Enumeration: CustomCommandSource **`Beta`** 谁执行了该命令。 Who executed the command. ## Enumeration Members ### Block > **Block**: `"Block"` **`Beta`** #### Remarks 命令源自命令方块。 Command originated from a command block. *** ### Entity > **Entity**: `"Entity"` **`Beta`** #### Remarks 命令源自实体或玩家。 Command originated from an entity or player. *** ### NPCDialogue > **NPCDialogue**: `"NPCDialogue"` **`Beta`** *** ### Server > **Server**: `"Server"` **`Beta`** #### Remarks 命令源自服务器。 Command originated from the server. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/CustomCommandStatus.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/CustomCommandStatus.md. # Enumeration: CustomCommandStatus **`Beta`** ## Enumeration Members ### Failure > **Failure**: `1` **`Beta`** *** ### Success > **Success**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/CustomComponentNameErrorReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/CustomComponentNameErrorReason.md. # Enumeration: CustomComponentNameErrorReason error component **`Beta`** ## Enumeration Members ### DisallowedNamespace > **DisallowedNamespace**: `2` **`Beta`** *** ### NoNamespace > **NoNamespace**: `1` **`Beta`** ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [CustomComponentInvalidRegistryError](/server/classes/CustomComponentInvalidRegistryError.md) - [CustomComponentNameError](/server/classes/CustomComponentNameError.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/Difficulty.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/Difficulty.md. # Enumeration: Difficulty **`Beta`** Minecraft 各种难度级别的枚举。 An enumeration for the various difficulty levels of Minecraft. ## Enumeration Members ### Easy > **Easy**: `"Easy"` **`Beta`** #### Remarks 简单难度级别。 Easy difficulty level. *** ### Hard > **Hard**: `"Hard"` **`Beta`** #### Remarks 困难难度级别。 Hard difficulty level. *** ### Normal > **Normal**: `"Normal"` **`Beta`** #### Remarks 普通难度级别。 Normal difficulty level. *** ### Peaceful > **Peaceful**: `"Peaceful"` **`Beta`** #### Remarks 和平难度级别。 Peaceful difficulty level. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/Direction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/Direction.md. # Enumeration: Direction **`Beta`** 通用枚举之一。表示朝向。 A general purpose relative direction enumeration. ## Enumeration Members ### Down > **Down**: `"Down"` **`Beta`** #### Remarks 表示下方(y - 1)。 Returns the [Block](/server/enums/CustomCommandSource.md#block) beneath (y - 1) of this item. *** ### East > **East**: `"East"` **`Beta`** #### Remarks 表示东方(x + 1)。 Returns the [Block](/server/enums/CustomCommandSource.md#block) to the east (x + 1) of this item. *** ### North > **North**: `"North"` **`Beta`** #### Remarks 表示北方(z - 1)。 Returns the [Block](/server/enums/CustomCommandSource.md#block) to the east (z + 1) of this item. *** ### South > **South**: `"South"` **`Beta`** #### Remarks 表示南方(z + 1)。 Returns the [Block](/server/enums/CustomCommandSource.md#block) to the south (z - 1) of this item. *** ### Up > **Up**: `"Up"` **`Beta`** #### Remarks 表示上方(y + 1)。 Returns the [Block](/server/enums/CustomCommandSource.md#block) above (y + 1) of this item. *** ### West > **West**: `"West"` **`Beta`** #### Remarks 表示西方(x - 1)。 Returns the [Block](/server/enums/CustomCommandSource.md#block) to the west (x - 1) of this item. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/DisplaySlotId.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/DisplaySlotId.md. # Enumeration: DisplaySlotId **`Beta`** 表示记分板分数的显示方式。 Specifies a mechanism for displaying scores on a scoreboard. ## Enumeration Members ### BelowName > **BelowName**: `"BelowName"` **`Beta`** #### Remarks 记分项上的分数将显示在玩家名称牌下方。 Displays the score below the player's name. *** ### List > **List**: `"List"` **`Beta`** #### Remarks 该记分项与对应的分数持有者将显示在暂停菜单上。 Displays the score as a list on the pause screen. *** ### Sidebar > **Sidebar**: `"Sidebar"` **`Beta`** #### Remarks 记分项将在屏幕右侧显示。 Displays the score on the side of the player's screen. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/DyeColor.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/DyeColor.md. # Enumeration: DyeColor **`Beta`** 指定用作染料的不同颜色。 Specifies different colors for use as dye. ## Enumeration Members ### Black > **Black**: `"Black"` **`Beta`** #### Remarks 黑色染料颜色。 Black dye color. *** ### Blue > **Blue**: `"Blue"` **`Beta`** #### Remarks 蓝色染料颜色。 Blue dye color. *** ### Brown > **Brown**: `"Brown"` **`Beta`** #### Remarks 棕色染料颜色。 Brown dye color. *** ### Cyan > **Cyan**: `"Cyan"` **`Beta`** #### Remarks 青色染料颜色。 Cyan dye color. *** ### Gray > **Gray**: `"Gray"` **`Beta`** #### Remarks 灰色染料颜色。 Gray dye color. *** ### Green > **Green**: `"Green"` **`Beta`** #### Remarks 绿色染料颜色。 Green dye color. *** ### LightBlue > **LightBlue**: `"LightBlue"` **`Beta`** #### Remarks 淡蓝色染料颜色。 Light blue dye color. *** ### Lime > **Lime**: `"Lime"` **`Beta`** #### Remarks 黄绿色染料颜色。 Lime dye color. *** ### Magenta > **Magenta**: `"Magenta"` **`Beta`** #### Remarks 品红色染料颜色。 Magenta dye color. *** ### Orange > **Orange**: `"Orange"` **`Beta`** #### Remarks 橙色染料颜色。 Orange dye color. *** ### Pink > **Pink**: `"Pink"` **`Beta`** #### Remarks 粉红色染料颜色。 Pink dye color. *** ### Purple > **Purple**: `"Purple"` **`Beta`** #### Remarks 紫色染料颜色。 Purple dye color. *** ### Red > **Red**: `"Red"` **`Beta`** #### Remarks 红色染料颜色。 Red dye color. *** ### Silver > **Silver**: `"Silver"` **`Beta`** #### Remarks 银色染料颜色。 Silver dye color. *** ### White > **White**: `"White"` **`Beta`** #### Remarks 白色染料颜色。 White dye color. *** ### Yellow > **Yellow**: `"Yellow"` **`Beta`** #### Remarks 黄色染料颜色。 Yellow dye color. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/EasingType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/EasingType.md. # Enumeration: EasingType **`Beta`** ## Enumeration Members ### InBack > **InBack**: `"InBack"` **`Beta`** *** ### InBounce > **InBounce**: `"InBounce"` **`Beta`** *** ### InCirc > **InCirc**: `"InCirc"` **`Beta`** *** ### InCubic > **InCubic**: `"InCubic"` **`Beta`** *** ### InElastic > **InElastic**: `"InElastic"` **`Beta`** *** ### InExpo > **InExpo**: `"InExpo"` **`Beta`** *** ### InOutBack > **InOutBack**: `"InOutBack"` **`Beta`** *** ### InOutBounce > **InOutBounce**: `"InOutBounce"` **`Beta`** *** ### InOutCirc > **InOutCirc**: `"InOutCirc"` **`Beta`** *** ### InOutCubic > **InOutCubic**: `"InOutCubic"` **`Beta`** *** ### InOutElastic > **InOutElastic**: `"InOutElastic"` **`Beta`** *** ### InOutExpo > **InOutExpo**: `"InOutExpo"` **`Beta`** *** ### InOutQuad > **InOutQuad**: `"InOutQuad"` **`Beta`** *** ### InOutQuart > **InOutQuart**: `"InOutQuart"` **`Beta`** *** ### InOutQuint > **InOutQuint**: `"InOutQuint"` **`Beta`** *** ### InOutSine > **InOutSine**: `"InOutSine"` **`Beta`** *** ### InQuad > **InQuad**: `"InQuad"` **`Beta`** *** ### InQuart > **InQuart**: `"InQuart"` **`Beta`** *** ### InQuint > **InQuint**: `"InQuint"` **`Beta`** *** ### InSine > **InSine**: `"InSine"` **`Beta`** *** ### Linear > **Linear**: `"Linear"` **`Beta`** *** ### OutBack > **OutBack**: `"OutBack"` **`Beta`** *** ### OutBounce > **OutBounce**: `"OutBounce"` **`Beta`** *** ### OutCirc > **OutCirc**: `"OutCirc"` **`Beta`** *** ### OutCubic > **OutCubic**: `"OutCubic"` **`Beta`** *** ### OutElastic > **OutElastic**: `"OutElastic"` **`Beta`** *** ### OutExpo > **OutExpo**: `"OutExpo"` **`Beta`** *** ### OutQuad > **OutQuad**: `"OutQuad"` **`Beta`** *** ### OutQuart > **OutQuart**: `"OutQuart"` **`Beta`** *** ### OutQuint > **OutQuint**: `"OutQuint"` **`Beta`** *** ### OutSine > **OutSine**: `"OutSine"` **`Beta`** *** ### Spring > **Spring**: `"Spring"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/EnchantmentSlot.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/EnchantmentSlot.md. # Enumeration: EnchantmentSlot **`Beta`** ## Enumeration Members ### ArmorFeet > **ArmorFeet**: `"ArmorFeet"` **`Beta`** *** ### ArmorHead > **ArmorHead**: `"ArmorHead"` **`Beta`** *** ### ArmorLegs > **ArmorLegs**: `"ArmorLegs"` **`Beta`** *** ### ArmorTorso > **ArmorTorso**: `"ArmorTorso"` **`Beta`** *** ### Axe > **Axe**: `"Axe"` **`Beta`** *** ### Bow > **Bow**: `"Bow"` **`Beta`** *** ### CarrotStick > **CarrotStick**: `"CarrotStick"` **`Beta`** *** ### CosmeticHead > **CosmeticHead**: `"CosmeticHead"` **`Beta`** *** ### Crossbow > **Crossbow**: `"Crossbow"` **`Beta`** *** ### Elytra > **Elytra**: `"Elytra"` **`Beta`** *** ### FishingRod > **FishingRod**: `"FishingRod"` **`Beta`** *** ### Flintsteel > **Flintsteel**: `"Flintsteel"` **`Beta`** *** ### Hoe > **Hoe**: `"Hoe"` **`Beta`** *** ### MeleeSpear > **MeleeSpear**: `"MeleeSpear"` **`Beta`** *** ### Pickaxe > **Pickaxe**: `"Pickaxe"` **`Beta`** *** ### Shears > **Shears**: `"Shears"` **`Beta`** *** ### Shield > **Shield**: `"Shield"` **`Beta`** *** ### Shovel > **Shovel**: `"Shovel"` **`Beta`** *** ### Spear > **Spear**: `"Spear"` **`Beta`** *** ### Sword > **Sword**: `"Sword"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/EntityAttachPoint.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/EntityAttachPoint.md. # Enumeration: EntityAttachPoint entity **`Beta`** 实体的附着位置点。包含头部、身体、腿部等点,用于将摄像机附着到实体上。 The entity's attach location point. Contains points such as head, body, leg, etc to attach the camera to. ## Enumeration Members ### Body > **Body**: `"Body"` **`Beta`** *** ### BreathingPoint > **BreathingPoint**: `"BreathingPoint"` **`Beta`** *** ### DropAttachPoint > **DropAttachPoint**: `"DropAttachPoint"` **`Beta`** *** ### ExplosionPoint > **ExplosionPoint**: `"ExplosionPoint"` **`Beta`** *** ### Eyes > **Eyes**: `"Eyes"` **`Beta`** *** ### Feet > **Feet**: `"Feet"` **`Beta`** *** ### Head > **Head**: `"Head"` **`Beta`** *** ### Mouth > **Mouth**: `"Mouth"` **`Beta`** *** ### WeaponAttachPoint > **WeaponAttachPoint**: `"WeaponAttachPoint"` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/EntityComponentTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/EntityComponentTypes.md. # Enumeration: EntityComponentTypes entity component **`Beta`** 可通过 Entity.getComponent 函数访问的实体组件类型。 The types of entity components that are accessible via function Entity.getComponent. ## Enumeration Members ### AddRider > **AddRider**: `"minecraft:addrider"` **`Beta`** #### Remarks 添加时,此组件使实体生成时带有指定 entityType 的骑乘者。 When added, this component makes the entity spawn with a rider of the specified entityType. *** ### Ageable > **Ageable**: `"minecraft:ageable"` **`Beta`** #### Remarks 为实体添加成长计时器。可以通过给予实体由 feedItems 定义的它喜欢的物品来加速。 Adds a timer for the entity to grow up. It can be accelerated by giving the entity the items it likes as defined by feedItems. *** ### Breathable > **Breathable**: `"minecraft:breathable"` **`Beta`** #### Remarks 定义此实体可以在哪些方块中呼吸,并赋予它们窒息的能力。 Defines what blocks this entity can breathe in and gives them the ability to suffocate. *** ### CanClimb > **CanClimb**: `"minecraft:can_climb"` **`Beta`** #### Remarks 添加时,此组件表示实体可以爬上梯子。 When added, this component signifies that the entity can climb up ladders. *** ### CanFly > **CanFly**: `"minecraft:can_fly"` **`Beta`** #### Remarks 添加时,此组件表示实体可以飞行,且寻路器不会限制在需要下方有实心方块的路径上。 When added, this component signifies that the entity can fly, and the pathfinder won't be restricted to paths where a solid block is required underneath it. *** ### CanPowerJump > **CanPowerJump**: `"minecraft:can_power_jump"` **`Beta`** #### Remarks 添加时,此组件表示实体可以像 Minecraft 中的马一样进行蓄力跳跃。 When added, this component signifies that the entity can power jump like the horse does within Minecraft. *** ### Color > **Color**: `"minecraft:color"` **`Beta`** #### Remarks 定义实体的颜色。仅对具有预定义颜色值的某些实体起作用(例如,羊、羊驼、潜影贝)。 Defines the entity's color. Only works on certain entities that have predefined color values (e.g., sheep, llama, shulker). *** ### Color2 > **Color2**: `"minecraft:color2"` **`Beta`** #### Remarks 定义实体的次要颜色。仅对具有预定义次要颜色值的某些实体起作用(例如,热带鱼)。 Defines the entity's secondary color. Only works on certain entities that have predefined secondary color values (e.g., tropical fish). *** ### CursorInventory > **CursorInventory**: `"minecraft:cursor_inventory"` **`Beta`** *** ### EnderInventory > **EnderInventory**: `"minecraft:ender_inventory"` **`Beta`** #### Remarks 表示此实体的末影箱库存属性。 Represents this entity's ender inventory properties. *** ### Equippable > **Equippable**: `"minecraft:equippable"` **`Beta`** #### Remarks 提供对生物装备槽的访问。此组件存在于所有生物实体上。 Provides access to a mob's equipment slots. This component exists for all mob entities. *** ### Exhaustion > **Exhaustion**: `"minecraft:player.exhaustion"` **`Beta`** #### Remarks 使用此组件读取玩家的饥饿值。仅在玩家身上可用。 Use this component to read the exhaustion of a player. This is only available on players. *** ### FireImmune > **FireImmune**: `"minecraft:fire_immune"` **`Beta`** #### Remarks 添加时,此组件表示此实体不会受到火焰伤害。 When added, this component signifies that this entity doesn't take damage from fire. *** ### FloatsInLiquid > **FloatsInLiquid**: `"minecraft:floats_in_liquid"` **`Beta`** #### Remarks 添加时,此组件表示此实体可以在液体方块中浮动。 When added, this component signifies that this entity can float in liquid blocks. *** ### FlyingSpeed > **FlyingSpeed**: `"minecraft:flying_speed"` **`Beta`** #### Remarks 表示实体的飞行速度。 Represents the flying speed of an entity. *** ### FrictionModifier > **FrictionModifier**: `"minecraft:friction_modifier"` **`Beta`** #### Remarks 定义摩擦力对此实体的影响程度。 Defines how much friction affects this entity. *** ### Healable > **Healable**: `"minecraft:healable"` **`Beta`** #### Remarks 定义与此实体交互以进行治疗的方式。 Defines the interactions with this entity for healing it. *** ### Health > **Health**: `"minecraft:health"` **`Beta`** #### Remarks 定义实体的生命值属性。 Defines the health properties of an entity. *** ### Hunger > **Hunger**: `"minecraft:player.hunger"` **`Beta`** #### Remarks 使用此组件读取玩家的饥饿度。仅在玩家身上可用。 Use this component to read the hunger of a player. This is only available on players. *** ### Inventory > **Inventory**: `"minecraft:inventory"` **`Beta`** #### Remarks 定义此实体的库存属性。 Defines this entity's inventory properties. *** ### IsBaby > **IsBaby**: `"minecraft:is_baby"` **`Beta`** #### Remarks 添加时,此组件表示此实体是幼年体。 When added, this component signifies that this entity is a baby. *** ### IsCharged > **IsCharged**: `"minecraft:is_charged"` **`Beta`** #### Remarks 添加时,此组件表示此实体已充能。 When added, this component signifies that this entity is charged. *** ### IsChested > **IsChested**: `"minecraft:is_chested"` **`Beta`** #### Remarks 添加时,此组件表示此实体当前携带箱子。 When added, this component signifies that this entity is currently carrying a chest. *** ### IsDyeable > **IsDyeable**: `"minecraft:is_dyeable"` **`Beta`** #### Remarks 添加时,此组件表示可以使用染料更改此实体的颜色。 When added, this component signifies that dyes can be used on this entity to change its color. *** ### IsHiddenWhenInvisible > **IsHiddenWhenInvisible**: `"minecraft:is_hidden_when_invisible"` **`Beta`** #### Remarks 添加时,此组件表示此实体在隐形时可以躲避敌对生物。 When added, this component signifies that this entity can hide from hostile mobs while invisible. *** ### IsIgnited > **IsIgnited**: `"minecraft:is_ignited"` **`Beta`** #### Remarks 添加时,此组件表示此实体当前着火。 When added, this component signifies that this entity this currently on fire. *** ### IsIllagerCaptain > **IsIllagerCaptain**: `"minecraft:is_illager_captain"` **`Beta`** #### Remarks 添加时,此组件表示此实体是灾厄队长。 When added, this component signifies that this entity is an illager captain. *** ### IsSaddled > **IsSaddled**: `"minecraft:is_saddled"` **`Beta`** #### Remarks 添加时,此组件表示此实体当前已上鞍。 When added, this component signifies that this entity is currently saddled. *** ### IsShaking > **IsShaking**: `"minecraft:is_shaking"` **`Beta`** #### Remarks 添加时,此组件表示此实体当前正在摇晃。 When added, this component signifies that this entity is currently shaking. *** ### IsSheared > **IsSheared**: `"minecraft:is_sheared"` **`Beta`** #### Remarks 添加时,此组件表示此实体当前已被剪毛。 When added, this component signifies that this entity is currently sheared. *** ### IsStackable > **IsStackable**: `"minecraft:is_stackable"` **`Beta`** #### Remarks 添加时,此组件表示此实体可以堆叠。 When added, this component signifies that this entity can be stacked. *** ### IsStunned > **IsStunned**: `"minecraft:is_stunned"` **`Beta`** #### Remarks 添加时,此组件表示此实体当前被眩晕。 When added, this component signifies that this entity is currently stunned. *** ### IsTamed > **IsTamed**: `"minecraft:is_tamed"` **`Beta`** #### Remarks 添加时,此组件表示此实体当前已被驯服。 When added, this component signifies that this entity is currently tamed. *** ### Item > **Item**: `"minecraft:item"` **`Beta`** #### Remarks 如果添加到实体上,表示该实体代表世界中自由浮动的物品。允许您通过 itemStack 属性获取实际的物品堆栈内容。 If added onto the entity, this indicates that the entity represents a free-floating item in the world. Lets you retrieve the actual item stack contents via the itemStack property. *** ### LavaMovement > **LavaMovement**: `"minecraft:lava_movement"` **`Beta`** #### Remarks 定义此实体在熔岩中的基础移动速度。 Defines the base movement speed in lava of this entity. *** ### Leashable > **Leashable**: `"minecraft:leashable"` **`Beta`** #### Remarks 允许此实体被拴绳拴住,并定义此实体被拴绳时的条件和事件。 Allows this entity to be leashed and defines the conditions and events for this entity when is leashed. *** ### MarkVariant > **MarkVariant**: `"minecraft:mark_variant"` **`Beta`** #### Remarks 添加时,此组件表示此实体包含一个额外的变体值。可用于进一步区分变体。 When added, this component signifies that this entity contains an additional variant value. Can be used to further differentiate variants. *** ### Movement > **Movement**: `"minecraft:movement"` **`Beta`** #### Remarks 定义此实体的常规移动速度。 Defines the general movement speed of this entity. *** ### MovementAmphibious > **MovementAmphibious**: `"minecraft:movement.amphibious"` **`Beta`** #### Remarks 添加时,此移动控制允许生物在水中游泳并在陆地上行走。 When added, this movement control allows the mob to swim in water and walk on land. *** ### MovementBasic > **MovementBasic**: `"minecraft:movement.basic"` **`Beta`** #### Remarks 添加时,此组件允许实体的移动。 When added, this component allows the movement of an entity. *** ### MovementFly > **MovementFly**: `"minecraft:movement.fly"` **`Beta`** #### Remarks 添加时,此移动控制使生物飞行。 When added, this move control causes the mob to fly. *** ### MovementGeneric > **MovementGeneric**: `"minecraft:movement.generic"` **`Beta`** #### Remarks 添加时,此移动控制允许生物飞行、游泳、攀爬等。 When added, this move control allows a mob to fly, swim, climb, etc. *** ### MovementGlide > **MovementGlide**: `"minecraft:movement.glide"` **`Beta`** #### Remarks 添加时,此移动控制允许生物滑翔。 When added, this movement control allows the mob to glide. *** ### MovementHover > **MovementHover**: `"minecraft:movement.hover"` **`Beta`** #### Remarks 添加时,此移动控制使生物悬停。 When added, this move control causes the mob to hover. *** ### MovementJump > **MovementJump**: `"minecraft:movement.jump"` **`Beta`** #### Remarks 移动控制,使生物在移动时跳跃,并在跳跃之间具有指定的延迟。 Move control that causes the mob to jump as it moves with a specified delay between jumps. *** ### MovementSkip > **MovementSkip**: `"minecraft:movement.skip"` **`Beta`** #### Remarks 添加时,此移动控制使生物在移动时单脚跳。 When added, this move control causes the mob to hop as it moves. *** ### MovementSway > **MovementSway**: `"minecraft:movement.sway"` **`Beta`** #### Remarks 添加时,此移动控制使生物左右摇摆,给人以游泳的印象。 When added, this move control causes the mob to sway side to side giving the impression it is swimming. *** ### NavigationClimb > **NavigationClimb**: `"minecraft:navigation.climb"` **`Beta`** #### Remarks 允许此实体生成包含垂直墙壁的路径(例如,像 Minecraft 中的蜘蛛那样)。 Allows this entity to generate paths that include vertical walls (for example, like Minecraft spiders do.) *** ### NavigationFloat > **NavigationFloat**: `"minecraft:navigation.float"` **`Beta`** #### Remarks 允许此实体像普通恶魂一样在空中飞行生成路径。 Allows this entity to generate paths by flying around the air like the regular Ghast. *** ### NavigationFly > **NavigationFly**: `"minecraft:navigation.fly"` **`Beta`** #### Remarks 允许此实体在空中生成路径(例如,像 Minecraft 中的鹦鹉那样)。 Allows this entity to generate paths in the air (for example, like Minecraft parrots do.) *** ### NavigationGeneric > **NavigationGeneric**: `"minecraft:navigation.generic"` **`Beta`** #### Remarks 允许此实体通过行走、游泳、飞行和/或攀爬以及跳跃上下一个方块来生成路径。 Allows this entity to generate paths by walking, swimming, flying and/or climbing around and jumping up and down a block. *** ### NavigationHover > **NavigationHover**: `"minecraft:navigation.hover"` **`Beta`** #### Remarks 允许此实体在空中生成路径(例如,像 Minecraft 中的蜜蜂那样)。防止它们从天空中掉落并进行预测性移动。 Allows this entity to generate paths in the air (for example, like the Minecraft Bees do.) Keeps them from falling out of the skies and doing predictive movement. *** ### NavigationWalk > **NavigationWalk**: `"minecraft:navigation.walk"` **`Beta`** #### Remarks 允许此实体像普通生物一样通过行走和跳跃上下一个方块来生成路径。 Allows this entity to generate paths by walking around and jumping up and down a block like regular mobs. *** ### Npc 实验性 > **Npc**: `"minecraft:npc"` **`Beta`** #### Remarks 为实体添加 NPC 功能,例如自定义皮肤、名称和对话交互。 Adds NPC capabilities to an entity such as custom skin, name, and dialogue interactions. *** ### OnFire > **OnFire**: `"minecraft:onfire"` **`Beta`** #### Remarks 当存在于实体上时,此实体着火。 When present on an entity, this entity is on fire. *** ### Projectile > **Projectile**: `"minecraft:projectile"` **`Beta`** #### Remarks 弹射物组件控制弹射物实体的属性,并允许其在给定方向上发射。当实体具有 minecraft:projectile 组件时,此组件存在。 The projectile component controls the properties of a projectile entity and allows it to be shot in a given direction. This component is present when the entity has the minecraft:projectile component. *** ### PushThrough > **PushThrough**: `"minecraft:push_through"` **`Beta`** #### Remarks 设置实体可以穿过的距离。 Sets the distance through which the entity can push through. *** ### Rideable > **Rideable**: `"minecraft:rideable"` **`Beta`** #### Remarks 添加时,此组件增加了一个实体可以被另一个实体骑乘的能力。 When added, this component adds the capability that an entity can be ridden by another entity. *** ### Riding > **Riding**: `"minecraft:riding"` **`Beta`** #### Remarks 当任何实体正在骑乘另一个实体时,此组件被添加到该实体上。 This component is added to any entity when it is riding another entity. *** ### Saturation > **Saturation**: `"minecraft:player.saturation"` **`Beta`** #### Remarks 使用此组件读取玩家的饱和度。仅在玩家身上可用。 Use this component to read the saturation of a player. This is only available on players. *** ### Scale > **Scale**: `"minecraft:scale"` **`Beta`** #### Remarks 设置实体的视觉大小。 Sets the entity's visual size. *** ### SkinId > **SkinId**: `"minecraft:skin_id"` **`Beta`** #### Remarks 皮肤 ID 值。可用于区分皮肤,例如村民的基础皮肤。 Skin Id value. Can be used to differentiate skins, such as base skins for villagers. *** ### Strength > **Strength**: `"minecraft:strength"` **`Beta`** #### Remarks 定义实体携带物品的强度。 Defines the entity's strength to carry items. *** ### Tameable > **Tameable**: `"minecraft:tameable"` **`Beta`** #### Remarks 定义实体被玩家驯服的规则。 Defines the rules for an entity to be tamed by the player. *** ### TameMount > **TameMount**: `"minecraft:tamemount"` **`Beta`** #### Remarks 包含基于骑乘它的实体来驯服可骑乘实体的选项。 Contains options for taming a rideable entity based on the entity that mounts it. *** ### TypeFamily > **TypeFamily**: `"minecraft:type_family"` **`Beta`** #### Remarks 用于确定实体所属的类型族。 Used to determine the type families the entity belongs to. *** ### UnderwaterMovement > **UnderwaterMovement**: `"minecraft:underwater_movement"` **`Beta`** #### Remarks 定义此实体在水下的常规移动速度。 Defines the general movement speed underwater of this entity. *** ### Variant > **Variant**: `"minecraft:variant"` **`Beta`** #### Remarks 用于区分实体变体的组件组(例如,豹猫、村民)。 Used to differentiate the component group of a variant of an entity from others. (e.g. ocelot, villager). *** ### WantsJockey > **WantsJockey**: `"minecraft:wants_jockey"` **`Beta`** #### Remarks 添加时,此组件表示此实体想要成为骑师。 When added, this component signifies that this entity wants to become a jockey. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/EntityDamageCause.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/EntityDamageCause.md. # Enumeration: EntityDamageCause entity damage **`Beta`** 描述实体的伤害来源。 Describes the source of damage from an Entity. ## Enumeration Members ### anvil > **anvil**: `"anvil"` **`Beta`** #### Remarks 由下落的铁砧造成的伤害。 Damage caused by a falling anvil. *** ### blockExplosion > **blockExplosion**: `"blockExplosion"` **`Beta`** #### Remarks 由非实体爆炸造成的伤害。例如,爆炸的床。 Damage caused from a non-Entity explosion. For example, an exploding bed. *** ### campfire > **campfire**: `"campfire"` **`Beta`** #### Remarks 由营火造成的伤害。 Damage caused by Campfires. *** ### charging > **charging**: `"charging"` **`Beta`** #### Remarks 未使用。 Unused. *** ### contact > **contact**: `"contact"` **`Beta`** #### Remarks 由物理接触实体或方块造成的伤害。例如,触碰甜浆果丛或河豚。 Damage caused by physically touching an Entity or Block. For example, touching a Sweet Berry bush or Pufferfish. *** ### drowning > **drowning**: `"drowning"` **`Beta`** #### Remarks 由实体处于无空气状态且在液体方块内部造成的伤害。 Damage caused by an Entity being out of air and inside a liquid block. *** ### entityAttack > **entityAttack**: `"entityAttack"` **`Beta`** #### Remarks 由实体攻击造成的伤害。 Damage caused by an Entity attack. *** ### entityExplosion > **entityExplosion**: `"entityExplosion"` **`Beta`** #### Remarks 由实体爆炸造成的伤害。例如,苦力怕或凋灵。 Damage caused by an Entity explosion. For example, a Creeper or Wither. *** ### fall > **fall**: `"fall"` **`Beta`** #### Remarks 由摔落到地面造成的伤害。 Damage caused by falling onto the ground. *** ### fallingBlock > **fallingBlock**: `"fallingBlock"` **`Beta`** #### Remarks 由下落的方块造成的伤害。注意:铁砧和钟乳石有它们自己的伤害原因。 Damage caused by falling blocks. Note: Anvils and Stalactites have their own damage causes. *** ### fire > **fire**: `"fire"` **`Beta`** #### Remarks 由着火造成的伤害。 Damage caused by catching on fire. *** ### fireTick > **fireTick**: `"fireTick"` **`Beta`** #### Remarks 由持续燃烧造成的伤害。 Damage caused by burning over time. *** ### fireworks > **fireworks**: `"fireworks"` **`Beta`** #### Remarks 由烟花造成的伤害。 Damage caused by fireworks. *** ### flyIntoWall > **flyIntoWall**: `"flyIntoWall"` **`Beta`** #### Remarks 在穿着鞘翅滑翔时高速撞墙造成的伤害。 Damage caused by flying into a wall at high speed while gliding with Elytra. *** ### freezing > **freezing**: `"freezing"` **`Beta`** #### Remarks 由停留在细雪方块内造成的伤害。 Damage caused by staying inside a Powder Snow block. *** ### lava > **lava**: `"lava"` **`Beta`** #### Remarks 由接触熔岩方块造成的伤害。 Damage caused by touching a Lava block. *** ### lightning > **lightning**: `"lightning"` **`Beta`** #### Remarks 由被闪电击中造成的伤害。 Damage caused by being struck by lightning. *** ### maceSmash > **maceSmash**: `"maceSmash"` **`Beta`** *** ### magic > **magic**: `"magic"` **`Beta`** #### Remarks 由魔法攻击造成的伤害。例如,唤魔者尖牙或潮涌核心方块。 Damage caused by magical attacks. For example, Evoker Fang or Conduit Block. *** ### magma > **magma**: `"magma"` **`Beta`** #### Remarks 由接触岩浆块造成的伤害。 Damage caused by touching a Magma block. *** ### none > **none**: `"none"` **`Beta`** #### Remarks 由无来源造成的伤害。例如,来自命令或脚本。 Damage caused by no source. For example, from a command or script. *** ### override > **override**: `"override"` **`Beta`** #### Remarks 由间接来源造成的伤害。例如,在行为包中将生物的生命值设为 0。 Damage caused by an indirect source. For example, setting a mob's health to 0 in a behavior pack. *** ### piston > **piston**: `"piston"` **`Beta`** #### Remarks 由活塞造成的伤害。 Damage caused by a Piston. *** ### projectile > **projectile**: `"projectile"` **`Beta`** #### Remarks 由弹射物造成的伤害。 Damage caused by a projectile. *** ### ramAttack > **ramAttack**: `"ramAttack"` **`Beta`** #### Remarks 由山羊冲撞造成的伤害。 Damage caused by Goat ramming. *** ### selfDestruct > **selfDestruct**: `"selfDestruct"` **`Beta`** #### Remarks 由 /kill 命令造成的伤害。 Damage caused by the /kill command. *** ### sonicBoom > **sonicBoom**: `"sonicBoom"` **`Beta`** #### Remarks 由监守者的音波尖啸攻击造成的伤害。 Damage caused by the Warden's Sonic Boom attack. *** ### soulCampfire > **soulCampfire**: `"soulCampfire"` **`Beta`** #### Remarks 由灵魂营火造成的伤害。 Damage caused by a Soul Campfire. *** ### stalactite > **stalactite**: `"stalactite"` **`Beta`** #### Remarks 由下落的钟乳石块造成的伤害。 Damage caused by a falling Stalactite block. *** ### stalagmite > **stalagmite**: `"stalagmite"` **`Beta`** #### Remarks 由接触石笋块造成的伤害。 Damage caused by touching a Stalagmite block. *** ### starve > **starve**: `"starve"` **`Beta`** #### Remarks 因饥饿值空而随时间造成的伤害。 Damage caused over time by having an empty hunger bar. *** ### suffocation > **suffocation**: `"suffocation"` **`Beta`** #### Remarks 由实体处于无空气状态且在非液体方块内部造成的伤害。 Damage caused by an Entity being out of air and inside a non-liquid block. *** ### temperature > **temperature**: `"temperature"` **`Beta`** #### Remarks 由实体处于不适宜生存的气候中造成的伤害。例如,雪傀儡在温度大于 1 的生物群系中。 Damage caused by an Entity being in an inhabitable climate. For example, a Snow Golem in a biome with a temperature greater than 1. *** ### thorns > **thorns**: `"thorns"` **`Beta`** #### Remarks 由荆棘盔甲附魔和守卫者荆棘效果造成的伤害。 Damage caused by the Thorns armor enchantment and by the Guardian thorns effect. *** ### void > **void**: `"void"` **`Beta`** #### Remarks 因掉入虚空而随时间造成的伤害。 Damage caused over time by falling into the void. *** ### wither > **wither**: `"wither"` **`Beta`** #### Remarks 由凋灵效果造成的伤害。例如,接触凋灵玫瑰。 Damage caused by the Wither effect. For example, from touching a Wither Rose. ## 同领域相关 - [EntityApplyDamageByProjectileOptions](/server/interfaces/EntityApplyDamageByProjectileOptions.md) - [EntityApplyDamageOptions](/server/interfaces/EntityApplyDamageOptions.md) - [EntityDamageSource](/server/interfaces/EntityDamageSource.md) - [EntityHealthChangedAfterEvent](/server/classes/EntityHealthChangedAfterEvent.md) - [EntityHealthChangedAfterEventSignal](/server/classes/EntityHealthChangedAfterEventSignal.md) - [EntityHealthComponent](/server/classes/EntityHealthComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/EntityHealCause.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/EntityHealCause.md. # Enumeration: EntityHealCause entity **`Beta`** 描述实体的治疗来源。 Describes the source of healing of an Entity. ## Enumeration Members ### Heal > **Heal**: `"Heal"` **`Beta`** #### Remarks 由药水等物品造成的治疗。 Healing caused by items such as potions. *** ### Regeneration > **Regeneration**: `"Regeneration"` **`Beta`** #### Remarks 由再生效果造成的治疗。 Healing caused by regeneration effects. *** ### SelfHeal > **SelfHeal**: `"SelfHeal"` **`Beta`** #### Remarks 当饥饿值满时造成的治疗。 Healing caused when hunger is full. *** ### TotemOfUndying > **TotemOfUndying**: `"TotemOfUndying"` **`Beta`** #### Remarks 当不死图腾被激活时造成的治疗。 Healing caused when Totem of Undying is activated. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/EntityInitializationCause.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/EntityInitializationCause.md. # Enumeration: EntityInitializationCause entity **`Beta`** 描述实体初始化原因的枚举。 An enumeration describing initialization cause of an entity. ## Enumeration Members ### Born > **Born**: `"Born"` **`Beta`** #### Remarks 实体作为其他实体的子代创建时的情况,例如,牛生小牛或史莱姆死亡后分裂出更小的史莱姆。 Case when an entity is created as child of other entity or entities, e.g., cows making a cow or slimes making smaller slimes after dying. *** ### Event > **Event**: `"Event"` **`Beta`** #### Remarks 实体由事件创建时的情况,例如,流浪商人生成羊驼。 Case when an entity is created by an event, e.g., a Wandering trader spawning llamas. *** ### Loaded > **Loaded**: `"Loaded"` **`Beta`** #### Remarks 实体被加载到世界中时的情况。 Case when an entity is loaded into the world. *** ### Spawned > **Spawned**: `"Spawned"` **`Beta`** #### Remarks 实体自然生成在世界中时的情况。 Case when an entity is naturally spawned in the world. *** ### Transformed > **Transformed**: `"Transformed"` **`Beta`** #### Remarks 实体转变为另一个实体时的情况。 Case when an entity is transformed into another entity. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/EntitySwingSource.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/EntitySwingSource.md. # Enumeration: EntitySwingSource entity **`Beta`** 描述实体挥动来源的枚举。作为 [PlayerSwingStartAfterEvent](/server/classes/PlayerSwingStartAfterEvent.md) 的一部分发送。 Enumerator describing the source of an Entity swing. Sent as part of [PlayerSwingStartAfterEvent](/server/classes/PlayerSwingStartAfterEvent.md) ## Enumeration Members ### Attack > **Attack**: `"Attack"` **`Beta`** #### Remarks 当实体作为攻击的一部分挥动时发送。 Sent when the Entity swings as part of an attack. *** ### Build > **Build**: `"Build"` **`Beta`** #### Remarks 当实体作为建造动作的一部分挥动时发送。 Sent when the Entity swings as part of a build action. *** ### DropItem > **DropItem**: `"DropItem"` **`Beta`** #### Remarks 当实体作为丢弃物品的一部分挥动时发送。 Sent when the Entity swings as part of dropping an item. *** ### Event > **Event**: `"Event"` **`Beta`** #### Remarks 当实体作为事件响应的一部分挥动时发送。 Sent when the Entity swings as part of an event response. *** ### Interact > **Interact**: `"Interact"` **`Beta`** #### Remarks 当实体作为交互的一部分挥动时发送。 Sent when the Entity swings as part of an interaction. *** ### Mine > **Mine**: `"Mine"` **`Beta`** #### Remarks 当实体作为挖掘动作的一部分挥动时发送。 Sent when the Entity swings as part of a mine action. *** ### None > **None**: `"None"` **`Beta`** #### Remarks 当实体挥动没有可确定的来源时发送。 Sent when the Entity swing has no determinable source. *** ### ThrowItem > **ThrowItem**: `"ThrowItem"` **`Beta`** #### Remarks 当实体作为投掷物品的一部分挥动时发送。 Sent when the Entity swings as part of throwing an item. *** ### UseItem > **UseItem**: `"UseItem"` **`Beta`** #### Remarks 当实体作为使用物品的一部分挥动时发送。 Sent when the Entity swings as part of using an item. ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/EquipmentSlot.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/EquipmentSlot.md. # Enumeration: EquipmentSlot **`Beta`** 生物的装备槽。包括盔甲、副手和主手槽。 The equipment slot of the mob. This includes armor, offhand and mainhand slots. ## Enumeration Members ### Body 实验性 > **Body**: `"Body"` **`Beta`** #### Remarks 身体槽。此槽用于为非人形生物持有盔甲。 The body slot. This slot is used to hold armor for non-humanoid mobs. *** ### Chest > **Chest**: `"Chest"` **`Beta`** #### Remarks 胸部槽。此槽用于持有胸甲或鞘翅等物品。 The chest slot. This slot is used to hold items such as Chestplate or Elytra. *** ### Feet > **Feet**: `"Feet"` **`Beta`** #### Remarks 脚部槽。此槽用于持有靴子等物品。 The feet slot. This slot is used to hold items such as Boots. *** ### Head > **Head**: `"Head"` **`Beta`** #### Remarks 头部槽。此槽用于持有头盔或雕刻南瓜等物品。 The head slot. This slot is used to hold items such as Helmets or Carved Pumpkins. *** ### Legs > **Legs**: `"Legs"` **`Beta`** #### Remarks 腿部槽。此槽用于持有护腿等物品。 The legs slot. This slot is used to hold items such as Leggings. *** ### Mainhand > **Mainhand**: `"Mainhand"` **`Beta`** #### Remarks 主手槽。对于玩家,主手槽指的是当前激活的快捷栏槽位。 The mainhand slot. For players, the mainhand slot refers to the currently active hotbar slot. *** ### Offhand > **Offhand**: `"Offhand"` **`Beta`** #### Remarks 副手槽。此槽用于持有盾牌和地图等物品。 The offhand slot. This slot is used to hold items such as shields and maps. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/FluidType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/FluidType.md. # Enumeration: FluidType **`Beta`** 表示在包含液体的方块(如炼药锅)中使用的流体类型。 Represents the type of fluid for use within a fluid containing block, like a cauldron. ## Enumeration Members ### Lava > **Lava**: `"Lava"` **`Beta`** #### Remarks 表示熔岩作为一种流体类型。 Represents lava as a type of fluid. *** ### Potion > **Potion**: `"Potion"` **`Beta`** #### Remarks 表示药水作为一种流体类型。 Represents a potion as a type of fluid. *** ### PowderSnow > **PowderSnow**: `"PowderSnow"` **`Beta`** #### Remarks 表示细雪作为一种流体类型。 Represents powder snow as a type of fluid. *** ### Water > **Water**: `"Water"` **`Beta`** #### Remarks 表示水作为一种流体类型。 Represents water as a type of fluida. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/GameMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/GameMode.md. # Enumeration: GameMode **`Beta`** 表示当前世界体验的游戏模式。 Represents a game mode for the current world experience. ## Enumeration Members ### Adventure > **Adventure**: `"Adventure"` **`Beta`** #### Remarks 世界处于更受限的体验模式,方块可能无法被操作。 World is in a more locked-down experience, where blocks may not be manipulated. *** ### Creative > **Creative**: `"Creative"` **`Beta`** #### Remarks 世界处于完全创造模式。在创造模式下,玩家拥有物品选择选项卡和生存选择选项卡中的所有可用资源。他们还可以立即破坏方块,包括那些通常无法破坏的方块。命令方块和结构方块也可以在创造模式下使用。物品也不会失去耐久度或消失。 World is in a full creative mode. In creative mode, the player has all the resources available in the item selection tabs and the survival selection tab. They can also destroy blocks instantly including those which would normally be indestructible. Command and structure blocks can also be used in creative mode. Items also do not lose durability or disappear. *** ### Spectator > **Spectator**: `"Spectator"` **`Beta`** #### Remarks 世界处于旁观者模式。在旁观者模式下,旁观者始终飞行且无法着陆。旁观者可以穿过实心方块和实体而不会发生任何碰撞,并且无法使用物品或与方块或生物交互。旁观者不会被生物或其他玩家看到,除非是其他旁观者;旁观者显示为透明的浮动头部。 World is in spectator mode. In spectator mode, spectators are always flying and cannot become grounded. Spectators can pass through solid blocks and entities without any collisions, and cannot use items or interact with blocks or mobs. Spectators cannot be seen by mobs or other players, except for other spectators; spectators appear as a transparent floating head. *** ### Survival > **Survival**: `"Survival"` **`Beta`** #### Remarks 世界处于生存模式,玩家可能受到伤害,实体可能不是和平的。生存模式下,玩家必须收集资源、建造结构,同时在其生成的世界中生存。活动会随着时间的推移逐渐消耗玩家的生命值和饥饿值。 World is in a survival mode, where players can take damage and entities may not be peaceful. Survival mode is where the player must collect resources, build structures while surviving in their generated world. Activities can, over time, chip away at player health and hunger bar. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/GameRule.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/GameRule.md. # Enumeration: GameRule **`Beta`** 游戏规则。这些值也可以通过 /gamerule 命令控制。 Game rules. These values can also be controlled via the /gamerule command. ## Enumeration Members ### CommandBlockOutput > **CommandBlockOutput**: `"commandBlockOutput"` **`Beta`** #### Remarks 命令方块在执行命令时是否通知管理员。 Whether command blocks should notify admins when they perform commands. *** ### CommandBlocksEnabled > **CommandBlocksEnabled**: `"commandBlocksEnabled"` **`Beta`** #### Remarks 控制命令方块是否可以执行命令。 Controls whether command blocks can execute commands. *** ### DoDayLightCycle > **DoDayLightCycle**: `"doDayLightCycle"` **`Beta`** #### Remarks 控制昼夜循环是否进行。 Controls whether the day and night cycles progress. *** ### DoEntityDrops > **DoEntityDrops**: `"doEntityDrops"` **`Beta`** #### Remarks 控制非生物实体是否掉落物品。例如,物品展示框。 Controls whether non-mob entities do drops. ie. Item Frame *** ### DoFireTick > **DoFireTick**: `"doFireTick"` **`Beta`** #### Remarks 控制火势是否蔓延。 Controls whether fire spreads. *** ### DoImmediateRespawn > **DoImmediateRespawn**: `"doImmediateRespawn"` **`Beta`** #### Remarks 控制玩家是立即重生还是显示死亡屏幕。 Controls whether players immediately respawn or are shown the death screen. *** ### DoInsomnia > **DoInsomnia**: `"doInsomnia"` **`Beta`** #### Remarks 控制玩家是否处理不睡觉的影响(例如幻翼生成)。 Controls whether players deal with the effects of not sleeping (such as Phantom spawning). *** ### DoLimitedCrafting > **DoLimitedCrafting**: `"doLimitedCrafting"` **`Beta`** #### Remarks 决定玩家是否只能制作那些他们已经解锁的配方——当 dolimitedcrafting 设置为 `true` 时。 Determines whether players should be able to craft only those recipes that they've unlocked first - when dolimitedcrafting is set to true. *** ### DoMobLoot > **DoMobLoot**: `"doMobLoot"` **`Beta`** #### Remarks 控制生物是否掉落战利品。 Controls whether mobs drop loot. *** ### DoMobSpawning > **DoMobSpawning**: `"doMobSpawning"` **`Beta`** #### Remarks 控制生物是否自然生成在世界中。 Controls whether mobs spawn naturally in the world. *** ### DoTileDrops > **DoTileDrops**: `"doTileDrops"` **`Beta`** #### Remarks 控制方块被破坏时是否掉落物品。 Controls whether blocks drop items when destroyed. *** ### DoWeatherCycle > **DoWeatherCycle**: `"doWeatherCycle"` **`Beta`** #### Remarks 控制天气是否可以自然变化。 Controls whether the weather can change naturally. *** ### DrowningDamage > **DrowningDamage**: `"drowningDamage"` **`Beta`** #### Remarks 控制实体是否因溺水而受到伤害。 Controls whether entities take damage from drowning. *** ### FallDamage > **FallDamage**: `"fallDamage"` **`Beta`** #### Remarks 控制实体是否因摔落而受到伤害。 Controls whether entities take damage from falling. *** ### FireDamage > **FireDamage**: `"fireDamage"` **`Beta`** #### Remarks 控制实体是否因火焰而受到伤害。 Controls whether entities take damage from fire. *** ### FreezeDamage > **FreezeDamage**: `"freezeDamage"` **`Beta`** #### Remarks 控制是否受到冰冻伤害。 Controls whether there is damage from freezing. *** ### FunctionCommandLimit > **FunctionCommandLimit**: `"functionCommandLimit"` **`Beta`** #### Remarks 可由 /function 命令同时执行的最大命令数量。 The maximum number of commands that can be executed simultaneously by the /function command. *** ### KeepInventory > **KeepInventory**: `"keepInventory"` **`Beta`** #### Remarks 控制玩家死亡时是否保留其物品栏。 Controls whether players keep their inventories when they die. *** ### MaxCommandChainLength > **MaxCommandChainLength**: `"maxCommandChainLength"` **`Beta`** #### Remarks 每 tick 可执行的最大连锁命令数量。 The maximum number of chained commands that can execute per tick. *** ### MobGriefing > **MobGriefing**: `"mobGriefing"` **`Beta`** #### Remarks 控制世界中是否会发生生物破坏行为。例如:苦力怕爆炸破坏方块。 Controls whether mob griefing can happen in the world. Example: A Creeper explosion destroying blocks. *** ### NaturalRegeneration > **NaturalRegeneration**: `"naturalRegeneration"` **`Beta`** #### Remarks 控制玩家是否可以恢复生命值。 Controls whether players can regenerate health. *** ### PlayersSleepingPercentage > **PlayersSleepingPercentage**: `"playersSleepingPercentage"` **`Beta`** #### Remarks 需要睡眠的玩家百分比,以进入第二天。 The percentage of players required to be sleeping in order to advance to the next day. *** ### PlayerWaypoints 实验性 > **PlayerWaypoints**: `"playerWaypoints"` **`Beta`** #### Remarks 控制哪些玩家路径点会自动添加到玩家的定位栏中。 Controls which player waypoints are automatically added to the players locator bar. *** ### ProjectilesCanBreakBlocks > **ProjectilesCanBreakBlocks**: `"projectilesCanBreakBlocks"` **`Beta`** #### Remarks 控制弹射物(具有弹射物组件的实体,如箭、投掷的三叉戟或烟花)是否可以破坏某些支持此交互的方块(如紫颂果、滴水石锥或饰纹陶罐)。不同弹射物可以破坏哪些方块有限制。 Controls whether projectiles (entities with a projectile component, like Arrows, thrown Tridents or Fireworks) can destroy certain blocks that support this interaction (such as Chorus Fruit, Dripstone or Decorated Pots). Restrictions on which projectiles can destroy certain blocks apply. *** ### Pvp > **Pvp**: `"pvp"` **`Beta`** #### Remarks 控制玩家是否可以互相伤害。 Controls whether players can damage each other. *** ### RandomTickSpeed > **RandomTickSpeed**: `"randomTickSpeed"` **`Beta`** #### Remarks 控制随机 tick 发生的频率。值为 0 或更小将禁用随机 tick。默认值为 1。 Controls how frequently random ticks occur. A value of 0 or less will disable random ticks. The default value is 1. *** ### RecipesUnlock > **RecipesUnlock**: `"recipesUnlock"` **`Beta`** #### Remarks 控制内置(原版)配方是否在玩家游戏进程中自动解锁(另一种选择是根据自定义游戏逻辑使用 /recipe 命令)。 Controls whether built-in (vanilla) recipes automatically unlock as the player progresses through the game (one alternative to this is to use the /recipe command based on custom gameplay logic.) *** ### RespawnBlocksExplode > **RespawnBlocksExplode**: `"respawnBlocksExplode"` **`Beta`** #### Remarks 控制重生方块(例如床、重生锚)是否在其他维度中爆炸。 Controls whether respawn blocks (e.g. Bed, Respawn Anchor) explode in other dimensions. *** ### SendCommandFeedback > **SendCommandFeedback**: `"sendCommandFeedback"` **`Beta`** #### Remarks 控制命令输出是否显示给玩家。同时也控制命令方块输出是否默认存储。 Controls whether command output is displayed to players. Also controls whether Command Block output is stored by default. *** ### ShowBorderEffect > **ShowBorderEffect**: `"showBorderEffect"` **`Beta`** #### Remarks 控制是否显示边界方块效果。 Controls whether Border Block effects are shown. *** ### ShowCoordinates > **ShowCoordinates**: `"showCoordinates"` **`Beta`** #### Remarks 控制是否显示玩家坐标。 Controls whether player coordinates are displayed. *** ### ShowDaysPlayed > **ShowDaysPlayed**: `"showDaysPlayed"` **`Beta`** #### Remarks 控制是否显示玩家已游玩的天数。 Controls whether the days a player has played is displayed. *** ### ShowDeathMessages > **ShowDeathMessages**: `"showDeathMessages"` **`Beta`** #### Remarks 控制死亡消息是否显示在聊天中。 Controls whether death messages are displayed in chat. *** ### ShowRecipeMessages > **ShowRecipeMessages**: `"showRecipeMessages"` **`Beta`** #### Remarks 控制配方的标准玩家通知是否显示。当设置为 `false` 时,"玩家已解锁配方"不再作为玩家通知发送。 Controls whether standard player notifications for recipes will show. When set to false, 'player unlocked recipes' are no longer sent as player notifications. *** ### ShowTags > **ShowTags**: `"showTags"` **`Beta`** #### Remarks 控制是否显示物品标签。例如,"Can Place On"、"Can Destroy"、物品锁定图标等。 Controls whether item tags are shown. E.g. 'Can Place On', 'Can Destroy', item lock icons, etc. *** ### SpawnRadius > **SpawnRadius**: `"spawnRadius"` **`Beta`** #### Remarks 允许玩家在世界出生点周围生成的方块半径。不影响冒险模式。默认值为 10 个方块。 The block radius from world spawn that a player is allowed to spawn in. Does not affect Adventure mode. The default value is 10 blocks. *** ### TntExplodes > **TntExplodes**: `"tntExplodes"` **`Beta`** #### Remarks 影响 TNT 方块是否可以被点燃。 Affects whether TNT blocks can be lit. *** ### TntExplosionDropDecay > **TntExplosionDropDecay**: `"tntExplosionDropDecay"` **`Beta`** #### Remarks 控制方块在被爆炸破坏时是随机掉落战利品还是全部掉落战利品。默认为 `false`。 Controls whether blocks randomly drop loot or all blocks drop loot when destroyed by an explosion. Defaults to false. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/GraphicsMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/GraphicsMode.md. # Enumeration: GraphicsMode **`Beta`** 描述客户端的图形模式。由 [Player.graphicsMode](/server/classes/Player.md#graphicsmode) 使用。 Describes the graphics mode of a client. Used by [Player.graphicsMode](/server/classes/Player.md#graphicsmode) ## Enumeration Members ### Deferred > **Deferred**: `"Deferred"` **`Beta`** #### Remarks 指代延迟技术预览图形模式设置的图形模式。 A graphics mode that refers to the Deferred Technical Preview graphics mode setting. *** ### Fancy > **Fancy**: `"Fancy"` **`Beta`** #### Remarks 指代精美图形模式设置的图形模式。在此设置下,大多数特殊图形效果都已打开。 A graphics mode that refers to the Fancy graphics mode setting. Most special graphics effects are turned on in this setting. *** ### RayTraced > **RayTraced**: `"RayTraced"` **`Beta`** #### Remarks 指代光线追踪图形模式设置的图形模式。此设置启用光线追踪。 A graphics mode that refers to the Ray Traced graphics mode setting. This setting enables ray tracing. *** ### Simple > **Simple**: `"Simple"` **`Beta`** #### Remarks 指代简单图形模式设置的图形模式。在此设置下,大多数图形效果都已关闭。 A graphics mode that refers to the Simple graphics mode setting. Most graphics effects are turned off in this setting. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/HeldItemOption.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/HeldItemOption.md. # Enumeration: HeldItemOption **`Beta`** 指定与实体当前持有的物品相关的选项。 Specifies options related to the item currently being held by an entity. ## Enumeration Members ### AnyItem > **AnyItem**: `"AnyItem"` **`Beta`** #### Remarks 正在持有任何物品。 Any item is being held. *** ### NoItem > **NoItem**: `"NoItem"` **`Beta`** #### Remarks 没有持有物品。 No item is being held. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/HudElement.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/HudElement.md. # Enumeration: HudElement **`Beta`** ## Enumeration Members ### AirBubbles > **AirBubbles**: `9` **`Beta`** *** ### Armor > **Armor**: `1` **`Beta`** *** ### Crosshair > **Crosshair**: `4` **`Beta`** *** ### Health > **Health**: `6` **`Beta`** *** ### HorseHealth > **HorseHealth**: `10` **`Beta`** *** ### Hotbar > **Hotbar**: `5` **`Beta`** *** ### Hunger > **Hunger**: `8` **`Beta`** *** ### ItemText > **ItemText**: `12` **`Beta`** *** ### PaperDoll > **PaperDoll**: `0` **`Beta`** *** ### ProgressBar > **ProgressBar**: `7` **`Beta`** *** ### StatusEffects > **StatusEffects**: `11` **`Beta`** *** ### ToolTips > **ToolTips**: `2` **`Beta`** *** ### TouchControls > **TouchControls**: `3` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/HudVisibility.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/HudVisibility.md. # Enumeration: HudVisibility **`Beta`** 指定如何处理 HUD 元素的可见性的枚举。 Enumeration that specifies how to treat the visibility of a HUD element. ## Enumeration Members ### Hide > **Hide**: `0` **`Beta`** #### Remarks 指定此 HUD 元素应被隐藏。 Specifies that this HUD element should be hidden. *** ### Reset > **Reset**: `1` **`Beta`** #### Remarks 指定此 HUD 元素应重置为其默认状态(虽然大多数 HUD 元素是可见的,但某些 HUD 元素可以通过玩家设置隐藏。) Specifies that this HUD element should be reset to its default state (while most HUD elements are visible, some HUD elements can be hidden by the player via settings.) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/InputButton.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/InputButton.md. # Enumeration: InputButton **`Beta`** 所有支持的输入按钮。与 [InputInfo.getButtonState](/server/classes/InputInfo.md#getbuttonstate)(通过 [Player.inputInfo](/server/classes/Player.md#inputinfo))或 [PlayerButtonInputAfterEvent](/server/classes/PlayerButtonInputAfterEvent.md)(通过 [WorldAfterEvents.playerButtonInput](/server/classes/WorldAfterEvents.md#playerbuttoninput))一起使用。 All the different input buttons that are supported. Use with [InputInfo.getButtonState](/server/classes/InputInfo.md#getbuttonstate) via [Player.inputInfo](/server/classes/Player.md#inputinfo) or [PlayerButtonInputAfterEvent](/server/classes/PlayerButtonInputAfterEvent.md) via [WorldAfterEvents.playerButtonInput](/server/classes/WorldAfterEvents.md#playerbuttoninput) ## Enumeration Members ### Jump > **Jump**: `"Jump"` **`Beta`** #### Remarks 映射到控制器、键盘和触摸界面上的"跳跃"按钮。 This is mapped to the 'Jump' button on controllers, keyboards, and touch interfaces. *** ### Sneak > **Sneak**: `"Sneak"` **`Beta`** #### Remarks 映射到控制器、键盘和触摸界面上的"潜行"按钮。默认情况下,在键盘上是 shift,在 Xbox 控制器上是 B。在触摸界面上,这只会被按下 1 tick 或更短时间,然后即使玩家按住手指也会立即释放。下马或离开船只不会发送潜行按钮更改事件。 This is mapped to the 'Sneak' button on controllers, keyboards, and touch interfaces. By default, this is shift on a keyboard or B on an Xbox controller. On touch interfaces this will only be pressed for 1 tick or less and then it will be released immediately even if the player holds their finger down. Dismounting a horse or exiting a boat will not send a Sneak button change event. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/InputMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/InputMode.md. # Enumeration: InputMode **`Beta`** 描述设备的输入类型。 Describes the type of input of a device. ## Enumeration Members ### Gamepad > **Gamepad**: `"Gamepad"` **`Beta`** #### Remarks 游戏手柄输入。 Gamepad input. *** ### KeyboardAndMouse > **KeyboardAndMouse**: `"KeyboardAndMouse"` **`Beta`** #### Remarks 键盘和鼠标输入。 Keyboard and mouse input. *** ### MotionController > **MotionController**: `"MotionController"` **`Beta`** #### Remarks 动作控制器输入。 Motion controller input. *** ### Touch > **Touch**: `"Touch"` **`Beta`** #### Remarks 触摸输入。 Touch input. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/InputPermissionCategory.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/InputPermissionCategory.md. # Enumeration: InputPermissionCategory permission **`Beta`** 输入权限类别。由 [PlayerInputPermissionCategoryChangeAfterEvent](/server/classes/PlayerInputPermissionCategoryChangeAfterEvent.md) 指定哪个类别已更改,以及由 [PlayerInputPermissions](/server/classes/PlayerInputPermissions.md) 获取或设置权限。 Input permission categories. Used by [PlayerInputPermissionCategoryChangeAfterEvent](/server/classes/PlayerInputPermissionCategoryChangeAfterEvent.md) to specify which category was changed and [PlayerInputPermissions](/server/classes/PlayerInputPermissions.md) to get or set permissions. ## Enumeration Members ### Camera > **Camera**: `1` **`Beta`** #### Remarks 与摄像机移动相关的玩家输入。 Player input relating to camera movement. *** ### Dismount > **Dismount**: `8` **`Beta`** #### Remarks 与下马相关的玩家输入。当禁用时,玩家仍可以通过其他方式下马,例如在马背上玩家仍然可以跳下,在船上玩家可以进入另一艘船。 Player input relating to dismounting. When disabled, the player can still dismount vehicles by other means, for example on horses players can still jump off and in boats players can go into another boat. *** ### Jump > **Jump**: `6` **`Beta`** #### Remarks 与跳跃相关的玩家输入。这也影响向上飞行。 Player input relating to jumping. This also affects flying up. *** ### LateralMovement > **LateralMovement**: `4` **`Beta`** #### Remarks 玩家在世界中横向移动的输入。在键盘上是 WASD,在手柄或触摸上是移动摇杆。 Player input for moving laterally in the world. This would be WASD on a keyboard or the movement joystick on gamepad or touch. *** ### Mount > **Mount**: `7` **`Beta`** #### Remarks 与骑乘载具相关的玩家输入。 Player input relating to mounting vehicles. *** ### MoveBackward > **MoveBackward**: `10` **`Beta`** #### Remarks 与玩家向后移动相关的输入。 Player input relating to moving the player backward. *** ### MoveForward > **MoveForward**: `9` **`Beta`** #### Remarks 与玩家向前移动相关的输入。 Player input relating to moving the player forward. *** ### MoveLeft > **MoveLeft**: `11` **`Beta`** #### Remarks 与玩家向左移动相关的输入。 Player input relating to moving the player left. *** ### Movement > **Movement**: `2` **`Beta`** #### Remarks 与所有玩家移动相关的输入。禁用此选项相当于禁用跳跃、潜行、横向移动、上马和下马。 Player input relating to all player movement. Disabling this is equivalent to disabling jump, sneak, lateral movement, mount, and dismount. *** ### MoveRight > **MoveRight**: `12` **`Beta`** #### Remarks 与玩家向右移动相关的输入。 Player input relating to moving the player right. *** ### Sneak > **Sneak**: `5` **`Beta`** #### Remarks 与潜行相关的玩家输入。这也影响向下飞行。 Player input relating to sneak. This also affects flying down. ## 同领域相关 - [CommandPermissionLevel](/server/enums/CommandPermissionLevel.md) - [PlayerInputPermissionCategoryChangeAfterEvent](/server/classes/PlayerInputPermissionCategoryChangeAfterEvent.md) - [PlayerInputPermissionCategoryChangeAfterEventSignal](/server/classes/PlayerInputPermissionCategoryChangeAfterEventSignal.md) - [PlayerPermissionLevel](/server/enums/PlayerPermissionLevel.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/ItemComponentTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/ItemComponentTypes.md. # Enumeration: ItemComponentTypes component **`Beta`** 可通过 ItemStack.getComponent 函数访问的物品组件类型。 The types of item components that are accessible via function ItemStack.getComponent. ## Enumeration Members ### BlockDynamicProperties 实验性 > **BlockDynamicProperties**: `"minecraft:block_actor_dynamic_properties"` **`Beta`** *** ### Book > **Book**: `"minecraft:book"` **`Beta`** #### Remarks minecraft:book 组件。 The minecraft:book component. *** ### Compostable > **Compostable**: `"minecraft:compostable"` **`Beta`** *** ### Cooldown > **Cooldown**: `"minecraft:cooldown"` **`Beta`** #### Remarks minecraft:cooldown 组件。 The minecraft:cooldown component. *** ### Durability > **Durability**: `"minecraft:durability"` **`Beta`** #### Remarks minecraft:durability 组件。 The minecraft:durability component. *** ### Dyeable > **Dyeable**: `"minecraft:dyeable"` **`Beta`** *** ### Enchantable > **Enchantable**: `"minecraft:enchantable"` **`Beta`** #### Remarks minecraft:enchantable 组件。 The minecraft:enchantable component. *** ### Food > **Food**: `"minecraft:food"` **`Beta`** #### Remarks minecraft:food 组件。 The minecraft:food component. *** ### Inventory > **Inventory**: `"minecraft:inventory"` **`Beta`** *** ### Potion > **Potion**: `"minecraft:potion"` **`Beta`** ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/ItemLockMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/ItemLockMode.md. # Enumeration: ItemLockMode item **`Beta`** 描述物品在容器中的移动方式。 Describes how an an item can be moved within a container. ## Enumeration Members ### inventory > **inventory**: `"inventory"` **`Beta`** #### Remarks 物品不能被丢弃或用于合成。 The item cannot be dropped or crafted with. *** ### none > **none**: `"none"` **`Beta`** #### Remarks 物品没有容器限制。 The item has no container restrictions. *** ### slot > **slot**: `"slot"` **`Beta`** #### Remarks 物品不能从其槽位移出、丢弃或用于合成。 The item cannot be moved from its slot, dropped or crafted with. ## 同领域相关 - [InvalidItemStackError](/server/classes/InvalidItemStackError.md) - [ItemStack](/server/classes/ItemStack.md) - [ItemType](/server/classes/ItemType.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [CollectionTreeEntryItemType](/server-editor/enums/CollectionTreeEntryItemType.md) - [CoreActionBarItemType](/server-editor/enums/CoreActionBarItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/LiquidSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/LiquidSettings.md. # Enumeration: LiquidSettings **`Beta`** 指定如何处理可与水共存的方块与现有液体重叠的情况。 Specifies how to handle waterloggable blocks overlapping with existing liquid. ## Enumeration Members ### ApplyWaterlogging > **ApplyWaterlogging**: `"ApplyWaterlogging"` **`Beta`** #### Remarks 使可与水共存的方块在与现有液体重叠时变为含水状态。 Causes a waterloggable block to become waterlogged, if it overlaps with existing liquid. *** ### IgnoreWaterlogging > **IgnoreWaterlogging**: `"IgnoreWaterlogging"` **`Beta`** #### Remarks 不要使任何与现有液体重叠的可与水共存的方块变为含水状态。 Do not waterlog any waterloggable blocks that overlap existing liquid. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/LiquidType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/LiquidType.md. # Enumeration: LiquidType **`Beta`** 表示可以放置在方块上或在世界中动态流动的液体类型。 Represents the type of liquid that can be placed on a block or flow dynamically in the world. ## Enumeration Members ### Water > **Water**: `"Water"` **`Beta`** #### Remarks 表示水作为一种液体类型。 Represents water as a type of liquid. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/LocatorBarErrorReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/LocatorBarErrorReason.md. # Enumeration: LocatorBarErrorReason error **`Beta`** 表示定位栏操作可能失败的各种原因的枚举。 Enum representing the different reasons why a locator bar operation may fail. ## Enumeration Members ### WaypointAlreadyExists > **WaypointAlreadyExists**: `"WaypointAlreadyExists"` **`Beta`** #### Remarks 该路径点已存在于定位栏中,无法再次添加。 The waypoint already exists in the locator bar and cannot be added again. *** ### WaypointLimitExceeded > **WaypointLimitExceeded**: `"WaypointLimitExceeded"` **`Beta`** #### Remarks 已达到最大路径点数量,无法再添加更多。 The maximum number of waypoints has been reached and no more can be added. *** ### WaypointNotFound > **WaypointNotFound**: `"WaypointNotFound"` **`Beta`** #### Remarks 指定的路径点在定位栏中不存在。 The specified waypoint does not exist in the locator bar. ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/MemoryTier.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/MemoryTier.md. # Enumeration: MemoryTier **`Beta`** 描述设备的内存。 Describes the memory of a device. ## Enumeration Members ### High > **High**: `3` **`Beta`** #### Remarks 高等级的最大内存为 8GB。 Max memory for High Tier is 8GBs. *** ### Low > **Low**: `1` **`Beta`** #### Remarks 低等级的最大内存为 2GB。 Max memory for Low Tier is 2GBs. *** ### Mid > **Mid**: `2` **`Beta`** #### Remarks 中等级的最大内存为 4GB。 Max memory for Mid Tier is 4GBs. *** ### SuperHigh > **SuperHigh**: `4` **`Beta`** #### Remarks 超高等级的内存超过 8GB。 Memory for Super High Tier is above 8GBs. *** ### SuperLow > **SuperLow**: `0` **`Beta`** #### Remarks 超低等级的最大内存为 1.5GB。 Max memory for Super Low Tier is 1.5GBs. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/MoonPhase.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/MoonPhase.md. # Enumeration: MoonPhase **`Beta`** 包含基于当前日期的不同月相阶段的枚举。使用 world.getMoonPhase 获取当前月相。 月亮的满盈程度控制着各种生物行为,例如沼泽生物群系中史莱姆的生成数量、骷髅和僵尸生成时带有盔甲的几率,以及蜘蛛生成时带有特定状态效果的几率。 Enum containing the different phases of the moon based on the current day.,Obtain the current MoonPhase using world.getMoonPhase. The fullness of the moon controls various mob behaviors such as the number of slimes that spawn in Swamp biomes, the chance skeletons and zombies have to spawn with armor, as well as the chance for spiders to spawn with certain status effects. ## Enumeration Members ### FirstQuarter > **FirstQuarter**: `2` **`Beta`** #### Remarks 蛾眉月之后的阶段。 The phase following the Waxing Crescent. *** ### FullMoon > **FullMoon**: `0` **`Beta`** #### Remarks 最亮的月相。在此阶段,猫有 50% 的几率生成黑猫。 The brightest moon phase. During this phase, cats have a 50% chance of spawning as black cats. *** ### LastQuarter > **LastQuarter**: `6` **`Beta`** #### Remarks 亏凸月之后的阶段。 The phase following the Waning Gibbous. *** ### NewMoon > **NewMoon**: `4` **`Beta`** #### Remarks 最暗的月相。 The darkest moon phase. *** ### WaningCrescent > **WaningCrescent**: `3` **`Beta`** #### Remarks 下弦月之后的阶段。 The phase following the Last Quarter. *** ### WaningGibbous > **WaningGibbous**: `1` **`Beta`** #### Remarks 满月之后的阶段。 The phase following the Full Moon. *** ### WaxingCrescent > **WaxingCrescent**: `5` **`Beta`** #### Remarks 新月之后的阶段。 The phase following the New Moon. *** ### WaxingGibbous > **WaxingGibbous**: `7` **`Beta`** #### Remarks 上弦月之后的阶段。 The phase following the First Quarter. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/MovementType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/MovementType.md. # Enumeration: MovementType **`Beta`** ## Enumeration Members ### Immovable > **Immovable**: `"Immovable"` **`Beta`** *** ### Popped > **Popped**: `"Popped"` **`Beta`** *** ### Push > **Push**: `"Push"` **`Beta`** *** ### PushPull > **PushPull**: `"PushPull"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/NamespaceNameErrorReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/NamespaceNameErrorReason.md. # Enumeration: NamespaceNameErrorReason error **`Beta`** 描述命名空间名称错误被抛出原因的枚举。 An enumeration describing the reason for the namespace name error being thrown ## Enumeration Members ### DisallowedNamespace > **DisallowedNamespace**: `"DisallowedNamespace"` **`Beta`** #### Remarks 使用了受限的命名空间作为命名空间。 A restricted namespace was used as the namespace *** ### NoNamespace > **NoNamespace**: `"NoNamespace"` **`Beta`** #### Remarks 当需要命名空间时,名称缺少命名空间。 The name was missing a namespace when one is required ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/ObjectiveSortOrder.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/ObjectiveSortOrder.md. # Enumeration: ObjectiveSortOrder **`Beta`** 表示分数持有者列表的排序顺序。 Used for specifying a sort order for how to display an objective and its list of participants. ## Enumeration Members ### Ascending > **Ascending**: `0` **`Beta`** #### Remarks 以升序显示分数持有者列表(例如:A-Z)。 Objective participant list is displayed in ascending (e.g., A-Z) order. *** ### Descending > **Descending**: `1` **`Beta`** #### Remarks 以降序显示分数持有者列表(例如:Z-A)。 Objective participant list is displayed in descending (e.g., Z-A) order. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/PaletteColor.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/PaletteColor.md. # Enumeration: PaletteColor **`Beta`** 包含可与 EntityColorComponent 和 EntityColor2Component 一起使用的颜色的枚举。 Enum containing colors to be used with EntityColorComponent and EntityColor2Component ## Enumeration Members ### Black > **Black**: `15` **`Beta`** #### Remarks 十六进制颜色 #1D1D21 Hex color #1D1D21 *** ### Blue > **Blue**: `11` **`Beta`** #### Remarks 十六进制颜色 #3C44AA Hex color #3C44AA *** ### Brown > **Brown**: `12` **`Beta`** #### Remarks 十六进制颜色 #835432 Hex color #835432 *** ### Cyan > **Cyan**: `9` **`Beta`** #### Remarks 十六进制颜色 #169C9C Hex color #169C9C *** ### Gray > **Gray**: `7` **`Beta`** #### Remarks 十六进制颜色 #474F52 Hex color #474F52 *** ### Green > **Green**: `13` **`Beta`** #### Remarks 十六进制颜色 #5E7C16 Hex color #5E7C16 *** ### LightBlue > **LightBlue**: `3` **`Beta`** #### Remarks 十六进制颜色 #3AB3DA Hex color #3AB3DA *** ### Lime > **Lime**: `5` **`Beta`** #### Remarks 十六进制颜色 #80C71F Hex color #80C71F *** ### Magenta > **Magenta**: `2` **`Beta`** #### Remarks 十六进制颜色 #C74EBD Hex color #C74EBD *** ### Orange > **Orange**: `1` **`Beta`** #### Remarks 十六进制颜色 #F9801D Hex color #F9801D *** ### Pink > **Pink**: `6` **`Beta`** #### Remarks 十六进制颜色 #F38BAA Hex color #F38BAA *** ### Purple > **Purple**: `10` **`Beta`** #### Remarks 十六进制颜色 #8932B8 Hex color #8932B8 *** ### Red > **Red**: `14` **`Beta`** #### Remarks 十六进制颜色 #B02E26 Hex color #B02E26 *** ### Silver > **Silver**: `8` **`Beta`** #### Remarks 十六进制颜色 #9D9D97 Hex color #9D9D97 *** ### White > **White**: `0` **`Beta`** #### Remarks 十六进制颜色 #f0f0f0 Hex color #f0f0f0 *** ### Yellow > **Yellow**: `4` **`Beta`** #### Remarks 十六进制颜色 #FED83D Hex color #FED83D [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/PlatformType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/PlatformType.md. # Enumeration: PlatformType **`Beta`** 描述设备属于哪种平台。 Describes what kind of platform is a device. ## Enumeration Members ### Console > **Console**: `"Console"` **`Beta`** #### Remarks 专用游戏设备。 Specialized gaming device. *** ### Desktop > **Desktop**: `"Desktop"` **`Beta`** #### Remarks 个人计算机(PC)。 Personal Computer (PC). *** ### Mobile > **Mobile**: `"Mobile"` **`Beta`** #### Remarks 手持设备,例如智能手机或平板电脑。 Handheld device such smartphone or tablet. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/PlayerInventoryType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/PlayerInventoryType.md. # Enumeration: PlayerInventoryType player inventory **`Beta`** 指定玩家库存类型。 Specifies the player inventory type. ## Enumeration Members ### Hotbar > **Hotbar**: `"Hotbar"` **`Beta`** #### Remarks 快捷栏库存。 Hotbar inventory. *** ### Inventory > **Inventory**: `"Inventory"` **`Beta`** #### Remarks 主库存。 Main inventory. ## 同领域相关 - [PlayerCursorInventoryComponent](/server/classes/PlayerCursorInventoryComponent.md) - [PlayerInventoryItemChangeAfterEvent](/server/classes/PlayerInventoryItemChangeAfterEvent.md) - [PlayerInventoryItemChangeAfterEventSignal](/server/classes/PlayerInventoryItemChangeAfterEventSignal.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/PlayerPermissionLevel.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/PlayerPermissionLevel.md. # Enumeration: PlayerPermissionLevel player permission **`Beta`** 玩家权限等级。 The player permission level. ## Enumeration Members ### Custom > **Custom**: `3` **`Beta`** *** ### Member > **Member**: `1` **`Beta`** #### Remarks 成员可以建造和挖掘、攻击玩家和生物,以及与物品和实体交互。 Members can build and mine, attack players and mobs, and interact with items and entities. *** ### Operator > **Operator**: `2` **`Beta`** #### Remarks 操作员可以传送和使用命令,此外还可以执行成员的所有操作。 Operators can teleport and use commands, in addition to everything Members can do. *** ### Visitor > **Visitor**: `0` **`Beta`** #### Remarks 访客只能观察世界,不能与之交互。 Visitors can only observe the world, not interact with it. ## 同领域相关 - [PlayerInputPermissionCategoryChangeAfterEvent](/server/classes/PlayerInputPermissionCategoryChangeAfterEvent.md) - [PlayerInputPermissionCategoryChangeAfterEventSignal](/server/classes/PlayerInputPermissionCategoryChangeAfterEventSignal.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/PlayerSplitScreenSlot.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/PlayerSplitScreenSlot.md. # Enumeration: PlayerSplitScreenSlot player **`Beta`** ## Preview 玩家的分屏槽位。 The split screen slot of a player. ## Enumeration Members ### First > **First**: `"First"` **`Beta`** #### Remarks 分屏会话中的第一个玩家。这是主要玩家。 The first player in the split screen session. This is the primary player. *** ### Fourth > **Fourth**: `"Fourth"` **`Beta`** #### Remarks 分屏会话中的第四个玩家。 The fourth player in the split screen session. *** ### Second > **Second**: `"Second"` **`Beta`** #### Remarks 分屏会话中的第二个玩家。 The second player in the split screen session. *** ### Third > **Third**: `"Third"` **`Beta`** #### Remarks 分屏会话中的第三个玩家。 The third player in the split screen session. ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/PlayerWaypointsMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/PlayerWaypointsMode.md. # Enumeration: PlayerWaypointsMode player **`Beta`** 玩家路径点模式的枚举。 Player waypoints mode enum. ## Enumeration Members ### Everyone > **Everyone**: `"Everyone"` **`Beta`** *** ### Off > **Off**: `"Off"` **`Beta`** ## 同领域相关 - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent.md) - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition.md) - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/ScoreboardIdentityType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/ScoreboardIdentityType.md. # Enumeration: ScoreboardIdentityType scoreboard **`Beta`** 表示分数持有者的类型。 Contains objectives and participants for the scoreboard. ## Enumeration Members ### Entity > **Entity**: `"Entity"` **`Beta`** #### Remarks 分数持有者是一个实体。 This scoreboard participant is tied to an entity. *** ### FakePlayer > **FakePlayer**: `"FakePlayer"` **`Beta`** #### Remarks 分数持有者是一个虚拟玩家(通常用于存储数据或者作为抽象进度)。 This scoreboard participant is tied to a pseudo player entity - typically this is used to store scores as data or as abstract progress. *** ### Player > **Player**: `"Player"` **`Beta`** #### Remarks 分数持有者是一位玩家。 This scoreboard participant is tied to a player. ## 同领域相关 - [Scoreboard](/server/classes/Scoreboard.md) - [ScoreboardIdentity](/server/classes/ScoreboardIdentity.md) - [ScoreboardObjective](/server/classes/ScoreboardObjective.md) - [ScoreboardObjectiveDisplayOptions](/server/interfaces/ScoreboardObjectiveDisplayOptions.md) - [ScoreboardScoreInfo](/server/classes/ScoreboardScoreInfo.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/ScriptEventSource.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/ScriptEventSource.md. # Enumeration: ScriptEventSource event **`Beta`** 描述脚本事件的来源。 Describes where the script event originated from. ## Enumeration Members ### Block > **Block**: `"Block"` **`Beta`** #### Remarks 脚本事件源自方块,例如命令方块。 The script event originated from a Block such as a Command Block. *** ### Entity > **Entity**: `"Entity"` **`Beta`** #### Remarks 脚本事件源自实体,例如玩家、命令方块矿车或动画控制器。 The script event originated from an Entity such as a Player, Command Block Minecart or Animation Controller. *** ### NPCDialogue > **NPCDialogue**: `"NPCDialogue"` **`Beta`** #### Remarks 脚本事件源自 NPC 对话。 The script event originated from an NPC dialogue. *** ### Server > **Server**: `"Server"` **`Beta`** #### Remarks 脚本事件源自服务器,例如来自 runCommand API 调用或专用服务器控制台。 The script event originated from the server, such as from a runCommand API call or a dedicated server console. ## 同领域相关 - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/SignSide.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/SignSide.md. # Enumeration: SignSide **`Beta`** 表示告示牌的一面。 Represents a side of a sign. ## Enumeration Members ### Back > **Back**: `"Back"` **`Beta`** #### Remarks 告示牌的背面。 The back of the sign. *** ### Front > **Front**: `"Front"` **`Beta`** #### Remarks 告示牌的正面。 The front of the sign. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/StickyType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/StickyType.md. # Enumeration: StickyType **`Beta`** ## Enumeration Members ### None > **None**: `"None"` **`Beta`** *** ### Same > **Same**: `"Same"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/StructureAnimationMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/StructureAnimationMode.md. # Enumeration: StructureAnimationMode animation **`Beta`** 指定放置结构时结构方块应如何动画显示。 Specifies how structure blocks should be animated when a structure is placed. ## Enumeration Members ### Blocks > **Blocks**: `"Blocks"` **`Beta`** #### Remarks 方块将一次一个随机放置。使用 @minecraft/server.StructurePlaceOptions.animationSeconds 控制所有方块放置完成所需的时间。 Blocks will be randomly placed one at at time. Use @minecraft/server.StructurePlaceOptions.animationSeconds to control how long it takes for all blocks to be placed. *** ### Layers > **Layers**: `"Layers"` **`Beta`** #### Remarks 方块将从下到上一次一层地放置。使用 @minecraft/server.StructurePlaceOptions.animationSeconds 控制所有方块放置完成所需的时间。 Blocks will be placed one layer at a time from bottom to top. Use @minecraft/server.StructurePlaceOptions.animationSeconds to control how long it takes for all blocks to be placed. *** ### None > **None**: `"None"` **`Beta`** #### Remarks 所有方块将立即放置。 All blocks will be placed immediately. ## 同领域相关 - [AnimationOptions](/server/interfaces/AnimationOptions.md) - [PlayAnimationOptions](/server/interfaces/PlayAnimationOptions.md) - [SplineAnimation](/server/interfaces/SplineAnimation.md) - [ImageAnimationData](/server-editor/types/ImageAnimationData.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/StructureMirrorAxis.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/StructureMirrorAxis.md. # Enumeration: StructureMirrorAxis **`Beta`** 指定放置结构时应如何镜像。 Specifies how a structure should be mirrored when placed. ## Enumeration Members ### None > **None**: `"None"` **`Beta`** #### Remarks 不镜像。 No mirroring. *** ### X > **X**: `"X"` **`Beta`** #### Remarks 结构沿 X 轴镜像。 Structure is mirrored across the X axis. *** ### XZ > **XZ**: `"XZ"` **`Beta`** #### Remarks 结构沿 X 和 Z 轴镜像。 Structure is mirrored across both the X and Z axes. *** ### Z > **Z**: `"Z"` **`Beta`** #### Remarks 结构沿 Z 轴镜像。 Structure is mirrored across the Z axis. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/StructureRotation.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/StructureRotation.md. # Enumeration: StructureRotation **`Beta`** 描述结构放置旋转的枚举。 Enum describing a structure's placement rotation. ## Enumeration Members ### None > **None**: `"None"` **`Beta`** #### Remarks 不旋转。 No rotation. *** ### Rotate180 > **Rotate180**: `"Rotate180"` **`Beta`** #### Remarks 180 度旋转。 180 degree rotation. *** ### Rotate270 > **Rotate270**: `"Rotate270"` **`Beta`** #### Remarks 270 度旋转。 270 degree rotation. *** ### Rotate90 > **Rotate90**: `"Rotate90"` **`Beta`** #### Remarks 90 度旋转。 90 degree rotation. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/StructureSaveMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/StructureSaveMode.md. # Enumeration: StructureSaveMode **`Beta`** 指定结构的保存方式。 Specifies how a structure should be saved. ## Enumeration Members ### Memory > **Memory**: `"Memory"` **`Beta`** #### Remarks 结构将临时保存到内存中。结构将持续到世界关闭为止。 The structure will be temporarily saved to memory. The structure will persist until the world is shut down. *** ### World > **World**: `"World"` **`Beta`** #### Remarks 结构将保存到世界文件中,并在世界加载之间持续存在。可以通过 @minecraft/server.StructureManager.delete 从世界中移除已保存的结构。 The structure will be saved to the world file and persist between world loads. A saved structure can be removed from the world via @minecraft/server.StructureManager.delete. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/TickingAreaErrorReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/TickingAreaErrorReason.md. # Enumeration: TickingAreaErrorReason error **`Beta`** 抛出 [@minecraft/server.TickingAreaError](/server/classes/TickingAreaError.md) 的原因。 The reason that the [@minecraft/server.TickingAreaError](/server/classes/TickingAreaError.md) was thrown. ## Enumeration Members ### IdentifierAlreadyExists > **IdentifierAlreadyExists**: `"IdentifierAlreadyExists"` **`Beta`** #### Remarks 添加了一个标识符已存在的常加载区域。 Added a ticking area with an identifier that already exists. *** ### OverChunkLimit > **OverChunkLimit**: `"OverChunkLimit"` **`Beta`** #### Remarks 添加此常加载区域将常加载区域推过了 [TickingAreaManager.maxChunkCount](/server/classes/TickingAreaManager.md#maxchunkcount) 指定的限制。 Adding this ticking area pushed the ticking areas over the limit specified by [TickingAreaManager.maxChunkCount](/server/classes/TickingAreaManager.md#maxchunkcount). *** ### SideLengthExceeded > **SideLengthExceeded**: `"SideLengthExceeded"` **`Beta`** #### Remarks 超过了常加载区域长度或宽度的 255 个区块限制。 Exceeded the 255 chunk limit for the length or width of the ticking area. *** ### UnknownIdentifier > **UnknownIdentifier**: `"UnknownIdentifier"` **`Beta`** #### Remarks 尝试移除在 [TickingAreaManager](/server/classes/TickingAreaManager.md) 中未注册标识符的常加载区域。 Tried to remove ticking area with identifier not registered in the [TickingAreaManager](/server/classes/TickingAreaManager.md). ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [BookError](/server/classes/BookError.md) - [BookErrorReason](/server/enums/BookErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/TimeOfDay.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/TimeOfDay.md. # Enumeration: TimeOfDay **`Beta`** 提供 Minecraft 一天中常见时段的数值。 Provides numeric values for common periods in the Minecraft day. ## Enumeration Members ### Day > **Day**: `1000` **`Beta`** #### Remarks 将时间设置为一天的开始,在 Minecraft 中对应时间 1,000(相当于早上 7 点)。 Sets the time to the start of the day, which is time of the day 1,000 (or the equivalent of 7am) in Minecraft. *** ### Midnight > **Midnight**: `18000` **`Beta`** #### Remarks 将时间设置为午夜,在 Minecraft 中对应时间 18,000(相当于凌晨 12:00)。 Sets the time to midnight, which is time of the day 18,000 (or the equivalent of 12:00am) in Minecraft. *** ### Night > **Night**: `13000` **`Beta`** #### Remarks 将时间设置为夜晚,在 Minecraft 中对应时间 13,000(相当于晚上 7:00)。 Sets the time to night, which is time of the day 13,000 (or the equivalent of 7:00pm) in Minecraft. *** ### Noon > **Noon**: `6000` **`Beta`** #### Remarks 将时间设置为正午,在 Minecraft 中对应时间 6,000。 Sets the time to noon, which is time of the day 6,000 in Minecraft. *** ### Sunrise > **Sunrise**: `23000` **`Beta`** #### Remarks 将时间设置为日出,在 Minecraft 中对应时间 23,000(相当于早上 5 点)。 Sets the time to sunrise, which is time of the day 23,000 (or the equivalent of 5am) in Minecraft. *** ### Sunset > **Sunset**: `12000` **`Beta`** #### Remarks 将时间设置为日落,在 Minecraft 中对应时间 12,000(相当于下午 6 点)。 Sets the time to sunset, which is time of the day 12,000 (or the equivalent of 6pm) in Minecraft. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/TintMethod.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/TintMethod.md. # Enumeration: TintMethod **`Beta`** 应用于方块或方块部分的着色逻辑。当世界位置作为上下文的一部分时,颜色可能会变化,因为生物群系通常会影响最终的着色结果。 Tint logic applied to a block or part of a block. The color may vary when a world position is part of the context, as biomes often have an influence on the resulting tint. ## Enumeration Members ### BirchFoliage > **BirchFoliage**: `"BirchFoliage"` **`Beta`** #### Remarks 指定白桦树叶着色方法。 Specifies a birch foliage tint method. *** ### DefaultFoliage > **DefaultFoliage**: `"DefaultFoliage"` **`Beta`** #### Remarks 指定默认树叶着色方法。 Specifies a default foliage tint method. *** ### DryFoliage > **DryFoliage**: `"DryFoliage"` **`Beta`** #### Remarks 指定干燥树叶着色方法。 Specifies a dry foliage tint method. *** ### EvergreenFoliage > **EvergreenFoliage**: `"EvergreenFoliage"` **`Beta`** #### Remarks 指定常绿树叶着色方法。 Specifies an evergreen foliage tint method. *** ### Grass > **Grass**: `"Grass"` **`Beta`** #### Remarks 指定草地着色方法。 Specifies a grass tint method. *** ### None > **None**: `"None"` **`Beta`** #### Remarks 指定不使用着色方法,结果为白色着色。 Specifies no tint method, resulting in a white tint. *** ### Water > **Water**: `"Water"` **`Beta`** #### Remarks 指定水体着色方法。 Specifies a water tint method. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/WatchdogTerminateReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/WatchdogTerminateReason.md. # Enumeration: WatchdogTerminateReason **`Beta`** 一个枚举,表示监视程序决定终止行为包脚本执行的原因。 An enumeration with the reason that a watchdog is deciding to terminate execution of a behavior packs' script. ## Enumeration Members ### Hang > **Hang**: `"Hang"` **`Beta`** #### Remarks 行为包的脚本运行时因脚本无响应(挂起或无限循环)而被终止。 Script runtime for a behavior pack is terminated due to non-responsiveness from script (a hang or infinite loop). *** ### StackOverflow > **StackOverflow**: `"StackOverflow"` **`Beta`** #### Remarks 行为包的脚本运行时因栈溢出(一个长且可能是无限的函数调用链)而被终止。 Script runtime for a behavior pack is terminated due to a stack overflow (a long, and potentially infinite) chain of function calls. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/WaypointTexture.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/WaypointTexture.md. # Enumeration: WaypointTexture **`Beta`** 表示可在定位栏上为路径点显示的不同纹理图标的枚举。 Enum representing different texture icons that can be displayed for waypoints on the locator bar. ## Enumeration Members ### Circle > **Circle**: `"minecraft:circle"` **`Beta`** #### Remarks 圆形路径点图标纹理。 Circle waypoint icon texture. *** ### SmallSquare > **SmallSquare**: `"minecraft:small_square"` **`Beta`** #### Remarks 小方形路径点图标纹理。 Small square waypoint icon texture. *** ### SmallStar > **SmallStar**: `"minecraft:small_star"` **`Beta`** #### Remarks 小星形路径点图标纹理。 Small star waypoint icon texture. *** ### Square > **Square**: `"minecraft:square"` **`Beta`** #### Remarks 方形路径点图标纹理。 Square waypoint icon texture. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/enums/WeatherType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/enums/WeatherType.md. # Enumeration: WeatherType **`Beta`** 用于指定世界中天气状况的类型。 Used to specify the type of weather condition within the world. ## Enumeration Members ### Clear > **Clear**: `"Clear"` **`Beta`** #### Remarks 指定晴天天气状况。 Specifies a clear weather condition. *** ### Rain > **Rain**: `"Rain"` **`Beta`** #### Remarks 指定雨天天气状况。 Specifies a rain weather condition. *** ### Thunder > **Thunder**: `"Thunder"` **`Beta`** #### Remarks 指定雷雨天气状况。 Specifies a rain and thunder weather condition. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/variables/HudElementsCount.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/variables/HudElementsCount.md. # Variable: HudElementsCount > `const` **HudElementsCount**: `13` = `13` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/variables/HudVisibilityCount.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/variables/HudVisibilityCount.md. # Variable: HudVisibilityCount > `const` **HudVisibilityCount**: `2` = `2` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/variables/MoonPhaseCount.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/variables/MoonPhaseCount.md. # Variable: MoonPhaseCount > `const` **MoonPhaseCount**: `8` = `8` **`Beta`** ## Remarks 包含月相(MoonPhases)的数量。 Holds the number of MoonPhases [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/variables/system.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/variables/system.md. # Variable: system > `const` **system**: [`System`](/server/classes/System.md) **`Beta`** ## Remarks 一个提供系统级事件和函数的类。 A class that provides system-level events and functions. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/variables/TicksPerDay.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/variables/TicksPerDay.md. # Variable: TicksPerDay > `const` **TicksPerDay**: `24000` = `24000` **`Beta`** ## Remarks 服务器在游戏内一天中刻(tick)的次数。 How many times the server ticks in one in-game day. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/variables/TicksPerSecond.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/variables/TicksPerSecond.md. # Variable: TicksPerSecond > `const` **TicksPerSecond**: `20` = `20` **`Beta`** ## Remarks 服务器每秒(现实时间)的刻(tick)次数。 How many times the server ticks per second of real time. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/variables/world.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/variables/world.md. # Variable: world > `const` **world**: [`World`](/server/classes/World.md) **`Beta`** ## Remarks 一个封装世界状态的类——一组维度以及 Minecraft 的环境。 A class that wraps the state of a world - a set of dimensions and the environment of Minecraft. [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/types/BlockComponentReturnType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/types/BlockComponentReturnType.md. # Type Alias: BlockComponentReturnType\ block component > **BlockComponentReturnType**\<`T`> = `T` _extends_ keyof [`BlockComponentTypeMap`](/server/types/BlockComponentTypeMap.md) ? [`BlockComponentTypeMap`](/server/types/BlockComponentTypeMap.md)\[`T`] : [`BlockCustomComponentInstance`](/server/classes/BlockCustomComponentInstance.md) **`Beta`** ## Type Parameters ### T `T` _extends_ `string` ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/types/BlockComponentTypeMap.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/types/BlockComponentTypeMap.md. # Type Alias: BlockComponentTypeMap block component > **BlockComponentTypeMap** = `object` **`Beta`** ## Properties ### dynamic\_properties > **dynamic\_properties**: [`BlockDynamicPropertiesComponent`](/server/classes/BlockDynamicPropertiesComponent.md) *** ### fluid\_container > **fluid\_container**: [`BlockFluidContainerComponent`](/server/classes/BlockFluidContainerComponent.md) *** ### instrument\_sound > **instrument\_sound**: [`BlockInstrumentComponent`](/server/classes/BlockInstrumentComponent.md) *** ### inventory > **inventory**: [`BlockInventoryComponent`](/server/classes/BlockInventoryComponent.md) *** ### map\_color > **map\_color**: [`BlockMapColorComponent`](/server/classes/BlockMapColorComponent.md) *** ### minecraft:dynamic\_properties > **minecraft:dynamic\_properties**: [`BlockDynamicPropertiesComponent`](/server/classes/BlockDynamicPropertiesComponent.md) *** ### minecraft:fluid\_container > **minecraft:fluid\_container**: [`BlockFluidContainerComponent`](/server/classes/BlockFluidContainerComponent.md) *** ### minecraft:instrument\_sound > **minecraft:instrument\_sound**: [`BlockInstrumentComponent`](/server/classes/BlockInstrumentComponent.md) *** ### minecraft:inventory > **minecraft:inventory**: [`BlockInventoryComponent`](/server/classes/BlockInventoryComponent.md) *** ### minecraft:map\_color > **minecraft:map\_color**: [`BlockMapColorComponent`](/server/classes/BlockMapColorComponent.md) *** ### minecraft:movable > **minecraft:movable**: [`BlockMovableComponent`](/server/classes/BlockMovableComponent.md) *** ### minecraft:piston > **minecraft:piston**: [`BlockPistonComponent`](/server/classes/BlockPistonComponent.md) *** ### minecraft:precipitation\_interactions > **minecraft:precipitation\_interactions**: [`BlockPrecipitationInteractionsComponent`](/server/classes/BlockPrecipitationInteractionsComponent.md) *** ### minecraft:record\_player > **minecraft:record\_player**: [`BlockRecordPlayerComponent`](/server/classes/BlockRecordPlayerComponent.md) *** ### minecraft:redstone\_producer > **minecraft:redstone\_producer**: [`BlockRedstoneProducerComponent`](/server/classes/BlockRedstoneProducerComponent.md) *** ### minecraft:sign > **minecraft:sign**: [`BlockSignComponent`](/server/classes/BlockSignComponent.md) *** ### movable > **movable**: [`BlockMovableComponent`](/server/classes/BlockMovableComponent.md) *** ### piston > **piston**: [`BlockPistonComponent`](/server/classes/BlockPistonComponent.md) *** ### precipitation\_interactions > **precipitation\_interactions**: [`BlockPrecipitationInteractionsComponent`](/server/classes/BlockPrecipitationInteractionsComponent.md) *** ### record\_player > **record\_player**: [`BlockRecordPlayerComponent`](/server/classes/BlockRecordPlayerComponent.md) *** ### redstone\_producer > **redstone\_producer**: [`BlockRedstoneProducerComponent`](/server/classes/BlockRedstoneProducerComponent.md) *** ### sign > **sign**: [`BlockSignComponent`](/server/classes/BlockSignComponent.md) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/types/BlockStateArg.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/types/BlockStateArg.md. # Type Alias: BlockStateArg\ block > **BlockStateArg**\<`T`> = `T` _extends_ `` `${MinecraftBlockTypes}` `` ? `T` _extends_ keyof `BlockStateMapping` ? `BlockStateMapping`\[`T`] : `never` : `Record`\<`string`, `boolean` | `number` | `string`> **`Beta`** 由 [BlockPermutation](/server/classes/BlockPermutation.md) 的 matches 与 resolve 函数使用的类型别名, 用于将方块状态参数类型收窄到 由 @minecraft/vanilla-data.BlockStateMapping 映射出来的类型。 Type alias used by the [BlockPermutation](/server/classes/BlockPermutation.md) matches and resolve functions to narrow block state argument types to those mapped by @minecraft/vanilla-data.BlockStateMapping. ## Type Parameters ### T `T` ## 同领域相关 - [Block](/server/classes/Block.md) - [BlockBoundingBox](/server/interfaces/BlockBoundingBox.md) - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils.md) - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/types/EntityComponentReturnType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/types/EntityComponentReturnType.md. # Type Alias: EntityComponentReturnType\ entity component > **EntityComponentReturnType**\<`T`> = `T` _extends_ keyof [`EntityComponentTypeMap`](/server/types/EntityComponentTypeMap.md) ? [`EntityComponentTypeMap`](/server/types/EntityComponentTypeMap.md)\[`T`] : [`EntityComponent`](/server/classes/EntityComponent.md) **`Beta`** ## Type Parameters ### T `T` _extends_ `string` ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/types/EntityComponentTypeMap.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/types/EntityComponentTypeMap.md. # Type Alias: EntityComponentTypeMap entity component > **EntityComponentTypeMap** = `object` **`Beta`** ## Properties ### addrider > **addrider**: [`EntityAddRiderComponent`](/server/classes/EntityAddRiderComponent.md) *** ### ageable > **ageable**: [`EntityAgeableComponent`](/server/classes/EntityAgeableComponent.md) *** ### breathable > **breathable**: [`EntityBreathableComponent`](/server/classes/EntityBreathableComponent.md) *** ### can\_climb > **can\_climb**: [`EntityCanClimbComponent`](/server/classes/EntityCanClimbComponent.md) *** ### can\_fly > **can\_fly**: [`EntityCanFlyComponent`](/server/classes/EntityCanFlyComponent.md) *** ### can\_power\_jump > **can\_power\_jump**: [`EntityCanPowerJumpComponent`](/server/classes/EntityCanPowerJumpComponent.md) *** ### color > **color**: [`EntityColorComponent`](/server/classes/EntityColorComponent.md) *** ### color2 > **color2**: [`EntityColor2Component`](/server/classes/EntityColor2Component.md) *** ### cursor\_inventory > **cursor\_inventory**: [`PlayerCursorInventoryComponent`](/server/classes/PlayerCursorInventoryComponent.md) *** ### ender\_inventory > **ender\_inventory**: [`EntityEnderInventoryComponent`](/server/classes/EntityEnderInventoryComponent.md) *** ### equippable > **equippable**: [`EntityEquippableComponent`](/server/classes/EntityEquippableComponent.md) *** ### fire\_immune > **fire\_immune**: [`EntityFireImmuneComponent`](/server/classes/EntityFireImmuneComponent.md) *** ### floats\_in\_liquid > **floats\_in\_liquid**: [`EntityFloatsInLiquidComponent`](/server/classes/EntityFloatsInLiquidComponent.md) *** ### flying\_speed > **flying\_speed**: [`EntityFlyingSpeedComponent`](/server/classes/EntityFlyingSpeedComponent.md) *** ### friction\_modifier > **friction\_modifier**: [`EntityFrictionModifierComponent`](/server/classes/EntityFrictionModifierComponent.md) *** ### healable > **healable**: [`EntityHealableComponent`](/server/classes/EntityHealableComponent.md) *** ### health > **health**: [`EntityHealthComponent`](/server/classes/EntityHealthComponent.md) *** ### inventory > **inventory**: [`EntityInventoryComponent`](/server/classes/EntityInventoryComponent.md) *** ### is\_baby > **is\_baby**: [`EntityIsBabyComponent`](/server/classes/EntityIsBabyComponent.md) *** ### is\_charged > **is\_charged**: [`EntityIsChargedComponent`](/server/classes/EntityIsChargedComponent.md) *** ### is\_chested > **is\_chested**: [`EntityIsChestedComponent`](/server/classes/EntityIsChestedComponent.md) *** ### is\_dyeable > **is\_dyeable**: [`EntityIsDyeableComponent`](/server/classes/EntityIsDyeableComponent.md) *** ### is\_hidden\_when\_invisible > **is\_hidden\_when\_invisible**: [`EntityIsHiddenWhenInvisibleComponent`](/server/classes/EntityIsHiddenWhenInvisibleComponent.md) *** ### is\_ignited > **is\_ignited**: [`EntityIsIgnitedComponent`](/server/classes/EntityIsIgnitedComponent.md) *** ### is\_illager\_captain > **is\_illager\_captain**: [`EntityIsIllagerCaptainComponent`](/server/classes/EntityIsIllagerCaptainComponent.md) *** ### is\_saddled > **is\_saddled**: [`EntityIsSaddledComponent`](/server/classes/EntityIsSaddledComponent.md) *** ### is\_shaking > **is\_shaking**: [`EntityIsShakingComponent`](/server/classes/EntityIsShakingComponent.md) *** ### is\_sheared > **is\_sheared**: [`EntityIsShearedComponent`](/server/classes/EntityIsShearedComponent.md) *** ### is\_stackable > **is\_stackable**: [`EntityIsStackableComponent`](/server/classes/EntityIsStackableComponent.md) *** ### is\_stunned > **is\_stunned**: [`EntityIsStunnedComponent`](/server/classes/EntityIsStunnedComponent.md) *** ### is\_tamed > **is\_tamed**: [`EntityIsTamedComponent`](/server/classes/EntityIsTamedComponent.md) *** ### item > **item**: [`EntityItemComponent`](/server/classes/EntityItemComponent.md) *** ### lava\_movement > **lava\_movement**: [`EntityLavaMovementComponent`](/server/classes/EntityLavaMovementComponent.md) *** ### leashable > **leashable**: [`EntityLeashableComponent`](/server/classes/EntityLeashableComponent.md) *** ### mark\_variant > **mark\_variant**: [`EntityMarkVariantComponent`](/server/classes/EntityMarkVariantComponent.md) *** ### minecraft:addrider > **minecraft:addrider**: [`EntityAddRiderComponent`](/server/classes/EntityAddRiderComponent.md) *** ### minecraft:ageable > **minecraft:ageable**: [`EntityAgeableComponent`](/server/classes/EntityAgeableComponent.md) *** ### minecraft:breathable > **minecraft:breathable**: [`EntityBreathableComponent`](/server/classes/EntityBreathableComponent.md) *** ### minecraft:can\_climb > **minecraft:can\_climb**: [`EntityCanClimbComponent`](/server/classes/EntityCanClimbComponent.md) *** ### minecraft:can\_fly > **minecraft:can\_fly**: [`EntityCanFlyComponent`](/server/classes/EntityCanFlyComponent.md) *** ### minecraft:can\_power\_jump > **minecraft:can\_power\_jump**: [`EntityCanPowerJumpComponent`](/server/classes/EntityCanPowerJumpComponent.md) *** ### minecraft:color > **minecraft:color**: [`EntityColorComponent`](/server/classes/EntityColorComponent.md) *** ### minecraft:color2 > **minecraft:color2**: [`EntityColor2Component`](/server/classes/EntityColor2Component.md) *** ### minecraft:cursor\_inventory > **minecraft:cursor\_inventory**: [`PlayerCursorInventoryComponent`](/server/classes/PlayerCursorInventoryComponent.md) *** ### minecraft:ender\_inventory > **minecraft:ender\_inventory**: [`EntityEnderInventoryComponent`](/server/classes/EntityEnderInventoryComponent.md) *** ### minecraft:equippable > **minecraft:equippable**: [`EntityEquippableComponent`](/server/classes/EntityEquippableComponent.md) *** ### minecraft:fire\_immune > **minecraft:fire\_immune**: [`EntityFireImmuneComponent`](/server/classes/EntityFireImmuneComponent.md) *** ### minecraft:floats\_in\_liquid > **minecraft:floats\_in\_liquid**: [`EntityFloatsInLiquidComponent`](/server/classes/EntityFloatsInLiquidComponent.md) *** ### minecraft:flying\_speed > **minecraft:flying\_speed**: [`EntityFlyingSpeedComponent`](/server/classes/EntityFlyingSpeedComponent.md) *** ### minecraft:friction\_modifier > **minecraft:friction\_modifier**: [`EntityFrictionModifierComponent`](/server/classes/EntityFrictionModifierComponent.md) *** ### minecraft:healable > **minecraft:healable**: [`EntityHealableComponent`](/server/classes/EntityHealableComponent.md) *** ### minecraft:health > **minecraft:health**: [`EntityHealthComponent`](/server/classes/EntityHealthComponent.md) *** ### minecraft:inventory > **minecraft:inventory**: [`EntityInventoryComponent`](/server/classes/EntityInventoryComponent.md) *** ### minecraft:is\_baby > **minecraft:is\_baby**: [`EntityIsBabyComponent`](/server/classes/EntityIsBabyComponent.md) *** ### minecraft:is\_charged > **minecraft:is\_charged**: [`EntityIsChargedComponent`](/server/classes/EntityIsChargedComponent.md) *** ### minecraft:is\_chested > **minecraft:is\_chested**: [`EntityIsChestedComponent`](/server/classes/EntityIsChestedComponent.md) *** ### minecraft:is\_dyeable > **minecraft:is\_dyeable**: [`EntityIsDyeableComponent`](/server/classes/EntityIsDyeableComponent.md) *** ### minecraft:is\_hidden\_when\_invisible > **minecraft:is\_hidden\_when\_invisible**: [`EntityIsHiddenWhenInvisibleComponent`](/server/classes/EntityIsHiddenWhenInvisibleComponent.md) *** ### minecraft:is\_ignited > **minecraft:is\_ignited**: [`EntityIsIgnitedComponent`](/server/classes/EntityIsIgnitedComponent.md) *** ### minecraft:is\_illager\_captain > **minecraft:is\_illager\_captain**: [`EntityIsIllagerCaptainComponent`](/server/classes/EntityIsIllagerCaptainComponent.md) *** ### minecraft:is\_saddled > **minecraft:is\_saddled**: [`EntityIsSaddledComponent`](/server/classes/EntityIsSaddledComponent.md) *** ### minecraft:is\_shaking > **minecraft:is\_shaking**: [`EntityIsShakingComponent`](/server/classes/EntityIsShakingComponent.md) *** ### minecraft:is\_sheared > **minecraft:is\_sheared**: [`EntityIsShearedComponent`](/server/classes/EntityIsShearedComponent.md) *** ### minecraft:is\_stackable > **minecraft:is\_stackable**: [`EntityIsStackableComponent`](/server/classes/EntityIsStackableComponent.md) *** ### minecraft:is\_stunned > **minecraft:is\_stunned**: [`EntityIsStunnedComponent`](/server/classes/EntityIsStunnedComponent.md) *** ### minecraft:is\_tamed > **minecraft:is\_tamed**: [`EntityIsTamedComponent`](/server/classes/EntityIsTamedComponent.md) *** ### minecraft:item > **minecraft:item**: [`EntityItemComponent`](/server/classes/EntityItemComponent.md) *** ### minecraft:lava\_movement > **minecraft:lava\_movement**: [`EntityLavaMovementComponent`](/server/classes/EntityLavaMovementComponent.md) *** ### minecraft:leashable > **minecraft:leashable**: [`EntityLeashableComponent`](/server/classes/EntityLeashableComponent.md) *** ### minecraft:mark\_variant > **minecraft:mark\_variant**: [`EntityMarkVariantComponent`](/server/classes/EntityMarkVariantComponent.md) *** ### minecraft:movement > **minecraft:movement**: [`EntityMovementComponent`](/server/classes/EntityMovementComponent.md) *** ### minecraft:movement.amphibious > **minecraft:movement.amphibious**: [`EntityMovementAmphibiousComponent`](/server/classes/EntityMovementAmphibiousComponent.md) *** ### minecraft:movement.basic > **minecraft:movement.basic**: [`EntityMovementBasicComponent`](/server/classes/EntityMovementBasicComponent.md) *** ### minecraft:movement.fly > **minecraft:movement.fly**: [`EntityMovementFlyComponent`](/server/classes/EntityMovementFlyComponent.md) *** ### minecraft:movement.generic > **minecraft:movement.generic**: [`EntityMovementGenericComponent`](/server/classes/EntityMovementGenericComponent.md) *** ### minecraft:movement.glide > **minecraft:movement.glide**: [`EntityMovementGlideComponent`](/server/classes/EntityMovementGlideComponent.md) *** ### minecraft:movement.hover > **minecraft:movement.hover**: [`EntityMovementHoverComponent`](/server/classes/EntityMovementHoverComponent.md) *** ### minecraft:movement.jump > **minecraft:movement.jump**: [`EntityMovementJumpComponent`](/server/classes/EntityMovementJumpComponent.md) *** ### minecraft:movement.skip > **minecraft:movement.skip**: [`EntityMovementSkipComponent`](/server/classes/EntityMovementSkipComponent.md) *** ### minecraft:movement.sway > **minecraft:movement.sway**: [`EntityMovementSwayComponent`](/server/classes/EntityMovementSwayComponent.md) *** ### minecraft:navigation.climb > **minecraft:navigation.climb**: [`EntityNavigationClimbComponent`](/server/classes/EntityNavigationClimbComponent.md) *** ### minecraft:navigation.float > **minecraft:navigation.float**: [`EntityNavigationFloatComponent`](/server/classes/EntityNavigationFloatComponent.md) *** ### minecraft:navigation.fly > **minecraft:navigation.fly**: [`EntityNavigationFlyComponent`](/server/classes/EntityNavigationFlyComponent.md) *** ### minecraft:navigation.generic > **minecraft:navigation.generic**: [`EntityNavigationGenericComponent`](/server/classes/EntityNavigationGenericComponent.md) *** ### minecraft:navigation.hover > **minecraft:navigation.hover**: [`EntityNavigationHoverComponent`](/server/classes/EntityNavigationHoverComponent.md) *** ### minecraft:navigation.walk > **minecraft:navigation.walk**: [`EntityNavigationWalkComponent`](/server/classes/EntityNavigationWalkComponent.md) *** ### minecraft:npc > **minecraft:npc**: [`EntityNpcComponent`](/server/classes/EntityNpcComponent.md) *** ### minecraft:onfire > **minecraft:onfire**: [`EntityOnFireComponent`](/server/classes/EntityOnFireComponent.md) *** ### minecraft:player.exhaustion > **minecraft:player.exhaustion**: [`EntityExhaustionComponent`](/server/classes/EntityExhaustionComponent.md) *** ### minecraft:player.hunger > **minecraft:player.hunger**: [`EntityHungerComponent`](/server/classes/EntityHungerComponent.md) *** ### minecraft:player.saturation > **minecraft:player.saturation**: [`EntitySaturationComponent`](/server/classes/EntitySaturationComponent.md) *** ### minecraft:projectile > **minecraft:projectile**: [`EntityProjectileComponent`](/server/classes/EntityProjectileComponent.md) *** ### minecraft:push\_through > **minecraft:push\_through**: [`EntityPushThroughComponent`](/server/classes/EntityPushThroughComponent.md) *** ### minecraft:rideable > **minecraft:rideable**: [`EntityRideableComponent`](/server/classes/EntityRideableComponent.md) *** ### minecraft:riding > **minecraft:riding**: [`EntityRidingComponent`](/server/classes/EntityRidingComponent.md) *** ### minecraft:scale > **minecraft:scale**: [`EntityScaleComponent`](/server/classes/EntityScaleComponent.md) *** ### minecraft:skin\_id > **minecraft:skin\_id**: [`EntitySkinIdComponent`](/server/classes/EntitySkinIdComponent.md) *** ### minecraft:strength > **minecraft:strength**: [`EntityStrengthComponent`](/server/classes/EntityStrengthComponent.md) *** ### minecraft:tameable > **minecraft:tameable**: [`EntityTameableComponent`](/server/classes/EntityTameableComponent.md) *** ### minecraft:tamemount > **minecraft:tamemount**: [`EntityTameMountComponent`](/server/classes/EntityTameMountComponent.md) *** ### minecraft:type\_family > **minecraft:type\_family**: [`EntityTypeFamilyComponent`](/server/classes/EntityTypeFamilyComponent.md) *** ### minecraft:underwater\_movement > **minecraft:underwater\_movement**: [`EntityUnderwaterMovementComponent`](/server/classes/EntityUnderwaterMovementComponent.md) *** ### minecraft:variant > **minecraft:variant**: [`EntityVariantComponent`](/server/classes/EntityVariantComponent.md) *** ### minecraft:wants\_jockey > **minecraft:wants\_jockey**: [`EntityWantsJockeyComponent`](/server/classes/EntityWantsJockeyComponent.md) *** ### movement > **movement**: [`EntityMovementComponent`](/server/classes/EntityMovementComponent.md) *** ### movement.amphibious > **movement.amphibious**: [`EntityMovementAmphibiousComponent`](/server/classes/EntityMovementAmphibiousComponent.md) *** ### movement.basic > **movement.basic**: [`EntityMovementBasicComponent`](/server/classes/EntityMovementBasicComponent.md) *** ### movement.fly > **movement.fly**: [`EntityMovementFlyComponent`](/server/classes/EntityMovementFlyComponent.md) *** ### movement.generic > **movement.generic**: [`EntityMovementGenericComponent`](/server/classes/EntityMovementGenericComponent.md) *** ### movement.glide > **movement.glide**: [`EntityMovementGlideComponent`](/server/classes/EntityMovementGlideComponent.md) *** ### movement.hover > **movement.hover**: [`EntityMovementHoverComponent`](/server/classes/EntityMovementHoverComponent.md) *** ### movement.jump > **movement.jump**: [`EntityMovementJumpComponent`](/server/classes/EntityMovementJumpComponent.md) *** ### movement.skip > **movement.skip**: [`EntityMovementSkipComponent`](/server/classes/EntityMovementSkipComponent.md) *** ### movement.sway > **movement.sway**: [`EntityMovementSwayComponent`](/server/classes/EntityMovementSwayComponent.md) *** ### navigation.climb > **navigation.climb**: [`EntityNavigationClimbComponent`](/server/classes/EntityNavigationClimbComponent.md) *** ### navigation.float > **navigation.float**: [`EntityNavigationFloatComponent`](/server/classes/EntityNavigationFloatComponent.md) *** ### navigation.fly > **navigation.fly**: [`EntityNavigationFlyComponent`](/server/classes/EntityNavigationFlyComponent.md) *** ### navigation.generic > **navigation.generic**: [`EntityNavigationGenericComponent`](/server/classes/EntityNavigationGenericComponent.md) *** ### navigation.hover > **navigation.hover**: [`EntityNavigationHoverComponent`](/server/classes/EntityNavigationHoverComponent.md) *** ### navigation.walk > **navigation.walk**: [`EntityNavigationWalkComponent`](/server/classes/EntityNavigationWalkComponent.md) *** ### npc > **npc**: [`EntityNpcComponent`](/server/classes/EntityNpcComponent.md) *** ### onfire > **onfire**: [`EntityOnFireComponent`](/server/classes/EntityOnFireComponent.md) *** ### player.exhaustion > **player.exhaustion**: [`EntityExhaustionComponent`](/server/classes/EntityExhaustionComponent.md) *** ### player.hunger > **player.hunger**: [`EntityHungerComponent`](/server/classes/EntityHungerComponent.md) *** ### player.saturation > **player.saturation**: [`EntitySaturationComponent`](/server/classes/EntitySaturationComponent.md) *** ### projectile > **projectile**: [`EntityProjectileComponent`](/server/classes/EntityProjectileComponent.md) *** ### push\_through > **push\_through**: [`EntityPushThroughComponent`](/server/classes/EntityPushThroughComponent.md) *** ### rideable > **rideable**: [`EntityRideableComponent`](/server/classes/EntityRideableComponent.md) *** ### riding > **riding**: [`EntityRidingComponent`](/server/classes/EntityRidingComponent.md) *** ### scale > **scale**: [`EntityScaleComponent`](/server/classes/EntityScaleComponent.md) *** ### skin\_id > **skin\_id**: [`EntitySkinIdComponent`](/server/classes/EntitySkinIdComponent.md) *** ### strength > **strength**: [`EntityStrengthComponent`](/server/classes/EntityStrengthComponent.md) *** ### tameable > **tameable**: [`EntityTameableComponent`](/server/classes/EntityTameableComponent.md) *** ### tamemount > **tamemount**: [`EntityTameMountComponent`](/server/classes/EntityTameMountComponent.md) *** ### type\_family > **type\_family**: [`EntityTypeFamilyComponent`](/server/classes/EntityTypeFamilyComponent.md) *** ### underwater\_movement > **underwater\_movement**: [`EntityUnderwaterMovementComponent`](/server/classes/EntityUnderwaterMovementComponent.md) *** ### variant > **variant**: [`EntityVariantComponent`](/server/classes/EntityVariantComponent.md) *** ### wants\_jockey > **wants\_jockey**: [`EntityWantsJockeyComponent`](/server/classes/EntityWantsJockeyComponent.md) ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/types/EntityIdentifierType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/types/EntityIdentifierType.md. # Type Alias: EntityIdentifierType\ entity > **EntityIdentifierType**\<`T`> = \[`T`] _extends_ \[`never`] ? [`VanillaEntityIdentifier`](/server/types/VanillaEntityIdentifier.md) : `T` _extends_ `string` ? [`VanillaEntityIdentifier`](/server/types/VanillaEntityIdentifier.md) | `T` : `never` **`Beta`** ## Type Parameters ### T `T` ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/types/ItemComponentReturnType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/types/ItemComponentReturnType.md. # Type Alias: ItemComponentReturnType\ component > **ItemComponentReturnType**\<`T`> = `T` _extends_ keyof [`ItemComponentTypeMap`](/server/types/ItemComponentTypeMap.md) ? [`ItemComponentTypeMap`](/server/types/ItemComponentTypeMap.md)\[`T`] : [`ItemCustomComponentInstance`](/server/classes/ItemCustomComponentInstance.md) **`Beta`** ## Type Parameters ### T `T` _extends_ `string` ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/types/ItemComponentTypeMap.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/types/ItemComponentTypeMap.md. # Type Alias: ItemComponentTypeMap component > **ItemComponentTypeMap** = `object` **`Beta`** ## Properties ### block\_actor\_dynamic\_properties > **block\_actor\_dynamic\_properties**: [`ItemBlockDynamicPropertiesComponent`](/server/classes/ItemBlockDynamicPropertiesComponent.md) *** ### book > **book**: [`ItemBookComponent`](/server/classes/ItemBookComponent.md) *** ### compostable > **compostable**: [`ItemCompostableComponent`](/server/classes/ItemCompostableComponent.md) *** ### cooldown > **cooldown**: [`ItemCooldownComponent`](/server/classes/ItemCooldownComponent.md) *** ### durability > **durability**: [`ItemDurabilityComponent`](/server/classes/ItemDurabilityComponent.md) *** ### dyeable > **dyeable**: [`ItemDyeableComponent`](/server/classes/ItemDyeableComponent.md) *** ### enchantable > **enchantable**: [`ItemEnchantableComponent`](/server/classes/ItemEnchantableComponent.md) *** ### food > **food**: [`ItemFoodComponent`](/server/classes/ItemFoodComponent.md) *** ### inventory > **inventory**: [`ItemInventoryComponent`](/server/classes/ItemInventoryComponent.md) *** ### minecraft:block\_actor\_dynamic\_properties > **minecraft:block\_actor\_dynamic\_properties**: [`ItemBlockDynamicPropertiesComponent`](/server/classes/ItemBlockDynamicPropertiesComponent.md) *** ### minecraft:book > **minecraft:book**: [`ItemBookComponent`](/server/classes/ItemBookComponent.md) *** ### minecraft:compostable > **minecraft:compostable**: [`ItemCompostableComponent`](/server/classes/ItemCompostableComponent.md) *** ### minecraft:cooldown > **minecraft:cooldown**: [`ItemCooldownComponent`](/server/classes/ItemCooldownComponent.md) *** ### minecraft:durability > **minecraft:durability**: [`ItemDurabilityComponent`](/server/classes/ItemDurabilityComponent.md) *** ### minecraft:dyeable > **minecraft:dyeable**: [`ItemDyeableComponent`](/server/classes/ItemDyeableComponent.md) *** ### minecraft:enchantable > **minecraft:enchantable**: [`ItemEnchantableComponent`](/server/classes/ItemEnchantableComponent.md) *** ### minecraft:food > **minecraft:food**: [`ItemFoodComponent`](/server/classes/ItemFoodComponent.md) *** ### minecraft:inventory > **minecraft:inventory**: [`ItemInventoryComponent`](/server/classes/ItemInventoryComponent.md) *** ### minecraft:potion > **minecraft:potion**: [`ItemPotionComponent`](/server/classes/ItemPotionComponent.md) *** ### potion > **potion**: [`ItemPotionComponent`](/server/classes/ItemPotionComponent.md) ## 同领域相关 - [BlockComponent](/server/classes/BlockComponent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server/types/VanillaEntityIdentifier.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/types/VanillaEntityIdentifier.md. # Type Alias: VanillaEntityIdentifier entity > **VanillaEntityIdentifier** = [`EntityType`](/server/classes/EntityType.md) | `MinecraftEntityTypes` | `` `${MinecraftEntityTypes}` `` | `` `${MinecraftEntityTypes}<${string}>` `` **`Beta`** ## 同领域相关 - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction.md) - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition.md) - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent.md) - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server) --- url: /server-ui/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/index.md. # Module: server-ui **`Beta`** `@minecraft/server-ui` 模块包含了用于基于对话框的简易用户交互功能的类型。 - [ActionFormData](/server-ui/classes/ActionFormData.md) 包含了一系列带有标题与图片的按钮。便于要求用户从一系列选项中选择。 - [MessageFormData](/server-ui/classes/MessageFormData.md) 则是包含了两个按钮的简易消息框,允许用户选择是/否或者确定/取消。 - [ModalFormData](/server-ui/classes/ModalFormData.md) 则提供了一套更具灵活性的类似问卷形式的控件,允许用户填写并提交。 The `@minecraft/server-ui` module contains types for expressing simple dialog-based user experiences. - [ActionFormData](/server-ui/classes/ActionFormData.md) contain a list of buttons with captions and images that can be used for presenting a set of options to a player. - [MessageFormData](/server-ui/classes/MessageFormData.md) are simple two-button message experiences that are functional for Yes/No or OK/Cancel questions. - [ModalFormData](/server-ui/classes/ModalFormData.md) allow for a more flexible "questionnaire-style" list of controls that can be used to take input. Manifest Details ```json { "module_name": "@minecraft/server-ui", "version": "2.2.0-beta" } ``` ## Enumerations - [DataDrivenScreenClosedReason](/server-ui/enums/DataDrivenScreenClosedReason.md) - [FormCancelationReason](/server-ui/enums/FormCancelationReason.md) - [FormRejectReason](/server-ui/enums/FormRejectReason.md) - [FormVisibilityErrorReason](/server-ui/enums/FormVisibilityErrorReason.md) - [TextFilteringError](/server-ui/enums/TextFilteringError.md) ## Classes - [ActionFormData](/server-ui/classes/ActionFormData.md) - [ActionFormResponse](/server-ui/classes/ActionFormResponse.md) - [CustomForm](/server-ui/classes/CustomForm.md) - [FormRejectError](/server-ui/classes/FormRejectError.md) - [FormResponse](/server-ui/classes/FormResponse.md) - [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) - [InvalidFormError](/server-ui/classes/InvalidFormError.md) - [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) - [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) - [MessageBox](/server-ui/classes/MessageBox.md) - [MessageFormData](/server-ui/classes/MessageFormData.md) - [MessageFormResponse](/server-ui/classes/MessageFormResponse.md) - [ModalFormData](/server-ui/classes/ModalFormData.md) - [ModalFormResponse](/server-ui/classes/ModalFormResponse.md) - [ObservableBoolean](/server-ui/classes/ObservableBoolean.md) - [ObservableNumber](/server-ui/classes/ObservableNumber.md) - [ObservableString](/server-ui/classes/ObservableString.md) - [ObservableUIRawMessage](/server-ui/classes/ObservableUIRawMessage.md) - [PlayerLeftError](/server-ui/classes/PlayerLeftError.md) - [UIManager](/server-ui/classes/UIManager.md) ## Interfaces - [ButtonOptions](/server-ui/interfaces/ButtonOptions.md) - [DividerOptions](/server-ui/interfaces/DividerOptions.md) - [DropdownItemData](/server-ui/interfaces/DropdownItemData.md) - [DropdownOptions](/server-ui/interfaces/DropdownOptions.md) - [ImageDetails](/server-ui/interfaces/ImageDetails.md) - [ImageOptions](/server-ui/interfaces/ImageOptions.md) - [MessageBoxButtonOptions](/server-ui/interfaces/MessageBoxButtonOptions.md) - [MessageBoxResult](/server-ui/interfaces/MessageBoxResult.md) - [ModalFormDataDropdownOptions](/server-ui/interfaces/ModalFormDataDropdownOptions.md) - [ModalFormDataSliderOptions](/server-ui/interfaces/ModalFormDataSliderOptions.md) - [ModalFormDataTextFieldOptions](/server-ui/interfaces/ModalFormDataTextFieldOptions.md) - [ModalFormDataToggleOptions](/server-ui/interfaces/ModalFormDataToggleOptions.md) - [ObservableOptions](/server-ui/interfaces/ObservableOptions.md) - [SliderOptions](/server-ui/interfaces/SliderOptions.md) - [SpacingOptions](/server-ui/interfaces/SpacingOptions.md) - [TextFieldOptions](/server-ui/interfaces/TextFieldOptions.md) - [TextOptions](/server-ui/interfaces/TextOptions.md) - [ToggleOptions](/server-ui/interfaces/ToggleOptions.md) - [UIRawMessage](/server-ui/interfaces/UIRawMessage.md) ## Variables - [uiManager](/server-ui/variables/uiManager.md) --- url: /server-ui/classes/FormResponse.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/FormResponse.md. # Class: FormResponse **`Beta`** 表单响应的基础类型。 Base type for a form response. ## Extended by - [`ActionFormResponse`](/server-ui/classes/ActionFormResponse.md) - [`MessageFormResponse`](/server-ui/classes/MessageFormResponse.md) - [`ModalFormResponse`](/server-ui/classes/ModalFormResponse.md) ## Properties ### cancelationReason? > `readonly` `optional` **cancelationReason?**: [`FormCancelationReason`](/server-ui/enums/FormCancelationReason.md) **`Beta`** #### Remarks 包含关于表单为何被取消的附加详细信息。 Contains additional details as to why a form was canceled. *** ### canceled > `readonly` **canceled**: `boolean` **`Beta`** #### Remarks 如果为 `true`,则表示表单已被玩家取消(例如,他们点击了弹窗的 X 关闭按钮)。 If true, the form was canceled by the player (e.g., they selected the pop-up X close button). [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/ActionFormResponse.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/ActionFormResponse.md. # Class: ActionFormResponse **`Beta`** 返回来自模态操作表单的玩家结果数据。 Returns data about the player results from a modal action form. ## Examples **showActionForm.ts** ```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); } }); } } ``` **showFavoriteMonth.ts** ```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; } }); } } ``` ## Extends - [`FormResponse`](/server-ui/classes/FormResponse.md) ## Properties ### cancelationReason? > `readonly` `optional` **cancelationReason?**: [`FormCancelationReason`](/server-ui/enums/FormCancelationReason.md) **`Beta`** #### Remarks 包含关于表单为何被取消的附加详细信息。 Contains additional details as to why a form was canceled. #### Inherited from [`FormResponse`](/server-ui/classes/FormResponse.md).[`cancelationReason`](/server-ui/classes/FormResponse.md#cancelationreason) *** ### canceled > `readonly` **canceled**: `boolean` **`Beta`** #### Remarks 如果为 `true`,则表示表单已被玩家取消(例如,他们点击了弹窗的 X 关闭按钮)。 If true, the form was canceled by the player (e.g., they selected the pop-up X close button). #### Inherited from [`FormResponse`](/server-ui/classes/FormResponse.md).[`canceled`](/server-ui/classes/FormResponse.md#canceled) *** ### selection? > `readonly` `optional` **selection?**: `number` **`Beta`** #### Remarks 返回被按下的按钮的索引。 Returns the index of the button that was pushed. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/MessageFormResponse.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/MessageFormResponse.md. # Class: MessageFormResponse **`Beta`** Returns data about the player results from a modal message form. 返回关于玩家在模态消息表单中操作结果的数据。 ## Examples **showBasicMessageForm.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; import { MessageFormResponse, MessageFormData } from '@minecraft/server-ui'; function showBasicMessageForm(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); const messageForm = new MessageFormData() .title('Message Form Example') .body('This shows a simple example using §o§7MessageFormData§r.') .button1('Button 1') .button2('Button 2'); messageForm .show(players[0]) .then((formData: MessageFormResponse) => { // player canceled the form, or another dialog was up and open. if (formData.canceled || formData.selection === undefined) { return; } log(`You selected ${formData.selection === 0 ? 'Button 1' : 'Button 2'}`); }) .catch((error: Error) => { log('Failed to show form: ' + error); return -1; }); } ``` **showTranslatedMessageForm.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; import { MessageFormResponse, MessageFormData } from '@minecraft/server-ui'; function showTranslatedMessageForm(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); const messageForm = new MessageFormData() .title({ translate: 'permissions.removeplayer' }) .body({ translate: 'accessibility.list.or.two', with: ['Player 1', 'Player 2'] }) .button1('Player 1') .button2('Player 2'); messageForm .show(players[0]) .then((formData: MessageFormResponse) => { // player canceled the form, or another dialog was up and open. if (formData.canceled || formData.selection === undefined) { return; } log(`You selected ${formData.selection === 0 ? 'Player 1' : 'Player 2'}`); }) .catch((error: Error) => { log('Failed to show form: ' + error); return -1; }); } ``` ## Extends - [`FormResponse`](/server-ui/classes/FormResponse.md) ## Properties ### cancelationReason? > `readonly` `optional` **cancelationReason?**: [`FormCancelationReason`](/server-ui/enums/FormCancelationReason.md) **`Beta`** #### Remarks 包含关于表单为何被取消的附加详细信息。 Contains additional details as to why a form was canceled. #### Inherited from [`FormResponse`](/server-ui/classes/FormResponse.md).[`cancelationReason`](/server-ui/classes/FormResponse.md#cancelationreason) *** ### canceled > `readonly` **canceled**: `boolean` **`Beta`** #### Remarks 如果为 `true`,则表示表单已被玩家取消(例如,他们点击了弹窗的 X 关闭按钮)。 If true, the form was canceled by the player (e.g., they selected the pop-up X close button). #### Inherited from [`FormResponse`](/server-ui/classes/FormResponse.md).[`canceled`](/server-ui/classes/FormResponse.md#canceled) *** ### selection? > `readonly` `optional` **selection?**: `number` **`Beta`** #### Remarks Returns the index of the button that was pushed. 返回被按下的按钮的索引。 [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/ModalFormResponse.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/ModalFormResponse.md. # Class: ModalFormResponse **`Beta`** Returns data about player responses to a modal form. 返回有关玩家对模态表单响应的数据。 ## Example **showBasicModalForm.ts** ```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; }); } ``` ## Extends - [`FormResponse`](/server-ui/classes/FormResponse.md) ## Properties ### cancelationReason? > `readonly` `optional` **cancelationReason?**: [`FormCancelationReason`](/server-ui/enums/FormCancelationReason.md) **`Beta`** #### Remarks 包含关于表单为何被取消的附加详细信息。 Contains additional details as to why a form was canceled. #### Inherited from [`FormResponse`](/server-ui/classes/FormResponse.md).[`cancelationReason`](/server-ui/classes/FormResponse.md#cancelationreason) *** ### canceled > `readonly` **canceled**: `boolean` **`Beta`** #### Remarks 如果为 `true`,则表示表单已被玩家取消(例如,他们点击了弹窗的 X 关闭按钮)。 If true, the form was canceled by the player (e.g., they selected the pop-up X close button). #### Inherited from [`FormResponse`](/server-ui/classes/FormResponse.md).[`canceled`](/server-ui/classes/FormResponse.md#canceled) *** ### formValues? > `readonly` `optional` **formValues?**: (`string` | `number` | `boolean` | `undefined`)\[] **`Beta`** #### Remarks An ordered set of values based on the order of controls specified by ModalFormData. 基于 `ModalFormData` 指定的控件顺序的有序值集合。 [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/ActionFormData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/ActionFormData.md. # Class: ActionFormData **`Beta`** 构建一个带有按钮的简单玩家表单,让玩家可以执行操作。 Builds a simple player form with buttons that let the player take action. ## Examples **showActionForm.ts** ```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); } }); } } ``` **showFavoriteMonth.ts** ```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; } }); } } ``` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ActionFormData**(): `ActionFormData` **`Beta`** #### Returns `ActionFormData` ## Methods ### body() > **body**(`bodyText`): `ActionFormData` **`Beta`** #### Parameters ##### bodyText `any` #### Returns `ActionFormData` #### Remarks 设置模态表单主体文本的方法。 Method that sets the body text for the modal form. *** ### button() > **button**(`text`, `iconPath?`): `ActionFormData` **`Beta`** #### Parameters ##### text `any` ##### iconPath? `string` #### Returns `ActionFormData` #### Remarks 向此表单添加一个带有资源包图标的按钮。 Adds a button to this form with an icon from a resource pack. *** ### divider() > **divider**(): `ActionFormData` **`Beta`** #### Returns `ActionFormData` #### Remarks 向表单添加一个区域分隔线。 Adds a section divider to the form. *** ### header() > **header**(`text`): `ActionFormData` **`Beta`** #### Parameters ##### text `any` 要显示的文本。 Text to display. #### Returns `ActionFormData` #### Remarks 向表单添加一个标题。 Adds a header to the form. *** ### label() > **label**(`text`): `ActionFormData` **`Beta`** #### Parameters ##### text `any` 要显示的文本。 Text to display. #### Returns `ActionFormData` #### Remarks 向表单添加一个标签。 Adds a label to the form. *** ### show() > **show**(`player`): `Promise`\<[`ActionFormResponse`](/server-ui/classes/ActionFormResponse.md)> **`World Mutation`** **`Beta`** #### Parameters ##### player `Player` 要向其显示此对话框的玩家。 Player to show this dialog to. #### Returns `Promise`\<[`ActionFormResponse`](/server-ui/classes/ActionFormResponse.md)> #### Remarks 创建并显示此模态弹出表单。当玩家确认或取消对话框时异步返回。 Creates and shows this modal popup form. Returns asynchronously when the player confirms or cancels the dialog. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [RawMessageError](/server/classes/RawMessageError.md) *** ### title() > **title**(`titleText`): `ActionFormData` **`Beta`** #### Parameters ##### titleText `any` #### Returns `ActionFormData` #### Remarks 此构建器方法设置模态对话框的标题。 This builder method sets the title for the modal dialog. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/CustomForm.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/CustomForm.md. # Class: CustomForm **`Beta`** 一个可自定义的数据驱动(DDUI)表单,允许您添加按钮、标签、开关、下拉菜单、滑块、文本字段等。表单布局通过在调用 `show()` 之前调用方法来添加组件来构建。绑定到表单组件的任何 `Observable` 值在其值发生变化时会自动更新 UI。 A customizable data driven (DDUI) form that lets you add buttons, labels, toggles, dropdowns, sliders, text fields, and more. The form layout is built by calling methods to add components before calling show(). Any Observable values bound to form components will automatically update the UI when their values change. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new CustomForm**(`player`, `title`): `CustomForm` **`Beta`** #### Parameters ##### player `Player` 要向其显示此表单的玩家。 The player to show this form to. ##### title `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) 在表单顶部显示的标题文本。 The title text to display at the top of the form. #### Returns `CustomForm` #### Remarks 为指定玩家创建一个具有给定标题的新 `CustomForm`。 Creates a new CustomForm for the specified player with the given title. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) ## Methods ### button() > **button**(`label`, `onClick`, `options?`): `CustomForm` **`World Mutation`** **`Beta`** #### Parameters ##### label `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) 在按钮上显示的文本标签。 The text label to display on the button. ##### onClick () => `void` 当玩家点击按钮时调用的回调函数。 A callback function that is invoked when the player clicks the button. ##### options? [`ButtonOptions`](/server-ui/interfaces/ButtonOptions.md) 按钮的可选配置,例如工具提示、禁用状态或可见性。 Optional configuration for the button, such as a tooltip, disabled state, or visibility. #### Returns `CustomForm` #### Remarks 向表单布局添加一个可点击的按钮。返回表单实例以允许方法链式调用。 Adds a clickable button to the form layout. Returns the form instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### close() > **close**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 如果表单当前正在向玩家显示,则关闭它。如果表单当前未打开,则抛出 `FormVisibilityError`。 Closes the form if it is currently being shown to the player. Throws a FormVisibilityError if the form is not currently open. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### closeButton() > **closeButton**(): `CustomForm` **`World Mutation`** **`Beta`** #### Returns `CustomForm` #### Remarks 向表单底部和角落添加一个关闭按钮(显示为 'X')。返回表单实例以允许方法链式调用。 Adds a close button to the form at the bottom and as an 'X' in the corner. Returns the form instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### divider() > **divider**(`options?`): `CustomForm` **`World Mutation`** **`Beta`** #### Parameters ##### options? [`DividerOptions`](/server-ui/interfaces/DividerOptions.md) 分隔线的可选配置,例如可见性。 Optional configuration for the divider, such as visibility. #### Returns `CustomForm` #### Remarks 向表单布局添加一条水平分隔线。用于在视觉上分隔表单的不同部分。返回表单实例以允许方法链式调用。 Adds a horizontal divider line to the form layout. Useful for visually separating sections of the form. Returns the form instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### dropdown() > **dropdown**(`label`, `value`, `items`, `options?`): `CustomForm` **`World Mutation`** **`Beta`** #### Parameters ##### label `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) 在下拉菜单周围显示的文本标签。 The text label displayed around the dropdown. ##### value [`ObservableNumber`](/server-ui/classes/ObservableNumber.md) 一个持有当前选中项索引的 `ObservableNumber`。 An ObservableNumber that holds the index of the currently selected item. ##### items [`DropdownItemData`](/server-ui/interfaces/DropdownItemData.md)\[] 要在下拉菜单中显示的项目列表。 The list of items to display in the dropdown. ##### options? [`DropdownOptions`](/server-ui/interfaces/DropdownOptions.md) 下拉菜单的可选配置,例如描述、禁用状态或可见性。 Optional configuration for the dropdown, such as a description, disabled state, or visibility. #### Returns `CustomForm` #### Remarks 向表单布局添加一个下拉选择控件。当前选择通过 `ObservableNumber` 跟踪,并在玩家更改选择时更新。返回表单实例以允许方法链式调用。 Adds a dropdown selection control to the form layout. The current selection is tracked via an ObservableNumber and will update when the player changes the selection. Returns the form instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) *** ### header() > **header**(`text`, `options?`): `CustomForm` **`World Mutation`** **`Beta`** #### Parameters ##### text `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) 要显示的标题文本。 The header text to display. ##### options? [`TextOptions`](/server-ui/interfaces/TextOptions.md) 标题的可选配置,例如可见性。 Optional configuration for the header, such as visibility. #### Returns `CustomForm` #### Remarks 向表单布局添加一个标题文本组件。标题以比常规标签更大或更粗的样式显示,适用于章节标题。返回表单实例以允许方法链式调用。 Adds a header text component to the form layout. Headers are displayed in a larger or bolder style than regular labels, and are suitable for section titles. Returns the form instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### image() > **image**(`src`, `pack`, `options?`): `CustomForm` **`Beta`** **`World Mutation`** #### Parameters ##### src `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) 要显示的图像源路径。必须是提供的包内图像文件的相对路径。 The image source path to display. Must be a relative path to an image file within the provided pack. ##### pack `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) 包含所提供的图像源的资源包标识符。 The resource pack identifier that contains the provided image source. ##### options? [`ImageOptions`](/server-ui/interfaces/ImageOptions.md) 图像的可选配置,例如可见性或宽度。 Optional configuration for the image, such as visibility or width. #### Returns `CustomForm` 返回表单实例以允许方法链式调用。 The form instance to allow method chaining. #### Remarks 向表单布局添加一个图像组件。 Adds an image component to the form layout. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) *** ### isShowing() > **isShowing**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks 如果表单当前正在向玩家显示则返回 `true`,否则返回 `false`。 Returns true if the form is currently being shown to the player, false otherwise. *** ### label() > **label**(`text`, `options?`): `CustomForm` **`World Mutation`** **`Beta`** #### Parameters ##### text `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) 在标签中显示的文本。 The text to display in the label. ##### options? [`TextOptions`](/server-ui/interfaces/TextOptions.md) 标签的可选配置,例如可见性。 Optional configuration for the label, such as visibility. #### Returns `CustomForm` #### Remarks 向表单布局添加一个只读文本标签。返回表单实例以允许方法链式调用。 Adds a read-only text label to the form layout. Returns the form instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### show() > **show**(): `Promise`\<[`DataDrivenScreenClosedReason`](/server-ui/enums/DataDrivenScreenClosedReason.md)> **`World Mutation`** **`Beta`** #### Returns `Promise`\<[`DataDrivenScreenClosedReason`](/server-ui/enums/DataDrivenScreenClosedReason.md)> #### Remarks 向玩家显示表单。返回一个 Promise,该 Promise 解析为一个 `DataDrivenScreenClosedReason`,指示表单是如何关闭的。 Shows the form to the player. Returns a promise that resolves with a DataDrivenScreenClosedReason indicating how the form was closed. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### slider() > **slider**(`label`, `value`, `min`, `max`, `options?`): `CustomForm` **`World Mutation`** **`Beta`** #### Parameters ##### label `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) 在滑块周围显示的文本标签。 The text label displayed around the slider. ##### value [`ObservableNumber`](/server-ui/classes/ObservableNumber.md) 一个持有滑块当前值的 `ObservableNumber`。 An ObservableNumber that holds the current value of the slider. ##### min `number` | [`ObservableNumber`](/server-ui/classes/ObservableNumber.md) 滑块范围的最小值。 The minimum value of the slider range. ##### max `number` | [`ObservableNumber`](/server-ui/classes/ObservableNumber.md) 滑块范围的最大值。 The maximum value of the slider range. ##### options? [`SliderOptions`](/server-ui/interfaces/SliderOptions.md) 滑块的可选配置,例如步长、描述、禁用状态或可见性。 Optional configuration for the slider, such as step size, a description, disabled state, or visibility. #### Returns `CustomForm` #### Remarks 向表单布局添加一个数字滑块控件。当前值通过 `ObservableNumber` 跟踪,并在玩家移动滑块时更新。返回表单实例以允许方法链式调用。 Adds a numeric slider control to the form layout. The current value is tracked via an ObservableNumber and will update as the player moves the slider. Returns the form instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) *** ### spacer() > **spacer**(`options?`): `CustomForm` **`World Mutation`** **`Beta`** #### Parameters ##### options? [`SpacingOptions`](/server-ui/interfaces/SpacingOptions.md) 间距组件的可选配置,例如可见性。 Optional configuration for the spacer, such as visibility. #### Returns `CustomForm` #### Remarks 向表单布局添加一个垂直间距组件。用于在表单组件之间添加空白空间。返回表单实例以允许方法链式调用。 Adds a vertical spacer component to the form layout. Useful for adding empty space between form components. Returns the form instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### textField() > **textField**(`label`, `text`, `options?`): `CustomForm` **`World Mutation`** **`Beta`** #### Parameters ##### label `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) 在文本字段周围显示的文本标签。 The text label displayed around the text field. ##### text [`ObservableString`](/server-ui/classes/ObservableString.md) 一个持有输入字段当前文本值的 `ObservableString`。 An ObservableString that holds the current text value of the input field. ##### options? [`TextFieldOptions`](/server-ui/interfaces/TextFieldOptions.md) 文本字段的可选配置,例如描述、禁用状态或可见性。 Optional configuration for the text field, such as a description, disabled state, or visibility. #### Returns `CustomForm` #### Remarks 向表单布局添加一个文本输入字段。当前文本值通过 `ObservableString` 跟踪,并在玩家输入时更新。返回表单实例以允许方法链式调用。 Adds a text input field to the form layout. The current text value is tracked via an ObservableString and will update as the player types. Returns the form instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) *** ### toggle() > **toggle**(`label`, `toggled`, `options?`): `CustomForm` **`World Mutation`** **`Beta`** #### Parameters ##### label `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) 在开关旁边显示的文本标签。 The text label displayed next to the toggle. ##### toggled [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) 一个持有开关当前开/关状态的 `ObservableBoolean`。 An ObservableBoolean that holds the current on/off state of the toggle. ##### options? [`ToggleOptions`](/server-ui/interfaces/ToggleOptions.md) 开关的可选配置,例如描述、禁用状态或可见性。 Optional configuration for the toggle, such as a description, disabled state, or visibility. #### Returns `CustomForm` #### Remarks 向表单布局添加一个开关控件。当前状态通过 `ObservableBoolean` 跟踪,并在玩家切换时更新。返回表单实例以允许方法链式调用。 Adds a toggle (on/off switch) control to the form layout. The current state is tracked via an ObservableBoolean and will update when the player toggles it. Returns the form instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/FormRejectError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/FormRejectError.md. # Class: FormRejectError error **`Beta`** 当表单被拒绝时抛出。包含拒绝的原因。 Thrown when a form is rejected. Contains the reason for the rejection. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### reason > `readonly` **reason**: [`FormRejectReason`](/server-ui/enums/FormRejectReason.md) **`Early Execution`** **`Beta`** #### Remarks 表单被拒绝的原因。 The reason the form was rejected. *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) - [FormVisibilityErrorReason](/server-ui/enums/FormVisibilityErrorReason.md) - [InvalidFormError](/server-ui/classes/InvalidFormError.md) - [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) - [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) - [PlayerLeftError](/server-ui/classes/PlayerLeftError.md) [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/FormVisibilityError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/FormVisibilityError.md. # Class: FormVisibilityError error **`Beta`** 当表单可见性操作失败时抛出,例如尝试显示一个已经正在显示的表单,或尝试关闭一个当前未打开的表单。 Thrown when a form visibility operation fails, such as attempting to show a form that is already showing or attempting to close a form that is not currently open. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### formId > `readonly` **formId**: `string` **`Early Execution`** **`Beta`** #### Remarks 导致可见性错误的表单标识符。 The identifier of the form that caused the visibility error. *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### reason > `readonly` **reason**: [`FormVisibilityErrorReason`](/server-ui/enums/FormVisibilityErrorReason.md) **`Early Execution`** **`Beta`** #### Remarks 表单可见性操作失败的原因。 The reason the form visibility operation failed. *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [FormRejectError](/server-ui/classes/FormRejectError.md) - [FormVisibilityErrorReason](/server-ui/enums/FormVisibilityErrorReason.md) - [InvalidFormError](/server-ui/classes/InvalidFormError.md) - [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) - [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) - [PlayerLeftError](/server-ui/classes/PlayerLeftError.md) [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/InvalidFormError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/InvalidFormError.md. # Class: InvalidFormError error **`Beta`** Thrown when attempting to interact with a form using an invalid or unknown form identifier. 当尝试使用无效或未知的表单标识符与表单交互时抛出。 ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### formId > `readonly` **formId**: `string` **`Early Execution`** **`Beta`** #### Remarks The identifier of the invalid form that was referenced. 所引用的无效表单的标识符。 *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [FormRejectError](/server-ui/classes/FormRejectError.md) - [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) - [FormVisibilityErrorReason](/server-ui/enums/FormVisibilityErrorReason.md) - [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) - [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) - [PlayerLeftError](/server-ui/classes/PlayerLeftError.md) [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/InvalidFormModificationError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/InvalidFormModificationError.md. # Class: InvalidFormModificationError error **`Beta`** Thrown when attempting to modify a form after it has already been shown to a player. Form properties cannot be changed while the form is active. 当尝试在表单已展示给玩家后修改表单时抛出。表单处于活动状态时,其属性无法更改。 ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### formId > `readonly` **formId**: `string` **`Early Execution`** **`Beta`** #### Remarks The identifier of the form that was illegally modified after being shown. 在展示后被非法修改的表单的标识符。 *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [FormRejectError](/server-ui/classes/FormRejectError.md) - [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) - [FormVisibilityErrorReason](/server-ui/enums/FormVisibilityErrorReason.md) - [InvalidFormError](/server-ui/classes/InvalidFormError.md) - [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) - [PlayerLeftError](/server-ui/classes/PlayerLeftError.md) [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/InvalidObservableError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/InvalidObservableError.md. # Class: InvalidObservableError error **`Beta`** Thrown when an observable value is expected to be writable, but it is not. 当期望可观察值是可写的,但它不可写时抛出。 ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [FormRejectError](/server-ui/classes/FormRejectError.md) - [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) - [FormVisibilityErrorReason](/server-ui/enums/FormVisibilityErrorReason.md) - [InvalidFormError](/server-ui/classes/InvalidFormError.md) - [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) - [PlayerLeftError](/server-ui/classes/PlayerLeftError.md) [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/MessageBox.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/MessageBox.md. # Class: MessageBox **`Beta`** A simple message form with two buttons and a text body. Use this class to show a basic dialog to a player and handle the player's button selection. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new MessageBox**(`player`, `title`): `MessageBox` **`Beta`** #### Parameters ##### player `Player` The player to show this message box to. ##### title `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) The title text to display at the top of the message box. #### Returns `MessageBox` #### Remarks Creates a new MessageBox for the specified player with the given title. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) ## Methods ### body() > **body**(`body`): `MessageBox` **`World Mutation`** **`Beta`** #### Parameters ##### body `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) The body text to display. Accepts either a plain string or an ObservableString. #### Returns `MessageBox` #### Remarks Sets the body text displayed in the message box. Returns the message box instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### button1() > **button1**(`label`, `tooltip?`): `MessageBox` **`World Mutation`** **`Beta`** #### Parameters ##### label `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) The text label to display on the first button. ##### tooltip? `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) Optional tooltip text shown when hovering over the first button. #### Returns `MessageBox` #### Remarks Sets the label for the first button of the message box. Returns the message box instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### button1WithOptions() > **button1WithOptions**(`label`, `options?`): `MessageBox` **`Beta`** **`World Mutation`** #### Parameters ##### label `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) The text label to display on the first button. ##### options? [`MessageBoxButtonOptions`](/server-ui/interfaces/MessageBoxButtonOptions.md) Optional configuration for the first button, such as tooltip and image. #### Returns `MessageBox` #### Remarks Sets the label and options for the first button of the message box. Returns the message box instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### button2() > **button2**(`label`, `tooltip?`): `MessageBox` **`World Mutation`** **`Beta`** #### Parameters ##### label `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) The text label to display on the second button. ##### tooltip? `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) Optional tooltip text shown when hovering over the second button. #### Returns `MessageBox` #### Remarks Sets the label for the second button of the message box. Returns the message box instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### button2WithOptions() > **button2WithOptions**(`label`, `options?`): `MessageBox` **`Beta`** **`World Mutation`** #### Parameters ##### label `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) The text label to display on the second button. ##### options? [`MessageBoxButtonOptions`](/server-ui/interfaces/MessageBoxButtonOptions.md) Optional configuration for the second button, such as tooltip and image. #### Returns `MessageBox` #### Remarks Sets the label and options for the second button of the message box. Returns the message box instance to allow method chaining. #### Throws This function can throw errors. [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) *** ### close() > **close**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Closes the message box if it is currently being shown to the player. Throws a FormVisibilityError if the form is not currently open. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### isShowing() > **isShowing**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks Returns true if the message box is currently being shown to the player, false otherwise. *** ### show() > **show**(): `Promise`\<[`MessageBoxResult`](/server-ui/interfaces/MessageBoxResult.md)> **`World Mutation`** **`Beta`** #### Returns `Promise`\<[`MessageBoxResult`](/server-ui/interfaces/MessageBoxResult.md)> #### Remarks Shows the message box to the player. Returns a promise that resolves with a MessageBoxResult containing the close reason and the player's button selection. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/MessageFormData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/MessageFormData.md. # Class: MessageFormData **`Beta`** Builds a simple two-button modal dialog. 构建一个简单的双按钮模态对话框。 ## Examples **showBasicMessageForm.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; import { MessageFormResponse, MessageFormData } from '@minecraft/server-ui'; function showBasicMessageForm(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); const messageForm = new MessageFormData() .title('Message Form Example') .body('This shows a simple example using §o§7MessageFormData§r.') .button1('Button 1') .button2('Button 2'); messageForm .show(players[0]) .then((formData: MessageFormResponse) => { // player canceled the form, or another dialog was up and open. if (formData.canceled || formData.selection === undefined) { return; } log(`You selected ${formData.selection === 0 ? 'Button 1' : 'Button 2'}`); }) .catch((error: Error) => { log('Failed to show form: ' + error); return -1; }); } ``` **showTranslatedMessageForm.ts** ```typescript import { world, DimensionLocation } from '@minecraft/server'; import { MessageFormResponse, MessageFormData } from '@minecraft/server-ui'; function showTranslatedMessageForm(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) { const players = world.getPlayers(); const messageForm = new MessageFormData() .title({ translate: 'permissions.removeplayer' }) .body({ translate: 'accessibility.list.or.two', with: ['Player 1', 'Player 2'] }) .button1('Player 1') .button2('Player 2'); messageForm .show(players[0]) .then((formData: MessageFormResponse) => { // player canceled the form, or another dialog was up and open. if (formData.canceled || formData.selection === undefined) { return; } log(`You selected ${formData.selection === 0 ? 'Player 1' : 'Player 2'}`); }) .catch((error: Error) => { log('Failed to show form: ' + error); return -1; }); } ``` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new MessageFormData**(): `MessageFormData` **`Beta`** #### Returns `MessageFormData` ## Methods ### body() > **body**(`bodyText`): `MessageFormData` **`Beta`** #### Parameters ##### bodyText `any` #### Returns `MessageFormData` #### Remarks Method that sets the body text for the modal form. 设置模态表单正文文本的方法。 *** ### button1() > **button1**(`text`): `MessageFormData` **`Beta`** #### Parameters ##### text `any` #### Returns `MessageFormData` #### Remarks Method that sets the text for the first button of the dialog. 设置对话框第一个按钮文本的方法。 *** ### button2() > **button2**(`text`): `MessageFormData` **`Beta`** #### Parameters ##### text `any` #### Returns `MessageFormData` #### Remarks This method sets the text for the second button on the dialog. 此方法设置对话框上第二个按钮的文本。 *** ### show() > **show**(`player`): `Promise`\<[`MessageFormResponse`](/server-ui/classes/MessageFormResponse.md)> **`World Mutation`** **`Beta`** #### Parameters ##### player `Player` Player to show this dialog to. 要向其展示此对话框的玩家。 #### Returns `Promise`\<[`MessageFormResponse`](/server-ui/classes/MessageFormResponse.md)> #### Remarks Creates and shows this modal popup form. Returns asynchronously when the player confirms or cancels the dialog. 创建并显示此模态弹出表单。当玩家确认或取消对话框时异步返回。 #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [RawMessageError](/server/classes/RawMessageError.md) *** ### title() > **title**(`titleText`): `MessageFormData` **`Beta`** #### Parameters ##### titleText `any` #### Returns `MessageFormData` #### Remarks This builder method sets the title for the modal dialog. 此构建器方法设置模态对话框的标题。 [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/ModalFormData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/ModalFormData.md. # Class: ModalFormData **`Beta`** Used to create a fully customizable pop-up form for a player. 用于为玩家创建完全可自定义的弹出表单。 ## Example **showBasicModalForm.ts** ```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; }); } ``` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ModalFormData**(): `ModalFormData` **`Beta`** #### Returns `ModalFormData` ## Methods ### divider() > **divider**(): `ModalFormData` **`Beta`** #### Returns `ModalFormData` #### Remarks Adds a section divider to the form. 向表单添加一个分隔线。 *** ### dropdown() > **dropdown**(`label`, `items`, `dropdownOptions?`): `ModalFormData` **`Beta`** #### Parameters ##### label `any` The label to display for the dropdown. 下拉菜单显示的标签。 ##### items `any`\[] The selectable items for the dropdown. 下拉菜单的可选项目。 ##### dropdownOptions? [`ModalFormDataDropdownOptions`](/server-ui/interfaces/ModalFormDataDropdownOptions.md) The optional additional values for the dropdown creation. 创建下拉菜单时可选的附加参数。 #### Returns `ModalFormData` #### Remarks Adds a dropdown with choices to the form. 向表单添加一个包含选项的下拉菜单。 *** ### header() > **header**(`text`): `ModalFormData` **`Beta`** #### Parameters ##### text `any` Text to display. 要显示的文本。 #### Returns `ModalFormData` #### Remarks Adds a header to the form. 向表单添加一个标题。 *** ### label() > **label**(`text`): `ModalFormData` **`Beta`** #### Parameters ##### text `any` Text to display. 要显示的文本。 #### Returns `ModalFormData` #### Remarks Adds a label to the form. 向表单添加一个标签。 *** ### show() > **show**(`player`): `Promise`\<[`ModalFormResponse`](/server-ui/classes/ModalFormResponse.md)> **`World Mutation`** **`Beta`** #### Parameters ##### player `Player` Player to show this dialog to. 要显示此对话框的玩家。 #### Returns `Promise`\<[`ModalFormResponse`](/server-ui/classes/ModalFormResponse.md)> #### Remarks Creates and shows this modal popup form. Returns asynchronously when the player confirms or cancels the dialog. 创建并显示此模态弹出表单。当玩家确认或取消对话框时异步返回。 #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [RawMessageError](/server/classes/RawMessageError.md) *** ### slider() > **slider**(`label`, `minimumValue`, `maximumValue`, `sliderOptions?`): `ModalFormData` **`Beta`** #### Parameters ##### label `any` The label to display for the slider. 滑块显示的标签。 ##### minimumValue `number` The minimum selectable possible value. 可选择的最小值。 ##### maximumValue `number` The maximum selectable possible value. 可选择的最大值。 ##### sliderOptions? [`ModalFormDataSliderOptions`](/server-ui/interfaces/ModalFormDataSliderOptions.md) The optional additional values for the slider creation. 创建滑块时可选的附加参数。 #### Returns `ModalFormData` #### Remarks Adds a numeric slider to the form. 向表单添加一个数值滑块。 *** ### submitButton() > **submitButton**(`submitButtonText`): `ModalFormData` **`Beta`** #### Parameters ##### submitButtonText `any` #### Returns `ModalFormData` *** ### textField() > **textField**(`label`, `placeholderText`, `textFieldOptions?`): `ModalFormData` **`Beta`** #### Parameters ##### label `any` The label to display for the textfield. 文本字段显示的标签。 ##### placeholderText `any` The place holder text to display. 要显示的占位文本。 ##### textFieldOptions? [`ModalFormDataTextFieldOptions`](/server-ui/interfaces/ModalFormDataTextFieldOptions.md) The optional additional values for the textfield creation. 创建文本字段时可选的附加参数。 #### Returns `ModalFormData` #### Remarks Adds a textbox to the form. 向表单添加一个文本框。 *** ### title() > **title**(`titleText`): `ModalFormData` **`Beta`** #### Parameters ##### titleText `any` #### Returns `ModalFormData` #### Remarks This builder method sets the title for the modal dialog. 此构建器方法设置模态对话框的标题。 *** ### toggle() > **toggle**(`label`, `toggleOptions?`): `ModalFormData` **`Beta`** #### Parameters ##### label `any` The label to display for the toggle. 开关显示的标签。 ##### toggleOptions? [`ModalFormDataToggleOptions`](/server-ui/interfaces/ModalFormDataToggleOptions.md) The optional additional values for the toggle creation. 创建开关时可选的附加参数。 #### Returns `ModalFormData` #### Remarks Adds a toggle checkbox button to the form. 向表单添加一个开关复选框按钮。 [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/ObservableBoolean.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/ObservableBoolean.md. # Class: ObservableBoolean **`Beta`** An observable that holds a boolean value. Listeners are notified whenever the value changes. 一个持有布尔值的可观察对象。当值发生变化时,会通知所有监听器。 ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ObservableBoolean**(`data`, `options?`): `ObservableBoolean` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### data `boolean` The initial boolean value for this observable. 此可观察对象的初始布尔值。 ##### options? [`ObservableOptions`](/server-ui/interfaces/ObservableOptions.md) Optional configuration for the observable, such as whether the value can be written by the client. 可观察对象的可选配置,例如该值是否可由客户端写入。 #### Returns `ObservableBoolean` #### Remarks Creates a new ObservableBoolean with the provided initial boolean value. 使用提供的初始布尔值创建一个新的 `ObservableBoolean`。 ## Methods ### getData() > **getData**(): `boolean` **`World Mutation`** **`Early Execution`** **`Beta`** #### Returns `boolean` #### Remarks Returns the current boolean value held by this observable. 返回此可观察对象持有的当前布尔值。 *** ### setData() > **setData**(`data`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### data `boolean` The new boolean value to set. 要设置的新布尔值。 #### Returns `void` #### Remarks Updates the boolean value held by this observable. If the new value differs from the current value, all subscribed listeners are notified with the new value. 更新此可观察对象持有的布尔值。如果新值与当前值不同,则会使用新值通知所有已订阅的监听器。 *** ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` A function that receives the new boolean value each time the observable changes. 每次可观察对象发生变化时接收新布尔值的函数。 #### Returns (`arg0`) => `void` #### Remarks Registers a callback to be invoked whenever the observable's value changes. Returns the callback, which can be passed to unsubscribe to remove the listener. 注册一个回调函数,当可观察对象的值发生变化时调用。返回该回调函数,可将其传递给 `unsubscribe` 以移除监听器。 *** ### unsubscribe() > **unsubscribe**(`callback`): `boolean` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` The callback handle previously returned by subscribe. 先前由 `subscribe` 返回的回调句柄。 #### Returns `boolean` #### Remarks Removes a previously registered listener from this observable. Returns true if the listener was found and removed, false if it was not found. 从此可观察对象中移除先前注册的监听器。如果找到并移除了监听器,则返回 `true`;如果未找到,则返回 `false`。 [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/ObservableNumber.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/ObservableNumber.md. # Class: ObservableNumber **`Beta`** An observable that holds a numeric value. Listeners are notified whenever the value changes. 一个持有数值的可观察对象。当值发生变化时,会通知所有监听器。 ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ObservableNumber**(`data`, `options?`): `ObservableNumber` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### data `number` The initial numeric value for this observable. 此可观察对象的初始数值。 ##### options? [`ObservableOptions`](/server-ui/interfaces/ObservableOptions.md) Optional configuration for the observable, such as whether the value can be written by the client. 可观察对象的可选配置,例如该值是否可由客户端写入。 #### Returns `ObservableNumber` #### Remarks Creates a new ObservableNumber with the provided initial numeric value. 使用提供的初始数值创建一个新的 `ObservableNumber`。 ## Methods ### getData() > **getData**(): `number` **`World Mutation`** **`Early Execution`** **`Beta`** #### Returns `number` #### Remarks Returns the current numeric value held by this observable. 返回此可观察对象持有的当前数值。 *** ### setData() > **setData**(`data`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### data `number` The new numeric value to set. 要设置的新数值。 #### Returns `void` #### Remarks Updates the numeric value held by this observable. If the new value differs from the current value, all subscribed listeners are notified with the new value. 更新此可观察对象持有的数值。如果新值与当前值不同,则会使用新值通知所有已订阅的监听器。 *** ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` A function that receives the new numeric value each time the observable changes. 每次可观察对象发生变化时接收新数值的函数。 #### Returns (`arg0`) => `void` #### Remarks Registers a callback to be invoked whenever the observable's value changes. Returns the callback, which can be passed to unsubscribe to remove the listener. 注册一个回调函数,当可观察对象的值发生变化时调用。返回该回调函数,可将其传递给 `unsubscribe` 以移除监听器。 *** ### unsubscribe() > **unsubscribe**(`callback`): `boolean` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` The callback handle previously returned by subscribe. 先前由 `subscribe` 返回的回调句柄。 #### Returns `boolean` #### Remarks Removes a previously registered listener from this observable. Returns true if the listener was found and removed, false if it was not found. 从此可观察对象中移除先前注册的监听器。如果找到并移除了监听器,则返回 `true`;如果未找到,则返回 `false`。 [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/ObservableString.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/ObservableString.md. # Class: ObservableString **`Beta`** An observable that holds a string value. Listeners are notified whenever the value changes. 一个持有字符串值的可观察对象。当值发生变化时,会通知所有监听器。 ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ObservableString**(`data`, `options?`): `ObservableString` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### data `string` The initial string value for this observable. 此可观察对象的初始字符串值。 ##### options? [`ObservableOptions`](/server-ui/interfaces/ObservableOptions.md) Optional configuration for the observable, such as whether the value can be written by the client. 可观察对象的可选配置,例如该值是否可由客户端写入。 #### Returns `ObservableString` #### Remarks Creates a new ObservableString with the provided initial string value. 使用提供的初始字符串值创建一个新的 `ObservableString`。 ## Methods ### getData() > **getData**(): `string` **`World Mutation`** **`Early Execution`** **`Beta`** #### Returns `string` #### Remarks Returns the current string value held by this observable. 返回此可观察对象持有的当前字符串值。 *** ### getFilteredText() > **getFilteredText**(`player`): `Promise`\<`string` | [`TextFilteringError`](/server-ui/enums/TextFilteringError.md)\[]> **`World Mutation`** **`Beta`** #### Parameters ##### player `Player` #### Returns `Promise`\<`string` | [`TextFilteringError`](/server-ui/enums/TextFilteringError.md)\[]> #### Remarks Gets filtered data from the Observable (only available for strings). In case of failure, it will return an array of TextFilteringError that can provide more context about the filtering process. For testing purposes, the options are available under 'Creator -> Text Filtering' settings menu. This delay is only applied to the getFilteredText function and can be used to simulate network latency when testing. 从可观察对象获取经过过滤的数据(仅适用于字符串)。如果失败,它将返回一个 `TextFilteringError` 数组,该数组可以提供有关过滤过程的更多上下文。出于测试目的,这些选项可在 'Creator -> Text Filtering' 设置菜单中找到。此延迟仅适用于 `getFilteredText` 函数,并可在测试时用于模拟网络延迟。 #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### setData() > **setData**(`data`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### data `string` The new string value to set. 要设置的新字符串值。 #### Returns `void` #### Remarks Updates the string value held by this observable. If the new value differs from the current value, all subscribed listeners are notified with the new value. 更新此可观察对象持有的字符串值。如果新值与当前值不同,则会使用新值通知所有已订阅的监听器。 *** ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` A function that receives the new string value each time the observable changes. 每次可观察对象发生变化时接收新字符串值的函数。 #### Returns (`arg0`) => `void` #### Remarks Registers a callback to be invoked whenever the observable's value changes. Returns the callback, which can be passed to unsubscribe to remove the listener. 注册一个回调函数,当可观察对象的值发生变化时调用。返回该回调函数,可将其传递给 `unsubscribe` 以移除监听器。 *** ### unsubscribe() > **unsubscribe**(`callback`): `boolean` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` The callback handle previously returned by subscribe. 先前由 `subscribe` 返回的回调句柄。 #### Returns `boolean` #### Remarks Removes a previously registered listener from this observable. Returns true if the listener was found and removed, false if it was not found. 从此可观察对象中移除先前注册的监听器。如果找到并移除了监听器,则返回 `true`;如果未找到,则返回 `false`。 [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/ObservableUIRawMessage.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/ObservableUIRawMessage.md. # Class: ObservableUIRawMessage **`Beta`** An observable that holds a UIRawMessage value. Listeners are notified whenever the value changes. 一个持有 `UIRawMessage` 值的可观察对象。当值发生变化时,会通知所有监听器。 ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ObservableUIRawMessage**(`data`, `options?`): `ObservableUIRawMessage` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### data [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) The initial UIRawMessage value for this observable. 此可观察对象的初始 `UIRawMessage` 值。 ##### options? [`ObservableOptions`](/server-ui/interfaces/ObservableOptions.md) Optional configuration for the observable, such as whether the value can be written by the client. 可观察对象的可选配置,例如该值是否可由客户端写入。 #### Returns `ObservableUIRawMessage` #### Remarks Creates a new ObservableUIRawMessage with the provided initial UIRawMessage value. 使用提供的初始 `UIRawMessage` 值创建一个新的 `ObservableUIRawMessage`。 ## Methods ### getData() > **getData**(): [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`World Mutation`** **`Early Execution`** **`Beta`** #### Returns [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) #### Remarks Returns the current UIRawMessage value held by this observable. 返回此可观察对象持有的当前 `UIRawMessage` 值。 *** ### setData() > **setData**(`data`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### data [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) The new UIRawMessage value to set. 要设置的新 `UIRawMessage` 值。 #### Returns `void` #### Remarks Updates the UIRawMessage value held by this observable. If the new value differs from the current value, all subscribed listeners are notified with the new value. 更新此可观察对象持有的 `UIRawMessage` 值。如果新值与当前值不同,则会使用新值通知所有已订阅的监听器。 *** ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` A function that receives the new UIRawMessage value each time the observable changes. 每次可观察对象发生变化时接收新 `UIRawMessage` 值的函数。 #### Returns (`arg0`) => `void` #### Remarks Registers a callback to be invoked whenever the observable's value changes. Returns the callback, which can be passed to unsubscribe to remove the listener. 注册一个回调函数,当可观察对象的值发生变化时调用。返回该回调函数,可将其传递给 `unsubscribe` 以移除监听器。 *** ### unsubscribe() > **unsubscribe**(`callback`): `boolean` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` The callback handle previously returned by subscribe. 先前由 `subscribe` 返回的回调句柄。 #### Returns `boolean` #### Remarks Removes a previously registered listener from this observable. Returns true if the listener was found and removed, false if it was not found. 从此可观察对象中移除先前注册的监听器。如果找到并移除了监听器,则返回 `true`;如果未找到,则返回 `false`。 [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/PlayerLeftError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/PlayerLeftError.md. # Class: PlayerLeftError player error **`Beta`** 当表单操作因为目标玩家已离开游戏而失败时抛出。 Thrown when a form operation fails because the target player has left the game. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### formId > `readonly` **formId**: `string` **`Early Execution`** **`Beta`** #### Remarks 玩家离开游戏时正在显示的表单标识符。 The identifier of the form that was being shown when the player left the game. *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [PlayerAlreadyOpError](/server-admin/classes/PlayerAlreadyOpError.md) - [FormRejectError](/server-ui/classes/FormRejectError.md) - [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) - [FormVisibilityErrorReason](/server-ui/enums/FormVisibilityErrorReason.md) [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/classes/UIManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/classes/UIManager.md. # Class: UIManager **`Beta`** 管理与玩家相关的 UI 表单,包括关闭所有打开的表单。 Manages UI forms for a player, including closing all open forms. ## Methods ### closeAllForms() > **closeAllForms**(`player`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### player `Player` 要关闭其所有表单的玩家。 The player whose forms should be closed. #### Returns `void` #### Remarks 关闭指定玩家的所有已打开的表单。 Closes all open forms for the specified player. #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/ButtonOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/ButtonOptions.md. # Interface: ButtonOptions **`Beta`** Options for configuring a button component. ## Properties ### disabled? > `optional` **disabled?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When true or bound to a true ObservableBoolean, the button is shown but cannot be pressed. *** ### imageDetails? > `optional` **imageDetails?**: [`ImageDetails`](/server-ui/interfaces/ImageDetails.md) **`Beta`** #### Remarks Details of an image to display alongside the button label. *** ### tooltip? > `optional` **tooltip?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Text shown in a tooltip when the player hovers over the button. *** ### visible? > `optional` **visible?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When false or bound to a false ObservableBoolean, the button is hidden. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/DividerOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/DividerOptions.md. # Interface: DividerOptions **`Beta`** 用于配置 CustomForm 中分隔线组件的选项。 Options for configuring a divider component in a CustomForm. ## Properties ### visible? > `optional` **visible?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks 当为 `false` 或绑定到一个值为 `false` 的 `ObservableBoolean` 时,分隔线会被隐藏。 When false or bound to a false ObservableBoolean, the divider is hidden. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/DropdownItemData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/DropdownItemData.md. # Interface: DropdownItemData **`Beta`** 表示下拉组件中的单个选项。 Represents a single item in a dropdown component. ## Properties ### description? > `optional` **description?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks 当选中此项时,显示在下拉框周围的描述文本。 Optional descriptive text shown around the dropdown when this item is selected. *** ### label > **label**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks 在下拉列表中为此选项显示的文本。 The text displayed for this item in the dropdown list. *** ### value > **value**: `number` **`Beta`** #### Remarks 与此下拉选项关联的数值。当玩家选择此项时,绑定的 `ObservableNumber` 将被设置为该值。 The numeric value associated with this dropdown item. This is the value the bound ObservableNumber will be set to when the player selects this item. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/DropdownOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/DropdownOptions.md. # Interface: DropdownOptions **`Beta`** Options for configuring a dropdown component. ## Properties ### description? > `optional` **description?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Descriptive text shown around the dropdown to provide additional context. *** ### disabled? > `optional` **disabled?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When true or bound to a true ObservableBoolean, the dropdown is shown but cannot be changed. *** ### tooltip? > `optional` **tooltip?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Text shown in a tooltip when the player hovers over the dropdown. *** ### visible? > `optional` **visible?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When false or bound to a false ObservableBoolean, the dropdown is hidden. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/ImageDetails.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/ImageDetails.md. # Interface: ImageDetails **`Beta`** Details of an image to display. ## Properties ### imagePackId > **imagePackId**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) **`Beta`** #### Remarks Identifier of the resource pack that provides the imageSrc asset. *** ### imageSrc > **imageSrc**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) **`Beta`** #### Remarks Path to an image displayed. Loads the image based on the resource pack defined by imagePack. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/ImageOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/ImageOptions.md. # Interface: ImageOptions **`Beta`** Options for configuring an image component. ## Properties ### onClick? > `optional` **onClick?**: () => `void` **`Beta`** #### Returns `void` #### Remarks Sets a callback to be executed when the image is clicked. *** ### tooltip? > `optional` **tooltip?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Sets a tooltip to be displayed when the user hovers over the image. *** ### visible? > `optional` **visible?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When false or bound to a false ObservableBoolean, the image is hidden. *** ### width? > `optional` **width?**: `number` | [`ObservableNumber`](/server-ui/classes/ObservableNumber.md) **`Beta`** #### Remarks Sets the width of the image as a percentage of the width of the form. 1 is the entire form width, 0.5 is half of the form width. Greater than 1 or less than/equal to 0 will become 1. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/MessageBoxButtonOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/MessageBoxButtonOptions.md. # Interface: MessageBoxButtonOptions **`Beta`** Options for configuring a message box button. ## Properties ### imageDetails? > `optional` **imageDetails?**: [`ImageDetails`](/server-ui/interfaces/ImageDetails.md) **`Beta`** #### Remarks Details of an image to display alongside the button label. *** ### tooltip? > `optional` **tooltip?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Text shown in a tooltip when the player hovers over the button. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/MessageBoxResult.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/MessageBoxResult.md. # Interface: MessageBoxResult **`Beta`** 当 MessageBox 关闭时返回的结果。包含消息框关闭的原因以及玩家选择的按钮(如果适用)。 The result returned when an MessageBox is closed. Contains the reason the message box was closed and the player's button selection, if applicable. ## Properties ### closeReason > **closeReason**: [`DataDrivenScreenClosedReason`](/server-ui/enums/DataDrivenScreenClosedReason.md) **`Beta`** #### Remarks 消息框关闭的原因。 The reason the message box was closed. *** ### selection? > `optional` **selection?**: `number` **`Beta`** #### Remarks 玩家所选择按钮的索引。如果消息框在没有按钮选择的情况下关闭(例如,玩家正忙或服务器关闭了它),则不设置此值。 The index of the button the player selected. Not set if the message box was closed without a button selection (e.g., the player was busy or the server closed it). [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/ModalFormDataDropdownOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/ModalFormDataDropdownOptions.md. # Interface: ModalFormDataDropdownOptions **`Beta`** 传递给 [@minecraft/Server-ui.ModalFormData.dropdown](/server-ui/classes/ModalFormData.md#dropdown) 的接口,为下拉列表的创建提供额外的选项。 An interface that is passed into [@minecraft/Server-ui.ModalFormData.dropdown](/server-ui/classes/ModalFormData.md#dropdown) to provide additional options for the dropdown creation. ## Properties ### defaultValueIndex? > `optional` **defaultValueIndex?**: `number` **`Beta`** #### Remarks 默认选中的选项索引。如果未设置此值,则为零。 The default selected item index. It will be zero in case of not setting this value. *** ### tooltip? > `optional` **tooltip?**: `any` **`Beta`** #### Remarks 将显示一个感叹号图标,当悬停在该图标上时会显示工具提示。 It will show an exclamation icon that will display a tooltip if it is hovered. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/ModalFormDataSliderOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/ModalFormDataSliderOptions.md. # Interface: ModalFormDataSliderOptions **`Beta`** 传递给 [@minecraft/Server-ui.ModalFormData.slider](/server-ui/classes/ModalFormData.md#slider) 的接口,为滑块的创建提供额外的选项。 An interface that is passed into [@minecraft/Server-ui.ModalFormData.slider](/server-ui/classes/ModalFormData.md#slider) to provide additional options for the slider creation. ## Properties ### defaultValue? > `optional` **defaultValue?**: `number` **`Beta`** #### Remarks 滑块的默认值。 The default value for the slider. *** ### tooltip? > `optional` **tooltip?**: `any` **`Beta`** #### Remarks 将显示一个感叹号图标,当悬停在该图标上时会显示工具提示。 It will show an exclamation icon that will display a tooltip if it is hovered. *** ### valueStep? > `optional` **valueStep?**: `number` **`Beta`** #### Remarks 定义滑块移动时生成值的增量。如果未提供此值,则为 `1`。 Defines the increment of values that the slider generates when moved. It will be '1' in case of not providing this. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/ModalFormDataTextFieldOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/ModalFormDataTextFieldOptions.md. # Interface: ModalFormDataTextFieldOptions **`Beta`** 传递给 [@minecraft/Server-ui.ModalFormData.textField](/server-ui/classes/ModalFormData.md#textfield) 的接口,为文本输入框的创建提供额外的选项。 An interface that is passed into [@minecraft/Server-ui.ModalFormData.textField](/server-ui/classes/ModalFormData.md#textfield) to provide additional options for the textfield creation. ## Properties ### defaultValue? > `optional` **defaultValue?**: `any` **`Beta`** #### Remarks 文本输入框的默认值。 The default value for the textfield. *** ### tooltip? > `optional` **tooltip?**: `any` **`Beta`** #### Remarks 将显示一个感叹号图标,当悬停在该图标上时会显示工具提示。 It will show an exclamation icon that will display a tooltip if it is hovered. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/ModalFormDataToggleOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/ModalFormDataToggleOptions.md. # Interface: ModalFormDataToggleOptions **`Beta`** 传递给 [@minecraft/Server-ui.ModalFormData.toggle](/server-ui/classes/ModalFormData.md#toggle) 的接口,为开关的创建提供额外的选项。 An interface that is passed into [@minecraft/Server-ui.ModalFormData.toggle](/server-ui/classes/ModalFormData.md#toggle) to provide additional options for the toggle creation. ## Properties ### defaultValue? > `optional` **defaultValue?**: `boolean` **`Beta`** #### Remarks 开关的默认值。 The default value for the toggle. *** ### tooltip? > `optional` **tooltip?**: `any` **`Beta`** #### Remarks 将显示一个感叹号图标,当悬停在该图标上时会显示工具提示。 It will show an exclamation icon that will display a tooltip if it is hovered. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/ObservableOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/ObservableOptions.md. # Interface: ObservableOptions **`Beta`** 用于创建 Observable 的配置选项。控制可观察值的访问和修改方式。 Configuration options for creating an Observable. Controls how the observable value can be accessed and modified. ## Properties ### clientWritable > **clientWritable**: `boolean` **`Beta`** #### Remarks 当为 `true` 时,允许客户端直接写入此可观察对象的值,从而实现 UI 与可观察对象之间的双向数据绑定。 When true, allows the client to write to this observable's value directly, enabling two-way data binding between the UI and the observable. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/SliderOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/SliderOptions.md. # Interface: SliderOptions **`Beta`** Options for configuring a slider component. ## Properties ### description? > `optional` **description?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Descriptive text shown around the slider to provide additional context. *** ### disabled? > `optional` **disabled?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When true or bound to a true ObservableBoolean, the slider is shown but cannot be moved. *** ### fixedFormatDigits? > `optional` **fixedFormatDigits?**: `number` | [`ObservableNumber`](/server-ui/classes/ObservableNumber.md) **`Beta`** #### Remarks If set, displays the number of digits after the decimal point in fixed-point notation. For example, if set to 2, the value 3.14159 will be displayed as 3.14. *** ### step? > `optional` **step?**: `number` | [`ObservableNumber`](/server-ui/classes/ObservableNumber.md) **`Beta`** #### Remarks The increment amount between each slider step. Defaults to 1 if not specified. *** ### tooltip? > `optional` **tooltip?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Text shown in a tooltip when the player hovers over the slider. *** ### visible? > `optional` **visible?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When false or bound to a false ObservableBoolean, the slider is hidden. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/SpacingOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/SpacingOptions.md. # Interface: SpacingOptions **`Beta`** 用于配置间距组件的选项。 Options for configuring a spacer component. ## Properties ### visible? > `optional` **visible?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks 当为 `false` 或绑定到一个值为 `false` 的 `ObservableBoolean` 时,间距组件会被隐藏。 When false or bound to a false ObservableBoolean, the spacer is hidden. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/TextFieldOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/TextFieldOptions.md. # Interface: TextFieldOptions **`Beta`** Options for configuring a text field component. ## Properties ### description? > `optional` **description?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Descriptive text shown around the text field label to provide additional context. *** ### disabled? > `optional` **disabled?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When true or bound to a true ObservableBoolean, the text field is shown but cannot be edited. *** ### tooltip? > `optional` **tooltip?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Text shown in a tooltip when the player hovers over the text field. *** ### visible? > `optional` **visible?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When false or bound to a false ObservableBoolean, the text field is hidden. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/TextOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/TextOptions.md. # Interface: TextOptions **`Beta`** Options for configuring a text component (label or header). ## Properties ### tooltip? > `optional` **tooltip?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** *** ### visible? > `optional` **visible?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When false or bound to a false ObservableBoolean, the text component is hidden. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/ToggleOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/ToggleOptions.md. # Interface: ToggleOptions **`Beta`** Options for configuring a toggle component. ## Properties ### description? > `optional` **description?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Descriptive text shown around the toggle to provide additional context. *** ### disabled? > `optional` **disabled?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When true or bound to a true ObservableBoolean, the toggle is shown but cannot be interacted with. *** ### tooltip? > `optional` **tooltip?**: `string` | [`ObservableString`](/server-ui/classes/ObservableString.md) | [`ObservableUIRawMessage`](/server-ui/classes/ObservableUIRawMessage.md) | [`UIRawMessage`](/server-ui/interfaces/UIRawMessage.md) **`Beta`** #### Remarks Text shown in a tooltip when the player hovers over the toggle. *** ### visible? > `optional` **visible?**: `boolean` | [`ObservableBoolean`](/server-ui/classes/ObservableBoolean.md) **`Beta`** #### Remarks When false or bound to a false ObservableBoolean, the toggle is hidden. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/interfaces/UIRawMessage.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/interfaces/UIRawMessage.md. # Interface: UIRawMessage **`Beta`** 可以发送给客户端的消息。这是 RawMessage 类型的子集,用于 UI 消息。 A message that can be sent to the client. This is a subset of the RawMessage type, and is used for UI messages. ## Properties ### rawtext? > `optional` **rawtext?**: `UIRawMessage`\[] **`Beta`** #### Remarks 提供当前消息的原始文本等价物。 Provides a raw-text equivalent of the current message. *** ### text? > `optional` **text?**: `string` **`Beta`** #### Remarks 提供要使用的字符串字面量值。 Provides a string literal value to use. *** ### translate? > `optional` **translate?**: `string` **`Beta`** #### Remarks 提供一个本地化字符串,如果客户端在玩家语言中有与本地化字符串匹配的可用资源,则会在客户端进行翻译。 Provides a localization string where, if the client has an available resource in the players' language which matches the localization string, will get translated on the client. *** ### with? > `optional` **with?**: `string`\[] | `UIRawMessage` **`Beta`** #### Remarks 本地化字符串的参数。可以是字符串数组,也可以是包含原始文本对象数组的 UIRawMessage。 Arguments for the localization string. Can be either an array of strings or UIRawMessage containing an array of raw text objects. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/enums/DataDrivenScreenClosedReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/enums/DataDrivenScreenClosedReason.md. # Enumeration: DataDrivenScreenClosedReason **`Beta`** 数据驱动 UI 界面(MessageBox 或 CustomForm)被关闭的原因。 The reason why a data driven UI screen (MessageBox or CustomForm) was closed. ## Enumeration Members ### ClientClosed > **ClientClosed**: `"ClientClosed"` **`Beta`** #### Remarks 该界面被客户端关闭(例如,玩家关闭了它,或者存在客户端授权的关闭按钮)。 The screen was closed by the client (e.g., the player dismissed it or there was a client authoritative close button). *** ### ServerClosed > **ServerClosed**: `"ServerClosed"` **`Beta`** #### Remarks 该界面被服务器关闭,很可能是通过 close API 关闭的。 The screen was closed by the server, likely by the close API. *** ### UserBusy > **UserBusy**: `"UserBusy"` **`Beta`** #### Remarks 由于玩家正忙于另一个 UI 交互,无法显示该界面。 The screen could not be shown because the player was busy with another UI interaction. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/enums/FormCancelationReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/enums/FormCancelationReason.md. # Enumeration: FormCancelationReason **`Beta`** 一个枚举,表示表单被取消的原因。 An enum representing the reasons why a form was canceled. ## Enumeration Members ### UserBusy > **UserBusy**: `"UserBusy"` **`Beta`** #### Remarks 由于玩家正忙于另一个 UI 交互,表单被取消。 The form was canceled because the player was busy with another UI interaction. *** ### UserClosed > **UserClosed**: `"UserClosed"` **`Beta`** #### Remarks 由于玩家关闭了表单,表单被取消。 The form was canceled because the player closed it. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/enums/FormRejectReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/enums/FormRejectReason.md. # Enumeration: FormRejectReason **`Beta`** 一个枚举,表示表单被拒绝的原因。 An enum representing the reasons why a form was rejected. ## Enumeration Members ### MalformedResponse > **MalformedResponse**: `"MalformedResponse"` **`Beta`** #### Remarks 由于来自客户端的响应格式错误或无法解析,表单被拒绝。 The form was rejected because the response from the client was malformed or could not be parsed. *** ### PlayerQuit > **PlayerQuit**: `"PlayerQuit"` **`Beta`** #### Remarks 由于玩家在响应前退出了游戏,表单被拒绝。 The form was rejected because the player quit the game before responding. *** ### ServerShutdown > **ServerShutdown**: `"ServerShutdown"` **`Beta`** #### Remarks 由于在玩家响应前服务器关闭,表单被拒绝。 The form was rejected because the server shut down before the player responded. [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/enums/FormVisibilityErrorReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/enums/FormVisibilityErrorReason.md. # Enumeration: FormVisibilityErrorReason error **`Beta`** 表单可见性操作失败的原因。 The reason why a form visibility operation failed. ## Enumeration Members ### AlreadyShowing > **AlreadyShowing**: `"AlreadyShowing"` **`Beta`** #### Remarks 由于表单已在向玩家显示,操作失败。 The operation failed because the form is already being shown to the player. *** ### NotShowing > **NotShowing**: `"NotShowing"` **`Beta`** #### Remarks 由于表单当前未向玩家显示,操作失败。 The operation failed because the form is not currently being shown to the player. ## 同领域相关 - [FormRejectError](/server-ui/classes/FormRejectError.md) - [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) - [InvalidFormError](/server-ui/classes/InvalidFormError.md) - [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) - [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) - [PlayerLeftError](/server-ui/classes/PlayerLeftError.md) [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/enums/TextFilteringError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/enums/TextFilteringError.md. # Enumeration: TextFilteringError error **`Beta`** 一个枚举,表示文本过滤过程中可能发生的错误。它用于提供关于过滤过程的更多上下文。 An enum representing the errors that can occur during text filtering. This is used to provide more context about the filtering process. ## Enumeration Members ### DisabledByPlayer > **DisabledByPlayer**: `"DisabledByPlayer"` **`Beta`** #### Remarks 由于玩家在其设置中禁用了文本过滤,文本未被过滤。 The text was not filtered because the player disabled text filtering in their settings. *** ### TextProcessorServiceUnreachable > **TextProcessorServiceUnreachable**: `"TextProcessorServiceUnreachable"` **`Beta`** #### Remarks 由于服务不可达,文本未被过滤。这可能发生在网络问题或服务停机维护时。 The text was not filtered because the service is unreachable. This can occur if there are network issues or if the service is down for maintenance. *** ### Unknown > **Unknown**: `"Unknown"` **`Beta`** #### Remarks 文本过滤期间发生了未知错误。这可能发生在文本过滤服务出现意外问题,或者服务返回了一个未归类到其他错误类型的错误时。 An unknown error occurred during text filtering. This can occur if there is an unexpected issue with the text filtering service or if the service returns an error that is not categorized under the other error types. ## 同领域相关 - [FormRejectError](/server-ui/classes/FormRejectError.md) - [FormVisibilityError](/server-ui/classes/FormVisibilityError.md) - [FormVisibilityErrorReason](/server-ui/enums/FormVisibilityErrorReason.md) - [InvalidFormError](/server-ui/classes/InvalidFormError.md) - [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError.md) - [InvalidObservableError](/server-ui/classes/InvalidObservableError.md) [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /server-ui/variables/uiManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-ui/variables/uiManager.md. # Variable: uiManager > `const` **uiManager**: [`UIManager`](/server-ui/classes/UIManager.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-ui) --- url: /math/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/index.md. # Module: math ## Classes - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AABBUtils](/math/classes/AABBUtils.md) - [Vector2Builder](/math/classes/Vector2Builder.md) - [Vector2Utils](/math/classes/Vector2Utils.md) - [Vector3Builder](/math/classes/Vector3Builder.md) - [Vector3Utils](/math/classes/Vector3Utils.md) - [VectorXZBuilder](/math/classes/VectorXZBuilder.md) - [VectorXZUtils](/math/classes/VectorXZUtils.md) ## Variables - [Colors](/math/variables/Colors.md) - [VECTOR2\_ZERO](/math/variables/VECTOR2_ZERO.md) - [VECTOR3\_BACK](/math/variables/VECTOR3_BACK.md) - [VECTOR3\_DOWN](/math/variables/VECTOR3_DOWN.md) - [VECTOR3\_EAST](/math/variables/VECTOR3_EAST.md) - [VECTOR3\_FORWARD](/math/variables/VECTOR3_FORWARD.md) - [VECTOR3\_HALF](/math/variables/VECTOR3_HALF.md) - [VECTOR3\_LEFT](/math/variables/VECTOR3_LEFT.md) - [VECTOR3\_NEGATIVE\_ONE](/math/variables/VECTOR3_NEGATIVE_ONE.md) - [VECTOR3\_NORTH](/math/variables/VECTOR3_NORTH.md) - [VECTOR3\_ONE](/math/variables/VECTOR3_ONE.md) - [VECTOR3\_RIGHT](/math/variables/VECTOR3_RIGHT.md) - [VECTOR3\_SOUTH](/math/variables/VECTOR3_SOUTH.md) - [VECTOR3\_UP](/math/variables/VECTOR3_UP.md) - [VECTOR3\_WEST](/math/variables/VECTOR3_WEST.md) - [VECTOR3\_ZERO](/math/variables/VECTOR3_ZERO.md) - [VECTORXZ\_ZERO](/math/variables/VECTORXZ_ZERO.md) ## Functions - [clampNumber](/math/functions/clampNumber.md) --- url: /math/classes/AABBInvalidExtentError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/classes/AABBInvalidExtentError.md. # Class: AABBInvalidExtentError error 在 AABBUtils 操作中使用无效 AABB 时抛出的错误。 An error that is thrown when using an invalid AABB with AABBUtils operations. ## Extends - `Error` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new AABBInvalidExtentError**(`extent`): `AABBInvalidExtentError` #### Parameters ##### extent `Vector3` #### Returns `AABBInvalidExtentError` #### Overrides `Error.constructor` ## Properties ### cause? > `optional` **cause?**: `unknown` #### Inherited from `Error.cause` *** ### message > **message**: `string` #### Inherited from `Error.message` *** ### name > **name**: `string` #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/classes/AABBUtils.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/classes/AABBUtils.md. # Class: AABBUtils 对 AABB 对象执行操作的实用工具类。所有方法均为静态方法,且不会修改输入对象。 Utilities operating on AABB objects. All methods are static and do not modify the input objects. ## Properties ### EPSILON > `static` **EPSILON**: `number` EPSILON 内部 epsilon 值,用于确定有效性以及设置方块体积容差。 The internal epsilon value that determines validity and used for block volume tolerance. ## Methods ### createFromCornerPoints() > `static` **createFromCornerPoints**(`pointA`, `pointB`): `AABB` createFromCornerPoints 根据定义其角点的点获取 AABB,点的顺序不限。 Gets an AABB from points defining it's corners, the order doesn't matter. #### Parameters ##### pointA `Vector3` 第一个角点。 The first corner point. ##### pointB `Vector3` 第二个角点。 The second corner point. #### Returns `AABB` - 生成的 AABB。 The resulting AABB. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if the resulting AABB is invalid. *** ### dilate() > `static` **dilate**(`aabb`, `size`): `AABB` dilate 根据源 AABB 和膨胀向量创建膨胀后的 AABB。 Creates a dilated AABB given a source AABB and dilation vector. #### Parameters ##### aabb `AABB` 源 AABB。 The source AABB. ##### size `Vector3` 要加到 AABB 范围上的膨胀向量。 The dilation vector to add to the AABBs extent. #### Returns `AABB` - 膨胀后的 AABB。 The resulting dilated AABB. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if the input AABB is invalid. *** ### equals() > `static` **equals**(`aabb`, `other`): `boolean` equals 比较两个 AABB 是否相等。 Compares the equality of two AABBs. #### Parameters ##### aabb `AABB` 用于比较的第一个 AABB。 The first AABB in the comparison. ##### other `AABB` 用于比较的第二个 AABB。 The second AABB in the comparison. #### Returns `boolean` - 如果两个 AABB 的中心点和范围均相等,则为 true。 True if the center and extent of both AABBs are equal. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if either of the input AABBs are invalid. *** ### expand() > `static` **expand**(`aabb`, `other`): `AABB` expand 根据两个源 AABB 创建扩展后的 AABB。 Creates an expanded AABB given two source AABBs. #### Parameters ##### aabb `AABB` 第一个源 AABB。 The first source AABB. ##### other `AABB` 第二个源 AABB。 The second source AABB. #### Returns `AABB` - 扩展后的 AABB。 The resulting expanded AABB. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if either of the input AABBs are invalid. *** ### getBlockVolume() > `static` **getBlockVolume**(`aabb`): `BlockVolume` getBlockVolume 创建包含源 AABB 全部范围的最小 BlockVolume。 Creates the smallest BlockVolume that includes all of a source AABB. #### Parameters ##### aabb `AABB` 源 AABB。 The source AABB. #### Returns `BlockVolume` - 包含源 AABB 的 BlockVolume。 The BlockVolume containing the source AABB. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if the input AABB is invalid. *** ### getIntersection() > `static` **getIntersection**(`aabb`, `other`): `any` getIntersection 创建两个源 AABB 相交区域的 AABB。 Creates an AABB of the intersecting area of two source AABBs. #### Parameters ##### aabb `AABB` 第一个源 AABB。 The first source AABB. ##### other `AABB` 第二个源 AABB。 The second source AABB. #### Returns `any` - 如果两个 AABB 相交,则返回相交区域的 AABB;否则返回 undefined。 The resulting intersecting AABB if they intersect, otherwise returns undefined. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if either of the input AABBs are invalid. *** ### getMax() > `static` **getMax**(`aabb`): `Vector3` getMax 获取 AABB 的最大角点。 Gets the maximum corner of an AABB. #### Parameters ##### aabb `AABB` 要获取最大角点的 AABB。 The AABB to retrieve the maximum corner of. #### Returns `Vector3` - AABB 的最大角点。 The maximum corner of the AABB. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if the input AABB is invalid. *** ### getMin() > `static` **getMin**(`aabb`): `Vector3` getMin 获取 AABB 的最小角点。 Gets the minimum corner of an AABB. #### Parameters ##### aabb `AABB` 要获取最小角点的 AABB。 The AABB to retrieve the minimum corner of. #### Returns `Vector3` - AABB 的最小角点。 The minimum corner of the AABB. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if the input AABB is invalid. *** ### getSpan() > `static` **getSpan**(`aabb`): `Vector3` getSpan 获取 AABB 的跨度。 Gets the span of an AABB. #### Parameters ##### aabb `AABB` 要获取跨度的 AABB。 The AABB to retrieve the span of. #### Returns `Vector3` - AABB 的跨度。 The span of the AABB. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if the input AABB is invalid. *** ### intersects() > `static` **intersects**(`aabb`, `other`): `boolean` intersects 计算两个 AABB 是否相交。 Calculates if two AABBs are intersecting. #### Parameters ##### aabb `AABB` 第一个 AABB。 The first AABB. ##### other `AABB` 第二个 AABB。 The second AABB. #### Returns `boolean` - 如果两个 AABB 相交,则为 true;否则为 false。 True if the AABBs are intersecting, otherwise false. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if either of the input AABBs are invalid. *** ### isInside() > `static` **isInside**(`aabb`, `pos`): `boolean` isInside 计算某个位置是否位于 AABB 内部。 Calculates if a position is inside of an AABB. #### Parameters ##### aabb `AABB` 用于测试的 AABB。 The AABB to test against. ##### pos `Vector3` 要测试的位置。 The position to test. #### Returns `boolean` 如果位置位于 AABB 内部,则为 true;否则返回 false。 True if the position is inside of the AABB, otherwise returns false. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if the input AABB is invalid. *** ### isValid() > `static` **isValid**(`aabb`): `boolean` isValid 确定 AABB 是否在所有轴上都具有非零范围。 Determines if the AABB has non-zero extent on all axes. #### Parameters ##### aabb `AABB` 要测试有效性的 AABB。 The AABB to test for validity. #### Returns `boolean` - 如果所有范围轴均非零,则为 true;否则为 false。 True if all extent axes are non-zero, otherwise false. *** ### throwErrorIfInvalid() > `static` **throwErrorIfInvalid**(`aabb`): `void` throwErrorIfInvalid 如果 AABB 无效,则抛出错误。 Throws an error if the AABB is invalid. #### Parameters ##### aabb `AABB` 要测试有效性的 AABB。 The AABB to test for validity. #### Returns `void` #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if the input AABB is invalid. *** ### translate() > `static` **translate**(`aabb`, `delta`): `AABB` translate 根据源 AABB 和平移向量创建平移后的 AABB。 Creates a translated AABB given a source AABB and translation vector. #### Parameters ##### aabb `AABB` 源 AABB。 The source AABB. ##### delta `Vector3` 要加到 AABB 中心点上的平移向量。 The translation vector to add to the AABBs center. #### Returns `AABB` - 平移后的 AABB。 The resulting translated AABB. #### Throws [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) This exception is thrown if the input AABB is invalid. [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/classes/Vector2Builder.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/classes/Vector2Builder.md. # Class: Vector2Builder Vector2 wrapper class which can be used as a Vector2 for APIs on @minecraft/server which require a Vector2. 用于 @minecraft/server 中需要用到 Vector2 的 API 的 Vector2 包装类。 ## Implements - `unknown` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new Vector2Builder**(`vecStr`, `delim?`): `Vector2Builder` #### Parameters ##### vecStr `string` ##### delim? `string` #### Returns `Vector2Builder` ### Constructor \{#constructor} > **new Vector2Builder**(`vec`, `arg?`): `Vector2Builder` #### Parameters ##### vec `Vector2` ##### arg? `undefined` #### Returns `Vector2Builder` ### Constructor \{#constructor} > **new Vector2Builder**(`x`, `y`): `Vector2Builder` #### Parameters ##### x `number` ##### y `number` #### Returns `Vector2Builder` ## Properties ### x > **x**: `number` *** ### y > **y**: `number` ## Methods ### add() > **add**(`v`): `this` add 将向量 v 加到本向量上,返回自身。 Adds the vector v to this, returning itself. #### Parameters ##### v `Vector2` #### Returns `this` *** ### assign() > **assign**(`vec`): `this` 将传入向量的各分量值赋值给本向量,返回自身。 Assigns the values of the passed in vector to this vector. Returns itself. #### Parameters ##### vec `Vector2` #### Returns `this` *** ### clamp() > **clamp**(`limits`): `this` clamp 将向量的各分量限制在指定的上下限范围内,返回自身。 Clamps the components of a vector to limits to produce a new vector #### Parameters ##### limits ###### max? `any` ###### min? `any` #### Returns `this` *** ### distance() > **distance**(`vec`): `number` distance 计算两个向量之间的距离。 Calculate the distance between two vectors #### Parameters ##### vec `Vector2` #### Returns `number` *** ### dot() > **dot**(`vec`): `number` dot 计算本向量与传入向量的点积。 Computes the dot product of this and the passed in vector. #### Parameters ##### vec `Vector2` #### Returns `number` *** ### equals() > **equals**(`v`): `boolean` equals 判断两个向量是否相等。 Check the equality of two vectors #### Parameters ##### v `Vector2` #### Returns `boolean` *** ### floor() > **floor**(): `this` floor 将向量的各分量向下取整,返回自身。 Floor the components of a vector to produce a new vector #### Returns `this` *** ### lerp() > **lerp**(`vec`, `t`): `this` lerp 使用两个向量各分量的线性插值构造一个新向量,返回自身。 Constructs a new vector using linear interpolation on each component from two vectors. #### Parameters ##### vec `Vector2` ##### t `number` #### Returns `this` *** ### magnitude() > **magnitude**(): `number` magnitude 向量的模长。 The magnitude of the vector #### Returns `number` *** ### multiply() > **multiply**(`vec`): `this` multiply 对两个向量进行逐分量相乘。 注意不要与 [Vector2Builder.dot](#dot)(点积)混淆。 Element-wise multiplication of two vectors together. Not to be confused with [Vector2Builder.dot](#dot) product #### Parameters ##### vec `Vector2` #### Returns `this` *** ### normalize() > **normalize**(): `this` normalize 将本向量归一化,返回自身。 Normalizes this vector, returning itself. #### Returns `this` *** ### scale() > **scale**(`val`): `this` scale 将本向量按传入的数值进行缩放,返回自身。 Scales this by the passed in value, returning itself. #### Parameters ##### val `number` #### Returns `this` *** ### slerp() > **slerp**(`vec`, `t`): `this` slerp 使用两个向量各分量的球面线性插值构造一个新向量,返回自身。 Constructs a new vector using spherical linear interpolation on each component from two vectors. #### Parameters ##### vec `Vector2` ##### t `number` #### Returns `this` *** ### subtract() > **subtract**(`v`): `this` subtract 从本向量中减去向量 v,返回自身。 Subtracts the vector v from this, returning itself. #### Parameters ##### v `Vector2` #### Returns `this` *** ### toString() > **toString**(`options?`): `string` #### Parameters ##### options? ###### decimals? `number` ###### delimiter? `string` #### Returns `string` [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/classes/Vector2Utils.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/classes/Vector2Utils.md. # Class: Vector2Utils Utilities operating on Vector2 objects. All methods are static and do not modify the input objects. 操作 Vector2 对象的工具类。所有方法都是静态的,并且不会修改输入对象。 ## Constructors \{#constructors} ### Constructor \{#constructor} > **new Vector2Utils**(): `Vector2Utils` #### Returns `Vector2Utils` ## Methods ### add() > `static` **add**(`v1`, `v2`): `Vector2` add 将两个向量相加,生成一个新向量。 Add two vectors to produce a new vector #### Parameters ##### v1 `Vector2` ##### v2 `Vector2` #### Returns `Vector2` *** ### clamp() > `static` **clamp**(`v`, `limits?`): `Vector2` clamp 将向量的各分量限制在指定的上下限范围内,生成一个新向量。 Clamps the components of a vector to limits to produce a new vector #### Parameters ##### v `Vector2` ##### limits? ###### max? `any` ###### min? `any` #### Returns `Vector2` *** ### distance() > `static` **distance**(`a`, `b`): `number` distance 计算两个向量之间的距离。 Calculate the distance between two vectors #### Parameters ##### a `Vector2` ##### b `Vector2` #### Returns `number` *** ### dot() > `static` **dot**(`a`, `b`): `number` dot 计算两个向量的点积。 Calculate the dot product of two vectors #### Parameters ##### a `Vector2` ##### b `Vector2` #### Returns `number` *** ### equals() > `static` **equals**(`v1`, `v2`): `boolean` equals 判断两个向量是否相等。 Check the equality of two vectors #### Parameters ##### v1 `Vector2` ##### v2 `Vector2` #### Returns `boolean` *** ### floor() > `static` **floor**(`v`): `Vector2` floor 将向量的各分量向下取整,生成一个新向量。 Floor the components of a vector to produce a new vector #### Parameters ##### v `Vector2` #### Returns `Vector2` *** ### fromString() > `static` **fromString**(`str`, `delimiter?`): `any` fromString 从 [Vector2Utils.toString](#tostring) 生成的字符串形式中解析出一个 Vector2。 如果任何数值不是数字或格式无效,则返回 undefined。 Gets a Vector2 from the string representation produced by [Vector2Utils.toString](#tostring). If any numeric value is not a number or the format is invalid, undefined is returned. #### Parameters ##### str `string` 要解析的字符串 The string to parse ##### delimiter? `string` 用于分隔各分量的分隔符。默认与 [Vector2Utils.toString](#tostring) 的默认值相同。 The delimiter used to separate the components. Defaults to the same as the default for [Vector2Utils.toString](#tostring) #### Returns `any` *** ### lerp() > `static` **lerp**(`a`, `b`, `t`): `Vector2` lerp 使用两个向量各分量的线性插值构造一个新向量。 Constructs a new vector using linear interpolation on each component from two vectors. #### Parameters ##### a `Vector2` ##### b `Vector2` ##### t `number` #### Returns `Vector2` *** ### magnitude() > `static` **magnitude**(`v`): `number` magnitude 向量的模长。 The magnitude of a vector #### Parameters ##### v `Vector2` #### Returns `number` *** ### multiply() > `static` **multiply**(`a`, `b`): `Vector2` multiply 对两个向量进行逐分量相乘。 注意不要与 [Vector2Utils.dot](#dot)(点积)混淆。 Element-wise multiplication of two vectors together. Not to be confused with [Vector2Utils.dot](#dot) product #### Parameters ##### a `Vector2` ##### b `Vector2` #### Returns `Vector2` *** ### normalize() > `static` **normalize**(`v`): `Vector2` normalize 将一个二维向量归一化为单位向量。 Takes a vector 3 and normalizes it to a unit vector #### Parameters ##### v `Vector2` #### Returns `Vector2` *** ### scale() > `static` **scale**(`v1`, `scale`): `Vector2` scale 将向量中的所有分量乘以一个标量值,生成一个新向量。 Multiple all entries in a vector by a single scalar value producing a new vector #### Parameters ##### v1 `Vector2` ##### scale `number` #### Returns `Vector2` *** ### slerp() > `static` **slerp**(`a`, `b`, `t`): `Vector2` slerp 使用两个向量各分量的球面线性插值构造一个新向量。 Constructs a new vector using spherical linear interpolation on each component from two vectors. #### Parameters ##### a `Vector2` ##### b `Vector2` ##### t `number` #### Returns `Vector2` *** ### subtract() > `static` **subtract**(`v1`, `v2`): `Vector2` subtract 将两个向量相减,生成一个新向量 (v1-v2)。 Subtract two vectors to produce a new vector (v1-v2) #### Parameters ##### v1 `Vector2` ##### v2 `Vector2` #### Returns `Vector2` *** ### toString() > `static` **toString**(`v`, `options?`): `string` toString 创建 Vector2 的字符串表示形式。 Create a string representation of a vector2 将 Vector2 转换为字符串形式。 #### Parameters ##### v `Vector2` ##### options? ###### decimals? `number` ###### delimiter? `string` #### Returns `string` [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/classes/Vector3Builder.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/classes/Vector3Builder.md. # Class: Vector3Builder Vector3 wrapper class which can be used as a Vector3 for APIs on @minecraft/server which require a Vector, but also contain additional helper methods. This is an alternative to using the core Vector 3 utility methods directly, for those who prefer a more object-oriented approach. This version of the class is mutable and changes state inline. For an immutable version of the build, use ImmutableVector3Builder. 用于 @minecraft/server 中需要用到三维向量的 API 的 Vector3 包装类,同时也包含额外的帮助方法。 这是对直接使用核心 Vector 3 实用方法的一种替代,适用于偏好面向对象方法的人。 此类的该版本是可变的,并且在内联中会更改状态。 若要使用构建的不可变版本,请使用 ImmutableVector3Builder。 ## Implements - `unknown` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new Vector3Builder**(`vecStr`, `delim?`, `arg2?`): `Vector3Builder` #### Parameters ##### vecStr `string` ##### delim? `string` ##### arg2? `undefined` #### Returns `Vector3Builder` ### Constructor \{#constructor} > **new Vector3Builder**(`vec`, `arg?`, `arg2?`): `Vector3Builder` #### Parameters ##### vec `Vector3` ##### arg? `undefined` ##### arg2? `undefined` #### Returns `Vector3Builder` ### Constructor \{#constructor} > **new Vector3Builder**(`x`, `y`, `z`): `Vector3Builder` #### Parameters ##### x `number` ##### y `number` ##### z `number` #### Returns `Vector3Builder` ## Properties ### x > **x**: `number` *** ### y > **y**: `number` *** ### z > **z**: `number` ## Methods ### add() > **add**(`v`): `this` add Adds the vector v to this, returning itself. 将向量 v 加到当前向量上,返回自身。 #### Parameters ##### v `Vector3` #### Returns `this` *** ### assign() > **assign**(`vec`): `this` Assigns the values of the passed in vector to this vector. Returns itself. 将传入向量的值赋给此向量。返回自身。 #### Parameters ##### vec `Vector3` #### Returns `this` *** ### ceil() > **ceil**(): `this` ceil Ceil the components of a vector to produce a new vector 对向量的各个分量向上取整,生成新的向量。 #### Returns `this` *** ### clamp() > **clamp**(`limits`): `this` clamp Clamps the components of a vector to limits to produce a new vector 将向量的各个分量钳制在一定范围内,生成新的向量。 #### Parameters ##### limits ###### max? `any` ###### min? `any` #### Returns `this` *** ### cross() > **cross**(`vec`): `this` cross Computes the cross product of this and the passed in vector, returning itself. 计算此向量与传入向量的叉积,返回自身。 #### Parameters ##### vec `Vector3` #### Returns `this` *** ### distance() > **distance**(`vec`): `number` distance Calculate the distance between two vectors 计算两个向量之间的距离。 #### Parameters ##### vec `Vector3` #### Returns `number` *** ### dot() > **dot**(`vec`): `number` dot Computes the dot product of this and the passed in vector. 计算此向量与传入向量的点积。 #### Parameters ##### vec `Vector3` #### Returns `number` *** ### equals() > **equals**(`v`): `boolean` equals Check the equality of two vectors 检查两个向量是否相等。 #### Parameters ##### v `Vector3` #### Returns `boolean` *** ### floor() > **floor**(): `this` floor Floor the components of a vector to produce a new vector 对向量的各个分量向下取整,生成新的向量。 #### Returns `this` *** ### lerp() > **lerp**(`vec`, `t`): `this` lerp Constructs a new vector using linear interpolation on each component from two vectors. 使用在两个向量的每个分量上的线性插值构造新的向量。 #### Parameters ##### vec `Vector3` ##### t `number` #### Returns `this` *** ### magnitude() > **magnitude**(): `number` magnitude The magnitude of the vector 返回向量的模长。 #### Returns `number` *** ### max() > **max**(`vec`): `this` max Max the components of two vectors to produce a new vector 取两个向量各分量中的较大值,生成新的向量。 #### Parameters ##### vec `Vector3` #### Returns `this` *** ### min() > **min**(`vec`): `this` min Min the components of two vectors to produce a new vector 取两个向量各分量中的较小值,生成新的向量。 #### Parameters ##### vec `Vector3` #### Returns `this` *** ### multiply() > **multiply**(`vec`): `this` multiply 对两个向量进行逐元素相乘。 不要与 [Vector3Builder.dot](#dot) 点积或 [Vector3Builder.cross](#cross) 叉积混淆。 Element-wise multiplication of two vectors together. Not to be confused with [Vector3Builder.dot](#dot) product or [Vector3Builder.cross](#cross) product #### Parameters ##### vec `Vector3` #### Returns `this` *** ### normalize() > **normalize**(): `this` normalize Normalizes this vector, returning itself. 归一化此向量,返回自身。 #### Returns `this` *** ### rotateX() > **rotateX**(`a`): `this` rotateX 沿 x 轴逆时针(左手法则)旋转该向量。 Rotates the vector around the x axis counterclockwise (left hand rule) #### Parameters ##### a `number` Angle in radians #### Returns `this` *** ### rotateY() > **rotateY**(`a`): `this` rotateY 沿 y 轴逆时针(左手法则)旋转该向量。 Rotates the vector around the y axis counterclockwise (left hand rule) #### Parameters ##### a `number` Angle in radians #### Returns `this` *** ### rotateZ() > **rotateZ**(`a`): `this` rotateZ 沿 z 轴逆时针(左手法则)旋转该向量。 Rotates the vector around the z axis counterclockwise (left hand rule) #### Parameters ##### a `number` Angle in radians #### Returns `this` *** ### scale() > **scale**(`val`): `this` scale Scales this by the passed in value, returning itself. 使用传入的值数乘此向量,返回自身。 #### Parameters ##### val `number` #### Returns `this` *** ### slerp() > **slerp**(`vec`, `t`): `this` slerp Constructs a new vector using spherical linear interpolation on each component from two vectors. 使用在两个向量的每个分量上的球面线性插值构造新的向量。 #### Parameters ##### vec `Vector3` ##### t `number` #### Returns `this` *** ### subtract() > **subtract**(`v`): `this` subtract Subtracts the vector v from this, returning itself. 从此向量减去向量 v ,返回自身。 #### Parameters ##### v `Vector3` #### Returns `this` *** ### toString() > **toString**(`options?`): `string` toString Create a string representation of a vector 以指定的格式返回向量的字符串表示。 #### Parameters ##### options? ###### decimals? `number` ###### delimiter? `string` #### Returns `string` [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/classes/Vector3Utils.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/classes/Vector3Utils.md. # Class: Vector3Utils Utilities operating on Vector3 objects. All methods are static and do not modify the input objects. 操作 Vector3 对象的工具类。所有方法都是静态的,并且不会修改输入对象。 ## Constructors \{#constructors} ### Constructor \{#constructor} > **new Vector3Utils**(): `Vector3Utils` #### Returns `Vector3Utils` ## Methods ### add() > `static` **add**(`v1`, `v2`): `Vector3` add Add two vectors to produce a new vector 将两个向量相加生成一个新的向量。 #### Parameters ##### v1 `Vector3` ##### v2 `Vector3` #### Returns `Vector3` *** ### ceil() > `static` **ceil**(`v`): `Vector3` ceil Ceil the components of a vector to produce a new vector 对向量的各个分量向上取整,生成一个新的向量。 #### Parameters ##### v `Vector3` #### Returns `Vector3` *** ### clamp() > `static` **clamp**(`v`, `limits?`): `Vector3` clamp Clamps the components of a vector to limits to produce a new vector 将向量的各个分量钳制在一定范围内,生成一个新的向量。 #### Parameters ##### v `Vector3` ##### limits? ###### max? `any` ###### min? `any` #### Returns `Vector3` *** ### cross() > `static` **cross**(`a`, `b`): `Vector3` cross Calculate the cross product of two vectors. Returns a new vector. 计算两个向量的叉积。返回一个新的向量。 #### Parameters ##### a `Vector3` ##### b `Vector3` #### Returns `Vector3` *** ### distance() > `static` **distance**(`a`, `b`): `number` distance Calculate the distance between two vectors 计算两个向量之间的距离。 #### Parameters ##### a `Vector3` ##### b `Vector3` #### Returns `number` *** ### dot() > `static` **dot**(`a`, `b`): `number` dot Calculate the dot product of two vectors 计算两个向量的点积。 #### Parameters ##### a `Vector3` ##### b `Vector3` #### Returns `number` *** ### equals() > `static` **equals**(`v1`, `v2`): `boolean` equals Check the equality of two vectors 检查两个向量是否相等。 #### Parameters ##### v1 `Vector3` ##### v2 `Vector3` #### Returns `boolean` *** ### floor() > `static` **floor**(`v`): `Vector3` floor Floor the components of a vector to produce a new vector 对向量的各个分量向下取整,生成一个新的向量。 #### Parameters ##### v `Vector3` #### Returns `Vector3` *** ### fromString() > `static` **fromString**(`str`, `delimiter?`): `any` fromString 从 [Vector3Utils.toString](#tostring) 产生的字符串表示中解析出 Vector3。若任一数值不是数字或格式无效,则返回 undefined。 Gets a Vector3 from the string representation produced by [Vector3Utils.toString](#tostring). If any numeric value is not a number or the format is invalid, undefined is returned. #### Parameters ##### str `string` The string to parse ##### delimiter? `string` The delimiter used to separate the components. Defaults to the same as the default for [Vector3Utils.toString](#tostring) #### Returns `any` *** ### lerp() > `static` **lerp**(`a`, `b`, `t`): `Vector3` lerp Constructs a new vector using linear interpolation on each component from two vectors. 根据两个向量的每个分量进行线性插值,构建一个新的向量。 #### Parameters ##### a `Vector3` ##### b `Vector3` ##### t `number` #### Returns `Vector3` *** ### magnitude() > `static` **magnitude**(`v`): `number` magnitude The magnitude of a vector 返回向量的模长。 #### Parameters ##### v `Vector3` #### Returns `number` *** ### max() > `static` **max**(`a`, `b`): `Vector3` max Max the components of two vectors to produce a new vector 取两个向量各分量中的较大值,生成一个新的向量。 #### Parameters ##### a `Vector3` ##### b `Vector3` #### Returns `Vector3` *** ### min() > `static` **min**(`a`, `b`): `Vector3` min Min the components of two vectors to produce a new vector 取两个向量各分量中的较小值,生成一个新的向量。 #### Parameters ##### a `Vector3` ##### b `Vector3` #### Returns `Vector3` *** ### multiply() > `static` **multiply**(`a`, `b`): `Vector3` multiply 对两个向量进行逐元素相乘。 不要与 [Vector3Utils.dot](#dot) 点积或 [Vector3Utils.cross](#cross) 叉积混淆。 Element-wise multiplication of two vectors together. Not to be confused with [Vector3Utils.dot](#dot) product or [Vector3Utils.cross](#cross) product #### Parameters ##### a `Vector3` ##### b `Vector3` #### Returns `Vector3` *** ### normalize() > `static` **normalize**(`v`): `Vector3` normalize Takes a vector 3 and normalizes it to a unit vector 将一个三维向量归一化为单位向量。 #### Parameters ##### v `Vector3` #### Returns `Vector3` *** ### rotateX() > `static` **rotateX**(`v`, `a`): `Vector3` rotateX 沿 x 轴逆时针(左手法则)旋转该向量。 Rotates the vector around the x axis counterclockwise (left hand rule) #### Parameters ##### v `Vector3` ##### a `number` Angle in radians #### Returns `Vector3` *** ### rotateY() > `static` **rotateY**(`v`, `a`): `Vector3` rotateY 沿 y 轴逆时针(左手法则)旋转该向量。 Rotates the vector around the y axis counterclockwise (left hand rule) #### Parameters ##### v `Vector3` ##### a `number` Angle in radians #### Returns `Vector3` *** ### rotateZ() > `static` **rotateZ**(`v`, `a`): `Vector3` rotateZ 沿 z 轴逆时针(左手法则)旋转该向量。 Rotates the vector around the z axis counterclockwise (left hand rule) #### Parameters ##### v `Vector3` ##### a `number` Angle in radians #### Returns `Vector3` *** ### scale() > `static` **scale**(`v1`, `scale`): `Vector3` scale Multiple all entries in a vector by a single scalar value producing a new vector 使用单一标量值乘以向量中的所有元素,生成一个新的向量。 #### Parameters ##### v1 `Vector3` ##### scale `number` #### Returns `Vector3` *** ### slerp() > `static` **slerp**(`a`, `b`, `t`): `Vector3` slerp Constructs a new vector using spherical linear interpolation on each component from two vectors. 根据两个向量的每个分量进行球面线性插值,构建一个新的向量。 #### Parameters ##### a `Vector3` ##### b `Vector3` ##### t `number` #### Returns `Vector3` *** ### subtract() > `static` **subtract**(`v1`, `v2`): `Vector3` subtract Subtract two vectors to produce a new vector (v1-v2) 将两个向量相减生成一个新的向量 (v1-v2)。 #### Parameters ##### v1 `Vector3` ##### v2 `Vector3` #### Returns `Vector3` *** ### toString() > `static` **toString**(`v`, `options?`): `string` toString Create a string representation of a vector3 以指定的格式返回向量的字符串表示。 #### Parameters ##### v `Vector3` ##### options? ###### decimals? `number` ###### delimiter? `string` #### Returns `string` [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/classes/VectorXZBuilder.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/classes/VectorXZBuilder.md. # Class: VectorXZBuilder VectorXZ 包装类,可在需要 VectorXZ 的 @minecraft/server API 中用作 VectorXZ。 VectorXZ wrapper class which can be used as a VectorXZ for APIs on @minecraft/server which require a VectorXZ. ## Implements - `unknown` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new VectorXZBuilder**(`vecStr`, `delim?`): `VectorXZBuilder` #### Parameters ##### vecStr `string` ##### delim? `string` #### Returns `VectorXZBuilder` ### Constructor \{#constructor} > **new VectorXZBuilder**(`vec`, `arg?`): `VectorXZBuilder` #### Parameters ##### vec `VectorXZ` ##### arg? `undefined` #### Returns `VectorXZBuilder` ### Constructor \{#constructor} > **new VectorXZBuilder**(`x`, `y`): `VectorXZBuilder` #### Parameters ##### x `number` ##### y `number` #### Returns `VectorXZBuilder` ## Properties ### x > **x**: `number` *** ### z > **z**: `number` ## Methods ### add() > **add**(`v`): `this` add 将向量 v 与当前向量相加,并返回自身。 Adds the vector v to this, returning itself. #### Parameters ##### v `VectorXZ` #### Returns `this` *** ### assign() > **assign**(`vec`): `this` 将传入向量的值赋给当前向量,并返回自身。 Assigns the values of the passed in vector to this vector. Returns itself. #### Parameters ##### vec `VectorXZ` #### Returns `this` *** ### clamp() > **clamp**(`limits`): `this` clamp 将当前向量的各分量限制在给定范围内,并返回自身。 Clamps the components of a vector to limits to produce a new vector #### Parameters ##### limits ###### max? `any` ###### min? `any` #### Returns `this` *** ### distance() > **distance**(`vec`): `number` distance 计算两个向量之间的距离。 Calculate the distance between two vectors #### Parameters ##### vec `VectorXZ` #### Returns `number` *** ### dot() > **dot**(`vec`): `number` dot 计算当前向量与传入向量的点积。 Computes the dot product of this and the passed in vector. #### Parameters ##### vec `VectorXZ` #### Returns `number` *** ### equals() > **equals**(`v`): `boolean` equals 检查两个向量是否相等。 Check the equality of two vectors #### Parameters ##### v `VectorXZ` #### Returns `boolean` *** ### floor() > **floor**(): `this` floor 对向量的各个分量向下取整,并返回自身。 Floor the components of a vector to produce a new vector #### Returns `this` *** ### lerp() > **lerp**(`vec`, `t`): `this` lerp 使用两个向量之间各分量的线性插值构造一个新向量,并返回自身。 Constructs a new vector using linear interpolation on each component from two vectors. #### Parameters ##### vec `VectorXZ` ##### t `number` #### Returns `this` *** ### magnitude() > **magnitude**(): `number` magnitude 向量的模长。 The magnitude of the vector #### Returns `number` *** ### multiply() > **multiply**(`vec`): `this` multiply 当前向量与传入向量按元素相乘,并返回自身。 不要与 [VectorXZBuilder.dot](#dot) 乘积混淆。 Element-wise multiplication of two vectors together. Not to be confused with [VectorXZBuilder.dot](#dot) product #### Parameters ##### vec `VectorXZ` #### Returns `this` *** ### normalize() > **normalize**(): `this` normalize 将当前向量归一化,并返回自身。 Normalizes this vector, returning itself. #### Returns `this` *** ### scale() > **scale**(`val`): `this` scale 将当前向量按传入的标量进行缩放,并返回自身。 Scales this by the passed in value, returning itself. #### Parameters ##### val `number` #### Returns `this` *** ### slerp() > **slerp**(`vec`, `t`): `this` slerp 使用两个向量之间各分量的球面线性插值构造一个新向量,并返回自身。 Constructs a new vector using spherical linear interpolation on each component from two vectors. #### Parameters ##### vec `VectorXZ` ##### t `number` #### Returns `this` *** ### subtract() > **subtract**(`v`): `this` subtract 从当前向量中减去向量 v,并返回自身。 Subtracts the vector v from this, returning itself. #### Parameters ##### v `VectorXZ` #### Returns `this` *** ### toString() > **toString**(`options?`): `string` #### Parameters ##### options? ###### decimals? `number` ###### delimiter? `string` #### Returns `string` [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/classes/VectorXZUtils.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/classes/VectorXZUtils.md. # Class: VectorXZUtils 对 VectorXZ 对象执行操作的实用工具类。所有方法均为静态方法,且不会修改输入对象。 Utilities operating on VectorXZ objects. All methods are static and do not modify the input objects. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new VectorXZUtils**(): `VectorXZUtils` #### Returns `VectorXZUtils` ## Methods ### add() > `static` **add**(`v1`, `v2`): `VectorXZ` add 将两个向量相加,生成一个新向量。 Add two vectors to produce a new vector #### Parameters ##### v1 `VectorXZ` ##### v2 `VectorXZ` #### Returns `VectorXZ` *** ### clamp() > `static` **clamp**(`v`, `limits?`): `VectorXZ` clamp 将向量的各个分量限制在给定范围内,生成一个新向量。 Clamps the components of a vector to limits to produce a new vector #### Parameters ##### v `VectorXZ` ##### limits? ###### max? `any` ###### min? `any` #### Returns `VectorXZ` *** ### distance() > `static` **distance**(`a`, `b`): `number` distance 计算两个向量之间的距离。 Calculate the distance between two vectors #### Parameters ##### a `VectorXZ` ##### b `VectorXZ` #### Returns `number` *** ### dot() > `static` **dot**(`a`, `b`): `number` dot 计算两个向量的点积。 Calculate the dot product of two vectors #### Parameters ##### a `VectorXZ` ##### b `VectorXZ` #### Returns `number` *** ### equals() > `static` **equals**(`v1`, `v2`): `boolean` equals 检查两个向量是否相等。 Check the equality of two vectors #### Parameters ##### v1 `VectorXZ` ##### v2 `VectorXZ` #### Returns `boolean` *** ### floor() > `static` **floor**(`v`): `VectorXZ` floor 对向量的各个分量向下取整,生成一个新向量。 Floor the components of a vector to produce a new vector #### Parameters ##### v `VectorXZ` #### Returns `VectorXZ` *** ### fromString() > `static` **fromString**(`str`, `delimiter?`): `any` fromString 从 [VectorXZUtils.toString](#tostring) 生成的字符串表示形式中获取 VectorXZ。如果任何数值不是数字,或格式无效,则返回 undefined。 Gets a VectorXZ from the string representation produced by [VectorXZUtils.toString](#tostring). If any numeric value is not a number or the format is invalid, undefined is returned. #### Parameters ##### str `string` 要解析的字符串。 The string to parse ##### delimiter? `string` 用于分隔各分量的分隔符。默认为 [VectorXZUtils.toString](#tostring) 的默认值。 The delimiter used to separate the components. Defaults to the same as the default for [VectorXZUtils.toString](#tostring) #### Returns `any` *** ### lerp() > `static` **lerp**(`a`, `b`, `t`): `VectorXZ` lerp 使用两个向量之间各分量的线性插值构造一个新向量。 Constructs a new vector using linear interpolation on each component from two vectors. #### Parameters ##### a `VectorXZ` ##### b `VectorXZ` ##### t `number` #### Returns `VectorXZ` *** ### magnitude() > `static` **magnitude**(`v`): `number` magnitude 向量的模长。 The magnitude of a vector #### Parameters ##### v `VectorXZ` #### Returns `number` *** ### multiply() > `static` **multiply**(`a`, `b`): `VectorXZ` multiply 两个向量按元素相乘。 不要与 [VectorXZUtils.dot](#dot) 乘积混淆。 Element-wise multiplication of two vectors together. Not to be confused with [VectorXZUtils.dot](#dot) product #### Parameters ##### a `VectorXZ` ##### b `VectorXZ` #### Returns `VectorXZ` *** ### normalize() > `static` **normalize**(`v`): `VectorXZ` normalize 将向量归一化为单位向量。 Takes a vector 3 and normalizes it to a unit vector #### Parameters ##### v `VectorXZ` #### Returns `VectorXZ` *** ### scale() > `static` **scale**(`v1`, `scale`): `VectorXZ` scale 将向量的所有分量乘以一个标量,生成一个新向量。 Multiple all entries in a vector by a single scalar value producing a new vector #### Parameters ##### v1 `VectorXZ` ##### scale `number` #### Returns `VectorXZ` *** ### slerp() > `static` **slerp**(`a`, `b`, `t`): `VectorXZ` slerp 使用两个向量之间各分量的球面线性插值构造一个新向量。 Constructs a new vector using spherical linear interpolation on each component from two vectors. #### Parameters ##### a `VectorXZ` ##### b `VectorXZ` ##### t `number` #### Returns `VectorXZ` *** ### subtract() > `static` **subtract**(`v1`, `v2`): `VectorXZ` subtract 将第二个向量从第一个向量中减去,生成一个新向量(v1-v2)。 Subtract two vectors to produce a new vector (v1-v2) #### Parameters ##### v1 `VectorXZ` ##### v2 `VectorXZ` #### Returns `VectorXZ` *** ### toString() > `static` **toString**(`v`, `options?`): `string` toString 创建向量的字符串表示形式。 Create a string representation of a vectorxz #### Parameters ##### v `VectorXZ` ##### options? ###### decimals? `number` ###### delimiter? `string` #### Returns `string` [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/functions/clampNumber.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/functions/clampNumber.md. # Function: clampNumber() > **clampNumber**(`val`, `min`, `max`): `number` Clamps the passed in number to the passed in min and max values. 将输入的数值钳制在给定的最小值和最大值之间。 ## Parameters ### val `number` ### min `number` ### max `number` ## Returns `number` [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/Colors.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/Colors.md. # Variable: Colors > `const` **Colors**: `object` 一组常用的颜色常量值。 A set of commonly used color constant values. ## Type Declaration ### Black > **Black**: `object` #### Black.alpha > **alpha**: `number` #### Black.blue > **blue**: `number` #### Black.green > **green**: `number` #### Black.red > **red**: `number` ### Blue > **Blue**: `object` #### Blue.alpha > **alpha**: `number` #### Blue.blue > **blue**: `number` #### Blue.green > **green**: `number` #### Blue.red > **red**: `number` ### Brown > **Brown**: `object` #### Brown.alpha > **alpha**: `number` #### Brown.blue > **blue**: `number` #### Brown.green > **green**: `number` #### Brown.red > **red**: `number` ### Cyan > **Cyan**: `object` #### Cyan.alpha > **alpha**: `number` #### Cyan.blue > **blue**: `number` #### Cyan.green > **green**: `number` #### Cyan.red > **red**: `number` ### Gray > **Gray**: `object` #### Gray.alpha > **alpha**: `number` #### Gray.blue > **blue**: `number` #### Gray.green > **green**: `number` #### Gray.red > **red**: `number` ### Green > **Green**: `object` #### Green.alpha > **alpha**: `number` #### Green.blue > **blue**: `number` #### Green.green > **green**: `number` #### Green.red > **red**: `number` ### LightBlue > **LightBlue**: `object` #### LightBlue.alpha > **alpha**: `number` #### LightBlue.blue > **blue**: `number` #### LightBlue.green > **green**: `number` #### LightBlue.red > **red**: `number` ### Lime > **Lime**: `object` #### Lime.alpha > **alpha**: `number` #### Lime.blue > **blue**: `number` #### Lime.green > **green**: `number` #### Lime.red > **red**: `number` ### Magenta > **Magenta**: `object` #### Magenta.alpha > **alpha**: `number` #### Magenta.blue > **blue**: `number` #### Magenta.green > **green**: `number` #### Magenta.red > **red**: `number` ### Orange > **Orange**: `object` #### Orange.alpha > **alpha**: `number` #### Orange.blue > **blue**: `number` #### Orange.green > **green**: `number` #### Orange.red > **red**: `number` ### Pink > **Pink**: `object` #### Pink.alpha > **alpha**: `number` #### Pink.blue > **blue**: `number` #### Pink.green > **green**: `number` #### Pink.red > **red**: `number` ### PureBlack > **PureBlack**: `object` #### PureBlack.alpha > **alpha**: `number` #### PureBlack.blue > **blue**: `number` #### PureBlack.green > **green**: `number` #### PureBlack.red > **red**: `number` ### PureBlue > **PureBlue**: `object` #### PureBlue.alpha > **alpha**: `number` #### PureBlue.blue > **blue**: `number` #### PureBlue.green > **green**: `number` #### PureBlue.red > **red**: `number` ### PureGreen > **PureGreen**: `object` #### PureGreen.alpha > **alpha**: `number` #### PureGreen.blue > **blue**: `number` #### PureGreen.green > **green**: `number` #### PureGreen.red > **red**: `number` ### PureRed > **PureRed**: `object` #### PureRed.alpha > **alpha**: `number` #### PureRed.blue > **blue**: `number` #### PureRed.green > **green**: `number` #### PureRed.red > **red**: `number` ### PureWhite > **PureWhite**: `object` #### PureWhite.alpha > **alpha**: `number` #### PureWhite.blue > **blue**: `number` #### PureWhite.green > **green**: `number` #### PureWhite.red > **red**: `number` ### Purple > **Purple**: `object` #### Purple.alpha > **alpha**: `number` #### Purple.blue > **blue**: `number` #### Purple.green > **green**: `number` #### Purple.red > **red**: `number` ### Red > **Red**: `object` #### Red.alpha > **alpha**: `number` #### Red.blue > **blue**: `number` #### Red.green > **green**: `number` #### Red.red > **red**: `number` ### Silver > **Silver**: `object` #### Silver.alpha > **alpha**: `number` #### Silver.blue > **blue**: `number` #### Silver.green > **green**: `number` #### Silver.red > **red**: `number` ### Transparent > **Transparent**: `object` #### Transparent.alpha > **alpha**: `number` #### Transparent.blue > **blue**: `number` #### Transparent.green > **green**: `number` #### Transparent.red > **red**: `number` ### White > **White**: `object` #### White.alpha > **alpha**: `number` #### White.blue > **blue**: `number` #### White.green > **green**: `number` #### White.red > **red**: `number` ### Yellow > **Yellow**: `object` #### Yellow\.alpha > **alpha**: `number` #### Yellow\.blue > **blue**: `number` #### Yellow\.green > **green**: `number` #### Yellow\.red > **red**: `number` [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR2_ZERO.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR2_ZERO.md. # Variable: VECTOR2\_ZERO > `const` **VECTOR2\_ZERO**: `Vector2` 零向量 zero 表示在所有方向上取值为 0 的向量 (0,0)。 A vector representing the value of 0 in all directions (0,0) [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_BACK.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_BACK.md. # Variable: VECTOR3\_BACK > `const` **VECTOR3\_BACK**: `Vector3` back A unit vector representing the world BACK direction (0,0,-1) 表示世界后方方向的单位向量 (0,0,-1)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_DOWN.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_DOWN.md. # Variable: VECTOR3\_DOWN > `const` **VECTOR3\_DOWN**: `Vector3` down A unit vector representing the world DOWN direction (0,-1,0) 表示世界下方方向的单位向量 (0,-1,0)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_EAST.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_EAST.md. # Variable: VECTOR3\_EAST > `const` **VECTOR3\_EAST**: `Vector3` east A unit vector representing the world EAST direction (-1,0,0) (same as RIGHT) 表示世界东方(右方)方向的单位向量 (-1,0,0)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_FORWARD.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_FORWARD.md. # Variable: VECTOR3\_FORWARD > `const` **VECTOR3\_FORWARD**: `Vector3` forward A unit vector representing the world FORWARD direction (0,0,1) 表示世界前方方向的单位向量 (0,0,1)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_HALF.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_HALF.md. # Variable: VECTOR3\_HALF > `const` **VECTOR3\_HALF**: `Vector3` 半向量 half 表示在所有方向上取值为 0.5 的单位向量 (0.5,0.5,0.5)。 A unit vector representing the value of 0.5 in all directions (0.5,0.5,0.5) [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_LEFT.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_LEFT.md. # Variable: VECTOR3\_LEFT > `const` **VECTOR3\_LEFT**: `Vector3` left A unit vector representing the world LEFT direction (-1,0,0) 表示世界左侧方向的单位向量 (-1,0,0)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_NEGATIVE_ONE.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_NEGATIVE_ONE.md. # Variable: VECTOR3\_NEGATIVE\_ONE > `const` **VECTOR3\_NEGATIVE\_ONE**: `Vector3` 负一向量 negative 表示在所有方向上取值为 -1 的单位向量 (-1,-1,-1)。 A unit vector representing the value of -1 in all directions (-1,-1,-1) [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_NORTH.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_NORTH.md. # Variable: VECTOR3\_NORTH > `const` **VECTOR3\_NORTH**: `Vector3` north A unit vector representing the world NORTH direction (-1,0,0) (same as FORWARD) 表示世界北方(前方)方向的单位向量 (-1,0,0)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_ONE.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_ONE.md. # Variable: VECTOR3\_ONE > `const` **VECTOR3\_ONE**: `Vector3` one A unit vector representing the value of 1 in all directions (1,1,1) 表示在所有方向上值为 1 的单位向量 (1,1,1)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_RIGHT.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_RIGHT.md. # Variable: VECTOR3\_RIGHT > `const` **VECTOR3\_RIGHT**: `Vector3` right A unit vector representing the world RIGHT direction (1,0,0) 表示世界右侧方向的单位向量 (1,0,0)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_SOUTH.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_SOUTH.md. # Variable: VECTOR3\_SOUTH > `const` **VECTOR3\_SOUTH**: `Vector3` south A unit vector representing the world SOUTH direction (-1,0,0) (same as BACK) 表示世界南方(后方)方向的单位向量 (-1,0,0)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_UP.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_UP.md. # Variable: VECTOR3\_UP > `const` **VECTOR3\_UP**: `Vector3` up A unit vector representing the world UP direction (0,1,0) 表示世界上方方向的单位向量 (0,1,0)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_WEST.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_WEST.md. # Variable: VECTOR3\_WEST > `const` **VECTOR3\_WEST**: `Vector3` west A unit vector representing the world WEST direction (-1,0,0) (same as LEFT) 表示世界西方(左方)方向的单位向量 (-1,0,0)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTOR3_ZERO.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTOR3_ZERO.md. # Variable: VECTOR3\_ZERO > `const` **VECTOR3\_ZERO**: `Vector3` zero A unit vector representing the value of 0 in all directions (0,0,0) 表示在所有方向上值为 0 的单位向量 (0,0,0)。 [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /math/variables/VECTORXZ_ZERO.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /math/variables/VECTORXZ_ZERO.md. # Variable: VECTORXZ\_ZERO > `const` **VECTORXZ\_ZERO**: `VectorXZ` 零向量 zero 表示在所有方向上取值为 0 的向量 (0,0)。 A vector representing the value of 0 in all directions (0,0) [源码](https://www.npmjs.com/package/@minecraft/math) --- url: /versions/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /versions/index.md. # 版本映射 数据来源:官方 npm [`@minecraft/*`](https://www.npmjs.com/search?q=scope%3Aminecraft) 已发布版本号。 ## 当前文档站锁定版本 下列版本为构建本站文档时锁定的 `@minecraft/*` 依赖;完整历史对照见下文各包分表。 | 包名 | 当前文档版本 | 对应 MC 版本 | 本站更新日志 | | -------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------- | | [@minecraft/server](https://www.npmjs.com/package/@minecraft/server) | [`2.11.0-beta`](#minecraftserver) | `1.26.50.20` | [稳定/预览](/changelog/server.md) | | [@minecraft/server-ui](https://www.npmjs.com/package/@minecraft/server-ui) | [`2.3.0-beta`](#minecraftserver-ui) | `1.26.50.20` | [稳定/预览](/changelog/server-ui.md) | | [@minecraft/server-net](https://www.npmjs.com/package/@minecraft/server-net) | [`1.0.0-beta`](#minecraftserver-net) | `1.26.50.20` | [稳定/预览](/changelog/server-net.md) | | [@minecraft/common](https://www.npmjs.com/package/@minecraft/common) | [`1.3.0`](#minecraftcommon) | - | [稳定/预览](/changelog/common.md) | | [@minecraft/debug-utilities](https://www.npmjs.com/package/@minecraft/debug-utilities) | [`1.0.0-beta`](#minecraftdebug-utilities) | `1.26.50.20` | [稳定/预览](/changelog/debug-utilities.md) | | [@minecraft/diagnostics](https://www.npmjs.com/package/@minecraft/diagnostics) | [`1.0.0-beta`](#minecraftdiagnostics) | `1.26.50.20` | [稳定/预览](/changelog/diagnostics.md) | | [@minecraft/math](https://www.npmjs.com/package/@minecraft/math) | [`2.4.0`](#minecraftmath) | - | [模块文档](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/math/minecraft-math) | | [@minecraft/server-admin](https://www.npmjs.com/package/@minecraft/server-admin) | [`1.0.0-beta`](#minecraftserver-admin) | `1.26.50.20` | [稳定/预览](/changelog/server-admin.md) | | [@minecraft/server-editor](https://www.npmjs.com/package/@minecraft/server-editor) | [`0.1.0-beta`](#minecraftserver-editor) | `1.26.50.20` | [稳定/预览](/changelog/server-editor.md) | | [@minecraft/server-gametest](https://www.npmjs.com/package/@minecraft/server-gametest) | [`1.0.0-beta`](#minecraftserver-gametest) | `1.26.50.20` | [稳定/预览](/changelog/server-gametest.md) | | [@minecraft/server-graphics](https://www.npmjs.com/package/@minecraft/server-graphics) | [`1.0.0-beta`](#minecraftserver-graphics) | `1.26.50.20` | [稳定/预览](/changelog/server-graphics.md) | | [@minecraft/vanilla-data](https://www.npmjs.com/package/@minecraft/vanilla-data) | [`1.26.50-preview.20`](#minecraftvanilla-data) | - | [模块文档](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/vanilla-data/minecraft-vanilla-data) | 由版本号推断的游戏版本号:`1.26.50.20` > `@minecraft/vanilla-data` 以[精简名称索引](/vanilla-data/index.md)收录,不生成完整成员页。 ## 各包 API 版本对照 下表按包列出 npm 上出现过的 API 核心版本,以及能从版本号解析出的 Minecraft 稳定/预览分支。备注中的「文档站」对应当前本站锁定依赖所属的 API 核心版本。 ### @minecraft/server \{#minecraftserver} [npm](https://www.npmjs.com/package/@minecraft/server) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/changelog) · [本站更新日志](/changelog/server.md) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | -------- | ---------- | ------------- | ---------- | --- | | `2.11.0` | - | `1.26.50.24` | 2026-07-21 | 文档站 | | `2.10.0` | `1.26.43` | `1.26.50.24` | 2026-06-02 | 预览 | | `2.9.0` | `1.26.36` | `1.26.50.22` | 2026-04-21 | 稳定 | | `2.8.0` | `1.26.21` | `1.26.40.24` | 2026-03-10 | - | | `2.7.0` | `1.26.14` | `1.26.30.26` | 2026-01-27 | - | | `2.6.0` | `1.26.3` | `1.26.20.20` | 2025-12-03 | - | | `2.5.0` | `1.21.132` | `1.26.10.22` | 2025-10-14 | - | | `2.4.0` | `1.21.124` | `1.26.0.24` | 2025-09-03 | - | | `2.3.0` | `1.21.114` | `1.21.130.22` | 2025-07-22 | - | | `2.2.0` | `1.21.102` | `1.21.120.23` | 2025-06-10 | - | | `2.1.0` | `1.21.95` | `1.21.110.22` | 2025-04-22 | - | | `2.0.0` | `1.21.84` | `1.21.100.20` | 2025-01-30 | - | | `1.19.0` | - | `1.21.90.21` | 2025-04-03 | - | | `1.18.0` | `1.21.62` | `1.21.80.21` | 2024-11-21 | - | | `1.17.0` | `1.21.51` | `1.21.70.22` | 2024-10-10 | - | | `1.16.0` | `1.21.44` | `1.21.60.21` | 2024-09-04 | - | | `1.15.0` | `1.21.31` | `1.21.50.24` | 2024-08-01 | - | | `1.14.0` | `1.21.23` | `1.21.40.21` | 2024-06-27 | - | | `1.13.0` | - | `1.21.30.22` | 2024-05-22 | - | | `1.12.0` | `1.21.3` | `1.21.30.22` | 2024-04-03 | - | | `1.11.0` | `1.20.80` | `1.21.10.23` | 2024-02-29 | - | | `1.10.0` | `1.20.70` | `1.21.0.22` | 2024-01-24 | - | | `1.9.0` | `1.20.60` | `1.20.80.21` | 2023-11-15 | - | | `1.8.0` | `1.20.50` | `1.20.70.21` | 2023-10-11 | - | | `1.7.0` | `1.20.40` | `1.20.60.21` | 2023-09-13 | - | | `1.6.0` | `1.20.30` | `1.20.50.21` | 2023-08-03 | - | | `1.5.0` | - | `1.20.40.21` | 2023-06-14 | - | | `1.4.0` | `1.20.10` | `1.20.40.21` | 2023-05-11 | - | | `1.3.0` | `1.20.0` | `1.20.20.20` | 2023-04-19 | - | | `1.2.0` | `1.19.80` | `1.20.10.21` | 2023-03-08 | - | | `1.1.0` | `1.19.70` | `1.20.0.22` | 2022-10-19 | - | | `1.0.0` | - | `1.19.60.23` | 2022-09-27 | - | | `0.0.1` | - | - | 2022-09-22 | - | ### @minecraft/server-ui \{#minecraftserver-ui} [npm](https://www.npmjs.com/package/@minecraft/server-ui) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-ui/changelog) · [本站更新日志](/changelog/server-ui.md) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------- | ---------- | --- | | `2.3.0` | - | `1.26.50.24` | 2026-07-21 | 文档站 | | `2.2.0` | `1.26.43` | `1.26.50.24` | 2026-05-19 | 预览 | | `2.1.0` | `1.26.21` | `1.26.40.24` | 2025-04-22 | 稳定 | | `2.0.0` | `1.21.84` | `1.21.100.20` | 2025-01-30 | - | | `1.4.0` | `1.21.62` | `1.21.60.28` | 2024-08-01 | - | | `1.3.0` | `1.21.23` | `1.21.40.21` | 2024-06-12 | - | | `1.2.0` | `1.21.3` | `1.21.30.22` | 2023-06-14 | - | | `1.1.0` | `1.20.0` | `1.20.20.20` | 2023-04-19 | - | | `1.0.0` | `1.19.80` | `1.20.10.21` | 2022-09-27 | - | ### @minecraft/server-net \{#minecraftserver-net} [npm](https://www.npmjs.com/package/@minecraft/server-net) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-net/changelog) · [本站更新日志](/changelog/server-net.md) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2022-09-26 | 文档站 / 稳定 / 预览 | | `0.0.1` | - | - | 2022-09-22 | - | ### @minecraft/common \{#minecraftcommon} [npm](https://www.npmjs.com/package/@minecraft/common) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/common/changelog) · [本站更新日志](/changelog/common.md) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | ------- | ------------ | ---------- | ------------- | | `1.3.0` | - | `1.26.30.26` | 2026-03-25 | 文档站 / 稳定 / 预览 | | `1.2.0` | - | `1.20.80.21` | 2024-01-24 | - | | `1.1.0` | - | `1.20.60.21` | 2023-10-18 | - | | `1.0.0` | - | `1.20.50.22` | 2023-09-27 | - | ### @minecraft/debug-utilities \{#minecraftdebug-utilities} [npm](https://www.npmjs.com/package/@minecraft/debug-utilities) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/debug-utilities/changelog) · [本站更新日志](/changelog/debug-utilities.md) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2024-01-24 | 文档站 / 稳定 / 预览 | ### @minecraft/diagnostics \{#minecraftdiagnostics} [npm](https://www.npmjs.com/package/@minecraft/diagnostics) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/diagnostics/changelog) · [本站更新日志](/changelog/diagnostics.md) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2025-02-05 | 文档站 / 稳定 / 预览 | ### @minecraft/math \{#minecraftmath} [npm](https://www.npmjs.com/package/@minecraft/math) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/math/minecraft-math) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | -------- | ------- | ------- | ---------- | --- | | `2.4.0` | - | - | 2026-02-25 | 文档站 | | `2.3.1` | - | - | 2026-01-26 | - | | `2.3.0` | - | - | 2026-01-13 | - | | `2.2.11` | - | - | 2025-09-29 | - | | `2.2.10` | - | - | 2025-09-10 | - | | `2.2.9` | - | - | 2025-09-04 | - | | `2.2.8` | - | - | 2025-07-24 | - | | `2.2.7` | - | - | 2025-06-30 | - | | `2.2.6` | - | - | 2025-05-23 | - | | `2.2.5` | - | - | 2025-05-22 | - | | `2.2.4` | - | - | 2025-04-28 | - | | `2.2.3` | - | - | 2025-04-18 | - | | `2.2.2` | - | - | 2025-04-14 | - | | `2.2.1` | - | - | 2025-03-13 | - | | `2.2.0` | - | - | 2025-02-28 | - | | `2.1.0` | - | - | 2025-02-12 | - | | `2.0.1` | - | - | 2025-01-09 | - | | `2.0.0` | - | - | 2025-01-09 | - | | `1.5.2` | - | - | 2024-12-25 | - | | `1.5.1` | - | - | 2024-12-03 | - | | `1.5.0` | - | - | 2024-11-26 | - | | `1.4.2` | - | - | 2024-11-25 | - | | `1.4.1` | - | - | 2024-11-25 | - | | `1.4.0` | - | - | 2024-07-12 | - | | `1.3.5` | - | - | 2024-03-18 | - | | `1.3.4` | - | - | 2024-03-04 | - | | `1.3.3` | - | - | 2024-03-01 | - | | `1.3.2` | - | - | 2024-02-29 | - | | `1.3.1` | - | - | 2024-02-27 | - | | `1.3.0` | - | - | 2024-02-27 | - | | `1.1.1` | - | - | 2024-02-27 | - | | `1.1.0` | - | - | 2024-02-02 | - | | `1.0.1` | - | - | 2024-01-29 | - | | `1.0.0` | - | - | 2024-01-29 | - | ### @minecraft/server-admin \{#minecraftserver-admin} [npm](https://www.npmjs.com/package/@minecraft/server-admin) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-admin/changelog) · [本站更新日志](/changelog/server-admin.md) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2022-09-27 | 文档站 / 稳定 / 预览 | ### @minecraft/server-editor \{#minecraftserver-editor} [npm](https://www.npmjs.com/package/@minecraft/server-editor) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/changelog) · [本站更新日志](/changelog/server-editor.md) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------------- | | `0.1.0` | `1.26.43` | `1.26.50.24` | 2023-06-28 | 文档站 / 稳定 / 预览 | ### @minecraft/server-gametest \{#minecraftserver-gametest} [npm](https://www.npmjs.com/package/@minecraft/server-gametest) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/changelog) · [本站更新日志](/changelog/server-gametest.md) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | -------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2022-09-27 | 文档站 / 稳定 | | `0.1.0` | - | `1.21.40.20` | 2024-08-19 | 预览 | ### @minecraft/server-graphics \{#minecraftserver-graphics} [npm](https://www.npmjs.com/package/@minecraft/server-graphics) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-graphics/changelog) · [本站更新日志](/changelog/server-graphics.md) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2025-10-22 | 文档站 / 稳定 / 预览 | ### @minecraft/vanilla-data \{#minecraftvanilla-data} [npm](https://www.npmjs.com/package/@minecraft/vanilla-data) · [Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/vanilla-data/minecraft-vanilla-data) > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ---------- | ------- | ------- | ---------- | --- | | `1.26.50` | - | - | 2026-07-21 | 文档站 | | `1.26.40` | - | - | 2026-06-02 | - | | `1.26.33` | - | - | 2026-07-09 | - | | `1.26.32` | - | - | 2026-06-25 | - | | `1.26.31` | - | - | 2026-06-19 | - | | `1.26.30` | - | - | 2026-04-21 | - | | `1.26.21` | - | - | 2026-05-14 | - | | `1.26.20` | - | - | 2026-03-10 | - | | `1.26.13` | - | - | 2026-04-06 | - | | `1.26.12` | - | - | 2026-03-31 | - | | `1.26.10` | - | - | 2026-01-27 | - | | `1.26.2` | - | - | 2026-02-25 | - | | `1.26.1` | - | - | 2026-02-19 | - | | `1.26.0` | - | - | 2025-12-03 | - | | `1.21.131` | - | - | 2025-12-16 | - | | `1.21.130` | - | - | 2025-10-14 | - | | `1.21.124` | - | - | 2025-11-21 | - | | `1.21.123` | - | - | 2025-11-13 | - | | `1.21.120` | - | - | 2025-09-03 | - | | `1.21.114` | - | - | 2025-10-16 | - | | `1.21.113` | - | - | 2025-10-09 | - | | `1.21.111` | - | - | 2025-09-30 | - | | `1.21.110` | - | - | 2025-07-22 | - | | `1.21.101` | - | - | 2025-08-13 | - | | `1.21.100` | - | - | 2025-06-10 | - | | `1.21.93` | - | - | 2025-07-03 | - | | `1.21.90` | - | - | 2025-04-22 | - | | `1.21.81` | - | - | 2025-05-14 | - | | `1.21.80` | - | - | 2025-03-11 | - | | `1.21.70` | - | - | 2025-01-30 | - | | `1.21.62` | - | - | 2025-02-25 | - | | `1.21.61` | - | - | 2025-02-19 | - | | `1.21.60` | - | - | 2024-11-21 | - | | `1.21.50` | - | - | 2024-10-09 | - | | `1.21.44` | - | - | 2024-10-31 | - | | `1.21.43` | - | - | 2024-10-25 | - | | `1.21.41` | - | - | 2024-10-22 | - | | `1.21.40` | - | - | 2024-09-04 | - | | `1.21.31` | - | - | 2024-09-30 | - | | `1.21.30` | - | - | 2024-08-01 | - | | `1.21.23` | - | - | 2024-09-03 | - | | `1.21.22` | - | - | 2024-08-26 | - | | `1.21.20` | - | - | 2024-06-27 | - | | `1.21.10` | - | - | 2024-05-22 | - | | `1.21.3` | - | - | 2024-07-15 | - | | `1.21.2` | - | - | 2024-07-09 | - | | `1.21.1` | - | - | 2024-06-20 | - | | `1.21.0` | - | - | 2024-04-03 | - | | `1.20.80` | - | - | 2024-02-29 | - | | `1.20.70` | - | - | 2024-01-24 | - | | `1.20.60` | - | - | 2023-11-15 | - | | `1.20.50` | - | - | 2023-10-11 | - | | `1.20.40` | - | - | 2023-09-07 | - | | `1.20.30` | - | - | 2023-08-03 | - | | `1.20.20` | - | - | 2023-06-14 | - | | `1.20.10` | - | - | 2023-05-11 | - | | `1.20.0` | - | - | 2023-04-19 | - | | `1.19.80` | - | - | 2023-04-10 | - | --- url: /changelog/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/index.md. # 更新日志 按 npm 包分列稳定版与预览版完整官方变更;各模块页含相对 npm latest 的预览增量。 | 模块 | 稳定版 | 预览版 | | ----------------------------------------------------------- | -------------------------------- | ------------------------------ | | [@minecraft/server](/changelog/server.md) | `2.9.0` | `2.10.0-rc.1.26.50-preview.24` | | [@minecraft/server-ui](/changelog/server-ui.md) | `2.1.0` | `2.2.0-rc.1.26.50-preview.24` | | [@minecraft/server-net](/changelog/server-net.md) | `1.0.0-beta.11940b24` | `1.0.0-beta.1.26.43-stable` | | [@minecraft/common](/changelog/common.md) | `1.3.0` | `1.3.0-rc.1.26.30-preview.26` | | [@minecraft/debug-utilities](/changelog/debug-utilities.md) | `1.0.0-beta.1.20.70-preview.20` | `1.0.0-beta.1.26.43-stable` | | [@minecraft/diagnostics](/changelog/diagnostics.md) | `1.0.0-beta.1.21.70-preview.22` | `1.0.0-beta.1.26.43-stable` | | [@minecraft/server-admin](/changelog/server-admin.md) | `1.0.0-beta.11940b24` | `1.0.0-beta.1.26.43-stable` | | [@minecraft/server-editor](/changelog/server-editor.md) | `0.1.0-beta.1.20.20-preview.20` | `0.1.0-beta.1.26.43-stable` | | [@minecraft/server-gametest](/changelog/server-gametest.md) | `1.0.0-beta.1.21.60-preview.24` | `0.1.0-rc.1.21.40-preview.20` | | [@minecraft/server-graphics](/changelog/server-graphics.md) | `1.0.0-beta.1.21.130-preview.22` | `1.0.0-beta.1.26.43-stable` | --- url: /changelog/server.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/server.md. # @minecraft/server 更新日志 官方原文:[Microsoft Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/changelog) ## 版本映射表 > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | -------- | ---------- | ------------- | ---------- | -- | | `2.11.0` | - | `1.26.50.24` | 2026-07-21 | - | | `2.10.0` | `1.26.43` | `1.26.50.24` | 2026-06-02 | 预览 | | `2.9.0` | `1.26.36` | `1.26.50.22` | 2026-04-21 | 稳定 | | `2.8.0` | `1.26.21` | `1.26.40.24` | 2026-03-10 | - | | `2.7.0` | `1.26.14` | `1.26.30.26` | 2026-01-27 | - | | `2.6.0` | `1.26.3` | `1.26.20.20` | 2025-12-03 | - | | `2.5.0` | `1.21.132` | `1.26.10.22` | 2025-10-14 | - | | `2.4.0` | `1.21.124` | `1.26.0.24` | 2025-09-03 | - | | `2.3.0` | `1.21.114` | `1.21.130.22` | 2025-07-22 | - | | `2.2.0` | `1.21.102` | `1.21.120.23` | 2025-06-10 | - | | `2.1.0` | `1.21.95` | `1.21.110.22` | 2025-04-22 | - | | `2.0.0` | `1.21.84` | `1.21.100.20` | 2025-01-30 | - | | `1.19.0` | - | `1.21.90.21` | 2025-04-03 | - | | `1.18.0` | `1.21.62` | `1.21.80.21` | 2024-11-21 | - | | `1.17.0` | `1.21.51` | `1.21.70.22` | 2024-10-10 | - | | `1.16.0` | `1.21.44` | `1.21.60.21` | 2024-09-04 | - | | `1.15.0` | `1.21.31` | `1.21.50.24` | 2024-08-01 | - | | `1.14.0` | `1.21.23` | `1.21.40.21` | 2024-06-27 | - | | `1.13.0` | - | `1.21.30.22` | 2024-05-22 | - | | `1.12.0` | `1.21.3` | `1.21.30.22` | 2024-04-03 | - | | `1.11.0` | `1.20.80` | `1.21.10.23` | 2024-02-29 | - | | `1.10.0` | `1.20.70` | `1.21.0.22` | 2024-01-24 | - | | `1.9.0` | `1.20.60` | `1.20.80.21` | 2023-11-15 | - | | `1.8.0` | `1.20.50` | `1.20.70.21` | 2023-10-11 | - | | `1.7.0` | `1.20.40` | `1.20.60.21` | 2023-09-13 | - | | `1.6.0` | `1.20.30` | `1.20.50.21` | 2023-08-03 | - | | `1.5.0` | - | `1.20.40.21` | 2023-06-14 | - | | `1.4.0` | `1.20.10` | `1.20.40.21` | 2023-05-11 | - | | `1.3.0` | `1.20.0` | `1.20.20.20` | 2023-04-19 | - | | `1.2.0` | `1.19.80` | `1.20.10.21` | 2023-03-08 | - | | `1.1.0` | `1.19.70` | `1.20.0.22` | 2022-10-19 | - | | `1.0.0` | - | `1.19.60.23` | 2022-09-27 | - | | `0.0.1` | - | - | 2022-09-22 | - | ## 相对稳定版的变更 对比:稳定 `2.9.0` ↔ 预览(当前文档) `2.11.0-beta.1.26.50-preview.20` ### 新增导出符号 - `BannerPattern` - `BlockBoundingBoxUtils` - `BlockDynamicPropertiesComponent` - `BlockInstrumentComponent` - `BlockQueryOptions` - `CameraShakeOptions` - `CameraShakeType` - `CarryOverBlockEntityDataFunction` - `ChatSendAfterEvent` - `ChatSendAfterEventSignal` - `ChatSendBeforeEvent` - `ChatSendBeforeEventSignal` - `CloneMode` - `EntityIdentifierType` - `EntityNpcComponent` - `EntitySneakingChangedEventOptions` - `EntityStartSneakingAfterEvent` - `EntityStartSneakingAfterEventSignal` - `EntityStopSneakingAfterEvent` - `EntityStopSneakingAfterEventSignal` - `EntityTamedAfterEvent` - `EntityTamedAfterEventSignal` - `EntityTamedBeforeEvent` - `EntityTamedBeforeEventSignal` - `EntityTamedEventOptions` - `FogSettings` - `FogSettingsError` - `ItemBlockDynamicPropertiesComponent` - `MessageReceiveAfterEvent` - `PackSettingChangeAfterEvent` - `PackSettingChangeAfterEventSignal` - `PlayerPlaceBlockBeforeEvent` - `PlayerPlaceBlockBeforeEventSignal` - `PlayerUseNameTagAfterEvent` - `PlayerUseNameTagAfterEventSignal` - `PlayerWaypointsMode` - `PrimitiveShapeQueryOptions` - `ServerMessageAfterEventSignal` - `SoundCompletedAfterEvent` - `SoundCompletedAfterEventSignal` - `SoundDefinition` - `SoundDefinitionDurationInfo` - `SoundDefinitionFilter` - `SoundDefinitionMusicInfo` - `SoundDefinitionRegistry` - `SoundDurationInfo` - `VanillaEntityIdentifier` - `WatchdogTerminateBeforeEvent` - `WatchdogTerminateBeforeEventSignal` - `WatchdogTerminateReason` ### 既有符号的新增成员 - `Block`: `canPlace`, `getMapColor`, `isSolid`, `trySetPermutation` - `BlockComponentRedstoneUpdateEvent`: `firstUpdate` - `BlockComponentTypes`: `DynamicProperties`, `Instrument` - `BlockLocationIterator`: `isValid` - `BlockVolumeBase`: `getBoundingBox`, `getClosest`, `getFarthest` - `Camera`: `addShake`, `setCameraWithEase`, `stopShaking` - `CustomCommandErrorReason`: `UnexpectedEnumName` - `CustomCommandParameter`: `enumName` - `DefinitionModifier`: `triggers` - `Dimension`: `cloneBlocks`, `getGeneratedStructures`, `getWeather`, `spawnXp`, `stopAllSounds`, `stopSound` - `Entity`: `target` - `EntityBreathableComponent`: `airSupply`, `canBreathe` - `EntityComponentTypes`: `Npc` - `EquipmentSlot`: `Body` - `GameRule`: `PlayerWaypoints` - `GameRules`: `playerWaypoints` - `ItemComponentTypes`: `BlockDynamicProperties` - `Player`: `chatDisplayName`, `chatMessagePrefix`, `chatNamePrefix`, `chatNameSuffix`, `eatItem`, `fogSettings`, `getPing`, `getSplitScreenSlot`, `persistentId`, `postClientMessage`, `stopAllSounds`, `stopSound` - `PlayerSoundOptions`: `loopCount` - `PrimitiveShapesManager`: `getShapes` - `SetBannerDetailsFunction`: `baseColor`, `patterns` - `SoundInstance`: `durationInfo`, `fade`, `id`, `pause`, `recipient`, `resume`, `seekTo`, `setPitch`, `setVolume`, `soundEventId` - `SystemBeforeEvents`: `watchdogTerminate` - `TextPrimitive`: `lineGapHeight` - `World`: `allowCheats`, `broadcastClientMessage`, `soundDefinitionRegistry` - `WorldAfterEvents`: `chatSend`, `entityStartSneaking`, `entityStopSneaking`, `entityTamed`, `messageReceive`, `packSettingChange`, `playerUseNameTag`, `soundCompleted` - `WorldBeforeEvents`: `chatSend`, `entityTamed`, `playerPlaceBlock` - `WorldSoundOptions`: `loopCount` [查看官方完整更新日志](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/changelog) ## 稳定版 `2.9.0` ### Changed **`Block`** - Added function **`getParts`** ### Changed **`Dimension`** - Added function **`calculateClosestBiomeFromSeed`** ### Changed **`LootItem`** - Added property **`conditions`** ### Added **`PlayerCancelBreakingBlockAfterEvent`** ### Added **`PlayerCancelBreakingBlockAfterEventSignal`** ### Added **`PlayerStartBreakingBlockAfterEvent`** ### Added **`PlayerStartBreakingBlockAfterEventSignal`** ### Changed **`SoundInstance`** - Added function **`stop`** ### Changed **`WorldAfterEvents`** - Added property **`playerCancelBreakingBlock`** - Added property **`playerStartBreakingBlock`** ### Added enum `PlayerSplitScreenSlot` ## 预览版 `2.10.0-rc.1.26.50-preview.24` > 官方文档对应条目:`2.11.0-beta.1.26.50-preview.24`(近似匹配) ### Changed **`AimAssistCategorySettings`** - Changed function **`setBlockPriorities`** - Changed return type from _void_ to _void_ - Changed argument `blockPriorities` type from Record\<_string_, _number_> to _Record\_ - Changed function **`setBlockTagPriorities`** - Changed return type from _void_ to _void_ - Changed argument `blockTagPriorities` type from Record\<_string_, _number_> to _Record\_ - Changed function **`setEntityPriorities`** - Changed return type from _void_ to _void_ - Changed argument `entityPriorities` type from Record\<_string_, _number_> to _Record\_ - Changed function **`setEntityTypeFamilyPriorities`** - Changed return type from _void_ to _void_ - Changed argument `entityTypeFamilyPriorities` type from Record\<_string_, _number_> to _Record\_ ### Changed **`AimAssistPresetSettings`** - Changed function **`setExcludedBlockTagTargets`** - Changed return type from _void_ to _void_ - Added argument `targets` - Removed argument `blockTagTargets` - Changed function **`setExcludedBlockTargets`** - Changed return type from _void_ to _void_ - Added argument `targets` - Removed argument `blockTargets` - Changed function **`setExcludedEntityTargets`** - Changed return type from _void_ to _void_ - Added argument `targets` - Removed argument `entityTargets` - Changed function **`setExcludedEntityTypeFamilyTargets`** - Changed return type from _void_ to _void_ - Added argument `targets` - Removed argument `entityTypeFamilyTargets` - Changed function **`setItemSettings`** - Changed return type from _void_ to _void_ - Changed argument `itemSettings` type from Record\<_string_, _string_> to _Record\_ - Changed function **`setLiquidTargetingItems`** - Changed return type from _void_ to _void_ - Changed argument `items` type from _string_\[] to (_minecraftvanilladata.MinecraftItemTypes_ | _string_)\[] ### Added **`BannerPattern`** ### Changed **`Block`** - Added property **`isSolid`** - Added function **`canPlace`** - Added function **`getMapColor`** - Added function **`trySetPermutation`** ### Added **`BlockBoundingBoxUtils`** ### Changed **`BlockComponentRedstoneUpdateEvent`** - Added property **`firstUpdate`** ### Added **`BlockDynamicPropertiesComponent`** ### Added **`BlockInstrumentComponent`** ### Changed **`BlockLocationIterator`** - Added function **`isValid`** ### Changed **`BlockVolumeBase`** - Added function **`getBoundingBox`** - Added function **`getClosest`** - Added function **`getFarthest`** ### Changed **`Camera`** - Added function **`addShake`** - Added function **`setCameraWithEase`** - Added function **`stopShaking`** ### Added **`CarryOverBlockEntityDataFunction`** ### Added **`ChatSendAfterEvent`** ### Added **`ChatSendAfterEventSignal`** ### Added **`ChatSendBeforeEvent`** ### Added **`ChatSendBeforeEventSignal`** ### Changed **`Dimension`** - Added function **`cloneBlocks`** - Added function **`getBlocks`** - Added function **`getGeneratedStructures`** - Added function **`getWeather`** - Changed function **`spawnEntity`** - Changed return type from `*Entity*` (throws exceptions) to _Entity_ (throws exceptions) - Changed argument `identifier` type from `*EntityType*` | _string_ to _EntityIdentifierType\>_ - Changed argument `location` type from `*Vector3*` to _Vector3_ - Changed argument `options` type from `*SpawnEntityOptions*` to _SpawnEntityOptions_ - Added function **`spawnXp`** - Added function **`stopAllSounds`** - Added function **`stopSound`** ### Changed **`Entity`** - Added property **`target`** ### Changed **`EntityBreathableComponent`** - Added property **`airSupply`** - Added property **`canBreathe`** ### Added **`EntityNpcComponent`** ### Added **`EntityStartSneakingAfterEvent`** ### Added **`EntityStartSneakingAfterEventSignal`** ### Added **`EntityStopSneakingAfterEvent`** ### Added **`EntityStopSneakingAfterEventSignal`** ### Added **`EntityTamedAfterEvent`** ### Added **`EntityTamedAfterEventSignal`** ### Added **`EntityTamedBeforeEvent`** ### Added **`EntityTamedBeforeEventSignal`** ### Changed **`EntityTypes`** - Changed function **`get`** - Changed return type from `*EntityType*` to _EntityType_ | _undefined_ - Changed argument `identifier` type from _string_ to _EntityIdentifierType\>_ ### Added **`FogSettings`** ### Changed **`GameRules`** - Added property **`playerWaypoints`** ### Added **`ItemBlockDynamicPropertiesComponent`** ### Added **`MessageReceiveAfterEvent`** ### Added **`PackSettingChangeAfterEvent`** ### Added **`PackSettingChangeAfterEventSignal`** ### Changed **`Player`** - Added property **`chatDisplayName`** - Added property **`chatMessagePrefix`** - Added property **`chatNamePrefix`** - Added property **`chatNameSuffix`** - Added property **`fogSettings`** - Added property **`persistentId`** - Added function **`eatItem`** - Added function **`getPing`** - Added function **`getSplitScreenSlot`** - Added function **`postClientMessage`** - Added function **`stopAllSounds`** - Added function **`stopSound`** ### Added **`PlayerPlaceBlockBeforeEvent`** ### Added **`PlayerPlaceBlockBeforeEventSignal`** ### Added **`PlayerUseNameTagAfterEvent`** ### Added **`PlayerUseNameTagAfterEventSignal`** ### Changed **`Potions`** - Changed function **`resolve`** - Changed return type from `*ItemStack*` (throws exceptions) to _ItemStack_ (throws exceptions) - Changed argument `potionEffectType` type from `*PotionEffectType*` | _string_ to _PotionEffectType_ | _T_ - Changed argument `potionDeliveryType` type from `*PotionDeliveryType*` | _string_ to _PotionDeliveryType_ | _U_ ### Changed **`PrimitiveShapesManager`** - Added function **`getShapes`** ### Added **`ServerMessageAfterEventSignal`** ### Changed **`SetBannerDetailsFunction`** - Added property **`baseColor`** - Added property **`patterns`** ### Added **`SoundCompletedAfterEvent`** ### Added **`SoundCompletedAfterEventSignal`** ### Changed **`SoundDefinition`** - Added property **`durationInfo`** - Added property **`musicInfo`** - Added property **`soundEventId`** - Added property **`tags`** ### Added **`SoundDefinitionRegistry`** ### Added **`SoundDurationInfo`** ### Changed **`SoundInstance`** - Added property **`durationInfo`** - Added property **`id`** - Added property **`recipient`** - Added property **`soundEventId`** - Added function **`fade`** - Added function **`pause`** - Added function **`resume`** - Added function **`seekTo`** - Added function **`setPitch`** - Added function **`setVolume`** ### Changed **`StartupEvent`** - Added property **`worldClockRegistry`** ### Changed **`SystemBeforeEvents`** - Added property **`watchdogTerminate`** ### Changed **`TextPrimitive`** - Added property **`lineGapHeight`** ### Added **`WatchdogTerminateBeforeEvent`** ### Added **`WatchdogTerminateBeforeEventSignal`** ### Changed **`World`** - Added property **`allowCheats`** - Added property **`soundDefinitionRegistry`** - Added function **`broadcastClientMessage`** - Added function **`getClock`** ### Changed **`WorldAfterEvents`** - Added property **`chatSend`** - Added property **`entityStartSneaking`** - Added property **`entityStopSneaking`** - Added property **`entityTamed`** - Added property **`messageReceive`** - Added property **`packSettingChange`** - Added property **`playerUseNameTag`** - Added property **`soundCompleted`** ### Changed **`WorldBeforeEvents`** - Added property **`chatSend`** - Added property **`entityTamed`** - Added property **`playerPlaceBlock`** ### Added **`WorldClock`** ### Added **`WorldClockRegistry`** ### Changed enum `BlockComponentTypes` - Added value `DynamicProperties` - Added value `Instrument` ### Added enum `CameraShakeType` ### Added enum `CloneMode` ### Changed enum `CustomCommandErrorReason` - Added value `UnexpectedEnumName` ### Changed enum `EntityComponentTypes` - Added value `Npc` ### Changed enum `EquipmentSlot` - Added value `Body` ### Changed enum `GameRule` - Added value `PlayerWaypoints` ### Changed enum `ItemComponentTypes` - Added value `BlockDynamicProperties` ### Added enum `PlayerWaypointsMode` ### Added enum `WatchdogTerminateReason` --- url: /changelog/server-ui.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/server-ui.md. # @minecraft/server-ui 更新日志 官方原文:[Microsoft Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-ui/changelog) ## 版本映射表 > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------- | ---------- | -- | | `2.3.0` | - | `1.26.50.24` | 2026-07-21 | - | | `2.2.0` | `1.26.43` | `1.26.50.24` | 2026-05-19 | 预览 | | `2.1.0` | `1.26.21` | `1.26.40.24` | 2025-04-22 | 稳定 | | `2.0.0` | `1.21.84` | `1.21.100.20` | 2025-01-30 | - | | `1.4.0` | `1.21.62` | `1.21.60.28` | 2024-08-01 | - | | `1.3.0` | `1.21.23` | `1.21.40.21` | 2024-06-12 | - | | `1.2.0` | `1.21.3` | `1.21.30.22` | 2023-06-14 | - | | `1.1.0` | `1.20.0` | `1.20.20.20` | 2023-04-19 | - | | `1.0.0` | `1.19.80` | `1.20.10.21` | 2022-09-27 | - | ## 相对稳定版的变更 对比:稳定 `2.1.0` ↔ 预览(当前文档) `2.3.0-beta.1.26.50-preview.20` ### 新增导出符号 - `ImageDetails` - `ImageOptions` - `MessageBoxButtonOptions` ### 既有符号的新增成员 - `ButtonOptions`: `imageDetails` - `CustomForm`: `image` - `DropdownOptions`: `tooltip` - `MessageBox`: `button1WithOptions`, `button2WithOptions` - `SliderOptions`: `fixedFormatDigits`, `tooltip` - `TextFieldOptions`: `tooltip` - `TextOptions`: `tooltip` - `ToggleOptions`: `tooltip` [查看官方完整更新日志](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-ui/changelog) ## 稳定版 `2.1.0` ### Added **`CustomForm`** ### Added **`MessageBox`** ### Added **`ObservableBoolean`** ### Added **`ObservableNumber`** ### Added **`ObservableString`** ### Added **`ObservableUIRawMessage`** ### Added enum `DataDrivenScreenClosedReason` ### Added enum `FormVisibilityErrorReason` ### Added enum `TextFilteringError` ## 预览版 `2.2.0-rc.1.26.50-preview.24` ### Changed **`CustomForm`** - Added function **`image`** --- url: /changelog/server-net.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/server-net.md. # @minecraft/server-net 更新日志 官方原文:[Microsoft Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-net/changelog) ## 版本映射表 > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2022-09-26 | 稳定 / 预览 | | `0.0.1` | - | - | 2022-09-22 | - | ## 相对稳定版的变更 对比:稳定 `1.0.0-beta.11940b24` ↔ 预览(当前文档) `1.0.0-beta.1.26.50-preview.20` ### 新增导出符号 - `beforeEvents` - `CloseAfterEventSignal` - `HttpRequestLimitExceededError` - `HttpStatusCode` - `InternalHttpRequestError` - `InternalWebSocketError` - `MalformedUriError` - `MessageAfterEventSignal` - `NetworkBeforeEvents` - `PacketEventOptions` - `PacketId` - `PacketReceiveBeforeEventSignal` - `PacketReceivedBeforeEvent` - `PacketSendBeforeEvent` - `PacketSendBeforeEventSignal` - `RequestBodyTooLargeError` - `SerializableParseError` - `TLSOnlyError` - `UriNotAllowedError` - `websocket` - `WebSocket` - `WebSocketClient` - `WebSocketClientAfterEvents` - `WebSocketClientCloseAfterEvent` - `WebSocketClientCloseReasons` - `WebSocketClientReceiveAfterEvent` - `WebSocketConnectionFailedError` - `WebSocketLimitExceededError` - `WebSocketNotConnectedError` ### 既有符号的新增成员 - `HttpRequestMethod`: `Delete`, `Get`, `Head`, `Patch`, `Post`, `Put` - `HttpResponse`: `deserialize` [查看官方完整更新日志](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-net/changelog) ## 稳定版 `1.0.0-beta.11940b24` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/server-net` Module ## 预览版 `1.0.0-beta.1.26.43-stable` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/server-net` Module --- url: /changelog/common.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/common.md. # @minecraft/common 更新日志 官方原文:[Microsoft Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/common/changelog) ## 版本映射表 > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | ------- | ------------ | ---------- | ------- | | `1.3.0` | - | `1.26.30.26` | 2026-03-25 | 稳定 / 预览 | | `1.2.0` | - | `1.20.80.21` | 2024-01-24 | - | | `1.1.0` | - | `1.20.60.21` | 2023-10-18 | - | | `1.0.0` | - | `1.20.50.22` | 2023-09-27 | - | ## 相对稳定版的变更 对比:稳定 `1.3.0` ↔ 预览(当前文档) `1.3.0` 当前文档与 npm latest 一致,无预览增量。 [查看官方完整更新日志](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/common/changelog) ## 稳定版 `1.3.0` ### Changed enum `InvalidArgumentErrorType` - Added value `InvalidType` - Added value `UnsupportedValue` ## 预览版 `1.3.0-rc.1.26.30-preview.26` > 官方文档对应条目:`1.3.0`(近似匹配) ### Changed enum `InvalidArgumentErrorType` - Added value `InvalidType` - Added value `UnsupportedValue` --- url: /changelog/debug-utilities.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/debug-utilities.md. # @minecraft/debug-utilities 更新日志 官方原文:[Microsoft Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/debug-utilities/changelog) ## 版本映射表 > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2024-01-24 | 稳定 / 预览 | ## 相对稳定版的变更 对比:稳定 `1.0.0-beta.1.20.70-preview.20` ↔ 预览(当前文档) `1.0.0-beta.1.26.50-preview.20` ### 新增导出符号 - `collectPluginStats` - `collectRuntimeStats` - `DebugArrow` - `DebugBox` - `DebugCircle` - `DebugCone` - `DebugCylinder` - `debugDrawer` - `DebugDrawer` - `DebugEllipsoid` - `DebugLine` - `DebugPyramid` - `DebugShape` - `DebugSphere` - `DebugText` - `disableWatchdogTimingWarnings` - `HandleCounts` - `PluginStats` - `RuntimeStats` [查看官方完整更新日志](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/debug-utilities/changelog) ## 稳定版 `1.0.0-beta.1.20.70-preview.20` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/debug-utilities` Module ## 预览版 `1.0.0-beta.1.26.43-stable` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/debug-utilities` Module --- url: /changelog/diagnostics.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/diagnostics.md. # @minecraft/diagnostics 更新日志 官方原文:[Microsoft Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/diagnostics/changelog) ## 版本映射表 > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2025-02-05 | 稳定 / 预览 | ## 相对稳定版的变更 对比:稳定 `1.0.0-beta.1.21.70-preview.22` ↔ 预览(当前文档) `1.0.0-beta.1.26.50-preview.20` ### 新增导出符号 - `SentryCaptureContext` - `SentryEventLevel` ### 既有符号的新增成员 - `Sentry`: `captureException` - `SentryOptions`: `debug`, `maxBreadcrumbs`, `sampleRate` [查看官方完整更新日志](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/diagnostics/changelog) ## 稳定版 `1.0.0-beta.1.21.70-preview.22` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/diagnostics` Module ## 预览版 `1.0.0-beta.1.26.43-stable` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/diagnostics` Module --- url: /changelog/server-admin.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/server-admin.md. # @minecraft/server-admin 更新日志 官方原文:[Microsoft Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-admin/changelog) ## 版本映射表 > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2022-09-27 | 稳定 / 预览 | ## 相对稳定版的变更 对比:稳定 `1.0.0-beta.11940b24` ↔ 预览(当前文档) `1.0.0-beta.1.26.50-preview.20` ### 新增导出符号 - `AdminBeforeEvents` - `AllowList` - `AllowListEntry` - `AllowListFileReloadError` - `AllowListModificationError` - `AsyncPlayerJoinBeforeEvent` - `AsyncPlayerJoinBeforeEventSignal` - `beforeEvents` - `CannotDeopPlayerError` - `CannotKickPlayerError` - `dedicatedServer` - `DedicatedServerUtils` - `deopPlayer` - `DisconnectedError` - `kickPlayer` - `LevelStorage` - `LevelStorageQuerySnapshotFile` - `LevelStorageSaveStateChangeError` - `opPlayer` - `PlayerAlreadyOpError` - `transferPlayer` - `TransferPlayerIpPortOptions` - `TransferPlayerNetherNetOptions` [查看官方完整更新日志](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-admin/changelog) ## 稳定版 `1.0.0-beta.11940b24` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/server-admin` Module ## 预览版 `1.0.0-beta.1.26.43-stable` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/server-admin` Module --- url: /changelog/server-editor.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/server-editor.md. # @minecraft/server-editor 更新日志 官方原文:[Microsoft Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/changelog) ## 版本映射表 > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------- | | `0.1.0` | `1.26.43` | `1.26.50.24` | 2023-06-28 | 稳定 / 预览 | ## 相对稳定版的变更 对比:稳定 `0.1.0-beta.1.20.20-preview.20` ↔ 预览(当前文档) `0.1.0-beta.1.26.50-preview.20` ### 新增导出符号 - `AudioSettings` - `AudioSettingsProperty` - `AudioSettingsPropertyTypeMap` - `Axis` - `BasicTooltipContent` - `BlockIdentifierListObservableValidator` - `BlockIdentifierObservableValidator` - `BlockMaskList` - `BlockMaskListType` - `BlockPalette` - `BlockPaletteItemType` - `BlockPaletteManager` - `BlockPaletteSelectedItemChangeAfterEvent` - `BlockPaletteSelectedItemChangeAfterEventSignal` - `BlockTableOperationType` - `BlockUtilities` - `BlockUtilityExtrudeDirection` - `BlockUtilityFloodMatchCriteria` - `BlockUtilityManifest` - `BlockUtilityManifestEntry` - `BlockUtilityTasks` - `BoolPropertyItemVariant` - `BrushDirectionalPlacementMode` - `BrushElevationMode` - `BrushShape` - `BrushShapeManager` - `BrushShapeSettings` - `ButtonPropertyItemSupportedActionTypes` - `ClipboardChangeAfterEvent` - `ClipboardChangeAfterEventSignal` - `CollectionTreeEntryItemType` - `CollectionTreeSortType` - `ColorPickerPropertyItemVariant` - `ComboBoxPropertyItemDataType` - `ConeBrushShape` - `ConeBrushShapeSettings` - `ContiguousSelectionProperties` - `ContiguousSelectionType` - `ContinuousAction` - `ContinuousActionState` - `CoreActionBarItemType` - `CoreBrushShapeType` - `CoreInputBindingCategory` - `CoreMenuType` - `CoreModalDialogType` - `CuboidBrushShape` - `CuboidBrushShapeSettings` - `CurrentThemeChangeAfterEvent` - `CurrentThemeChangeAfterEventSignal` - `CurrentThemeColorChangeAfterEvent` - `CurrentThemeColorChangeAfterEventSignal` - `CursorPosition` - `CursorPropertiesChangeAfterEvent` - `CursorPropertyChangeAfterEventSignal` - `CursorRay` - `CylinderBrushShape` - `CylinderBrushShapeSettings` - `DataPickerModalDialogVariant` - `DaylightCycle` - `deserialize` - `EditorConstants` - `EditorMode` - `EditorStructure` - `EditorStructureManager` - `EditorStructureSearchOptions` - `EllipsoidBrushShape` - `EllipsoidBrushShapeSettings` - `EntityIdentifierObservableValidator` - `EntityOperationType` - `executeLargeOperationFromIterator` - `ExportManager` - `ExportResult` - `ExtensionContextAfterEvents` - `FlattenMode` - `GameOptions` - `GamePublishSetting` - `getDefaultAllowBlockList` - `getDefaultBrushShapes` - `GraphicsSettings` - `GraphicsSettingsProperty` - `GraphicsSettingsPropertyTypeMap` - `GuidePlane` - `GuidePlaneManager` - `IActionBar` - `IActionBarItem` - `IActionBarItemCreationParams` - `IBlockListPropertyItem` - `IBlockListPropertyItemOptions` - `IBlockPaletteItem` - `IBlockTableEntryInfo` - `IBlockTablePropertyItem` - `IBlockTablePropertyItemOptions` - `IBoolPropertyItem` - `IBoolPropertyItemOptions` - `IButtonPanePropertyItem` - `IButtonPanePropertyItemOptions` - `IButtonPropertyItem` - `IButtonPropertyItemOptions` - `ICollectionTreeEntry` - `ICollectionTreeEntryDropdownItem` - `ICollectionTreeEntryDropdownItemMenuOption` - `ICollectionTreeEntryDropdownItemParams` - `ICollectionTreeEntryItem` - `ICollectionTreeEntryNumberItem` - `ICollectionTreeEntryNumberItemParams` - `ICollectionTreeEntryOptions` - `ICollectionTreeEntryStringItem` - `ICollectionTreeEntryStringItemParams` - `ICollectionTreeFolder` - `ICollectionTreeFolderHeaderActionParams` - `ICollectionTreeFolderOptions` - `ICollectionTreePropertyItem` - `ICollectionTreePropertyItemOptions` - `ICollectionTreeViewControlPaneOptions` - `IColorPickerPropertyItem` - `IColorPickerPropertyItemOptions` - `IColorTimelinePropertyItem` - `IColorTimelinePropertyItemEntry` - `IColorTimelinePropertyItemOptions` - `IComboBoxPropertyItem` - `IComboBoxPropertyItemEntry` - `IComboBoxPropertyItemOptions` - `IContentBadgeManager` - `IDataTablePropertyItem` - `IDataTablePropertyItemEntry` - `IDataTablePropertyItemOptions` - `IDividerPropertyItemOptions` - `IDropdownPropertyItem` - `IDropdownPropertyItemEntry` - `IDropdownPropertyItemOptions` - `IImagePropertyItem` - `IImagePropertyItemOptions` - `IIntroductionPane` - `IIntroductionPaneOptions` - `ILinkPropertyItem` - `ILinkPropertyItemOptions` - `IListPaneBoolEntry` - `IListPaneButtonEntry` - `IListPaneEntry` - `IListPaneImageEntry` - `IListPanePropertyItem` - `IListPanePropertyItemOptions` - `IListPaneSlot` - `IListPaneSlotOptions` - `IListPaneTextEntry` - `IListPaneViewControlPaneOptions` - `IListViewControlPane` - `IListViewControlPaneOptions` - `ImageAnimationData` - `ImageResourceData` - `ImageResourceType` - `IMenuContainer` - `IMenuPropertyItem` - `IMenuPropertyItemOptions` - `IMinimapPropertyItem` - `IMinimapPropertyItemOptions` - `IModalControlPane` - `IModalDialog` - `IModalDialogActivationRequest` - `IModalDialogManager` - `IModalOverlayPane` - `IModalOverlayPaneOptions` - `IntroductionPaneTabProps` - `INumberPropertyItem` - `INumberPropertyItemOptions` - `INumberTimelinePropertyItem` - `INumberTimelinePropertyItemEntry` - `INumberTimelinePropertyItemOptions` - `InvalidWidgetComponentError` - `InvalidWidgetError` - `InvalidWidgetGroupError` - `IObservable` - `IObservableProp` - `IPane` - `IPaneManager` - `IPlayerLoggerProperties` - `IProgressIndicatorPropertyItem` - `IProgressIndicatorPropertyItemOptions` - `IPropertyItemBase` - `IPropertyItemOptionsBase` - `IRegisteredKeyBinding` - `IRootPropertyPane` - `IRootPropertyPaneHeaderAction` - `IRootPropertyPaneOptions` - `IStatusBar` - `IStatusBarItemCreationParams` - `IStringPropertyItem` - `IStringPropertyItemOptions` - `ISubPanePropertyItem` - `ISubPanePropertyItemOptions` - `ITagContainerPropertyItem` - `ITagContainerPropertyItemOptions` - `ITextPropertyItem` - `ITextPropertyItemOptions` - `ITimelinePlayer` - `ITimelinePlayerEntry` - `ITimelinePlayerGroup` - `ITimelinePlayerOptions` - `IToggleGroupPropertyItem` - `IToggleGroupPropertyItemEntry` - `IToggleGroupPropertyItemOptions` - `IVector2PropertyItem` - `IVector2PropertyItemOptions` - `IVector3Keyframe` - `IVector3PropertyItem` - `IVector3PropertyItemOptions` - `IVector3TimelinePlayerEntry` - `IVector3TimelinePlayerEntryOptions` - `IVector3TimelinePropertyItem` - `IVector3TimelinePropertyItemEntry` - `IVector3TimelinePropertyItemOptions` - `KeyBinding` - `KeyBindingInfo` - `KeyProcessingState` - `LayoutAlignment` - `LayoutFlex` - `LayoutSize` - `LayoutSizeType` - `ListPaneBoolEntryParams` - `ListPaneButtonEntryParams` - `ListPaneEntryMap` - `ListPaneEntryParams` - `ListPaneEntryType` - `ListPaneImageEntryParams` - `ListPaneSlotConfiguration` - `ListPaneSlotCreationProps` - `ListPaneSlotLayoutEntry` - `ListPaneSlotLayoutSections` - `ListPaneSlotVariant` - `ListPaneTextEntryParams` - `ListPaneViewFilter` - `ListPaneViewSortType` - `ListViewControlAction` - `ListViewControlActionState` - `ListViewControlFilterFlags` - `LocalizationEntry` - `LocalizedString` - `LogChannel` - `makeObservable` - `MinimapCreateOptions` - `MinimapItem` - `MinimapManager` - `MinimapMarkerData` - `MinimapMarkerType` - `MinimapTrackingMode` - `MinimapViewType` - `ModalDialogActivationParams` - `ModalDialogCoreResponseType` - `ModalDialogCreationParams` - `ModalDialogCustomResponse` - `ModalDialogDataPickerResponse` - `ModalDialogDismissResponse` - `ModalDialogRequestData` - `ModalDialogResponseType` - `ModalDialogType` - `ModeChangeAfterEvent` - `ModeChangeAfterEventSignal` - `MouseCursorIconType` - `NumberLimitObservableValidator` - `NumberPropertyItemVariant` - `ObservableValidator` - `PaintCompletionState` - `PaintMode` - `PaneItemStyle` - `PaneLayoutType` - `PendingTransaction` - `Plane` - `PlaytestManager` - `PlaytestSessionResult` - `PrimitiveType` - `ProbabilityBlockPaletteItem` - `ProgressIndicatorPropertyItemVariant` - `ProjectAfterEvents` - `ProjectExportOptions` - `ProjectExportType` - `PropertyItemType` - `PyramidBrushShape` - `PyramidBrushShapeSettings` - `QuickExtrudeProperties` - `registerSerializationForType` - `registerUserDefinedTransactionHandler` - `RelativeVolumeListBlockVolume` - `RenderPlaneGridResolution` - `RootPaneLocation` - `SelectedModalToolChangedEventPayload` - `SelectionChangeAfterEventSignal` - `SelectionContainerBase` - `SelectionContainerEntity` - `SelectionContainerVolume` - `SelectionContainerVolumeEvent` - `SelectionEventAfterEvent` - `SelectionManifestData` - `SelectionManifestEntry` - `SelectionVolumeEventType` - `serialize` - `SettingsManager` - `SimpleBlockPaletteItem` - `SimulationState` - `SimulationStateAfterEvent` - `SimulationStateChangeAfterEventSignal` - `SingleBlockBrushShape` - `SpeedSettings` - `SpeedSettingsProperty` - `SpeedSettingsPropertyTypeMap` - `SplineType` - `StatefulAction` - `StatusBarAlignment` - `stringFromException` - `StructureSource` - `TagContainerVariant` - `ThemeSettings` - `ThemeSettingsColorKey` - `TimelinePlayerPlaybackState` - `TooltipButton` - `TooltipContent` - `TooltipInteractiveContent` - `TooltipInteractiveContentDescriptionItem` - `TooltipLink` - `TransactionEvent` - `TransactionHandler` - `TransactionManagerNoChangesError` - `TransactionOperationHandler` - `TransactionProcessState` - `UserDefinedTransactionHandle` - `UserDefinedTransactionOperationHandler` - `Vector2LimitObservableValidator` - `Vector3LimitObservableValidator` - `VolumeListTransactionOperationHandler` - `WeightedBlock` - `Widget` - `WidgetCollisionType` - `WidgetComponentBase` - `WidgetComponentBaseOptions` - `WidgetComponentBoundingBox` - `WidgetComponentBoundingBoxLimit` - `WidgetComponentBoundingBoxOptions` - `WidgetComponentBoundingBoxStateChangeEventParameters` - `WidgetComponentClipboard` - `WidgetComponentClipboardOptions` - `WidgetComponentEntity` - `WidgetComponentEntityOptions` - `WidgetComponentGizmo` - `WidgetComponentGizmoOptions` - `WidgetComponentGizmoStateChangeEventParameters` - `WidgetComponentGrid` - `WidgetComponentGridOptions` - `WidgetComponentGuide` - `WidgetComponentGuideOptions` - `WidgetComponentRenderPlane` - `WidgetComponentRenderPlaneOptions` - `WidgetComponentRenderPrimitive` - `WidgetComponentRenderPrimitiveOptions` - `WidgetComponentRenderPrimitiveTypeAxialSphere` - `WidgetComponentRenderPrimitiveTypeBase` - `WidgetComponentRenderPrimitiveTypeBox` - `WidgetComponentRenderPrimitiveTypeCone` - `WidgetComponentRenderPrimitiveTypeCuboid` - `WidgetComponentRenderPrimitiveTypeCylinder` - `WidgetComponentRenderPrimitiveTypeDisc` - `WidgetComponentRenderPrimitiveTypeEllipsoid` - `WidgetComponentRenderPrimitiveTypeLine` - `WidgetComponentRenderPrimitiveTypePyramid` - `WidgetComponentRenderPrimitiveTypeWireframeMesh` - `WidgetComponentSpline` - `WidgetComponentSplineOptions` - `WidgetComponentText` - `WidgetComponentTextOptions` - `WidgetComponentType` - `WidgetComponentVolumeOutline` - `WidgetComponentVolumeOutlineOptions` - `WidgetCreateOptions` - `WidgetGizmoEventType` - `WidgetGizmoScaleMode` - `WidgetGroup` - `WidgetGroupCreateOptions` - `WidgetGroupSelectionMode` - `WidgetManager` - `WidgetMouseButtonActionType` - `WidgetMouseButtonEventData` - `WidgetStateChangeEventData` - `WireframeMeshOptions` - `WorldGeneratorType` ### 既有符号的新增成员 - `ActionTypes`: `ContinuousAction`, `StatefulAction` - `BuiltInUIManager`: `activateTutorial`, `navigateToSamples`, `saveAndExit`, `showKeyboardSettings`, `showUpdateInformation`, `updateControlHelpPanelVisibility`, `updateStructurePanelVisibility` - `ButtonVariant`: `Confirmation`, `Destructive`, `Primary`, `Secondary` - `ClipboardItem`: `getPredictedWriteVolume`, `id`, `normalizedOrigin`, `originalWorldLocation`, `readFromStructure`, `size` - `ClipboardWriteOptions`: `excludeAirBlocks`, `normalizedOrigin` - `Cursor`: `getDefaultProperties`, `getRay`, `maxViewBlockDistance`, `popPropertiesById`, `pushPropertiesById`, `updatePropertiesById` - `CursorProperties`: `fillColor`, `projectThroughLiquid` - `Extension`: `defaultToolGroupId`, `description`, `name`, `notes` - `ExtensionContext`: `afterEvents`, `blockPalette`, `blockUtilities`, `blockUtilityTasks`, `brushShapeManager`, `exportManager`, `extensionInfo`, `guidePlaneManager`, `minimapManager`, `playtest`, `settings`, `structureManager`, `widgetManager` - `ExtensionOptionalParameters`: `toolGroupId` - `IGlobalInputManager`: `registerBindingCategory`, `setMouseIcon` - `IMenu`: `checked`, `enabled` - `IMenuCreationParams`: `checked`, `enabled`, `icon`, `label`, `sortIndex`, `tooltip`, `uniqueId` - `IModalTool`: `isActive`, `setMouseIcon` - `IModalToolContainer`: `focusToolInputContext`, `getSelectedToolId`, `getSortOrder`, `onSelectedToolChanged`, `setSelectedToolId`, `setSortOrder` - `IPropertyPane`: `addBlockList`, `addBlockTable`, `addButtonPane`, `addCollectionTree`, `addColorPicker`, `addColorTimeline`, `addComboBox`, `addDataTable`, `addImage`, `addLink`, `addListPane`, `addMenu`, `addMinimap`, `addNumberTimeline`, `addProgressIndicator`, `addProxyPane`, `addTagContainer`, `addText`, `addTimelinePlayer`, `addToggleGroup`, `addVector2`, `addVector3Timeline`, `collapse`, `collapsed`, `createSubPane`, `expand`, `getTitle`, `removeSubPane`, `setTitle`, `toggleSubPaneVisibility` - `IPropertyPaneOptions`: `infoTooltip`, `title`, `uniqueId` - `IRegisterExtensionOptionalParameters`: `toolGroupId` - `IStatusBarItem`: `getText`, `setText` - `KeyboardKey`: `CONTEXT_MENU`, `EQUALS`, `HYPHEN`, `NUM_LOCK`, `PAUSE`, `SCROLL_LOCK`, `SEMICOLON`, `UNDEFINED`, `WINDOWS_LEFT`, `WINDOWS_RIGHT` - `LogProperties`: `channelMask`, `subMessage` - `MinecraftEditor`: `afterEvents`, `constants`, `simulation`, `worldGeneratorType` - `ModalToolCreationParameters`: `action`, `contentBadgeId`, `staging`, `title`, `tooltip` - `SelectionManager`: `deselectBlocks`, `entity`, `generateManifest`, `getCurrentManifest`, `replaceBlocks`, `volume` - `TransactionManager`: `createPendingTransaction`, `registerTransactionHandler` [查看官方完整更新日志](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/changelog) ## 稳定版 `0.1.0-beta.1.20.20-preview.20` > 官方文档对应条目:`0.1.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/server-editor` Module ## 预览版 `0.1.0-beta.1.26.43-stable` > 官方文档对应条目:`0.1.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/server-editor` Module --- url: /changelog/server-gametest.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/server-gametest.md. # @minecraft/server-gametest 更新日志 官方原文:[Microsoft Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/changelog) ## 版本映射表 > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | -- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2022-09-27 | 稳定 | | `0.1.0` | - | `1.21.40.20` | 2024-08-19 | 预览 | ## 相对稳定版的变更 对比:稳定 `1.0.0-beta.1.21.60-preview.24` ↔ 预览(当前文档) `1.0.0-beta.1.26.50-preview.20` ### 新增导出符号 - `GameTestCompletedError` - `GameTestCompletedErrorReason` - `getPlayerSkin` - `PersonaArmSize` - `PersonaPieceType` - `PlayerPersonaPiece` - `PlayerSkinData` - `setAfterBatchCallback` - `setBeforeBatchCallback` - `spawnSimulatedPlayer` ### 既有符号的新增成员 - `SimulatedPlayer`: `setSkin` - `Test`: `isCleaningUp`, `isCompleted`, `runOnFinish` [查看官方完整更新日志](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/changelog) ## 稳定版 `1.0.0-beta.1.21.60-preview.24` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/server-gametest` Module ## 预览版 `0.1.0-rc.1.21.40-preview.20` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/server-gametest` Module --- url: /changelog/server-graphics.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /changelog/server-graphics.md. # @minecraft/server-graphics 更新日志 官方原文:[Microsoft Learn](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-graphics/changelog) ## 版本映射表 > 由 npm 已发布版本号推断(如 `2.9.0-rc.1.26.50-preview.20` → 预览分支 MC `1.26.50.20`)。 | API 版本 | 稳定分支 MC | 预览分支 MC | 首次发布 | 备注 | | ------- | --------- | ------------ | ---------- | ------- | | `1.0.0` | `1.26.43` | `1.26.50.24` | 2025-10-22 | 稳定 / 预览 | ## 相对稳定版的变更 对比:稳定 `1.0.0-beta.1.21.130-preview.22` ↔ 预览(当前文档) `1.0.0-beta.1.26.50-preview.20` ### 新增导出符号 - `BiomeAtmospherics` - `BiomeColorGrading` - `BiomeLighting` - `BiomeWater` - `getBiomeAtmospherics` - `getBiomeColorGrading` - `getBiomeLighting` - `getBiomeWater` - `getPlayerAtmospherics` - `getPlayerColorGrading` - `getPlayerLighting` - `getPlayerWater` [查看官方完整更新日志](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-graphics/changelog) ## 稳定版 `1.0.0-beta.1.21.130-preview.22` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/server-graphics` Module ## 预览版 `1.0.0-beta.1.26.43-stable` > 官方文档对应条目:`1.0.0-beta.1.26.50-preview.24`(近似匹配) ### Added `@minecraft/server-graphics` Module --- url: /ai-use.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /ai-use.md. # AI 使用说明 本页说明搜索引擎、爬虫与 AI 系统如何使用 [sapi.dogelake.cn](https://sapi.dogelake.cn/) 上的内容。 ## 允许做什么 在遵守下文「上游权利」的前提下,本站明确允许: - 爬取与索引全站公开页面(含 HTML 与 Markdown 导出) - 将本站内容用于检索增强(RAG)、摘要与问答 - 将本站**原创编排、中文译文与站点结构**用于模型训练 - 在回答或文档中引用本站内容(请保留来源链接) 推荐入口: | 资源 | 地址 | | ------------ | ---------------------------------------------------------------------- | | 站点地图 | [sitemap.xml](https://sapi.dogelake.cn/sitemap.xml) | | AI 索引 | [llms.txt](https://sapi.dogelake.cn/llms.txt) | | 全文打包 | [llms-full.txt](https://sapi.dogelake.cn/llms-full.txt) | | 爬虫规则 | [robots.txt](https://sapi.dogelake.cn/robots.txt) | | MCP 简介 | [/mcp/](/mcp/index.md) | | MCP 安装(给 AI) | [mcp-install.md](https://sapi.dogelake.cn/mcp-install.md) | | MCP 远程端点 | `https://sapi.dogelake.cn/mcp` | | MCP 混合索引 | [api-index.json](https://sapi.dogelake.cn/mcp-data/api-index.json) | | MCP 版本映射数据 | [version-map.json](https://sapi.dogelake.cn/mcp-data/version-map.json) | 单页 Markdown 导出:在任意文档 URL 后改为 `.md`(例如 `/server/classes/Player.md`)。 ## Cursor / 其他 AI:安装文档 MCP 安装后可检索文档、查结构化 API,并初始化 JS/TS 脚本工程。把下面这句话发给任意支持 MCP 的 AI 即可: ```text 请帮我安装Minecraft Scripts API 中文文档 MCP:https://sapi.dogelake.cn/mcp-install.md ``` ## 引用时请保留来源 引用或转述本站内容时,请附上可点击来源,例如: `https://sapi.dogelake.cn/` 或具体页面 URL。 ## 上游权利(重要) 本站大量 API 说明源自官方 `@minecraft/*.d.ts` 与 [MicrosoftDocs/minecraft-creator](https://github.com/MicrosoftDocs/minecraft-creator) 等材料。 - Microsoft、npm 包作者与 Minecraft 相关商标、文档的权利仍归原权利人 - 本站**不**授予、也不代替上游内容的额外许可 - 若你的用途涉及官方原文或商标展示,请自行遵守上游条款 ## 本站许可范围 对本站**原创**的编排结构、中文译文加工与站点工程代码,采用与仓库一致的 **MIT** 许可(见 [GitHub 仓库](https://github.com/Tanya7z/sapi-typedoc))。 页脚皮肤贴图来自 [Minecraft Wiki](https://minecraft.wiki/),采用 [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/),该部分不适用上述 AI 训练声明中的「任意商用」理解,请按原许可证处理。 ## 联系 许可或抓取相关问题可发至:`hi@ovo7.cc` --- url: /common/classes/ArgumentOutOfBoundsError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /common/classes/ArgumentOutOfBoundsError.md. # Class: ArgumentOutOfBoundsError error 此类错误表示调用的方法参数或待设置的属性超出允许的范围。 This type of error is thrown when a parameter to a method or property is out of expected bounds. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` #### Inherited from `Error.cause` *** ### index > `readonly` **index**: `number` **`Early Execution`** #### Remarks 导致错误的参数的索引。 Index of the argument that is in error. *** ### maxValue? > `readonly` `optional` **maxValue?**: `number` **`Early Execution`** #### Remarks 参数允许的最大值。 Max expected value for the condition. *** ### message > **message**: `string` #### Inherited from `Error.message` *** ### minValue? > `readonly` `optional` **minValue?**: `number` **`Early Execution`** #### Remarks 参数允许的最小值。 Min expected value for the condition. *** ### name > **name**: `string` #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` #### Inherited from `Error.stack` *** ### value? > `readonly` `optional` **value?**: `number` **`Early Execution`** #### Remarks 传入参数的值。 Passed-in value for the argument. *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [EngineError](/common/classes/EngineError.md) - [InvalidArgumentError](/common/classes/InvalidArgumentError.md) - [InvalidArgumentErrorType](/common/enums/InvalidArgumentErrorType.md) - [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError.md) - [RuntimeConditionError](/common/classes/RuntimeConditionError.md) [源码](https://www.npmjs.com/package/@minecraft/common) --- url: /common/classes/ContainerSizeOutOfBoundsError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /common/classes/ContainerSizeOutOfBoundsError.md. # Class: ContainerSizeOutOfBoundsError inventory error 此错误表示容器的尺寸超出了允许的范围。 This type of error is thrown when the size of a container is out of expected bounds. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` #### Inherited from `Error.cause` *** ### maxValue > `readonly` **maxValue**: `number` **`Early Execution`** #### Remarks 容器允许的最大尺寸。 Maximum expected size for the container. *** ### message > **message**: `string` #### Inherited from `Error.message` *** ### name > **name**: `string` #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [ContainerRulesError](/server/classes/ContainerRulesError.md) - [ContainerRulesErrorReason](/server/enums/ContainerRulesErrorReason.md) - [InvalidContainerError](/server/classes/InvalidContainerError.md) - [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError.md) - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [EngineError](/common/classes/EngineError.md) [源码](https://www.npmjs.com/package/@minecraft/common) --- url: /common/classes/EngineError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /common/classes/EngineError.md. # Class: EngineError error 表示在处理函数时引擎中发生的底层错误。 Specifies an underlying error in the engine in processing a function. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` #### Inherited from `Error.cause` *** ### message > **message**: `string` #### Inherited from `Error.message` *** ### name > **name**: `string` #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [InvalidArgumentError](/common/classes/InvalidArgumentError.md) - [InvalidArgumentErrorType](/common/enums/InvalidArgumentErrorType.md) - [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError.md) - [RuntimeConditionError](/common/classes/RuntimeConditionError.md) [源码](https://www.npmjs.com/package/@minecraft/common) --- url: /common/classes/InvalidArgumentError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /common/classes/InvalidArgumentError.md. # Class: InvalidArgumentError error 表示指定传递给方法的参数不正确或不被允许。 Specifies that a passed-in argument to a method is not correct or allowed. ## Extends - `Error` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new InvalidArgumentError**(`funcName`, `argTypeName`, `errorType`, `argIndex?`): `InvalidArgumentError` #### Parameters ##### funcName `string` ##### argTypeName `string` ##### errorType [`InvalidArgumentErrorType`](/common/enums/InvalidArgumentErrorType.md) ##### argIndex? `number` #### Returns `InvalidArgumentError` #### Remarks #### Overrides `Error.constructor` ## Properties ### cause? > `optional` **cause?**: `unknown` #### Inherited from `Error.cause` *** ### index > `readonly` **index**: `number` **`Early Execution`** #### Remarks 出错的参数的索引。 Index of the argument that is in error. *** ### message > **message**: `string` #### Inherited from `Error.message` *** ### name > **name**: `string` #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` #### Inherited from `Error.stack` *** ### type > `readonly` **type**: [`InvalidArgumentErrorType`](/common/enums/InvalidArgumentErrorType.md) **`Early Execution`** #### Remarks 参数错误的类型。 Type of the argument error. *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [EngineError](/common/classes/EngineError.md) - [InvalidArgumentErrorType](/common/enums/InvalidArgumentErrorType.md) - [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError.md) - [RuntimeConditionError](/common/classes/RuntimeConditionError.md) [源码](https://www.npmjs.com/package/@minecraft/common) --- url: /common/classes/PropertyOutOfBoundsError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /common/classes/PropertyOutOfBoundsError.md. # Class: PropertyOutOfBoundsError error 此错误表示设置的属性值超出了允许的范围。 This type of error is thrown when a property value is out of expected bounds. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` #### Inherited from `Error.cause` *** ### maxValue? > `readonly` `optional` **maxValue?**: `number` **`Early Execution`** #### Remarks 属性允许的最大值。 Max expected value for the condition. *** ### message > **message**: `string` #### Inherited from `Error.message` *** ### minValue? > `readonly` `optional` **minValue?**: `number` **`Early Execution`** #### Remarks 属性允许的最小值。 Min expected value for the condition. *** ### name > **name**: `string` #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` #### Inherited from `Error.stack` *** ### value > `readonly` **value**: `number` **`Early Execution`** #### Remarks 设置的属性值。 Value set for the property. *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [EngineError](/common/classes/EngineError.md) - [InvalidArgumentError](/common/classes/InvalidArgumentError.md) - [InvalidArgumentErrorType](/common/enums/InvalidArgumentErrorType.md) - [RuntimeConditionError](/common/classes/RuntimeConditionError.md) [源码](https://www.npmjs.com/package/@minecraft/common) --- url: /common/classes/RuntimeConditionError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /common/classes/RuntimeConditionError.md. # Class: RuntimeConditionError error ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` #### Inherited from `Error.cause` *** ### message > **message**: `string` #### Inherited from `Error.message` *** ### name > **name**: `string` #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [EngineError](/common/classes/EngineError.md) - [InvalidArgumentError](/common/classes/InvalidArgumentError.md) - [InvalidArgumentErrorType](/common/enums/InvalidArgumentErrorType.md) - [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError.md) [源码](https://www.npmjs.com/package/@minecraft/common) --- url: /common/classes/UnsupportedFunctionalityError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /common/classes/UnsupportedFunctionalityError.md. # Class: UnsupportedFunctionalityError error 此错误表示调用了当前环境不支持的函数。 This type of error is thrown when a functionality is called that is not supported in the current environment. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` #### Inherited from `Error.cause` *** ### message > **message**: `string` #### Inherited from `Error.message` *** ### name > **name**: `string` #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [EngineError](/common/classes/EngineError.md) - [InvalidArgumentError](/common/classes/InvalidArgumentError.md) - [InvalidArgumentErrorType](/common/enums/InvalidArgumentErrorType.md) - [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError.md) [源码](https://www.npmjs.com/package/@minecraft/common) --- url: /common/enums/InvalidArgumentErrorType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /common/enums/InvalidArgumentErrorType.md. # Enumeration: InvalidArgumentErrorType error 描述 InvalidArgumentError 类型的枚举。 An enum describing the type of InvalidArgumentError ## Enumeration Members ### Duplicate > **Duplicate**: `"Duplicate"` #### Remarks 该参数在此域中存在重复。 The argument has a duplicate in this domain. *** ### Empty > **Empty**: `"Empty"` #### Remarks 该参数为空。 The argument is empty. *** ### InvalidType > **InvalidType**: `"InvalidType"` #### Remarks 该参数类型不正确。 The argument is not the correct type. *** ### Unknown > **Unknown**: `"Unknown"` #### Remarks 该参数在此域中未知。 The argument is unknown in this domain. *** ### Unspecified > **Unspecified**: `"Unspecified"` #### Remarks 未指定错误类型。 No specified error type. *** ### UnsupportedValue > **UnsupportedValue**: `"UnsupportedValue"` #### Remarks 该参数对该类型不受支持。 The argument is unsupported for this type. ## 同领域相关 - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [EngineError](/common/classes/EngineError.md) - [InvalidArgumentError](/common/classes/InvalidArgumentError.md) - [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError.md) - [RuntimeConditionError](/common/classes/RuntimeConditionError.md) [源码](https://www.npmjs.com/package/@minecraft/common) --- url: /common/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /common/index.md. # Module: common 清单详情 Manifest Details ```json { "module_name": "@minecraft/common", "version": "1.3.0" } ``` ## Enumerations - [InvalidArgumentErrorType](/common/enums/InvalidArgumentErrorType.md) ## Classes - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError.md) - [EngineError](/common/classes/EngineError.md) - [InvalidArgumentError](/common/classes/InvalidArgumentError.md) - [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError.md) - [RuntimeConditionError](/common/classes/RuntimeConditionError.md) - [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError.md) ## Interfaces - [NumberRange](/common/interfaces/NumberRange.md) --- url: /common/interfaces/NumberRange.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /common/interfaces/NumberRange.md. # Interface: NumberRange 表示一个最大/最小值的结构,用于描述数值的取值范围。 Represents a min/max structure for expressing a potential range of numbers. ## Properties ### max > **max**: `number` #### Remarks 能够取到的最大值。 Maximum value within a range. *** ### min > **min**: `number` #### Remarks 能够取到的最小值。 Minimum value within a range. [源码](https://www.npmjs.com/package/@minecraft/common) --- url: /debug-utilities/classes/DebugArrow.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugArrow.md. # Class: DebugArrow debug **`Beta`** 箭头头部/箭尖的长度。 The length of the arrow's head/tip. ## Extends - [`DebugLine`](/debug-utilities/classes/DebugLine.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new DebugArrow**(`location`, `endLocation`): `DebugArrow` **`Beta`** #### Parameters ##### location `any` ##### endLocation `Vector3` #### Returns `DebugArrow` #### Overrides [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`constructor`](/debug-utilities/classes/DebugLine.md#constructor) ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`attachedTo`](/debug-utilities/classes/DebugLine.md#attachedto) *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`color`](/debug-utilities/classes/DebugLine.md#color) *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`dimension`](/debug-utilities/classes/DebugLine.md#dimension) *** ### endLocation > **endLocation**: `Vector3` **`Beta`** #### Remarks 线段的终点位置。最终绘制的线段将位于 location 与 endLocation 之间。 The end location of the line segment. The final line will spawn between location and endLocation. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`endLocation`](/debug-utilities/classes/DebugLine.md#endlocation) *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`hasDuration`](/debug-utilities/classes/DebugLine.md#hasduration) *** ### headLength > **headLength**: `number` **`Beta`** #### Remarks 向世界中添加一个新的调试形状。 Adds a new debug shape to the world. *** ### headRadius > **headRadius**: `number` **`Beta`** #### Remarks 箭头头部/箭尖的半径。 The radius of the arrow's head/tip. *** ### headSegments > **headSegments**: `number` **`Beta`** #### Remarks 箭头头部/箭尖底部圆周的段数(默认:4)。 The number of segments for the base circle of the arrow's head/tip (default: 4). Bounds: \[3, 128] *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`location`](/debug-utilities/classes/DebugLine.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`maximumRenderDistance`](/debug-utilities/classes/DebugLine.md#maximumrenderdistance) *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`rotation`](/debug-utilities/classes/DebugLine.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`scale`](/debug-utilities/classes/DebugLine.md#scale) *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`timeLeft`](/debug-utilities/classes/DebugLine.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`totalTimeLeft`](/debug-utilities/classes/DebugLine.md#totaltimeleft) *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`visibleTo`](/debug-utilities/classes/DebugLine.md#visibleto) ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`remove`](/debug-utilities/classes/DebugLine.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugLine`](/debug-utilities/classes/DebugLine.md).[`setLocation`](/debug-utilities/classes/DebugLine.md#setlocation) ## 同领域相关 - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) - [DebugEllipsoid](/debug-utilities/classes/DebugEllipsoid.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugBox.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugBox.md. # Class: DebugBox debug **`Beta`** 表示一个长方体(立方体)的调试形状类。 A debug shape class that represents a box or cuboid. ## Extends - [`DebugShape`](/debug-utilities/classes/DebugShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new DebugBox**(`location`): `DebugBox` **`Beta`** #### Parameters ##### location `any` #### Returns `DebugBox` #### Overrides `DebugShape.constructor` ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`attachedTo`](/debug-utilities/classes/DebugShape.md#attachedto) *** ### bound > **bound**: `Vector3` **`Beta`** #### Remarks 该形状的包围盒。最终绘制的方块将是该包围盒乘以形状的缩放比例。 The bounding box of the shape. The final box will be this bound multiplied by the shape's scale. *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`color`](/debug-utilities/classes/DebugShape.md#color) *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`dimension`](/debug-utilities/classes/DebugShape.md#dimension) *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`hasDuration`](/debug-utilities/classes/DebugShape.md#hasduration) *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`location`](/debug-utilities/classes/DebugShape.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`maximumRenderDistance`](/debug-utilities/classes/DebugShape.md#maximumrenderdistance) *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`rotation`](/debug-utilities/classes/DebugShape.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`scale`](/debug-utilities/classes/DebugShape.md#scale) *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`timeLeft`](/debug-utilities/classes/DebugShape.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`totalTimeLeft`](/debug-utilities/classes/DebugShape.md#totaltimeleft) *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`visibleTo`](/debug-utilities/classes/DebugShape.md#visibleto) ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`remove`](/debug-utilities/classes/DebugShape.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`setLocation`](/debug-utilities/classes/DebugShape.md#setlocation) ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) - [DebugEllipsoid](/debug-utilities/classes/DebugEllipsoid.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugCircle.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugCircle.md. # Class: DebugCircle debug **`Beta`** 表示一个圆(2D)的调试形状类。 A debug shape class that represents a circle (2D). ## Extends - [`DebugShape`](/debug-utilities/classes/DebugShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new DebugCircle**(`location`): `DebugCircle` **`Beta`** #### Parameters ##### location `any` #### Returns `DebugCircle` #### Overrides `DebugShape.constructor` ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`attachedTo`](/debug-utilities/classes/DebugShape.md#attachedto) *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`color`](/debug-utilities/classes/DebugShape.md#color) *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`dimension`](/debug-utilities/classes/DebugShape.md#dimension) *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`hasDuration`](/debug-utilities/classes/DebugShape.md#hasduration) *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`location`](/debug-utilities/classes/DebugShape.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`maximumRenderDistance`](/debug-utilities/classes/DebugShape.md#maximumrenderdistance) *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`rotation`](/debug-utilities/classes/DebugShape.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`scale`](/debug-utilities/classes/DebugShape.md#scale) *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`timeLeft`](/debug-utilities/classes/DebugShape.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`totalTimeLeft`](/debug-utilities/classes/DebugShape.md#totaltimeleft) *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`visibleTo`](/debug-utilities/classes/DebugShape.md#visibleto) ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`remove`](/debug-utilities/classes/DebugShape.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`setLocation`](/debug-utilities/classes/DebugShape.md#setlocation) ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) - [DebugEllipsoid](/debug-utilities/classes/DebugEllipsoid.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugCone.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugCone.md. # Class: DebugCone debug **`Beta`** 表示圆锥体的调试形状类。 A debug shape class that represents a cone. ## Extends - [`DebugShape`](/debug-utilities/classes/DebugShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new DebugCone**(`location`): `DebugCone` **`Beta`** #### Parameters ##### location `any` #### Returns `DebugCone` #### Overrides `DebugShape.constructor` ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`attachedTo`](/debug-utilities/classes/DebugShape.md#attachedto) *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`color`](/debug-utilities/classes/DebugShape.md#color) *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`dimension`](/debug-utilities/classes/DebugShape.md#dimension) *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`hasDuration`](/debug-utilities/classes/DebugShape.md#hasduration) *** ### height > **height**: `number` **`Beta`** #### Remarks 圆锥体的高度。 The height of the cone. *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`location`](/debug-utilities/classes/DebugShape.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`maximumRenderDistance`](/debug-utilities/classes/DebugShape.md#maximumrenderdistance) *** ### numSegments > **numSegments**: `number` **`Beta`** #### Remarks 用于近似圆锥体圆形底面的分段数量。取值范围:\[3, 128] The number of segments used to approximate the circular base of the cone. Bounds: \[3, 128] Bounds: \[3, 128] *** ### radii > **radii**: `Vector2` **`Beta`** #### Remarks 圆锥体圆形底面的半径(x:底部半径,y:顶部半径)。 The radii of the cone's circular base (x: bottom radius, y: top radius). *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`rotation`](/debug-utilities/classes/DebugShape.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`scale`](/debug-utilities/classes/DebugShape.md#scale) *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`timeLeft`](/debug-utilities/classes/DebugShape.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`totalTimeLeft`](/debug-utilities/classes/DebugShape.md#totaltimeleft) *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`visibleTo`](/debug-utilities/classes/DebugShape.md#visibleto) ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`remove`](/debug-utilities/classes/DebugShape.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`setLocation`](/debug-utilities/classes/DebugShape.md#setlocation) ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) - [DebugEllipsoid](/debug-utilities/classes/DebugEllipsoid.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugCylinder.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugCylinder.md. # Class: DebugCylinder debug **`Beta`** 表示圆柱体的调试形状类。 A debug shape class that represents a cylinder. ## Extends - [`DebugShape`](/debug-utilities/classes/DebugShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new DebugCylinder**(`location`): `DebugCylinder` **`Beta`** #### Parameters ##### location `any` #### Returns `DebugCylinder` #### Overrides `DebugShape.constructor` ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`attachedTo`](/debug-utilities/classes/DebugShape.md#attachedto) *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`color`](/debug-utilities/classes/DebugShape.md#color) *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`dimension`](/debug-utilities/classes/DebugShape.md#dimension) *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`hasDuration`](/debug-utilities/classes/DebugShape.md#hasduration) *** ### height > **height**: `number` **`Beta`** #### Remarks 圆柱体的高度。 The height of the cylinder. *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`location`](/debug-utilities/classes/DebugShape.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`maximumRenderDistance`](/debug-utilities/classes/DebugShape.md#maximumrenderdistance) *** ### numSegments > **numSegments**: `number` **`Beta`** #### Remarks 用于近似圆柱体圆形截面的分段数。取值范围:\[3, 128] The number of segments used to approximate the circular cross-section of the cylinder. Bounds: \[3, 128] Bounds: \[3, 128] *** ### radii > **radii**: `Vector2` **`Beta`** #### Remarks 圆柱体圆形截面的半径(x:底部半径,y:顶部半径)。 The radii of the cylinder's circular cross-section (x: bottom radius, y: top radius). *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`rotation`](/debug-utilities/classes/DebugShape.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`scale`](/debug-utilities/classes/DebugShape.md#scale) *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`timeLeft`](/debug-utilities/classes/DebugShape.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`totalTimeLeft`](/debug-utilities/classes/DebugShape.md#totaltimeleft) *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`visibleTo`](/debug-utilities/classes/DebugShape.md#visibleto) ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`remove`](/debug-utilities/classes/DebugShape.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`setLocation`](/debug-utilities/classes/DebugShape.md#setlocation) ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) - [DebugEllipsoid](/debug-utilities/classes/DebugEllipsoid.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugDrawer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugDrawer.md. # Class: DebugDrawer debug **`Beta`** 用于在世界中添加和移除线框形状的调试绘制类。 Debug Drawing class used to allow adding and removing wireframe shapes in world space. ## Methods ### addShape() > **addShape**(`shape`, `dimension?`): `void` **`Beta`** #### Parameters ##### shape [`DebugShape`](/debug-utilities/classes/DebugShape.md) 要添加的调试形状,应为 DebugBox、DebugLine、DebugCircle、DebugSphere、DebugArrow 或 DebugText 类型。 The debug shape to be added. Should be of type DebugBox, DebugLine, DebugCircle, DebugSphere, DebugArrow or DebugText. ##### dimension? `any` #### Returns `void` #### Remarks 向世界中添加一个新的调试形状。 Adds a new debug shape to the world. *** ### removeAll() > **removeAll**(): `void` **`Beta`** #### Returns `void` #### Remarks 移除世界中的所有调试形状。 Removes all debug shapes from the world. *** ### removeShape() > **removeShape**(`shape`): `void` **`Beta`** #### Parameters ##### shape [`DebugShape`](/debug-utilities/classes/DebugShape.md) #### Returns `void` #### Remarks 从世界中移除一个调试形状实例。等同于在形状本身上调用 remove。 Removes an instance of a debug shape from the world. This is equivalent to calling remove on the shape itself. ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugEllipsoid](/debug-utilities/classes/DebugEllipsoid.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugEllipsoid.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugEllipsoid.md. # Class: DebugEllipsoid debug **`Beta`** 表示椭球体的调试形状类。 A debug shape class that represents an ellipsoid. ## Extends - [`DebugShape`](/debug-utilities/classes/DebugShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new DebugEllipsoid**(`location`): `DebugEllipsoid` **`Beta`** #### Parameters ##### location `any` #### Returns `DebugEllipsoid` #### Overrides `DebugShape.constructor` ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`attachedTo`](/debug-utilities/classes/DebugShape.md#attachedto) *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`color`](/debug-utilities/classes/DebugShape.md#color) *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`dimension`](/debug-utilities/classes/DebugShape.md#dimension) *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`hasDuration`](/debug-utilities/classes/DebugShape.md#hasduration) *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`location`](/debug-utilities/classes/DebugShape.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`maximumRenderDistance`](/debug-utilities/classes/DebugShape.md#maximumrenderdistance) *** ### radii > **radii**: `Vector3` **`Beta`** #### Remarks 椭球体沿各坐标轴(x、y、z)的半径。 The radii of the ellipsoid along each axis (x, y, z). *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`rotation`](/debug-utilities/classes/DebugShape.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`scale`](/debug-utilities/classes/DebugShape.md#scale) *** ### segmentsPerAxis > **segmentsPerAxis**: `number` **`Beta`** #### Remarks 沿每个轴用于近似椭球体的分段数。范围:\[3, 128] The number of segments used to approximate the ellipsoid per axis. Bounds: \[3, 128] Bounds: \[3, 128] *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`timeLeft`](/debug-utilities/classes/DebugShape.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`totalTimeLeft`](/debug-utilities/classes/DebugShape.md#totaltimeleft) *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`visibleTo`](/debug-utilities/classes/DebugShape.md#visibleto) ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`remove`](/debug-utilities/classes/DebugShape.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`setLocation`](/debug-utilities/classes/DebugShape.md#setlocation) ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugLine.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugLine.md. # Class: DebugLine debug **`Beta`** 表示一条线段的调试形状类。 A debug shape class that represents a line segment. ## Extends - [`DebugShape`](/debug-utilities/classes/DebugShape.md) ## Extended by - [`DebugArrow`](/debug-utilities/classes/DebugArrow.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new DebugLine**(`location`, `endLocation`): `DebugLine` **`Beta`** #### Parameters ##### location `any` ##### endLocation `Vector3` #### Returns `DebugLine` #### Overrides `DebugShape.constructor` ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`attachedTo`](/debug-utilities/classes/DebugShape.md#attachedto) *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`color`](/debug-utilities/classes/DebugShape.md#color) *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`dimension`](/debug-utilities/classes/DebugShape.md#dimension) *** ### endLocation > **endLocation**: `Vector3` **`Beta`** #### Remarks 线段的终点位置。最终绘制的线段将位于 location 与 endLocation 之间。 The end location of the line segment. The final line will spawn between location and endLocation. *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`hasDuration`](/debug-utilities/classes/DebugShape.md#hasduration) *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`location`](/debug-utilities/classes/DebugShape.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`maximumRenderDistance`](/debug-utilities/classes/DebugShape.md#maximumrenderdistance) *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`rotation`](/debug-utilities/classes/DebugShape.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`scale`](/debug-utilities/classes/DebugShape.md#scale) *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`timeLeft`](/debug-utilities/classes/DebugShape.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`totalTimeLeft`](/debug-utilities/classes/DebugShape.md#totaltimeleft) *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`visibleTo`](/debug-utilities/classes/DebugShape.md#visibleto) ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`remove`](/debug-utilities/classes/DebugShape.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`setLocation`](/debug-utilities/classes/DebugShape.md#setlocation) ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugPyramid.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugPyramid.md. # Class: DebugPyramid debug **`Beta`** 表示金字塔的调试形状类。 A debug shape class that represents a pyramid. ## Extends - [`DebugShape`](/debug-utilities/classes/DebugShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new DebugPyramid**(`location`): `DebugPyramid` **`Beta`** #### Parameters ##### location `any` #### Returns `DebugPyramid` #### Overrides `DebugShape.constructor` ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`attachedTo`](/debug-utilities/classes/DebugShape.md#attachedto) *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`color`](/debug-utilities/classes/DebugShape.md#color) *** ### depth? > `optional` **depth?**: `number` **`Beta`** #### Remarks 金字塔底面的深度。 The depth of the pyramid's base. *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`dimension`](/debug-utilities/classes/DebugShape.md#dimension) *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`hasDuration`](/debug-utilities/classes/DebugShape.md#hasduration) *** ### height > **height**: `number` **`Beta`** #### Remarks 金字塔的高度。 The height of the pyramid. *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`location`](/debug-utilities/classes/DebugShape.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`maximumRenderDistance`](/debug-utilities/classes/DebugShape.md#maximumrenderdistance) *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`rotation`](/debug-utilities/classes/DebugShape.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`scale`](/debug-utilities/classes/DebugShape.md#scale) *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`timeLeft`](/debug-utilities/classes/DebugShape.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`totalTimeLeft`](/debug-utilities/classes/DebugShape.md#totaltimeleft) *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`visibleTo`](/debug-utilities/classes/DebugShape.md#visibleto) *** ### width > **width**: `number` **`Beta`** #### Remarks 金字塔底面的宽度。 The width of the pyramid's base. ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`remove`](/debug-utilities/classes/DebugShape.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`setLocation`](/debug-utilities/classes/DebugShape.md#setlocation) ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugShape.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugShape.md. # Class: DebugShape debug **`Beta`** 所有调试形状的基类。表示世界中的一个对象及其基本属性。 The base class for all debug shapes. Represents an object in the world and its base properties. ## Extended by - [`DebugBox`](/debug-utilities/classes/DebugBox.md) - [`DebugCircle`](/debug-utilities/classes/DebugCircle.md) - [`DebugCone`](/debug-utilities/classes/DebugCone.md) - [`DebugCylinder`](/debug-utilities/classes/DebugCylinder.md) - [`DebugEllipsoid`](/debug-utilities/classes/DebugEllipsoid.md) - [`DebugLine`](/debug-utilities/classes/DebugLine.md) - [`DebugPyramid`](/debug-utilities/classes/DebugPyramid.md) - [`DebugSphere`](/debug-utilities/classes/DebugSphere.md) - [`DebugText`](/debug-utilities/classes/DebugText.md) ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugSphere.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugSphere.md. # Class: DebugSphere debug **`Beta`** 表示一个球体的调试形状类。 A debug shape class that represents a sphere. ## Extends - [`DebugShape`](/debug-utilities/classes/DebugShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new DebugSphere**(`location`): `DebugSphere` **`Beta`** #### Parameters ##### location `any` #### Returns `DebugSphere` #### Overrides `DebugShape.constructor` ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`attachedTo`](/debug-utilities/classes/DebugShape.md#attachedto) *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`color`](/debug-utilities/classes/DebugShape.md#color) *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`dimension`](/debug-utilities/classes/DebugShape.md#dimension) *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`hasDuration`](/debug-utilities/classes/DebugShape.md#hasduration) *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`location`](/debug-utilities/classes/DebugShape.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`maximumRenderDistance`](/debug-utilities/classes/DebugShape.md#maximumrenderdistance) *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`rotation`](/debug-utilities/classes/DebugShape.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`scale`](/debug-utilities/classes/DebugShape.md#scale) *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`timeLeft`](/debug-utilities/classes/DebugShape.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`totalTimeLeft`](/debug-utilities/classes/DebugShape.md#totaltimeleft) *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`visibleTo`](/debug-utilities/classes/DebugShape.md#visibleto) ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`remove`](/debug-utilities/classes/DebugShape.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`setLocation`](/debug-utilities/classes/DebugShape.md#setlocation) ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/classes/DebugText.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/classes/DebugText.md. # Class: DebugText debug **`Beta`** A debug shape class that represents a text label in the world with a background. ## Extends - [`DebugShape`](/debug-utilities/classes/DebugShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new DebugText**(`location`, `text`): `DebugText` **`Beta`** #### Parameters ##### location `any` ##### text `any` #### Returns `DebugText` #### Overrides `DebugShape.constructor` ## Properties ### attachedTo? > `optional` **attachedTo?**: `any` **`Beta`** #### Remarks 此形状所附加的实体。设置后,此形状将复制附加实体的根位置, 而形状的位置将作为偏移量使用。 The entity this shape is attached to. When set, this shape will copy the root location of the attached entity and the shape's position will be used as an offset. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`attachedTo`](/debug-utilities/classes/DebugShape.md#attachedto) *** ### backfaceVisible > **backfaceVisible**: `boolean` **`Beta`** #### Remarks If set to true, the debug text will render the back-face of the background. Defaults to true but will always be false if 'useRotation' is set to false. *** ### backgroundColorOverride? > `optional` **backgroundColorOverride?**: `any` **`Beta`** #### Remarks The color of the background plate of the text. If set to undefined, it will use the default color. *** ### color > **color**: `RGBA` **`Beta`** #### Remarks 形状的颜色。 The color of the shape. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`color`](/debug-utilities/classes/DebugShape.md#color) *** ### depthTest > **depthTest**: `boolean` **`Beta`** #### Remarks If set to true, the text will be hidden behind blocks or entities. By default this is set to false (will always render). *** ### dimension > `readonly` **dimension**: `Dimension` **`Beta`** #### Remarks 该形状可见的维度。如果该维度未定义,则会在所有维度中显示。 The dimension the shape is visible within. If the dimension is undefined, it will display in all dimensions. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`dimension`](/debug-utilities/classes/DebugShape.md#dimension) *** ### hasDuration > `readonly` **hasDuration**: `boolean` **`Beta`** #### Remarks 如果形状在被移除之前具有有限的时间跨度,则返回 true。 Returns true if the shape has a limited time span before being removed. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`hasDuration`](/debug-utilities/classes/DebugShape.md#hasduration) *** ### lineGapHeight > **lineGapHeight**: `number` **`Beta`** #### Remarks This value determines the gap between lines for the debug text. By default the line gap height is 0. *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Remarks 形状的位置。对于大多数形状,该位置是形状的中心, 但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 The location of the shape. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`location`](/debug-utilities/classes/DebugShape.md#location) *** ### maximumRenderDistance? > `optional` **maximumRenderDistance?**: `number` **`Beta`** #### Remarks 如果已定义,此距离将用于确定该形状对每个客户端所渲染的远处距离。 默认情况下,距离将匹配客户端的视距设置。 If defined, this distance will be used to determine how far away this shape will be rendered for each client. By default the distance will match the client's render distance setting. Minimum Value: 0 #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`maximumRenderDistance`](/debug-utilities/classes/DebugShape.md#maximumrenderdistance) *** ### rotation > **rotation**: `Vector3` **`Beta`** #### Remarks 形状的旋转(欧拉角 - \[俯仰角,偏航角,滚转角])。 The rotation of the shape (Euler angles - \[Pitch, Yaw, Roll]). #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`rotation`](/debug-utilities/classes/DebugShape.md#rotation) *** ### scale > **scale**: `number` **`Beta`** #### Remarks 形状的缩放比例。此属性不适用于 DebugLine 或 DebugArrow。 The scale of the shape. This does not apply to DebugLine or DebugArrow. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`scale`](/debug-utilities/classes/DebugShape.md#scale) *** ### text > `readonly` **text**: `any` **`Beta`** #### Remarks Get the text of the debug text shape. Returns the RawText of the debug text if `setText` was called with a RawMessage or a RawText object, otherwise returns a string. *** ### textBackfaceVisible > **textBackfaceVisible**: `boolean` **`Beta`** #### Remarks If set to true, the debug text will render the back-face of the text. Defaults to true but will always be false if 'useRotation' is set to false. *** ### timeLeft? > `optional` **timeLeft?**: `number` **`Beta`** #### Remarks 此形状被自动移除之前剩余的时间(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The time left (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`timeLeft`](/debug-utilities/classes/DebugShape.md#timeleft) *** ### totalTimeLeft? > `readonly` `optional` **totalTimeLeft?**: `number` **`Beta`** #### Remarks 直到该形状被自动移除为止的初始总时间跨度(以秒为单位)。 如果形状没有有限的生命周期,则返回 undefined。 The total initial time-span (in seconds) until this shape is automatically removed. Returns undefined if the shape does not have a limited life-span. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`totalTimeLeft`](/debug-utilities/classes/DebugShape.md#totaltimeleft) *** ### useRotation > **useRotation**: `boolean` **`Beta`** #### Remarks If set to true, the text will not face the camera and instead will use the rotation from the shape. *** ### visibleTo > **visibleTo**: `Player`\[] **`Beta`** #### Remarks 可以看到此形状的玩家列表。如果留空,则所有玩家都可以看到该形状。 The list of players that this shape will be visible to. If left empty, the shape will be visible to all players. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`visibleTo`](/debug-utilities/classes/DebugShape.md#visibleto) ## Methods ### remove() > **remove**(): `void` **`Beta`** #### Returns `void` #### Remarks 从世界中移除此形状。可以通过 DebugDrawer 的 addShape 方法重新添加。 Removes this shape from the world. The shape can be re-added via the DebugDrawer's addShape method. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`remove`](/debug-utilities/classes/DebugShape.md#remove) *** ### setLocation() > **setLocation**(`location`): `void` **`Beta`** #### Parameters ##### location `any` #### Returns `void` #### Remarks 设置形状的位置和维度。如果该维度未定义,则会在所有维度中显示。 对于大多数形状,该位置是形状的中心,但 DebugLine 和 DebugArrow 例外,它们表示线的起点。 Set the location and dimension of the shape. If the dimension is undefined, it will display in all dimensions. For most shapes the location is the centre of the shape, except DebugLine and DebugArrow where this represents the start point of the line. #### Inherited from [`DebugShape`](/debug-utilities/classes/DebugShape.md).[`setLocation`](/debug-utilities/classes/DebugShape.md#setlocation) *** ### setText() > **setText**(`text`): `void` **`Beta`** #### Parameters ##### text `any` #### Returns `void` #### Remarks Sets the text to display. #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) [RawMessageError](/server/classes/RawMessageError.md) ## 同领域相关 - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/functions/collectPluginStats.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/functions/collectPluginStats.md. # Function: collectPluginStats() > **collectPluginStats**(): [`PluginStats`](/debug-utilities/interfaces/PluginStats.md) **`Beta`** ## Returns [`PluginStats`](/debug-utilities/interfaces/PluginStats.md) PluginStats 对象。 PluginStats object. ## Remarks 为每个已激活的脚本插件/附加包收集类型使用统计信息。 Collect type usage stats for each active script plugin/add-on. [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/functions/collectRuntimeStats.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/functions/collectRuntimeStats.md. # Function: collectRuntimeStats() > **collectRuntimeStats**(): [`RuntimeStats`](/debug-utilities/interfaces/RuntimeStats.md) **`Beta`** ## Returns [`RuntimeStats`](/debug-utilities/interfaces/RuntimeStats.md) RuntimeStats 对象。 RuntimeStats object. ## Remarks 收集脚本运行时的内存统计信息。 Collect memory stats for script runtimes. [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/functions/disableWatchdogTimingWarnings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/functions/disableWatchdogTimingWarnings.md. # Function: disableWatchdogTimingWarnings() > **disableWatchdogTimingWarnings**(`disable`): `void` **`Beta`** ## Parameters ### disable `boolean` 用于禁用或重新启用警告的开关。 Flag to disable or re-enable warnings. ## Returns `void` ## Remarks 按插件禁用看门狗的“运行缓慢”与“耗时突增”警告。 Disable watchdog slow and spike warnings per plugin. ## Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/index.md. # Module: debug-utilities **`Beta`** 包含调试实用工具相关函数。 Contains debug utility functions. Manifest Details ```json { "module_name": "@minecraft/debug-utilities", "version": "1.0.0-beta" } ``` ## Classes - [DebugArrow](/debug-utilities/classes/DebugArrow.md) - [DebugBox](/debug-utilities/classes/DebugBox.md) - [DebugCircle](/debug-utilities/classes/DebugCircle.md) - [DebugCone](/debug-utilities/classes/DebugCone.md) - [DebugCylinder](/debug-utilities/classes/DebugCylinder.md) - [DebugDrawer](/debug-utilities/classes/DebugDrawer.md) - [DebugEllipsoid](/debug-utilities/classes/DebugEllipsoid.md) - [DebugLine](/debug-utilities/classes/DebugLine.md) - [DebugPyramid](/debug-utilities/classes/DebugPyramid.md) - [DebugShape](/debug-utilities/classes/DebugShape.md) - [DebugSphere](/debug-utilities/classes/DebugSphere.md) - [DebugText](/debug-utilities/classes/DebugText.md) ## Interfaces - [HandleCounts](/debug-utilities/interfaces/HandleCounts.md) - [PluginStats](/debug-utilities/interfaces/PluginStats.md) - [RuntimeStats](/debug-utilities/interfaces/RuntimeStats.md) ## Variables - [debugDrawer](/debug-utilities/variables/debugDrawer.md) ## Functions - [collectPluginStats](/debug-utilities/functions/collectPluginStats.md) - [collectRuntimeStats](/debug-utilities/functions/collectRuntimeStats.md) - [disableWatchdogTimingWarnings](/debug-utilities/functions/disableWatchdogTimingWarnings.md) --- url: /debug-utilities/interfaces/HandleCounts.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/interfaces/HandleCounts.md. # Interface: HandleCounts **`Beta`** ## Properties ### handleCounts > **handleCounts**: `Record`\<`string`, `number`> **`Beta`** *** ### name > **name**: `string` **`Beta`** *** ### packId > **packId**: `string` **`Beta`** *** ### scriptModuleUUID > **scriptModuleUUID**: `string` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/interfaces/PluginStats.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/interfaces/PluginStats.md. # Interface: PluginStats **`Beta`** ## Properties ### plugins > **plugins**: [`HandleCounts`](/debug-utilities/interfaces/HandleCounts.md)\[] **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/interfaces/RuntimeStats.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/interfaces/RuntimeStats.md. # Interface: RuntimeStats **`Beta`** ## Properties ### arrayCount > **arrayCount**: `number` **`Beta`** *** ### atomCount > **atomCount**: `number` **`Beta`** *** ### atomSize > **atomSize**: `number` **`Beta`** *** ### fastArrayCount > **fastArrayCount**: `number` **`Beta`** *** ### fastArrayElementCount > **fastArrayElementCount**: `number` **`Beta`** *** ### functionCodeSize > **functionCodeSize**: `number` **`Beta`** *** ### functionCount > **functionCount**: `number` **`Beta`** *** ### functionLineCount > **functionLineCount**: `number` **`Beta`** *** ### functionSize > **functionSize**: `number` **`Beta`** *** ### memoryAllocatedCount > **memoryAllocatedCount**: `number` **`Beta`** *** ### memoryAllocatedLimit > **memoryAllocatedLimit**: `number` **`Beta`** *** ### memoryAllocatedSize > **memoryAllocatedSize**: `number` **`Beta`** *** ### memoryUsedCount > **memoryUsedCount**: `number` **`Beta`** *** ### memoryUsedSize > **memoryUsedSize**: `number` **`Beta`** *** ### objectCount > **objectCount**: `number` **`Beta`** *** ### objectSize > **objectSize**: `number` **`Beta`** *** ### propertyCount > **propertyCount**: `number` **`Beta`** *** ### propertySize > **propertySize**: `number` **`Beta`** *** ### stringCount > **stringCount**: `number` **`Beta`** *** ### stringSize > **stringSize**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /debug-utilities/variables/debugDrawer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /debug-utilities/variables/debugDrawer.md. # Variable: debugDrawer > `const` **debugDrawer**: [`DebugDrawer`](/debug-utilities/classes/DebugDrawer.md) **`Beta`** ## Remarks 用于在世界空间中新增与移除线框形状的调试绘制类。 Debug Drawing class used to allow adding and removing wireframe shapes in world space. [源码](https://www.npmjs.com/package/@minecraft/debug-utilities) --- url: /diagnostics/classes/Sentry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /diagnostics/classes/Sentry.md. # Class: Sentry **`Beta`** 一个允许连接到 Sentry 进行错误报告的类。更多信息请参阅 [https://sentry.io/。](https://sentry.io/。) A class that allows hooking up reporting to Sentry. See [https://sentry.io/](https://sentry.io/) for more information. ## Methods ### addBreadcrumb() > **addBreadcrumb**(`level`, `message`, `category?`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### level [`SentryEventLevel`](/diagnostics/enums/SentryEventLevel.md) 面包屑的严重级别。 The severity level of the breadcrumb. ##### message `string` 要添加到面包屑的消息。 The message to add to the breadcrumb. ##### category? `string` 面包屑的类别。 The category of the breadcrumb. #### Returns `void` #### Remarks 向下一次 Sentry 报告的错误添加一个面包屑。这对于理解导致错误的事件追踪非常有用。更多详情请参阅 Sentry 文档:[https://docs.sentry.io/product/issues/issue-details/breadcrumbs/](https://docs.sentry.io/product/issues/issue-details/breadcrumbs/) Adds a breadcrumb to the next Sentry error reported. This can be useful for understanding a "trail" of events leading up to an error. See Sentry documentation for more details: [https://docs.sentry.io/product/issues/issue-details/breadcrumbs/](https://docs.sentry.io/product/issues/issue-details/breadcrumbs/) #### Throws This function can throw errors. [SentryUninitializedError](/diagnostics/classes/SentryUninitializedError.md) *** ### addTag() > **addTag**(`name`, `value`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### name `string` 标签的名称。 The name of the tag. ##### value `string` 标签的值。 The value of the tag. #### Returns `void` #### Remarks 向 Sentry 会话添加一个标签。更多详情请参阅 Sentry 文档:[https://docs.sentry.io/platforms/javascript/enriching-events/tags/](https://docs.sentry.io/platforms/javascript/enriching-events/tags/) Adds a tag to the Sentry session. See Sentry documentation for more details: [https://docs.sentry.io/platforms/javascript/enriching-events/tags/](https://docs.sentry.io/platforms/javascript/enriching-events/tags/) #### Throws This function can throw errors. [SentryUninitializedError](/diagnostics/classes/SentryUninitializedError.md) *** ### captureException() > **captureException**(`exception`, `captureContext?`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### exception `unknown` 要捕获的异常对象。 The exception object to capture. ##### captureContext? [`SentryCaptureContext`](/diagnostics/interfaces/SentryCaptureContext.md) 发送异常时的附加上下文信息。 Additional context to send with the exception. #### Returns `void` #### Remarks 捕获一个异常事件并将其发送到 Sentry。注意,您不仅可以通过 `Error` 对象,还可以传递其他类型的抛出对象——在这种情况下,将尝试为您序列化该对象,但堆栈跟踪可能会丢失。更多详情请参阅 Sentry 文档:[https://docs.sentry.io/platforms/javascript/apis/#capturing-events](https://docs.sentry.io/platforms/javascript/apis/#capturing-events) Captures an exception event and send it to Sentry. Note that you can pass not only `Error` objects, but also other types of thrown objects - in that case, an attempt will be made to serialize the object for you, and stack traces are likely to be missing. See Sentry documentation for more details: [https://docs.sentry.io/platforms/javascript/apis/#capturing-events](https://docs.sentry.io/platforms/javascript/apis/#capturing-events) #### Throws This function can throw errors. [SentryUninitializedError](/diagnostics/classes/SentryUninitializedError.md) *** ### getTags() > **getTags**(): `Record`\<`string`, `string`> **`Early Execution`** **`Beta`** #### Returns `Record`\<`string`, `string`> 包含所有标签名称和值的映射。 A record containing all tag names and values. #### Remarks 获取所有会话标签的列表。更多详情请参阅 Sentry 文档:[https://docs.sentry.io/platforms/javascript/enriching-events/tags/](https://docs.sentry.io/platforms/javascript/enriching-events/tags/) Gets the list of all session tags. See Sentry documentation for more details: [https://docs.sentry.io/platforms/javascript/enriching-events/tags/](https://docs.sentry.io/platforms/javascript/enriching-events/tags/) #### Throws This function can throw errors. [SentryUninitializedError](/diagnostics/classes/SentryUninitializedError.md) *** ### init() > **init**(`options`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### options [`SentryOptions`](/diagnostics/interfaces/SentryOptions.md) Sentry 的配置选项。 Configuration options for Sentry. #### Returns `void` #### Remarks 初始化 Sentry 以供使用。在调用任何其他 Sentry 函数之前,必须成功调用此函数。 Initializes Sentry for use. This must be successfully called before any other Sentry functions are called. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [SentryAlreadyInitializedError](/diagnostics/classes/SentryAlreadyInitializedError.md) *** ### removeTag() > **removeTag**(`name`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### name `string` 要移除的标签的名称。 The name of the tag to remove. #### Returns `void` #### Remarks 从 Sentry 会话中移除一个标签。更多详情请参阅 Sentry 文档:[https://docs.sentry.io/platforms/javascript/enriching-events/tags/](https://docs.sentry.io/platforms/javascript/enriching-events/tags/) Removes a tag to the Sentry session. See Sentry documentation for more details: [https://docs.sentry.io/platforms/javascript/enriching-events/tags/](https://docs.sentry.io/platforms/javascript/enriching-events/tags/) #### Throws This function can throw errors. [SentryUninitializedError](/diagnostics/classes/SentryUninitializedError.md) [源码](https://www.npmjs.com/package/@minecraft/diagnostics) --- url: /diagnostics/classes/SentryAlreadyInitializedError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /diagnostics/classes/SentryAlreadyInitializedError.md. # Class: SentryAlreadyInitializedError error **`Beta`** 此错误表示 Sentry 已初始化,无法再次初始化。 This error is thrown when Sentry has already been initialized. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [SentryUninitializedError](/diagnostics/classes/SentryUninitializedError.md) - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) [源码](https://www.npmjs.com/package/@minecraft/diagnostics) --- url: /diagnostics/classes/SentryUninitializedError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /diagnostics/classes/SentryUninitializedError.md. # Class: SentryUninitializedError error **`Beta`** 此错误表示 Sentry 尚未初始化,无法执行操作。 This error is thrown when Sentry has not been initialized yet. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [SentryAlreadyInitializedError](/diagnostics/classes/SentryAlreadyInitializedError.md) - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) [源码](https://www.npmjs.com/package/@minecraft/diagnostics) --- url: /diagnostics/enums/SentryEventLevel.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /diagnostics/enums/SentryEventLevel.md. # Enumeration: SentryEventLevel event **`Beta`** 定义错误、事件、异常或面包屑的严重级别。级别用于在 UI 中对面包屑进行强调或弱化处理。更多信息请参阅 Sentry 文档: [https://docs.sentry.io/product/issues/issue-details/breadcrumbs/](https://docs.sentry.io/product/issues/issue-details/breadcrumbs/) This defines the severity level of an error, event, exception, or breadcrumb. Levels are used in the UI to emphasize and deemphasize breadcrumbs. See Sentry documentation for more information: [https://docs.sentry.io/product/issues/issue-details/breadcrumbs/](https://docs.sentry.io/product/issues/issue-details/breadcrumbs/) ## Enumeration Members ### debug > **debug**: `"debug"` **`Beta`** *** ### error > **error**: `"error"` **`Beta`** *** ### fatal > **fatal**: `"fatal"` **`Beta`** *** ### info > **info**: `"info"` **`Beta`** *** ### warning > **warning**: `"warning"` **`Beta`** ## 同领域相关 - [AdminBeforeEvents](/server-admin/classes/AdminBeforeEvents.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [beforeEvents](/server-admin/variables/beforeEvents.md) - [beforeEvents](/server-net/variables/beforeEvents.md) [源码](https://www.npmjs.com/package/@minecraft/diagnostics) --- url: /diagnostics/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /diagnostics/index.md. # Module: diagnostics **`Beta`** 包含用于发现和诊断内容问题的诊断功能。 Contains diagnostics functionality for discovering and diagnosing issues with content. Manifest Details ```json { "module_name": "@minecraft/diagnostics", "version": "1.0.0-beta" } ``` ## Enumerations - [SentryEventLevel](/diagnostics/enums/SentryEventLevel.md) ## Classes - [Sentry](/diagnostics/classes/Sentry.md) - [SentryAlreadyInitializedError](/diagnostics/classes/SentryAlreadyInitializedError.md) - [SentryUninitializedError](/diagnostics/classes/SentryUninitializedError.md) ## Interfaces - [SentryCaptureContext](/diagnostics/interfaces/SentryCaptureContext.md) - [SentryOptions](/diagnostics/interfaces/SentryOptions.md) ## Variables - [sentry](/diagnostics/variables/sentry.md) --- url: /diagnostics/interfaces/SentryCaptureContext.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /diagnostics/interfaces/SentryCaptureContext.md. # Interface: SentryCaptureContext **`Beta`** 与发送到 Sentry 的捕获异常相关的上下文信息。 Context relating to a captured exception that should be sent to Sentry. ## Properties ### extraData? > `optional` **extraData?**: `Record`\<`string`, `string` | `number` | `boolean`> **`Beta`** #### Remarks 应与异常一起发送的附加数据。 Additional data that should be sent with the exception. *** ### level? > `optional` **level?**: [`SentryEventLevel`](/diagnostics/enums/SentryEventLevel.md) **`Beta`** #### Remarks 捕获异常的指示严重级别。 The indicated level of severity of the captured exception. *** ### tags? > `optional` **tags?**: `Record`\<`string`, `string`> **`Beta`** #### Remarks 应与异常一起发送的附加标签。 Additional tags that should be sent with the exception. [源码](https://www.npmjs.com/package/@minecraft/diagnostics) --- url: /diagnostics/interfaces/SentryOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /diagnostics/interfaces/SentryOptions.md. # Interface: SentryOptions **`Beta`** 描述此脚本模块的 Sentry 配置选项。 Describes options for configuring Sentry for this scripting module. ## Properties ### debug? > `optional` **debug?**: `boolean` **`Beta`** #### Remarks 设为 true 时,将启用 Sentry 系统的额外内容日志记录。默认为 false。 When set to true, additional content logging from the Sentry system will be enabled. Defaults to false. *** ### dsn > **dsn**: `any` **`Beta`** #### Remarks Sentry 项目的完全限定 DSN。有关详细信息,请参阅 Sentry 文档: [https://docs.sentry.io/concepts/key-terms/dsn-explainer/](https://docs.sentry.io/concepts/key-terms/dsn-explainer/) The fully qualified DSN for a Sentry project. See Sentry documentation for more information: [https://docs.sentry.io/concepts/key-terms/dsn-explainer/](https://docs.sentry.io/concepts/key-terms/dsn-explainer/) *** ### maxBreadcrumbs? > `optional` **maxBreadcrumbs?**: `number` **`Beta`** #### Remarks 每个错误事件要存储并报告给 Sentry 的最大面包屑数量(通过 [Sentry.addBreadcrumb](/diagnostics/classes/Sentry.md#addbreadcrumb) 提交)。默认值为 20,支持的值介于 0(无面包屑)到 100 之间。 The maximum number of breadcrumbs (submitted via [Sentry.addBreadcrumb](/diagnostics/classes/Sentry.md#addbreadcrumb)) to store and report per error event to Sentry. Default is 20, supported values range from 0 (no breadcrumbs) to 100. *** ### sampleRate? > `optional` **sampleRate?**: `number` **`Beta`** #### Remarks 一个介于 0 到 1 之间的数值,表示应发送至 Sentry 的事件比例。例如,值为 0.5 表示将发送 50% 的事件。默认值为 1(100% 的事件);0 表示不发送任何事件。 A number between 0 and 1 that indicates the percentage of events that should be sent to Sentry. For example, a value of 0.5 means that 50% of events will be sent. Default is 1 (100% of events). 0 means no events will be sent. [源码](https://www.npmjs.com/package/@minecraft/diagnostics) --- url: /diagnostics/variables/sentry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /diagnostics/variables/sentry.md. # Variable: sentry > `const` **sentry**: [`Sentry`](/diagnostics/classes/Sentry.md) **`Beta`** ## Remarks 用于接入 Sentry 上报的类。更多信息请参阅 [https://sentry.io/](https://sentry.io/) 。 A class that allows hooking up reporting to Sentry. See [https://sentry.io/](https://sentry.io/) for more information. [源码](https://www.npmjs.com/package/@minecraft/diagnostics) --- url: /index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /index.md. [API 参考](/server/)[版本映射](/versions/)[更新日志](/changelog/)[GitHub](https://github.com/Tanya7z/sapi-typedoc) ![Minecraft Script API 中文文档](/sapi_cn_docs_title.png)![Minecraft Script API 中文文档](/sapi_cn_docs_title.png) 相关站点 [Minecraft Wiki](https://zh.minecraft.wiki/w/Minecraft_Wiki:%E5%85%B3%E4%BA%8E)[官方文档](https://learn.microsoft.com/zh-cn/minecraft/creator/)[Bedrock Wiki](https://wiki.bedrock.dev/)[MCBE Dev](https://wiki.mcbe-dev.net/) ## 更新日志 每个 npm 包的**稳定版(latest)**与**预览版(rc / preview / beta)**完整更新日志已生成,见顶栏「更新日志」入口。 | 模块 | 稳定版 | 预览版 | | ----------------------------------------------------------- | -------------------------------- | ------------------------------ | | [@minecraft/server](/changelog/server.md) | `2.9.0` | `2.10.0-rc.1.26.50-preview.24` | | [@minecraft/server-ui](/changelog/server-ui.md) | `2.1.0` | `2.2.0-rc.1.26.50-preview.24` | | [@minecraft/server-net](/changelog/server-net.md) | `1.0.0-beta.11940b24` | `1.0.0-beta.1.26.43-stable` | | [@minecraft/common](/changelog/common.md) | `1.3.0` | `1.3.0-rc.1.26.30-preview.26` | | [@minecraft/debug-utilities](/changelog/debug-utilities.md) | `1.0.0-beta.1.20.70-preview.20` | `1.0.0-beta.1.26.43-stable` | | [@minecraft/diagnostics](/changelog/diagnostics.md) | `1.0.0-beta.1.21.70-preview.22` | `1.0.0-beta.1.26.43-stable` | | [@minecraft/server-admin](/changelog/server-admin.md) | `1.0.0-beta.11940b24` | `1.0.0-beta.1.26.43-stable` | | [@minecraft/server-editor](/changelog/server-editor.md) | `0.1.0-beta.1.20.20-preview.20` | `0.1.0-beta.1.26.43-stable` | | [@minecraft/server-gametest](/changelog/server-gametest.md) | `1.0.0-beta.1.21.60-preview.24` | `0.1.0-rc.1.21.40-preview.20` | | [@minecraft/server-graphics](/changelog/server-graphics.md) | `1.0.0-beta.1.21.130-preview.22` | `1.0.0-beta.1.26.43-stable` | > 正文来自 [MicrosoftDocs/minecraft-creator](https://github.com/MicrosoftDocs/minecraft-creator/tree/main/creator/ScriptAPI/minecraft);若 npm 预览版本尚未收录,会回退到官方 changelog 中同轨道最近条目。 --- url: /mcp-install.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /mcp-install.md. # MCP 安装说明(给 AI Agent) 你是安装助手。目标:把 **Minecraft Script API 中文文档 MCP(sapi-docs)** 安装到用户当前的 AI 客户端,使下列工具可用:`search_docs` / `get_page` / `list_modules` / `list_symbols` / `get_llms_index` / `get_symbol` / `search_by_tag` / `get_examples` / `get_versions` / `resolve_versions` / `init_script_project`。 **不要向用户推销。按下列步骤直接改配置并验证。** ## 决策树(必须遵守) 1. **优先远程(Streamable HTTP)**\ URL:`https://sapi.dogelake.cn/mcp` 2. **若出现以下任一情况,立即回退本地 npm(stdio)**: - 远程探测失败(超时、DNS、非 2xx、TLS 错误) - 客户端不支持 `url` 型 MCP,只支持 `command`/`args` - 用户明确要求离线/本地 3. 回退命令:`npx -y sapi-docs-mcp`(需本机 Node.js ≥ 20) 远程探测(可选,有网络时执行): ```bash curl -sS -o /dev/null -w "%{http_code}" -X POST "https://sapi.dogelake.cn/mcp" -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"probe\",\"version\":\"0.0.0\"}}}" ``` 能返回 HTTP 2xx/4xx(有 MCP 响应体)即可视为端点可达;完全连不上再走 npm。 ## 配置片段 把下列片段合并进客户端的 MCP 配置(保留用户已有的其他 server)。 ### A. 远程(优先) ```json { "mcpServers": { "sapi-docs": { "url": "https://sapi.dogelake.cn/mcp" } } } ``` ### B. 本地 npm(回退) ```json { "mcpServers": { "sapi-docs": { "command": "npx", "args": ["-y", "sapi-docs-mcp"] } } } ``` ### 各客户端文件位置 | 客户端 | 配置文件 | | ----------------- | ----------------------------------------------------------------------------------------------------------------------------- | | Cursor | 项目 `.cursor/mcp.json` 或用户目录 `~/.cursor/mcp.json`(Windows:`%USERPROFILE%\.cursor\mcp.json`) | | Claude Desktop | macOS:`~/Library/Application Support/Claude/claude_desktop_config.json`;Windows:`%APPDATA%\Claude\claude_desktop_config.json` | | VS Code / Copilot | 用户或工作区 MCP 配置(常见 `.vscode/mcp.json`,字段可能为 `servers`;按客户端文档把 `url` 或 `command` 写进去) | | 其他 MCP 客户端 | 使用标准字段:`url` **或** `command` + `args` | 若客户端 schema 使用 `servers` 而非 `mcpServers`,保持相同 server 名 `sapi-docs` 与同等 `url`/`command` 内容即可。 ## Cursor 一键链接(人类可选) - 远程:`cursor://anysphere.cursor-deeplink/mcp/install?name=sapi-docs&config=eyJ1cmwiOiJodHRwczovL3NhcGkuZG9nZWxha2UuY24vbWNwIn0=` - 本地:`cursor://anysphere.cursor-deeplink/mcp/install?name=sapi-docs&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInNhcGktZG9jcy1tY3AiXX0=` 主路径仍是改配置文件;deeplink 仅作快捷方式。 ## 安装后验证 1. 重新加载 MCP / 重启客户端(若需要)。 2. 确认工具列表含:`search_docs`、`get_page`、`list_modules`、`list_symbols`、`get_llms_index`、`get_symbol`、`search_by_tag`、`get_examples`、`get_versions`、`resolve_versions`、`init_script_project`。 3. 冒烟调用:`resolve_versions`,参数 `gameVersion: "1.26.42", track: "stable"`;再 `get_symbol`,参数 `name: "Player", module: "server"`。 ## 工具说明(装好后如何用) | 工具 | 用途 | | --------------------- | -------------------------------------- | | `search_docs` | 按关键词搜索 API 文档 | | `get_page` | 按路径取 Markdown 全文 | | `list_modules` | 列出模块 | | `list_symbols` | 列出模块内符号与路径 | | `get_llms_index` | 读取 llms 索引摘要或某模块段落 | | `get_symbol` | 结构化签名 / 成员 / 权限 / 标签 / 实验性 | | `search_by_tag` | 按领域标签列符号(event、player…) | | `get_examples` | 官方示例代码 | | `get_versions` | 文档站锁定的包版本 | | `resolve_versions` | 按游戏版本解析推荐包版本与 min\_engine | | `init_script_project` | 生成 BP 脚本工程文件树(由你写入磁盘;可传 `gameVersion`) | ## 首次编写 / 项目初始化(必须遵守) 当用户要写 Script API、做脚本模组,或初始化项目,且工作区未见现成行为包脚本工程时: 1. **先问语言**:JavaScript 或 TypeScript;**推荐 TypeScript**。 2. **询问游戏版本**(如 `1.26.42`),用 `resolve_versions` 确认包版本。 3. 确认包名(可用 `demo_pack`)与模块(默认 `server`)。 4. 调用 `init_script_project`(传入 `gameVersion`),把返回的 `FILE:` 区块写入工作区。 5. 再用 `get_symbol` / `search_by_tag` / `get_examples` 写业务代码;长说明才用 `get_page`。 `init_script_project` **不会**直接写用户磁盘,必须由你落盘。 文档站:[https://sapi.dogelake.cn/](https://sapi.dogelake.cn/)\ 完整 llms 索引:[https://sapi.dogelake.cn/llms.txt](https://sapi.dogelake.cn/llms.txt)\ 混合索引:[https://sapi.dogelake.cn/mcp-data/api-index.json](https://sapi.dogelake.cn/mcp-data/api-index.json)\ 版本映射数据:[https://sapi.dogelake.cn/mcp-data/version-map.json](https://sapi.dogelake.cn/mcp-data/version-map.json)\ npm 包:`sapi-docs-mcp` ## 给用户的最短提示(可复制) ```text 请帮我安装Minecraft Scripts API 中文文档 MCP:https://sapi.dogelake.cn/mcp-install.md ``` --- url: /mcp.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /mcp.md. # MCP **sapi-docs** 让 Cursor / Claude / VS Code 等直接使用本站文档写脚本: - 搜索与阅读 API 文档 - 查结构化签名、权限标签、领域标签与实验性差异 - 按游戏版本解析推荐 `@minecraft/*` 包版本(`resolve_versions`) - 取官方示例;初始化行为包工程(JS / TS,推荐 TS;可传 `gameVersion`) 数据来自本站公开页与 `/mcp-data/` 混合索引。远程优先;本地回退 `npx -y sapi-docs-mcp`。 ## 安装 ```text 请帮我安装Minecraft Scripts API 中文文档 MCP:https://sapi.dogelake.cn/mcp-install.md ``` 远程端点:`https://sapi.dogelake.cn/mcp`。首次写脚本时,AI 应先询问 JS/TS(推荐 TS),再生成工程模板。 --- url: /server-admin/classes/AdminBeforeEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/AdminBeforeEvents.md. # Class: AdminBeforeEvents event **`Beta`** ## Properties ### asyncPlayerJoin > `readonly` **asyncPlayerJoin**: [`AsyncPlayerJoinBeforeEventSignal`](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) **`Beta`** #### Remarks 该事件在玩家加入世界之前触发。与其他 before 事件不同,这是一个 before 事件,你可以通过不解析 subscribe 函数中返回的 Promise 来将其延迟若干 tick。如果该 Promise 被拒绝,则客户端将被拒绝连入。 This event is fired before a player joins the world. Unlike other before events, this event is a before event that you can delay several ticks by not resolving the promise returned in the subscribe function. If the promise is rejected, the client is rejected. ## 同领域相关 - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [beforeEvents](/server-admin/variables/beforeEvents.md) - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [beforeEvents](/server-admin/variables/beforeEvents.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/AllowList.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/AllowList.md. # Class: AllowList **`Beta`** Controls the allow list for the server. Only available on dedicated server. ## Properties ### enabled > **enabled**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### entries > `readonly` **entries**: [`AllowListEntry`](/server-admin/interfaces/AllowListEntry.md)\[] **`Beta`** #### Remarks The list of entries in the allow list. ## Methods ### add() > **add**(`player`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### player `any` Player or player name that should be added to the allow list. #### Returns `void` #### Remarks Adds a player to the server's allow list. #### Throws This function can throw errors. [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### clear() > **clear**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Clears the allow list, removing all entries. *** ### contains() > **contains**(`player`): `boolean` **`Beta`** #### Parameters ##### player `any` Player or player name that should be checked for. #### Returns `boolean` #### Remarks Returns if the player is in the server's allow list. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### reloadFile() > **reloadFile**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Reloads the server's allow list from disk. #### Throws This function can throw errors. [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) *** ### remove() > **remove**(`player`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### player `any` Player or player name that should be removed from the allow list. #### Returns `void` #### Remarks Removes a player from the server's allow list. #### Throws This function can throw errors. [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/AllowListFileReloadError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/AllowListFileReloadError.md. # Class: AllowListFileReloadError error **`Beta`** 当允许列表文件重新加载失败时抛出的错误。 An error that is thrown when the allow list file fails to reload. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [DisconnectedError](/server-admin/classes/DisconnectedError.md) - [LevelStorageSaveStateChangeError](/server-admin/classes/LevelStorageSaveStateChangeError.md) - [PlayerAlreadyOpError](/server-admin/classes/PlayerAlreadyOpError.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/AllowListModificationError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/AllowListModificationError.md. # Class: AllowListModificationError error **`Beta`** 修改允许列表失败时抛出的错误。 An error which is thrown when modifying the allow list has failed. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [DisconnectedError](/server-admin/classes/DisconnectedError.md) - [LevelStorageSaveStateChangeError](/server-admin/classes/LevelStorageSaveStateChangeError.md) - [PlayerAlreadyOpError](/server-admin/classes/PlayerAlreadyOpError.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/AsyncPlayerJoinBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/AsyncPlayerJoinBeforeEvent.md. # Class: AsyncPlayerJoinBeforeEvent event player **`Beta`** 玩家加入世界前可获得的数据。 The data available before a player joins the world. ## Properties ### name > `readonly` **name**: `string` **`Beta`** #### Remarks 玩家的名称。 The player's name *** ### persistentId > `readonly` **persistentId**: `string` **`Beta`** #### Remarks 一个可用于跨会话识别玩家的标识符。 An identifier that can be used to identify a player across sessions. *** ### splitScreenSlot? > `readonly` `optional` **splitScreenSlot?**: `any` **`Beta`** #### Remarks 加入玩家的分屏槽位;若玩家不在分屏会话中则为 undefined。 The split screen slot of the joining player or undefined if the player is not in a split screen session. ## Methods ### allowJoin() > **allowJoin**(): `void` **`Beta`** #### Returns `void` #### Remarks 调用此方法可显式允许玩家加入服务器。当玩家加入被禁用时(在专用服务器上 `allow-player-joining` 被设置为 `false`)很有用。 Call this to explicitly allow the player to join the server. This is useful when player joining is disabled (`allow-player-joining` is set to `false` when playing on dedicated server). #### Throws This function can throw errors. [DisconnectedError](/server-admin/classes/DisconnectedError.md) *** ### disallowJoin() > **disallowJoin**(`reason?`): `void` **`Beta`** #### Parameters ##### reason? `string` #### Returns `void` #### Remarks 调用此方法以拒绝玩家加入服务器。可用于阻止未授权的访问。 Call this to disallow the player from joining the server. This is useful for preventing unauthorized access to the server. #### Throws This function can throw errors. [DisconnectedError](/server-admin/classes/DisconnectedError.md) *** ### disconnect() > **disconnect**(`reason?`): `void` **`Beta`** #### Parameters ##### reason? `string` #### Returns `void` #### Remarks :::warning 已弃用 - 请改用 [disallowJoin](#disallowjoin)。调用此方法可断开玩家的连接。他们将可以重新尝试加入。被断开连接后,玩家将可以再次尝试加入。 ::: :::warning Deprecated - use [disallowJoin](#disallowjoin) instead.Call this to disconnect a player. They will be allowed to try to join again. They will be allowed to try to join again after being disconnected. ::: #### Throws This function can throw errors. [DisconnectedError](/server-admin/classes/DisconnectedError.md) *** ### isValid() > **isValid**(): `boolean` **`Beta`** #### Returns `boolean` #### Remarks 若玩家仍在等待加入世界则返回 true。若玩家已断开连接则返回 false。 Will return true if the player is still waiting to join the world. If they disconnect then it will return false. ## 同领域相关 - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md. # Class: AsyncPlayerJoinBeforeEventSignal event player **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `Promise`\<`void`> **`Beta`** #### Parameters ##### callback (`arg0`) => `Promise`\<`void`> #### Returns (`arg0`) => `Promise`\<`void`> #### Remarks 添加一个在玩家加入世界之前执行的回调。该回调会返回一个 Promise, 在该 Promise 解析之前玩家不会加入。如果该 Promise 未能在合理时间内 解析,则玩家的加入将被拒绝。如果加入服务器的玩家中途离开或断开 连接,那么事件数据的 isValid 将返回 false。 Add a callback that's ran before a player joins the world. This callback returns a promise and the player won't join until that promise is resolved. If the promise is not resolved within a reasonable time, the player joining will be rejected. If the player joining leaves/disconnects, then the event data's isValid will return false. *** ### unsubscribe() > **unsubscribe**(`callback`): `boolean` **`Beta`** #### Parameters ##### callback (`arg0`) => `Promise`\<`void`> #### Returns `boolean` ## 同领域相关 - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent.md) - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent.md) - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent.md) - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/CannotDeopPlayerError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/CannotDeopPlayerError.md. # Class: CannotDeopPlayerError player error **`Beta`** An error which is thrown when attempting to deop a player which cannot have their permissions removed. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [PlayerAlreadyOpError](/server-admin/classes/PlayerAlreadyOpError.md) - [PlayerLeftError](/server-ui/classes/PlayerLeftError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/CannotKickPlayerError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/CannotKickPlayerError.md. # Class: CannotKickPlayerError player error **`Beta`** 当尝试踢出一个无法被踢出的玩家时抛出的错误。 An error which is thrown when attempting to kick a player who cannot be kicked. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [PlayerAlreadyOpError](/server-admin/classes/PlayerAlreadyOpError.md) - [PlayerLeftError](/server-ui/classes/PlayerLeftError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/DedicatedServerUtils.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/DedicatedServerUtils.md. # Class: DedicatedServerUtils **`Beta`** 包含仅在基岩版专用服务器中可用的 API。 Contains apis that are only available when in Bedrock Dedicated Server. ## Properties ### allowList > `readonly` **allowList**: [`AllowList`](/server-admin/classes/AllowList.md) **`Beta`** #### Remarks 返回用于管理服务器允许列表的对象。 Returns an object that manages the server's allow list. *** ### levelStorage > `readonly` **levelStorage**: [`LevelStorage`](/server-admin/classes/LevelStorage.md) **`Beta`** #### Remarks 返回用于管理关卡存储的对象。 Returns an object that manages the level's storage. ## Methods ### reloadCDNConfig() > **reloadCDNConfig**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 从磁盘重新加载 CDN 配置。 Reloads the cdn configuration from disk. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### reloadPermissions() > **reloadPermissions**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 从磁盘重新加载服务器权限。 Reloads the permissions for the server from disk. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### reloadScriptingConfig() > **reloadScriptingConfig**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 从磁盘重新加载服务器的脚本配置。 Reloads the script configuration for the server from disk. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### stopServer() > **stopServer**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 关闭专用服务器。 Shuts down the dedicated server. [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/DisconnectedError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/DisconnectedError.md. # Class: DisconnectedError error **`Beta`** 当尝试与加入事件交互但玩家已断开连接时抛出的错误。 An error that is thrown when trying to interact with a join event and the player is disconnected. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### id > `readonly` **id**: `string` **`Early Execution`** **`Beta`** #### Remarks 已断开连接的玩家的 ID。 The id of the player that was disconnected. *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [LevelStorageSaveStateChangeError](/server-admin/classes/LevelStorageSaveStateChangeError.md) - [PlayerAlreadyOpError](/server-admin/classes/PlayerAlreadyOpError.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/LevelStorage.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/LevelStorage.md. # Class: LevelStorage data **`Beta`** 控制服务器如何保存到磁盘。仅在专用服务器上可用。 Controls how the server saves to disk. Only available on dedicated server. ## Methods ### saveHold() > **saveHold**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 停止服务器写入世界文件,并开始创建快照。 Disables the server writing to the world files and begins creating a snapshot. #### Throws This function can throw errors. [LevelStorageSaveStateChangeError](/server-admin/classes/LevelStorageSaveStateChangeError.md) *** ### saveQuery() > **saveQuery**(): [`LevelStorageQuerySnapshotFile`](/server-admin/classes/LevelStorageQuerySnapshotFile.md)\[] **`World Mutation`** **`Beta`** #### Returns [`LevelStorageQuerySnapshotFile`](/server-admin/classes/LevelStorageQuerySnapshotFile.md)\[] #### Remarks 返回当前快照(如果正在创建快照)中每个文件的路径和大小。 Returns the path and size of every file in the current snapshot if a snapshot is being taken. #### Throws This function can throw errors. [LevelStorageSaveStateChangeError](/server-admin/classes/LevelStorageSaveStateChangeError.md) *** ### saveResume() > **saveResume**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 重新启用服务器将世界状态写入文件,并移除快照。 Re-enables server writing world state to files and removes snapshot. #### Throws This function can throw errors. [LevelStorageSaveStateChangeError](/server-admin/classes/LevelStorageSaveStateChangeError.md) ## 同领域相关 - [LevelStorageQuerySnapshotFile](/server-admin/classes/LevelStorageQuerySnapshotFile.md) - [LevelStorageSaveStateChangeError](/server-admin/classes/LevelStorageSaveStateChangeError.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/LevelStorageQuerySnapshotFile.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/LevelStorageQuerySnapshotFile.md. # Class: LevelStorageQuerySnapshotFile data **`Beta`** 包含快照过程中所收集的文件的相关信息。 Contains information about a file that was gathered during a snapshot. ## Properties ### fileName > `readonly` **fileName**: `string` **`Beta`** #### Remarks 快照中该文件的路径。 The path to the file in the snapshot. *** ### fileSize > `readonly` **fileSize**: `number` **`Beta`** #### Remarks 快照中该文件的大小。 The size of the file in the snapshot. ## 同领域相关 - [LevelStorage](/server-admin/classes/LevelStorage.md) - [LevelStorageSaveStateChangeError](/server-admin/classes/LevelStorageSaveStateChangeError.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/LevelStorageSaveStateChangeError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/LevelStorageSaveStateChangeError.md. # Class: LevelStorageSaveStateChangeError data error **`Beta`** 当关卡存储的存档状态管理被乱序调用、或以无效方式重复调用时抛出的错误。 An error that is thrown when level storage save state management are used out of sequence or are repeated in an invalid way. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [DisconnectedError](/server-admin/classes/DisconnectedError.md) - [LevelStorage](/server-admin/classes/LevelStorage.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/PlayerAlreadyOpError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/PlayerAlreadyOpError.md. # Class: PlayerAlreadyOpError player error **`Beta`** An error which is thrown when attempting to op a player that already has op permissions. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [PlayerLeftError](/server-ui/classes/PlayerLeftError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/SecretString.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/SecretString.md. # Class: SecretString **`Beta`** 表示一段机密字符串的占位符。 脚本无法访问或修改机密字符串的内容, 此对象仅仅是一个占位符。 This represents a placeholder object that represents a secret string. The contents of that string are not available to script; this object is just a placeholder. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new SecretString**(`value`): `SecretString` **`Beta`** #### Parameters ##### value `string` #### Returns `SecretString` [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/ServerSecrets.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/ServerSecrets.md. # Class: ServerSecrets **`Beta`** 表示在专用服务器配置中定义的服务器机密变量的集合。 A collection of server secrets defined in dedicated server configuration. ## Example **getPlayerProfile.ts** ```typescript import { variables, secrets } from '@minecraft/server-admin'; import { http, HttpRequest, HttpRequestMethod, HttpHeader, HttpResponse } from '@minecraft/server-net'; const serverUrl = variables.get('serverEndpoint'); function getPlayerProfile(playerId: string): Promise { const req = new HttpRequest(serverUrl + 'getPlayerProfile'); req.body = JSON.stringify({ playerId, }); const authTokenSec = secrets.get('authtoken'); if (!authTokenSec) { throw new Error('authtoken secret not defined.'); } req.method = HttpRequestMethod.Post; req.headers = [new HttpHeader('Content-Type', 'application/json'), new HttpHeader('auth', authTokenSec)]; return http.request(req); } ``` ## Properties ### names > `readonly` **names**: `string`\[] **`Beta`** #### Remarks 已配置且可用的服务器机密变量名称组成的数组。 A list of available, configured server secrets. ## Methods ### get() > **get**(`name`): [`SecretString`](/server-admin/classes/SecretString.md) | `undefined` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### name `string` #### Returns [`SecretString`](/server-admin/classes/SecretString.md) | `undefined` #### Remarks 以占位符形式返回在专用服务器配置 JSON 文件中定义的指定机密变量。 在特定的对象(例如 HttpHeader)中,机密变量占位符会在执行时被替换为实际的值,但脚本本身是无法访问该值的。 Returns a SecretString that is a placeholder for a secret configured in a JSON file. In certain objects, like an HttpHeader, this Secret is resolved at the time of execution but is not made available to the script environment. [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/classes/ServerVariables.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/classes/ServerVariables.md. # Class: ServerVariables **`Beta`** 表示在专用服务器配置中定义的服务器变量的集合。 A collection of server variables defined in dedicated server configuration. ## Example **getPlayerProfile.ts** ```typescript import { variables, secrets } from '@minecraft/server-admin'; import { http, HttpRequest, HttpRequestMethod, HttpHeader, HttpResponse } from '@minecraft/server-net'; const serverUrl = variables.get('serverEndpoint'); function getPlayerProfile(playerId: string): Promise { const req = new HttpRequest(serverUrl + 'getPlayerProfile'); req.body = JSON.stringify({ playerId, }); const authTokenSec = secrets.get('authtoken'); if (!authTokenSec) { throw new Error('authtoken secret not defined.'); } req.method = HttpRequestMethod.Post; req.headers = [new HttpHeader('Content-Type', 'application/json'), new HttpHeader('auth', authTokenSec)]; return http.request(req); } ``` ## Properties ### names > `readonly` **names**: `string`\[] **`Beta`** #### Remarks 已配置且可用的服务器变量名称组成的数组。 A list of available, configured server variables. ## Methods ### get() > **get**(`name`): `unknown` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### name `string` #### Returns `unknown` #### Remarks 返回在专用服务器配置 JSON 文件中定义的指定变量的值。 Returns the value of variable that has been configured in a dedicated server configuration JSON file. [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/functions/deopPlayer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/functions/deopPlayer.md. # Function: deopPlayer() player > **deopPlayer**(`player`): `void` **`World Mutation`** **`Beta`** ## Parameters ### player `Player` Player to remove permissions from. ## Returns `void` ## Remarks Removes the player's op permissions. ## Throws This function can throw errors. [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) ## 同领域相关 - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [kickPlayer](/server-admin/functions/kickPlayer.md) - [opPlayer](/server-admin/functions/opPlayer.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/functions/kickPlayer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/functions/kickPlayer.md. # Function: kickPlayer() player > **kickPlayer**(`player`, `reason?`): `void` **`World Mutation`** **`Beta`** ## Parameters ### player `Player` 要踢出的玩家。 Player to kick. ### reason? `string` 踢出玩家的原因。 Reason for kicking the player. ## Returns `void` ## Remarks 将玩家从服务器中踢出。 Kicks a player from the server. ## Throws This function can throw errors. [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) ## 同领域相关 - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [deopPlayer](/server-admin/functions/deopPlayer.md) - [opPlayer](/server-admin/functions/opPlayer.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/functions/opPlayer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/functions/opPlayer.md. # Function: opPlayer() player > **opPlayer**(`player`): `void` **`World Mutation`** **`Beta`** ## Parameters ### player `Player` 要给予权限的玩家。 Player to add permissions to. ## Returns `void` ## Remarks 给予玩家 OP 权限。 Gives the player op permissions. ## Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [PlayerAlreadyOpError](/server-admin/classes/PlayerAlreadyOpError.md) ## 同领域相关 - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [deopPlayer](/server-admin/functions/deopPlayer.md) - [kickPlayer](/server-admin/functions/kickPlayer.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/functions/transferPlayer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/functions/transferPlayer.md. # Function: transferPlayer() player > **transferPlayer**(`player`, `options`): `void` **`World Mutation`** **`Beta`** ## Parameters ### player `Player` Player to transfer. ### options [`TransferPlayerIpPortOptions`](/server-admin/interfaces/TransferPlayerIpPortOptions.md) | [`TransferPlayerNetherNetOptions`](/server-admin/interfaces/TransferPlayerNetherNetOptions.md) Options for where to send the player. ## Returns `void` ## Remarks Transfer player to another server. ## Throws This function can throw errors. ## 同领域相关 - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [deopPlayer](/server-admin/functions/deopPlayer.md) - [kickPlayer](/server-admin/functions/kickPlayer.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/index.md. # Module: server-admin **`Beta`** 包含了用于管理基岩版专用服务器的类型。 这部分类型使基岩版专用服务器从所在目录中的 JSON 文件中读取变量与机密变量。 这部分类型不可用于 Minecraft 客户端。 Contains types related to administering a Bedrock Dedicated Server. These types allow for the configuration of variables and secrets in JSON files in the Bedrock Dedicated Server folder. These types cannot be used on Minecraft clients or within Minecraft Realms. Manifest Details ```json { "module_name": "@minecraft/server-admin", "version": "1.0.0-beta" } ``` ## Classes - [AdminBeforeEvents](/server-admin/classes/AdminBeforeEvents.md) - [AllowList](/server-admin/classes/AllowList.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [DedicatedServerUtils](/server-admin/classes/DedicatedServerUtils.md) - [DisconnectedError](/server-admin/classes/DisconnectedError.md) - [LevelStorage](/server-admin/classes/LevelStorage.md) - [LevelStorageQuerySnapshotFile](/server-admin/classes/LevelStorageQuerySnapshotFile.md) - [LevelStorageSaveStateChangeError](/server-admin/classes/LevelStorageSaveStateChangeError.md) - [PlayerAlreadyOpError](/server-admin/classes/PlayerAlreadyOpError.md) - [SecretString](/server-admin/classes/SecretString.md) - [ServerSecrets](/server-admin/classes/ServerSecrets.md) - [ServerVariables](/server-admin/classes/ServerVariables.md) ## Interfaces - [AllowListEntry](/server-admin/interfaces/AllowListEntry.md) - [TransferPlayerIpPortOptions](/server-admin/interfaces/TransferPlayerIpPortOptions.md) - [TransferPlayerNetherNetOptions](/server-admin/interfaces/TransferPlayerNetherNetOptions.md) ## Variables - [beforeEvents](/server-admin/variables/beforeEvents.md) - [dedicatedServer](/server-admin/variables/dedicatedServer.md) - [secrets](/server-admin/variables/secrets.md) - [variables](/server-admin/variables/variables.md) ## Functions - [deopPlayer](/server-admin/functions/deopPlayer.md) - [kickPlayer](/server-admin/functions/kickPlayer.md) - [opPlayer](/server-admin/functions/opPlayer.md) - [transferPlayer](/server-admin/functions/transferPlayer.md) --- url: /server-admin/interfaces/AllowListEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/interfaces/AllowListEntry.md. # Interface: AllowListEntry **`Beta`** Represents an entry to use in the allow list. ## Properties ### name? > `optional` **name?**: `string` **`Beta`** #### Remarks The player's name. *** ### xuid? > `optional` **xuid?**: `string` **`Beta`** #### Remarks The player's xuid. [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/interfaces/TransferPlayerIpPortOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/interfaces/TransferPlayerIpPortOptions.md. # Interface: TransferPlayerIpPortOptions player **`Beta`** 传输玩家到支持直接主机/端口连接的目标服务器时所使用的选项。 Options when transferring a player to a server that supports direct host/port connections. ## Properties ### hostname > **hostname**: `string` **`Beta`** #### Remarks 目标服务器的主机名。 Hostname of the destination server. *** ### port > **port**: `number` **`Beta`** #### Remarks 目标服务器的端口。 Port of the destination server. ## 同领域相关 - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [deopPlayer](/server-admin/functions/deopPlayer.md) - [kickPlayer](/server-admin/functions/kickPlayer.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/interfaces/TransferPlayerNetherNetOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/interfaces/TransferPlayerNetherNetOptions.md. # Interface: TransferPlayerNetherNetOptions player **`Beta`** 传输玩家到支持 NetherNet 连接的目标服务器时所使用的选项。 Options when transferring a player to a server that supports NetherNet connections. ## Properties ### netherNetId > **netherNetId**: `string` **`Beta`** #### Remarks 目标服务器的 NetherNet ID。 NetherNet ID of the destination server. ## 同领域相关 - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError.md) - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError.md) - [deopPlayer](/server-admin/functions/deopPlayer.md) - [kickPlayer](/server-admin/functions/kickPlayer.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/variables/beforeEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/variables/beforeEvents.md. # Variable: beforeEvents event > `const` **beforeEvents**: [`AdminBeforeEvents`](/server-admin/classes/AdminBeforeEvents.md) **`Beta`** ## 同领域相关 - [AdminBeforeEvents](/server-admin/classes/AdminBeforeEvents.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [beforeEvents](/server-admin/variables/beforeEvents.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/variables/dedicatedServer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/variables/dedicatedServer.md. # Variable: dedicatedServer > `const` **dedicatedServer**: [`DedicatedServerUtils`](/server-admin/classes/DedicatedServerUtils.md) | `undefined` **`Beta`** ## Remarks 一个全局可用的、可选的对象,包含仅在专用服务器上才有的 API。 A globally available, optional object that contains dedicated-server only apis. [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/variables/secrets.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/variables/secrets.md. # Variable: secrets > `const` **secrets**: [`ServerSecrets`](/server-admin/classes/ServerSecrets.md) **`Beta`** ## Remarks 表示全局可访问的专用服务器配置中的机密变量列表。 A globally available object that returns a list of dedicated-server configured secrets. [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-admin/variables/variables.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-admin/variables/variables.md. # Variable: variables > `const` **variables**: [`ServerVariables`](/server-admin/classes/ServerVariables.md) **`Beta`** ## Remarks 表示全局可访问的专用服务器配置中的变量列表。 A globally available object that returns a list of dedicated-server configured variables. [源码](https://www.npmjs.com/package/@minecraft/server-admin) --- url: /server-editor/classes/AudioSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/AudioSettings.md. # Class: AudioSettings **`Beta`** ## Methods ### get() > **get**\<`T`>(`property`): [`AudioSettingsPropertyTypeMap`](/server-editor/types/AudioSettingsPropertyTypeMap.md)\[`T`] | `undefined` **`Beta`** #### Type Parameters ##### T `T` _extends_ keyof [`AudioSettingsPropertyTypeMap`](/server-editor/types/AudioSettingsPropertyTypeMap.md) #### Parameters ##### property `T` #### Returns [`AudioSettingsPropertyTypeMap`](/server-editor/types/AudioSettingsPropertyTypeMap.md)\[`T`] | `undefined` *** ### getAll() > **getAll**(): [`AudioSettingsPropertyTypeMap`](/server-editor/types/AudioSettingsPropertyTypeMap.md) **`Beta`** #### Returns [`AudioSettingsPropertyTypeMap`](/server-editor/types/AudioSettingsPropertyTypeMap.md) *** ### set() > **set**\<`T`>(`property`, `value`): `void` **`World Mutation`** **`Beta`** #### Type Parameters ##### T `T` _extends_ keyof [`AudioSettingsPropertyTypeMap`](/server-editor/types/AudioSettingsPropertyTypeMap.md) #### Parameters ##### property `T` ##### value [`AudioSettingsPropertyTypeMap`](/server-editor/types/AudioSettingsPropertyTypeMap.md)\[`T`] #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setAll() > **setAll**(`properties`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### properties [`AudioSettingsPropertyTypeMap`](/server-editor/types/AudioSettingsPropertyTypeMap.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BedrockEventSubscriptionCache.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BedrockEventSubscriptionCache.md. # Class: BedrockEventSubscriptionCache event **`Beta`** A cache for bedrock event subscriptions. Stores off a subscription by event key, and upon teardown unregisters all subscriptions. ## Constructors \{#constructors} ### Constructor \{#constructor} > **new BedrockEventSubscriptionCache**(`mEvents`): `BedrockEventSubscriptionCache` **`Beta`** #### Parameters ##### mEvents `WorldAfterEvents` #### Returns `BedrockEventSubscriptionCache` #### Remarks Constructs a new instance of the `BedrockEventSubscriptionCache` class ## Methods ### subscribeToBedrockEvent() > **subscribeToBedrockEvent**\<`T`>(`event`, ...`params`): `any` **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` | `number` | `symbol` #### Parameters ##### event `T` The event on the bedrock APIs to which to subscribe ##### params ...`unknown`\[] The parameters to the subscription method for the event. Auto complete will display this for you #### Returns `any` #### Remarks Subcribes to a bedrock event using the key of the desired event. When subscribed, the event handler is both returned, but also cached internally for unsubscription. This means the caller of the subscription does not need to worry about unsubscription since the cache will automatically unsubscribe handlers on overall teardown. *** ### teardown() > **teardown**(): `void` **`Beta`** #### Returns `void` #### Remarks Cleans up the set of internal registrations and subscriptions. ## 同领域相关 - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) - [CurrentThemeChangeAfterEventSignal](/server-editor/classes/CurrentThemeChangeAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BlockIdentifierListObservableValidator.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BlockIdentifierListObservableValidator.md. # Class: BlockIdentifierListObservableValidator block **`Beta`** Validates observable objects that support string list as BlockType ## Implements - [`ObservableValidator`](/server-editor/classes/ObservableValidator.md)\<`string`\[]> ## Constructors \{#constructors} ### Constructor \{#constructor} > **new BlockIdentifierListObservableValidator**(): `BlockIdentifierListObservableValidator` **`Beta`** #### Returns `BlockIdentifierListObservableValidator` ## Methods ### validate() > **validate**(`newValue`): `string`\[] **`Beta`** #### Parameters ##### newValue `string`\[] #### Returns `string`\[] #### Implementation of [`ObservableValidator`](/server-editor/classes/ObservableValidator.md).[`validate`](/server-editor/classes/ObservableValidator.md#validate) ## 同领域相关 - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [BlockPaletteManager](/server-editor/classes/BlockPaletteManager.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BlockIdentifierObservableValidator.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BlockIdentifierObservableValidator.md. # Class: BlockIdentifierObservableValidator block **`Beta`** Validates observable objects that support string as BlockType ## Implements - [`ObservableValidator`](/server-editor/classes/ObservableValidator.md)\<`string`> ## Constructors \{#constructors} ### Constructor \{#constructor} > **new BlockIdentifierObservableValidator**(`defaultName`): `BlockIdentifierObservableValidator` **`Beta`** #### Parameters ##### defaultName `string` #### Returns `BlockIdentifierObservableValidator` #### Remarks Constructs a new instance of the `BlockIdentifierObservableValidator` class ## Properties ### \_defaultValue > `protected` **\_defaultValue**: `string` **`World Mutation`** **`Beta`** #### Remarks ## Accessors ### defaultValue #### Get Signature > **get** **defaultValue**(): `string` **`Beta`** ##### Returns `string` ## Methods ### validate() > **validate**(`newValue`): `string` **`Beta`** #### Parameters ##### newValue `string` #### Returns `string` #### Implementation of [`ObservableValidator`](/server-editor/classes/ObservableValidator.md).[`validate`](/server-editor/classes/ObservableValidator.md#validate) ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [BlockPaletteManager](/server-editor/classes/BlockPaletteManager.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BlockPalette.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BlockPalette.md. # Class: BlockPalette block **`Beta`** ## Constructors \{#constructors} ### Constructor \{#constructor} > **new BlockPalette**(): `BlockPalette` **`Beta`** #### Returns `BlockPalette` ## Methods ### getItem() > **getItem**(`index`): [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) **`Beta`** #### Parameters ##### index `number` #### Returns [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) *** ### removeItemAt() > **removeItemAt**(`index`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### index `number` #### Returns `void` #### Remarks #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) *** ### removeItems() > **removeItems**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks *** ### setItem() > **setItem**(`blockPaletteItem`, `index`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockPaletteItem [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) ##### index `number` #### Returns `void` #### Remarks #### Throws This function can throw errors. [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError.md) ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [BlockPaletteManager](/server-editor/classes/BlockPaletteManager.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BlockPaletteManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BlockPaletteManager.md. # Class: BlockPaletteManager block **`Beta`** ## Methods ### addOrReplacePalette() > **addOrReplacePalette**(`paletteId`, `palette`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### paletteId `string` ##### palette [`BlockPalette`](/server-editor/classes/BlockPalette.md) #### Returns `void` #### Remarks *** ### getPalette() > **getPalette**(`paletteId`): [`BlockPalette`](/server-editor/classes/BlockPalette.md) | `undefined` **`Beta`** #### Parameters ##### paletteId `string` #### Returns [`BlockPalette`](/server-editor/classes/BlockPalette.md) | `undefined` *** ### getPaletteIdList() > **getPaletteIdList**(): `string`\[] **`Beta`** #### Returns `string`\[] *** ### getPaletteItem() > **getPaletteItem**(`paletteId`, `index`): [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) **`Beta`** #### Parameters ##### paletteId `string` ##### index `number` #### Returns [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) #### Throws This function can throw errors. *** ### getPrimaryPalette() > **getPrimaryPalette**(): [`BlockPalette`](/server-editor/classes/BlockPalette.md) **`Beta`** #### Returns [`BlockPalette`](/server-editor/classes/BlockPalette.md) *** ### getSelectedBlockType() > **getSelectedBlockType**(): `BlockType` **`Beta`** #### Returns `BlockType` #### Throws This function can throw errors. *** ### getSelectedItem() > **getSelectedItem**(): [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) **`Beta`** #### Returns [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) *** ### removePalette() > **removePalette**(`paletteId`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### paletteId `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setPaletteItem() > **setPaletteItem**(`paletteId`, `index`, `item`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### paletteId `string` ##### index `number` ##### item [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setPrimaryPalette() > **setPrimaryPalette**(`paletteId`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### paletteId `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setSelectedItem() > **setSelectedItem**(`item`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### item [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md. # Class: BlockPaletteSelectedItemChangeAfterEvent event block **`Beta`** ## Properties ### selectedPaletteItem > `readonly` **selectedPaletteItem**: [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) **`Beta`** ## 同领域相关 - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md. # Class: BlockPaletteSelectedItemChangeAfterEventSignal event block **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BlockUtilities.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BlockUtilities.md. # Class: BlockUtilities block **`Beta`** ## Methods ### fillVolume() > **fillVolume**(`volume`, `block?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` ##### block? `any` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### findObscuredBlocksWithinVolume() > **findObscuredBlocksWithinVolume**(`volume`): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Remarks *** ### getContiguousSelection() > **getContiguousSelection**(`properties?`): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`World Mutation`** **`Beta`** #### Parameters ##### properties? [`ContiguousSelectionProperties`](/server-editor/interfaces/ContiguousSelectionProperties.md) #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Remarks #### Throws This function can throw errors. *** ### getDimensionLocationBoundingBox() > **getDimensionLocationBoundingBox**(): `BlockBoundingBox` **`World Mutation`** **`Beta`** #### Returns `BlockBoundingBox` #### Remarks *** ### getDimensionMaxLocation() > **getDimensionMaxLocation**(): `Vector3` **`World Mutation`** **`Beta`** #### Returns `Vector3` #### Remarks *** ### getDimensionMinLocation() > **getDimensionMinLocation**(): `Vector3` **`World Mutation`** **`Beta`** #### Returns `Vector3` #### Remarks *** ### getFacePreviewSelection() > **getFacePreviewSelection**(`properties?`): `ListBlockVolume` **`World Mutation`** **`Beta`** #### Parameters ##### properties? [`QuickExtrudeProperties`](/server-editor/interfaces/QuickExtrudeProperties.md) #### Returns `ListBlockVolume` #### Remarks #### Throws This function can throw errors. *** ### isLocationInsideCurrentDimensionBounds() > **isLocationInsideCurrentDimensionBounds**(`locationOrVolumeOrBounds`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### locationOrVolumeOrBounds `any` #### Returns `boolean` #### Remarks *** ### quickExtrude() > **quickExtrude**(`properties?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### properties? [`QuickExtrudeProperties`](/server-editor/interfaces/QuickExtrudeProperties.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### shrinkWrapVolume() > **shrinkWrapVolume**(`volume`): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Remarks *** ### trimVolumeToFitContents() > **trimVolumeToFitContents**(`volume`, `retainMarqueeAfterTrimming`, `ignoreLiquid`, `ignoreNoCollision`, `blockMask?`): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` ##### retainMarqueeAfterTrimming `boolean` ##### ignoreLiquid `boolean` ##### ignoreNoCollision `boolean` ##### blockMask? [`BlockMaskList`](/server-editor/interfaces/BlockMaskList.md) #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Remarks #### Throws This function can throw errors. ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BlockUtilityTasks.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BlockUtilityTasks.md. # Class: BlockUtilityTasks block **`Beta`** ## Methods ### extrude() > **extrude**(`location`, `direction?`, `faceRadius?`, `layerCount?`, `isShrink?`, `criteria?`, `customBlockList?`, `maxBlocksPerTick?`, `buildGeometry?`, `tolerance?`, `faceVolume?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` ##### direction? [`BlockUtilityExtrudeDirection`](/server-editor/enums/BlockUtilityExtrudeDirection.md) ##### faceRadius? `number` ##### layerCount? `number` ##### isShrink? `boolean` ##### criteria? [`BlockUtilityFloodMatchCriteria`](/server-editor/enums/BlockUtilityFloodMatchCriteria.md) ##### customBlockList? `string`\[] ##### maxBlocksPerTick? `number` ##### buildGeometry? `boolean` ##### tolerance? `number` ##### faceVolume? `any` #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> #### Remarks #### Throws This function can throw errors. *** ### fillVolume() > **fillVolume**(`volume`, `block?`, `maxBlocksPerTick?`): `Promise`\<`number`> **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` ##### block? `any` ##### maxBlocksPerTick? `number` #### Returns `Promise`\<`number`> #### Remarks #### Throws This function can throw errors. *** ### findObscuredBlocksWithinVolume() > **findObscuredBlocksWithinVolume**(`volume`, `maxBlocksPerTick?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` ##### maxBlocksPerTick? `number` #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> #### Remarks #### Throws This function can throw errors. *** ### floodSearch() > **floodSearch**(`location`, `criteria?`, `radius?`, `customBlockList?`, `maxResultBlocks?`, `maxBlocksPerTick?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` ##### criteria? [`BlockUtilityFloodMatchCriteria`](/server-editor/enums/BlockUtilityFloodMatchCriteria.md) ##### radius? `number` ##### customBlockList? `string`\[] ##### maxResultBlocks? `number` ##### maxBlocksPerTick? `number` #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> #### Remarks #### Throws This function can throw errors. *** ### generateManifest() > **generateManifest**(`volume`, `maxBlocksPerTick?`): `Promise`\<[`BlockUtilityManifest`](/server-editor/interfaces/BlockUtilityManifest.md)> **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` ##### maxBlocksPerTick? `number` #### Returns `Promise`\<[`BlockUtilityManifest`](/server-editor/interfaces/BlockUtilityManifest.md)> #### Remarks #### Throws This function can throw errors. *** ### replaceBlocksInSelection() > **replaceBlocksInSelection**(`volume`, `fromBlockIdentifier`, `toBlock?`, `maxBlocksPerTick?`): `Promise`\<`number`> **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` ##### fromBlockIdentifier `string` ##### toBlock? `any` ##### maxBlocksPerTick? `number` #### Returns `Promise`\<`number`> #### Remarks #### Throws This function can throw errors. *** ### shrinkWrapVolume() > **shrinkWrapVolume**(`volume`, `maxBlocksPerTick?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` ##### maxBlocksPerTick? `number` #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> #### Remarks #### Throws This function can throw errors. *** ### trimVolumeToFitContents() > **trimVolumeToFitContents**(`volume`, `retainMarqueeAfterTrimming`, `ignoreLiquid`, `ignoreNoCollision`, `blockMask?`, `maxBlocksPerTick?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` ##### retainMarqueeAfterTrimming `boolean` ##### ignoreLiquid `boolean` ##### ignoreNoCollision `boolean` ##### blockMask? [`BlockMaskList`](/server-editor/interfaces/BlockMaskList.md) ##### maxBlocksPerTick? `number` #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> #### Remarks #### Throws This function can throw errors. ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BrushShape.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BrushShape.md. # Abstract Class: BrushShape **`Beta`** Base for creating new brush shapes ## Extended by - [`ConeBrushShape`](/server-editor/classes/ConeBrushShape.md) - [`CuboidBrushShape`](/server-editor/classes/CuboidBrushShape.md) - [`CylinderBrushShape`](/server-editor/classes/CylinderBrushShape.md) - [`EllipsoidBrushShape`](/server-editor/classes/EllipsoidBrushShape.md) - [`PyramidBrushShape`](/server-editor/classes/PyramidBrushShape.md) - [`SingleBlockBrushShape`](/server-editor/classes/SingleBlockBrushShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new BrushShape**(`_id`, `_displayName`, `_icon`): `BrushShape` **`Beta`** #### Parameters ##### \_id `string` ##### \_displayName `string` ##### \_icon `string` #### Returns `BrushShape` #### Remarks Constructs a new instance of the `BrushShape` class ## Accessors ### displayName #### Get Signature > **get** **displayName**(): `string` **`Beta`** ##### Returns `string` *** ### icon #### Get Signature > **get** **icon**(): `string` **`Beta`** ##### Returns `string` *** ### id #### Get Signature > **get** **id**(): `string` **`Beta`** ##### Returns `string` ## Methods ### applySetting() > `abstract` **applySetting**(`brushSettings`): `void` **`Beta`** #### Parameters ##### brushSettings [`BrushShapeSettings`](/server-editor/types/BrushShapeSettings.md) #### Returns `void` *** ### calculateBounds() > `abstract` **calculateBounds**(): `BlockBoundingBox` **`Beta`** #### Returns `BlockBoundingBox` Object with min and max Vector3 bounds #### Remarks Calculates the bounding box of the shape in local coordinates. Used for region allocation before shape placement. *** ### createSettingsPane() > `abstract` **createSettingsPane**(`parentPane`, `onSettingsChange?`, `flatLayout?`): [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) | `undefined` **`Beta`** #### Parameters ##### parentPane [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) ##### onSettingsChange? () => `void` ##### flatLayout? `boolean` #### Returns [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) | `undefined` *** ### createShape() > `abstract` **createShape**(): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`Beta`** #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) *** ### createShapeAsync() > `abstract` **createShapeAsync**(`cancelToken?`, `yieldInterval?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`Beta`** #### Parameters ##### cancelToken? Optional token to cancel the operation. Set cancelled to true to abort. ###### cancelled `boolean` ##### yieldInterval? `number` Number of blocks to process before yielding. Default is 10000\. #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> Promise that resolves to the shape positions as Vector3 array. #### Remarks Asynchronously creates the shape, yielding control periodically to avoid timeouts. Use this for large shapes where createShape() may timeout. *** ### estimateBlockCount() > `abstract` **estimateBlockCount**(): `number` **`Beta`** #### Returns `number` Estimated block count #### Remarks Returns a mathematical estimate of the number of blocks in the shape. Used for UI display and validation before shape creation. *** ### getSettings() > `abstract` **getSettings**(): [`BrushShapeSettings`](/server-editor/types/BrushShapeSettings.md) **`Beta`** #### Returns [`BrushShapeSettings`](/server-editor/types/BrushShapeSettings.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/BrushShapeManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/BrushShapeManager.md. # Class: BrushShapeManager **`Beta`** ## Properties ### activeBrushVolume? > `readonly` `optional` **activeBrushVolume?**: [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`Beta`** ## Methods ### activateBrushTool() > **activateBrushTool**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks *** ### beginPainting() > **beginPainting**(`onComplete`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### onComplete (`arg0`) => `void` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### clearBlockStateOverrides() > **clearBlockStateOverrides**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks *** ### deactivateBrushTool() > **deactivateBrushTool**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks *** ### disableItemPlacement() > **disableItemPlacement**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks *** ### enableItemPlacement() > **enableItemPlacement**(`itemType`, `data?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### itemType `ItemType` ##### data? `number` #### Returns `void` #### Remarks *** ### endPainting() > **endPainting**(`cancelled`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### cancelled `boolean` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### getBrushShapeOffset() > **getBrushShapeOffset**(): `Vector3` **`World Mutation`** **`Beta`** #### Returns `Vector3` #### Remarks *** ### getDirectionalPlacementMode() > **getDirectionalPlacementMode**(): [`BrushDirectionalPlacementMode`](/server-editor/enums/BrushDirectionalPlacementMode.md) **`World Mutation`** **`Beta`** #### Returns [`BrushDirectionalPlacementMode`](/server-editor/enums/BrushDirectionalPlacementMode.md) #### Remarks *** ### getInverseEraseMode() > **getInverseEraseMode**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks *** ### isBrushPaintBusy() > **isBrushPaintBusy**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks *** ### pushBlockStateOverride() > **pushBlockStateOverride**\<`T`>(`blockStateName`, `blockStateValue`): `void` **`World Mutation`** **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` | `number` | `symbol` #### Parameters ##### blockStateName `T` ##### blockStateValue `BlockStateSuperset` #### Returns `void` #### Remarks *** ### setBlockFacePlacementBasedOnCamera() > **setBlockFacePlacementBasedOnCamera**(`enabled`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### enabled `boolean` #### Returns `void` #### Remarks *** ### setBrushMask() > **setBrushMask**(`mask`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### mask [`BlockMaskList`](/server-editor/interfaces/BlockMaskList.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setBrushShape() > **setBrushShape**(`shape`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### shape [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) | `Vector3`\[] #### Returns `void` #### Remarks *** ### setBrushShapeOffset() > **setBrushShapeOffset**(`offset`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### offset `Vector3` #### Returns `void` #### Remarks *** ### setBrushShapeVisible() > **setBrushShapeVisible**(`visible`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### visible `boolean` #### Returns `void` #### Remarks *** ### setDirectionalPlacementMode() > **setDirectionalPlacementMode**(`directionalPlacementMode`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### directionalPlacementMode [`BrushDirectionalPlacementMode`](/server-editor/enums/BrushDirectionalPlacementMode.md) #### Returns `void` #### Remarks *** ### setElevationBrushRadius() > **setElevationBrushRadius**(`elevationBrushRadius`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### elevationBrushRadius `number` #### Returns `void` #### Remarks *** ### setElevationFalloff() > **setElevationFalloff**(`elevationFalloff`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### elevationFalloff `number` #### Returns `void` #### Remarks *** ### setElevationMode() > **setElevationMode**(`elevationMode`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### elevationMode [`BrushElevationMode`](/server-editor/enums/BrushElevationMode.md) #### Returns `void` #### Remarks *** ### setElevationSampleLayers() > **setElevationSampleLayers**(`elevationSampleLayers`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### elevationSampleLayers `number` #### Returns `void` #### Remarks *** ### setFlattenMode() > **setFlattenMode**(`flattenMode`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### flattenMode [`FlattenMode`](/server-editor/enums/FlattenMode.md) #### Returns `void` #### Remarks *** ### setFlattenSmoothing() > **setFlattenSmoothing**(`flattenSmoothing`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### flattenSmoothing `number` #### Returns `void` #### Remarks *** ### setFloorBlockOverride() > **setFloorBlockOverride**(`floorBlockOverride`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### floorBlockOverride `boolean` #### Returns `void` #### Remarks *** ### setInverseEraseMode() > **setInverseEraseMode**(`inverseEraseMode`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### inverseEraseMode `boolean` #### Returns `void` #### Remarks *** ### setPendingTransaction() > **setPendingTransaction**(`pendingTransaction?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### pendingTransaction? [`PendingTransaction`](/server-editor/classes/PendingTransaction.md) #### Returns `void` #### Remarks *** ### setTerrainStrength() > **setTerrainStrength**(`terrainStrength`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### terrainStrength `number` #### Returns `void` #### Remarks *** ### singlePaint() > **singlePaint**(`onComplete`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### onComplete (`arg0`) => `void` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### switchBrushPaintMode() > **switchBrushPaintMode**(`paintMode`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### paintMode [`PaintMode`](/server-editor/enums/PaintMode.md) #### Returns `void` #### Remarks [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ClipboardChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ClipboardChangeAfterEvent.md. # Class: ClipboardChangeAfterEvent event **`Beta`** ## Properties ### isPrimary > `readonly` **isPrimary**: `boolean` **`Beta`** *** ### itemId > `readonly` **itemId**: `string` **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) - [CurrentThemeChangeAfterEventSignal](/server-editor/classes/CurrentThemeChangeAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ClipboardChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ClipboardChangeAfterEventSignal.md. # Class: ClipboardChangeAfterEventSignal event **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) - [CurrentThemeChangeAfterEventSignal](/server-editor/classes/CurrentThemeChangeAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ClipboardItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ClipboardItem.md. # Class: ClipboardItem **`Beta`** A ClipboardItem is a handle to an object which represents a set of blocks in a contained bounding area (most likely copied from the world) ## Properties ### id 实验性 > `readonly` **id**: `string` **`Beta`** *** ### isEmpty > `readonly` **isEmpty**: `boolean` **`Beta`** #### Remarks Return whether there is any block content in the item *** ### normalizedOrigin 实验性 > `readonly` **normalizedOrigin**: `Vector3` **`Beta`** *** ### originalWorldLocation 实验性 > `readonly` **originalWorldLocation**: `Vector3` **`Beta`** *** ### size 实验性 > `readonly` **size**: `Vector3` **`Beta`** ## Methods ### clear() > **clear**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Clear the contents of the item #### Throws This function can throw errors. *** ### getPredictedWriteVolume() > **getPredictedWriteVolume**(`location`, `options?`): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` ##### options? [`ClipboardWriteOptions`](/server-editor/interfaces/ClipboardWriteOptions.md) #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Remarks #### Throws This function can throw errors. *** ### readFromStructure() > **readFromStructure**(`structure`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### structure [`EditorStructure`](/server-editor/classes/EditorStructure.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### readFromWorld() > **readFromWorld**(`source`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### source `any` #### Returns `void` #### Remarks Copy the contents of a rectangular volume into the Clipboard Item #### Throws This function can throw errors. *** ### writeToWorld() > **writeToWorld**(`location`, `options?`, `transaction?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` The root point of the world location to which the ClipboardItem is written (this is modified by the various anchor, offset and rotation parameters of the [ClipboardWriteOptions](/server-editor/interfaces/ClipboardWriteOptions.md) ##### options? [`ClipboardWriteOptions`](/server-editor/interfaces/ClipboardWriteOptions.md) An optional set of write parameters which modify the properties of the ClipboardItem as it is applied to the world ##### transaction? [`PendingTransaction`](/server-editor/classes/PendingTransaction.md) #### Returns `boolean` Success or Failure #### Remarks Apply the contents of a ClipboardItem to the world at a given location using a set of write options #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ClipboardManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ClipboardManager.md. # Class: ClipboardManager **`Beta`** The ClipboardManager (accessible from the [ExtensionContext](/server-editor/classes/ExtensionContext.md)) is responsible for the management of all [ClipboardItem](/server-editor/classes/ClipboardItem.md) objects, and provides the user the ability to create new [ClipboardItem](/server-editor/classes/ClipboardItem.md) objects for use within an extension. ## Properties ### clipboard > `readonly` **clipboard**: [`ClipboardItem`](/server-editor/classes/ClipboardItem.md) **`Beta`** #### Remarks The primary [ClipboardItem](/server-editor/classes/ClipboardItem.md) object is always present (even if it's empty) and cannot be deleted. This object represents the main ClipboardItem object which is always accessible through the UI for cut/paste operations #### Throws This property can throw when used. ## Methods ### create() > **create**(): [`ClipboardItem`](/server-editor/classes/ClipboardItem.md) **`World Mutation`** **`Beta`** #### Returns [`ClipboardItem`](/server-editor/classes/ClipboardItem.md) #### Remarks Create a new [ClipboardItem](/server-editor/classes/ClipboardItem.md) object #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ConeBrushShape.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ConeBrushShape.md. # Class: ConeBrushShape **`Beta`** ## Extends - [`BrushShape`](/server-editor/classes/BrushShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ConeBrushShape**(`settings?`): `ConeBrushShape` **`Beta`** #### Parameters ##### settings? ###### depth? `number` ###### enableHollowSettings? `boolean` ###### height? `number` ###### hollow? `boolean` ###### maxHeight? `number` ###### maxRadius? `number` ###### radius? `number` ###### thickness? `number` ###### uniform? `boolean` ###### width? `number` ###### xRotation? `number` ###### yRotation? `number` ###### zRotation? `number` #### Returns `ConeBrushShape` #### Remarks Constructs a new instance of the `ConeBrushShape` class #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`constructor`](/server-editor/classes/BrushShape.md#constructor) ## Accessors ### displayName #### Get Signature > **get** **displayName**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`displayName`](/server-editor/classes/BrushShape.md#displayname) *** ### icon #### Get Signature > **get** **icon**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`icon`](/server-editor/classes/BrushShape.md#icon) *** ### id #### Get Signature > **get** **id**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`id`](/server-editor/classes/BrushShape.md#id) ## Methods ### applySetting() > **applySetting**(`brushSettings`): `void` **`Beta`** #### Parameters ##### brushSettings [`ConeBrushShapeSettings`](/server-editor/interfaces/ConeBrushShapeSettings.md) #### Returns `void` #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`applySetting`](/server-editor/classes/BrushShape.md#applysetting) *** ### calculateBounds() > **calculateBounds**(): `BlockBoundingBox` **`Beta`** #### Returns `BlockBoundingBox` Object with min and max Vector3 bounds #### Remarks Calculates the bounding box of the shape in local coordinates. Used for region allocation before shape placement. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`calculateBounds`](/server-editor/classes/BrushShape.md#calculatebounds) *** ### createSettingsPane() > **createSettingsPane**(`parentPane`, `onSettingsChange?`, `flatLayout?`): [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) **`Beta`** #### Parameters ##### parentPane [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) ##### onSettingsChange? () => `void` ##### flatLayout? `boolean` #### Returns [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createSettingsPane`](/server-editor/classes/BrushShape.md#createsettingspane) *** ### createShape() > **createShape**(): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`Beta`** #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShape`](/server-editor/classes/BrushShape.md#createshape) *** ### createShapeAsync() > **createShapeAsync**(`cancelToken?`, `yieldInterval?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`Beta`** #### Parameters ##### cancelToken? Optional token to cancel the operation. Set cancelled to true to abort. ###### cancelled `boolean` ##### yieldInterval? `number` Number of blocks to process before yielding. Default is 10000\. #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> Promise that resolves to the shape positions as Vector3 array. #### Remarks Asynchronously creates the shape, yielding control periodically to avoid timeouts. Use this for large shapes where createShape() may timeout. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShapeAsync`](/server-editor/classes/BrushShape.md#createshapeasync) *** ### estimateBlockCount() > **estimateBlockCount**(): `number` **`Beta`** #### Returns `number` Estimated block count #### Remarks Returns a mathematical estimate of the number of blocks in the shape. Used for UI display and validation before shape creation. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`estimateBlockCount`](/server-editor/classes/BrushShape.md#estimateblockcount) *** ### getSettings() > **getSettings**(): [`ConeBrushShapeSettings`](/server-editor/interfaces/ConeBrushShapeSettings.md) **`Beta`** #### Returns [`ConeBrushShapeSettings`](/server-editor/interfaces/ConeBrushShapeSettings.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`getSettings`](/server-editor/classes/BrushShape.md#getsettings) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/CuboidBrushShape.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/CuboidBrushShape.md. # Class: CuboidBrushShape **`Beta`** ## Extends - [`BrushShape`](/server-editor/classes/BrushShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new CuboidBrushShape**(`settings?`): `CuboidBrushShape` **`Beta`** #### Parameters ##### settings? ###### depth? `number` ###### enableHollowSettings? `boolean` ###### height? `number` ###### hideRotation? `boolean` ###### hollow? `boolean` ###### length? `number` ###### maxLength? `number` ###### minLength? `number` ###### thickness? `number` ###### uniform? `boolean` ###### width? `number` ###### xRotation? `number` ###### yRotation? `number` ###### zRotation? `number` #### Returns `CuboidBrushShape` #### Remarks Constructs a new instance of the `CuboidBrushShape` class #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`constructor`](/server-editor/classes/BrushShape.md#constructor) ## Accessors ### displayName #### Get Signature > **get** **displayName**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`displayName`](/server-editor/classes/BrushShape.md#displayname) *** ### icon #### Get Signature > **get** **icon**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`icon`](/server-editor/classes/BrushShape.md#icon) *** ### id #### Get Signature > **get** **id**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`id`](/server-editor/classes/BrushShape.md#id) ## Methods ### applySetting() > **applySetting**(`brushSettings`): `void` **`Beta`** #### Parameters ##### brushSettings [`CuboidBrushShapeSettings`](/server-editor/interfaces/CuboidBrushShapeSettings.md) #### Returns `void` #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`applySetting`](/server-editor/classes/BrushShape.md#applysetting) *** ### calculateBounds() > **calculateBounds**(): `BlockBoundingBox` **`Beta`** #### Returns `BlockBoundingBox` Object with min and max Vector3 bounds #### Remarks Calculates the bounding box of the shape in local coordinates. Used for region allocation before shape placement. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`calculateBounds`](/server-editor/classes/BrushShape.md#calculatebounds) *** ### createSettingsPane() > **createSettingsPane**(`parentPane`, `onSettingsChange?`, `flatLayout?`): [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) **`Beta`** #### Parameters ##### parentPane [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) ##### onSettingsChange? () => `void` ##### flatLayout? `boolean` #### Returns [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createSettingsPane`](/server-editor/classes/BrushShape.md#createsettingspane) *** ### createShape() > **createShape**(): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`Beta`** #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShape`](/server-editor/classes/BrushShape.md#createshape) *** ### createShapeAsync() > **createShapeAsync**(`cancelToken?`, `yieldInterval?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`Beta`** #### Parameters ##### cancelToken? Optional token to cancel the operation. Set cancelled to true to abort. ###### cancelled `boolean` ##### yieldInterval? `number` Number of blocks to process before yielding. Default is 10000\. #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> Promise that resolves to the shape positions as Vector3 array. #### Remarks Asynchronously creates the shape, yielding control periodically to avoid timeouts. Use this for large shapes where createShape() may timeout. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShapeAsync`](/server-editor/classes/BrushShape.md#createshapeasync) *** ### estimateBlockCount() > **estimateBlockCount**(): `number` **`Beta`** #### Returns `number` Estimated block count #### Remarks Returns a mathematical estimate of the number of blocks in the shape. Used for UI display and validation before shape creation. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`estimateBlockCount`](/server-editor/classes/BrushShape.md#estimateblockcount) *** ### getSettings() > **getSettings**(): [`CuboidBrushShapeSettings`](/server-editor/interfaces/CuboidBrushShapeSettings.md) **`Beta`** #### Returns [`CuboidBrushShapeSettings`](/server-editor/interfaces/CuboidBrushShapeSettings.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`getSettings`](/server-editor/classes/BrushShape.md#getsettings) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/CurrentThemeChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/CurrentThemeChangeAfterEvent.md. # Class: CurrentThemeChangeAfterEvent event **`Beta`** ## Properties ### id > `readonly` **id**: `string` **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEventSignal](/server-editor/classes/CurrentThemeChangeAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/CurrentThemeChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/CurrentThemeChangeAfterEventSignal.md. # Class: CurrentThemeChangeAfterEventSignal event **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/CurrentThemeColorChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/CurrentThemeColorChangeAfterEvent.md. # Class: CurrentThemeColorChangeAfterEvent event **`Beta`** ## Properties ### color > `readonly` **color**: `RGBA` **`Beta`** *** ### colorKey > `readonly` **colorKey**: `string` **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/CurrentThemeColorChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/CurrentThemeColorChangeAfterEventSignal.md. # Class: CurrentThemeColorChangeAfterEventSignal event **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/Cursor.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/Cursor.md. # Class: Cursor **`Beta`** The 3D block cursor is controlled through this read only object and provides the Editor some control over the input methods, display properties and positioning of the 3D block cursor within the world. The 3D block cursor is a native object which is constantly calculating a screen/mouse -> world raycast, and recording the resultant block collision position and facing direction. Depending on the properties of the cursor state, this is not always true – the cursor can also be manually manipulated by keyboard input and moved around independently of mouse movement; when the mouse is moved, the block cursor will return to the mouse/world ray intersection point. The cursor can also be set to either block or face mode; block mode represents the block the mouse is pointing at, and face mode represents the adjacent block that the mouse is pointing at (i.e. the block attached to the face of the intersection point). In practical use, each tool when activated grabs the current cursor state object and stores it. The active tool then sets the current state to represent the functionality of the tool (color, input mode, etc). When the tool loses focus, it restores the cursor state using the stored state object that was grabbed during activation. The 3D block cursor can also be used to query the current block at which the mouse is pointing (or the current block to which the cursor has been manually moved by the user) ## Properties ### faceDirection > `readonly` **faceDirection**: `number` **`Beta`** #### Remarks The face at of the block beneath the 3D block cursor which is intersected by the mouse raycast #### Throws This property can throw when used. *** ### isVisible > `readonly` **isVisible**: `boolean` **`Beta`** #### Remarks Query whether or not the 3D block cursor is visible or hidden #### Throws This property can throw when used. *** ### maxViewBlockDistance 实验性 > `readonly` **maxViewBlockDistance**: `number` **`Beta`** #### Throws This property can throw when used. ## Methods ### getDefaultProperties() > **getDefaultProperties**(): [`CursorProperties`](/server-editor/interfaces/CursorProperties.md) **`World Mutation`** **`Beta`** #### Returns [`CursorProperties`](/server-editor/interfaces/CursorProperties.md) #### Remarks #### Throws This function can throw errors. *** ### getPosition() > **getPosition**(): `Vector3` **`World Mutation`** **`Beta`** #### Returns `Vector3` #### Remarks Get the world position of the 3D block cursor #### Throws This function can throw errors. *** ### getProperties() > **getProperties**(): [`CursorProperties`](/server-editor/interfaces/CursorProperties.md) **`World Mutation`** **`Beta`** #### Returns [`CursorProperties`](/server-editor/interfaces/CursorProperties.md) #### Remarks Get a property object which represents the current properties of the 3D block cursor. #### Throws This function can throw errors. *** ### getRay() > **getRay**(): [`CursorRay`](/server-editor/interfaces/CursorRay.md) **`World Mutation`** **`Beta`** #### Returns [`CursorRay`](/server-editor/interfaces/CursorRay.md) #### Remarks #### Throws This function can throw errors. *** ### hide() > **hide**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Hide the 3D block cursor from view until the corresponding [Cursor.show](#show) function is called #### Throws This function can throw errors. *** ### moveBy() > **moveBy**(`offset`): `Vector3` **`World Mutation`** **`Beta`** #### Parameters ##### offset `Vector3` Amount by which the 3D block cursor should be moved #### Returns `Vector3` Return the newly modified position (or previous position if movement was restricted) #### Remarks Manually offset the 3D block cursor by given amount. Depending on the [CursorProperties.controlMode](/server-editor/interfaces/CursorProperties.md#controlmode) - this function may have no effect #### Throws This function can throw errors. *** ### popPropertiesById() > **popPropertiesById**(`identifier`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### pushPropertiesById() > **pushPropertiesById**(`properties`, `identifier`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### properties [`CursorProperties`](/server-editor/interfaces/CursorProperties.md) ##### identifier `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### resetToDefaultState() > **resetToDefaultState**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Reset the 3D block cursor to the system default state #### Throws This function can throw errors. *** ### setProperties() > **setProperties**(`properties`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### properties [`CursorProperties`](/server-editor/interfaces/CursorProperties.md) A set of optional parameters within a property state which represent the intended 3D block cursor state #### Returns `void` #### Remarks Set the 3D block cursor properties to a given state #### Throws This function can throw errors. *** ### show() > **show**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Make the 3D block cursor visible on screen #### Throws This function can throw errors. *** ### updatePropertiesById() > **updatePropertiesById**(`properties`, `identifier?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### properties [`CursorProperties`](/server-editor/interfaces/CursorProperties.md) ##### identifier? `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/CursorPropertiesChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/CursorPropertiesChangeAfterEvent.md. # Class: CursorPropertiesChangeAfterEvent event **`Beta`** ## Properties ### identifier? > `readonly` `optional` **identifier?**: `string` **`Beta`** *** ### position? > `readonly` `optional` **position?**: [`CursorPosition`](/server-editor/interfaces/CursorPosition.md) **`Beta`** *** ### properties > `readonly` **properties**: [`CursorProperties`](/server-editor/interfaces/CursorProperties.md) **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/CursorPropertyChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/CursorPropertyChangeAfterEventSignal.md. # Class: CursorPropertyChangeAfterEventSignal event **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/CylinderBrushShape.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/CylinderBrushShape.md. # Class: CylinderBrushShape **`Beta`** ## Extends - [`BrushShape`](/server-editor/classes/BrushShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new CylinderBrushShape**(`settings?`): `CylinderBrushShape` **`Beta`** #### Parameters ##### settings? ###### depth? `number` ###### enableHollowSettings? `boolean` ###### height? `number` ###### hideRotation? `boolean` ###### hollow? `boolean` ###### maxHeight? `number` ###### maxRadius? `number` ###### minRadius? `number` ###### radius? `number` ###### thickness? `number` ###### uniform? `boolean` ###### width? `number` ###### xRotation? `number` ###### yRotation? `number` ###### zRotation? `number` #### Returns `CylinderBrushShape` #### Remarks Constructs a new instance of the `CylinderBrushShape` class #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`constructor`](/server-editor/classes/BrushShape.md#constructor) ## Accessors ### depth #### Get Signature > **get** **depth**(): `number` **`Beta`** ##### Returns `number` *** ### displayName #### Get Signature > **get** **displayName**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`displayName`](/server-editor/classes/BrushShape.md#displayname) *** ### height #### Get Signature > **get** **height**(): `number` **`Beta`** ##### Returns `number` *** ### icon #### Get Signature > **get** **icon**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`icon`](/server-editor/classes/BrushShape.md#icon) *** ### id #### Get Signature > **get** **id**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`id`](/server-editor/classes/BrushShape.md#id) *** ### radius #### Get Signature > **get** **radius**(): `number` **`Beta`** ##### Returns `number` *** ### uniform #### Get Signature > **get** **uniform**(): `boolean` **`Beta`** ##### Returns `boolean` *** ### width #### Get Signature > **get** **width**(): `number` **`Beta`** ##### Returns `number` ## Methods ### applySetting() > **applySetting**(`brushSettings`): `void` **`Beta`** #### Parameters ##### brushSettings [`CylinderBrushShapeSettings`](/server-editor/interfaces/CylinderBrushShapeSettings.md) #### Returns `void` #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`applySetting`](/server-editor/classes/BrushShape.md#applysetting) *** ### calculateBounds() > **calculateBounds**(): `BlockBoundingBox` **`Beta`** #### Returns `BlockBoundingBox` Object with min and max Vector3 bounds #### Remarks Calculates the bounding box of the shape in local coordinates. Used for region allocation before shape placement. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`calculateBounds`](/server-editor/classes/BrushShape.md#calculatebounds) *** ### createSettingsPane() > **createSettingsPane**(`parentPane`, `onSettingsChange?`, `flatLayout?`): [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) **`Beta`** #### Parameters ##### parentPane [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) ##### onSettingsChange? () => `void` ##### flatLayout? `boolean` #### Returns [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createSettingsPane`](/server-editor/classes/BrushShape.md#createsettingspane) *** ### createShape() > **createShape**(): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`Beta`** #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShape`](/server-editor/classes/BrushShape.md#createshape) *** ### createShapeAsync() > **createShapeAsync**(`cancelToken?`, `yieldInterval?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`Beta`** #### Parameters ##### cancelToken? Optional token to cancel the operation. Set cancelled to true to abort. ###### cancelled `boolean` ##### yieldInterval? `number` Number of blocks to process before yielding. Default is 10000\. #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> Promise that resolves to the shape positions as Vector3 array. #### Remarks Asynchronously creates the shape, yielding control periodically to avoid timeouts. Use this for large shapes where createShape() may timeout. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShapeAsync`](/server-editor/classes/BrushShape.md#createshapeasync) *** ### estimateBlockCount() > **estimateBlockCount**(): `number` **`Beta`** #### Returns `number` Estimated block count #### Remarks Returns a mathematical estimate of the number of blocks in the shape. Used for UI display and validation before shape creation. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`estimateBlockCount`](/server-editor/classes/BrushShape.md#estimateblockcount) *** ### getSettings() > **getSettings**(): [`CylinderBrushShapeSettings`](/server-editor/interfaces/CylinderBrushShapeSettings.md) **`Beta`** #### Returns [`CylinderBrushShapeSettings`](/server-editor/interfaces/CylinderBrushShapeSettings.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`getSettings`](/server-editor/classes/BrushShape.md#getsettings) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/EditorConstants.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/EditorConstants.md. # Class: EditorConstants **`Beta`** ## Properties ### maxBlockVolume > `readonly` **maxBlockVolume**: `number` **`Beta`** *** ### maxDynamicSelectionSize > `readonly` **maxDynamicSelectionSize**: `Vector3` **`Beta`** *** ### maxSelectionSize > `readonly` **maxSelectionSize**: `Vector3` **`Beta`** *** ### maxStructureOffset > `readonly` **maxStructureOffset**: `Vector3` **`Beta`** *** ### minStructureOffset > `readonly` **minStructureOffset**: `Vector3` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/EditorStructure.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/EditorStructure.md. # Class: EditorStructure **`Beta`** ## Properties ### description > `readonly` **description**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### displayName > `readonly` **displayName**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### id > `readonly` **id**: `string` **`Beta`** *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** *** ### normalizedOrigin > `readonly` **normalizedOrigin**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### notes > `readonly` **notes**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### offset > `readonly` **offset**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### originalWorldLocation > `readonly` **originalWorldLocation**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### size > `readonly` **size**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### structureFullName > `readonly` **structureFullName**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### structureName > `readonly` **structureName**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### structureNamespace > `readonly` **structureNamespace**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidStructureError](/server/classes/InvalidStructureError.md) ## Methods ### getBlockPermutation() > **getBlockPermutation**(`location`): `any` **`Beta`** #### Parameters ##### location `Vector3` #### Returns `any` #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### getIsWaterlogged() > **getIsWaterlogged**(`location`): `boolean` **`Beta`** #### Parameters ##### location `Vector3` #### Returns `boolean` #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### getTags() > **getTags**(): `string`\[] **`Beta`** #### Returns `string`\[] #### Throws This function can throw errors. [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### setBlockPermutation() > **setBlockPermutation**(`location`, `blockPermutation`, `waterlogged?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` ##### blockPermutation `BlockPermutation` ##### waterlogged? `boolean` Defaults to: false #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidStructureError](/server/classes/InvalidStructureError.md) *** ### setTags() > **setTags**(`tags`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### tags `string`\[] #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidStructureError](/server/classes/InvalidStructureError.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/EditorStructureManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/EditorStructureManager.md. # Class: EditorStructureManager **`Beta`** ## Methods ### createEmpty() > **createEmpty**(`fullName`, `size`): [`EditorStructure`](/server-editor/classes/EditorStructure.md) **`World Mutation`** **`Beta`** #### Parameters ##### fullName `string` ##### size `Vector3` #### Returns [`EditorStructure`](/server-editor/classes/EditorStructure.md) #### Remarks #### Throws This function can throw errors. *** ### createFromClipboardItem() > **createFromClipboardItem**(`item`, `fullName`): [`EditorStructure`](/server-editor/classes/EditorStructure.md) **`World Mutation`** **`Beta`** #### Parameters ##### item [`ClipboardItem`](/server-editor/classes/ClipboardItem.md) ##### fullName `string` #### Returns [`EditorStructure`](/server-editor/classes/EditorStructure.md) #### Remarks #### Throws This function can throw errors. *** ### deleteStructure() > **deleteStructure**(`id`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### id `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### getExistingTags() > **getExistingTags**(): `string`\[] **`World Mutation`** **`Beta`** #### Returns `string`\[] #### Remarks #### Throws This function can throw errors. *** ### getStructure() > **getStructure**(`id`): [`EditorStructure`](/server-editor/classes/EditorStructure.md) **`World Mutation`** **`Beta`** #### Parameters ##### id `string` #### Returns [`EditorStructure`](/server-editor/classes/EditorStructure.md) #### Remarks #### Throws This function can throw errors. *** ### searchStructures() > **searchStructures**(`options?`): [`EditorStructure`](/server-editor/classes/EditorStructure.md)\[] **`World Mutation`** **`Beta`** #### Parameters ##### options? [`EditorStructureSearchOptions`](/server-editor/interfaces/EditorStructureSearchOptions.md) #### Returns [`EditorStructure`](/server-editor/classes/EditorStructure.md)\[] #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/EllipsoidBrushShape.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/EllipsoidBrushShape.md. # Class: EllipsoidBrushShape **`Beta`** ## Extends - [`BrushShape`](/server-editor/classes/BrushShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new EllipsoidBrushShape**(`settings?`): `EllipsoidBrushShape` **`Beta`** #### Parameters ##### settings? ###### depth? `number` ###### enableHollowSettings? `boolean` ###### height? `number` ###### hollow? `boolean` ###### maxRadius? `number` ###### minRadius? `number` ###### radius? `number` ###### thickness? `number` ###### uniform? `boolean` ###### width? `number` ###### xRotation? `number` ###### yRotation? `number` ###### zRotation? `number` #### Returns `EllipsoidBrushShape` #### Remarks Constructs a new instance of the `EllipsoidBrushShape` class #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`constructor`](/server-editor/classes/BrushShape.md#constructor) ## Accessors ### displayName #### Get Signature > **get** **displayName**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`displayName`](/server-editor/classes/BrushShape.md#displayname) *** ### icon #### Get Signature > **get** **icon**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`icon`](/server-editor/classes/BrushShape.md#icon) *** ### id #### Get Signature > **get** **id**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`id`](/server-editor/classes/BrushShape.md#id) ## Methods ### applySetting() > **applySetting**(`brushSettings`): `void` **`Beta`** #### Parameters ##### brushSettings [`EllipsoidBrushShapeSettings`](/server-editor/interfaces/EllipsoidBrushShapeSettings.md) #### Returns `void` #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`applySetting`](/server-editor/classes/BrushShape.md#applysetting) *** ### calculateBounds() > **calculateBounds**(): `BlockBoundingBox` **`Beta`** #### Returns `BlockBoundingBox` Object with min and max Vector3 bounds #### Remarks Calculates the bounding box of the shape in local coordinates. Used for region allocation before shape placement. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`calculateBounds`](/server-editor/classes/BrushShape.md#calculatebounds) *** ### createSettingsPane() > **createSettingsPane**(`parentPane`, `onSettingsChange?`, `flatLayout?`): [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) **`Beta`** #### Parameters ##### parentPane [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) ##### onSettingsChange? () => `void` ##### flatLayout? `boolean` #### Returns [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createSettingsPane`](/server-editor/classes/BrushShape.md#createsettingspane) *** ### createShape() > **createShape**(): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`Beta`** #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShape`](/server-editor/classes/BrushShape.md#createshape) *** ### createShapeAsync() > **createShapeAsync**(`cancelToken?`, `yieldInterval?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`Beta`** #### Parameters ##### cancelToken? Optional token to cancel the operation. Set cancelled to true to abort. ###### cancelled `boolean` ##### yieldInterval? `number` Number of blocks to process before yielding. Default is 10000\. #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> Promise that resolves to the shape positions as Vector3 array. #### Remarks Asynchronously creates the shape, yielding control periodically to avoid timeouts. Use this for large shapes where createShape() may timeout. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShapeAsync`](/server-editor/classes/BrushShape.md#createshapeasync) *** ### estimateBlockCount() > **estimateBlockCount**(): `number` **`Beta`** #### Returns `number` Estimated block count #### Remarks Returns a mathematical estimate of the number of blocks in the shape. Used for UI display and validation before shape creation. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`estimateBlockCount`](/server-editor/classes/BrushShape.md#estimateblockcount) *** ### getSettings() > **getSettings**(): [`EllipsoidBrushShapeSettings`](/server-editor/interfaces/EllipsoidBrushShapeSettings.md) **`Beta`** #### Returns [`EllipsoidBrushShapeSettings`](/server-editor/interfaces/EllipsoidBrushShapeSettings.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`getSettings`](/server-editor/classes/BrushShape.md#getsettings) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/EntityIdentifierObservableValidator.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/EntityIdentifierObservableValidator.md. # Class: EntityIdentifierObservableValidator entity **`Beta`** Validates observable objects that support string as EntityType ## Implements - [`ObservableValidator`](/server-editor/classes/ObservableValidator.md)\<`string`> ## Constructors \{#constructors} ### Constructor \{#constructor} > **new EntityIdentifierObservableValidator**(`defaultValue`): `EntityIdentifierObservableValidator` **`Beta`** #### Parameters ##### defaultValue `string` #### Returns `EntityIdentifierObservableValidator` #### Remarks Constructs a new instance of the `EntityIdentifierObservableValidator` class ## Properties ### \_defaultValue > `protected` **\_defaultValue**: `string` **`World Mutation`** **`Beta`** #### Remarks ## Accessors ### defaultValue #### Get Signature > **get** **defaultValue**(): `string` **`Beta`** ##### Returns `string` ## Methods ### validate() > **validate**(`newValue`): `string` **`Beta`** #### Parameters ##### newValue `string` #### Returns `string` #### Implementation of [`ObservableValidator`](/server-editor/classes/ObservableValidator.md).[`validate`](/server-editor/classes/ObservableValidator.md#validate) ## 同领域相关 - [EntityOperationType](/server-editor/enums/EntityOperationType.md) - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity.md) - [WidgetComponentEntity](/server-editor/classes/WidgetComponentEntity.md) - [WidgetComponentEntityOptions](/server-editor/interfaces/WidgetComponentEntityOptions.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ExportManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ExportManager.md. # Class: ExportManager **`Beta`** ## Methods ### beginExportProject() > **beginExportProject**(`options`): `Promise`\<[`ExportResult`](/server-editor/enums/ExportResult.md)> **`World Mutation`** **`Beta`** #### Parameters ##### options [`GameOptions`](/server-editor/interfaces/GameOptions.md) #### Returns `Promise`\<[`ExportResult`](/server-editor/enums/ExportResult.md)> #### Remarks #### Throws This function can throw errors. *** ### canExportProject() > **canExportProject**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks #### Throws This function can throw errors. *** ### getGameOptions() > **getGameOptions**(`useDefault?`): [`GameOptions`](/server-editor/interfaces/GameOptions.md) **`World Mutation`** **`Beta`** #### Parameters ##### useDefault? `boolean` #### Returns [`GameOptions`](/server-editor/interfaces/GameOptions.md) #### Remarks *** ### getGameVersion() > **getGameVersion**(): `string` **`World Mutation`** **`Beta`** #### Returns `string` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/Extension.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/Extension.md. # Class: Extension **`Beta`** Editor Extensions are the basis for all player specific, editor specific functionality within the game. Almost all editor functionality is exported and available within the context of an [ExtensionContext](/server-editor/classes/ExtensionContext.md) When the script manager initializes during level loading, the scripts are loaded from the behavior packs and executed. As part of the global execution context, the scripts are free to register any number of extensions. An Editor Extension is defined a name, an activation function and a shutdown function. It is not recommended to directly use this function as the contract is not guaranteed to be stable, instead prefer [registerEditorExtension](/server-editor/functions/registerEditorExtension.md) as it provides additional functionality and a stable contract. ## Properties ### defaultToolGroupId 实验性 > `readonly` **defaultToolGroupId**: `string` **`Beta`** #### Remarks Default identifier for tool rail grouping. All modal tools created from the extension will use this. *** ### description 实验性 > `readonly` **description**: `string` **`Beta`** #### Remarks Description specified during registration for the extension. *** ### name 实验性 > `readonly` **name**: `string` **`Beta`** #### Remarks Name of the extension. *** ### notes 实验性 > `readonly` **notes**: `string` **`Beta`** #### Remarks Notes specified during registration for the extension. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ExtensionContext.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ExtensionContext.md. # Class: ExtensionContext **`Beta`** The extension context is a native (C++) object created for each registered Editor Extension, when a player connection is established with the server. A registered extension activation or deactivation closure is accompanied by an \[ExtensionContext] object, which provides a player specific, editor extension specific context. The Extension Context is the main interface to all the bound Editor Services. As more player services are added to the editor, they will be exposed through this object ## Properties ### afterEvents 实验性 > `readonly` **afterEvents**: [`ExtensionContextAfterEvents`](/server-editor/classes/ExtensionContextAfterEvents.md) **`Beta`** #### Remarks Contains a set of events that are applicable to the editor player. Event callbacks are called in a deferred manner. Event callbacks are executed in read-write mode. *** ### blockPalette 实验性 > `readonly` **blockPalette**: [`BlockPaletteManager`](/server-editor/classes/BlockPaletteManager.md) **`Beta`** *** ### blockUtilities 实验性 > `readonly` **blockUtilities**: [`BlockUtilities`](/server-editor/classes/BlockUtilities.md) **`Beta`** *** ### blockUtilityTasks 实验性 > `readonly` **blockUtilityTasks**: [`BlockUtilityTasks`](/server-editor/classes/BlockUtilityTasks.md) **`Beta`** *** ### brushShapeManager 实验性 > `readonly` **brushShapeManager**: [`BrushShapeManager`](/server-editor/classes/BrushShapeManager.md) **`Beta`** *** ### clipboardManager > `readonly` **clipboardManager**: [`ClipboardManager`](/server-editor/classes/ClipboardManager.md) **`Beta`** #### Remarks This is used to access the players Clipboard Manager and the main interface through which the player can create, modify and apply clipboard items *** ### cursor > `readonly` **cursor**: [`Cursor`](/server-editor/classes/Cursor.md) **`Beta`** #### Remarks This is used to access the players 3D block cursor and it's properties *** ### exportManager 实验性 > `readonly` **exportManager**: [`ExportManager`](/server-editor/classes/ExportManager.md) **`Beta`** *** ### extensionInfo 实验性 > `readonly` **extensionInfo**: [`Extension`](/server-editor/classes/Extension.md) **`Beta`** #### Remarks Contains information about the registered extension instance. *** ### guidePlaneManager 实验性 > `readonly` **guidePlaneManager**: [`GuidePlaneManager`](/server-editor/classes/GuidePlaneManager.md) **`Beta`** *** ### minimapManager 实验性 > `readonly` **minimapManager**: [`MinimapManager`](/server-editor/classes/MinimapManager.md) **`Beta`** #### Remarks Manager for minimap functionality, providing interface for creating markers and controlling minimap displays. *** ### player > `readonly` **player**: `Player` **`Beta`** #### Remarks The current player which is the subject of the extension invocation *** ### playtest 实验性 > `readonly` **playtest**: [`PlaytestManager`](/server-editor/classes/PlaytestManager.md) **`Beta`** *** ### selectionManager > `readonly` **selectionManager**: [`SelectionManager`](/server-editor/classes/SelectionManager.md) **`Beta`** #### Remarks The instance of the players Selection Manager and the main interface through which the player can create/modify selections *** ### settings 实验性 > `readonly` **settings**: [`SettingsManager`](/server-editor/classes/SettingsManager.md) **`Beta`** #### Remarks The instance of the players Settings Manager and the contract through which the settings for the player can be modified. *** ### structureManager 实验性 > `readonly` **structureManager**: [`EditorStructureManager`](/server-editor/classes/EditorStructureManager.md) **`Beta`** *** ### transactionManager > `readonly` **transactionManager**: [`TransactionManager`](/server-editor/classes/TransactionManager.md) **`Beta`** #### Remarks The instance of the players Transaction Manager and the main interface through which the creator can create transaction records, and undo/redo previous transactions *** ### widgetManager 实验性 > `readonly` **widgetManager**: [`WidgetManager`](/server-editor/classes/WidgetManager.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ExtensionContextAfterEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ExtensionContextAfterEvents.md. # Class: ExtensionContextAfterEvents event **`Beta`** Contains a set of events that are available across the scope of the ExtensionContext. ## Properties ### blockPaletteSelectedItemChange > `readonly` **blockPaletteSelectedItemChange**: [`BlockPaletteSelectedItemChangeAfterEventSignal`](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### clipboardChange > `readonly` **clipboardChange**: [`ClipboardChangeAfterEventSignal`](/server-editor/classes/ClipboardChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### currentThemeChange > `readonly` **currentThemeChange**: [`CurrentThemeChangeAfterEventSignal`](/server-editor/classes/CurrentThemeChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### currentThemeColorChange > `readonly` **currentThemeColorChange**: [`CurrentThemeColorChangeAfterEventSignal`](/server-editor/classes/CurrentThemeColorChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### cursorPropertyChange > `readonly` **cursorPropertyChange**: [`CursorPropertyChangeAfterEventSignal`](/server-editor/classes/CursorPropertyChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### modeChange > `readonly` **modeChange**: [`ModeChangeAfterEventSignal`](/server-editor/classes/ModeChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks This event triggers when the editor mode changes for the player. *** ### SelectionChange > `readonly` **SelectionChange**: [`SelectionChangeAfterEventSignal`](/server-editor/classes/SelectionChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/GraphicsSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/GraphicsSettings.md. # Class: GraphicsSettings **`Beta`** Settings category that manages [GraphicsSettingsProperty](/server-editor/enums/GraphicsSettingsProperty.md) configurations. ## Methods ### get() > **get**\<`T`>(`property`): [`GraphicsSettingsPropertyTypeMap`](/server-editor/types/GraphicsSettingsPropertyTypeMap.md)\[`T`] | `undefined` **`Beta`** #### Type Parameters ##### T `T` _extends_ keyof [`GraphicsSettingsPropertyTypeMap`](/server-editor/types/GraphicsSettingsPropertyTypeMap.md) #### Parameters ##### property `T` Property identifier. #### Returns [`GraphicsSettingsPropertyTypeMap`](/server-editor/types/GraphicsSettingsPropertyTypeMap.md)\[`T`] | `undefined` Returns the property value if it is found. If the property is not available, it returns undefined. #### Remarks Retrieves a graphics settings property value. *** ### getAll() > **getAll**(): [`GraphicsSettingsPropertyTypeMap`](/server-editor/types/GraphicsSettingsPropertyTypeMap.md) **`Beta`** #### Returns [`GraphicsSettingsPropertyTypeMap`](/server-editor/types/GraphicsSettingsPropertyTypeMap.md) Returns a property value map for all available properties. #### Remarks Retrieves all graphics settings properties and their values. *** ### set() > **set**\<`T`>(`property`, `value`): `void` **`World Mutation`** **`Beta`** #### Type Parameters ##### T `T` _extends_ keyof [`GraphicsSettingsPropertyTypeMap`](/server-editor/types/GraphicsSettingsPropertyTypeMap.md) #### Parameters ##### property `T` Property identifier. ##### value [`GraphicsSettingsPropertyTypeMap`](/server-editor/types/GraphicsSettingsPropertyTypeMap.md)\[`T`] New property value. #### Returns `void` #### Remarks Modifies a graphics settings property value. #### Throws This function can throw errors. *** ### setAll() > **setAll**(`properties`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### properties [`GraphicsSettingsPropertyTypeMap`](/server-editor/types/GraphicsSettingsPropertyTypeMap.md) Property map to set available property values. If the property is not defined in the map, it will not be modified. #### Returns `void` #### Remarks Modify multiple graphics settings properties. #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/GuidePlaneManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/GuidePlaneManager.md. # Class: GuidePlaneManager **`Beta`** ## Properties ### allPlanesVisible > **allPlanesVisible**: `boolean` **`World Mutation`** **`Beta`** #### Remarks ## Methods ### addPlane() > **addPlane**(`origin`, `normal`, `visible`, `outlineColor`, `fillColor`): `string` **`World Mutation`** **`Beta`** #### Parameters ##### origin `Vector3` ##### normal `Vector3` ##### visible `boolean` ##### outlineColor `RGBA` ##### fillColor `RGBA` #### Returns `string` #### Remarks #### Throws This function can throw errors. *** ### getPlane() > **getPlane**(`planeId`): [`GuidePlane`](/server-editor/interfaces/GuidePlane.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### planeId `string` #### Returns [`GuidePlane`](/server-editor/interfaces/GuidePlane.md) | `undefined` #### Remarks #### Throws This function can throw errors. *** ### getPlanes() > **getPlanes**(): [`GuidePlane`](/server-editor/interfaces/GuidePlane.md)\[] **`World Mutation`** **`Beta`** #### Returns [`GuidePlane`](/server-editor/interfaces/GuidePlane.md)\[] #### Remarks #### Throws This function can throw errors. *** ### removePlane() > **removePlane**(`planeId`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### planeId `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setPlaneColors() > **setPlaneColors**(`planeId`, `outlineColor`, `fillColor`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### planeId `string` ##### outlineColor `RGBA` ##### fillColor `RGBA` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setPlaneNormal() > **setPlaneNormal**(`planeId`, `normal`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### planeId `string` ##### normal `Vector3` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setPlaneOrigin() > **setPlaneOrigin**(`planeId`, `origin`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### planeId `string` ##### origin `Vector3` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setPlaneVisibility() > **setPlaneVisibility**(`planeId`, `visible`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### planeId `string` ##### visible `boolean` #### Returns `void` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/IBlockPaletteItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/IBlockPaletteItem.md. # Class: IBlockPaletteItem **`Beta`** ## Extended by - [`ProbabilityBlockPaletteItem`](/server-editor/classes/ProbabilityBlockPaletteItem.md) - [`SimpleBlockPaletteItem`](/server-editor/classes/SimpleBlockPaletteItem.md) ## Methods ### getBlock() > **getBlock**(): `any` **`Beta`** #### Returns `any` *** ### getDisplayName() > **getDisplayName**(): `string` | `undefined` **`Beta`** #### Returns `string` | `undefined` *** ### getType() > **getType**(): [`BlockPaletteItemType`](/server-editor/enums/BlockPaletteItemType.md) **`Beta`** #### Returns [`BlockPaletteItemType`](/server-editor/enums/BlockPaletteItemType.md) *** ### setBlock() > **setBlock**(`block`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### block `any` #### Returns `void` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/InvalidWidgetComponentError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/InvalidWidgetComponentError.md. # Class: InvalidWidgetComponentError error component **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError.md) - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError.md) - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError.md) - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError.md) - [CustomComponentInvalidRegistryError](/server/classes/CustomComponentInvalidRegistryError.md) - [CustomComponentNameError](/server/classes/CustomComponentNameError.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/InvalidWidgetError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/InvalidWidgetError.md. # Class: InvalidWidgetError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [InvalidWidgetGroupError](/server-editor/classes/InvalidWidgetGroupError.md) - [TransactionManagerNoChangesError](/server-editor/classes/TransactionManagerNoChangesError.md) - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/InvalidWidgetGroupError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/InvalidWidgetGroupError.md. # Class: InvalidWidgetGroupError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) - [TransactionManagerNoChangesError](/server-editor/classes/TransactionManagerNoChangesError.md) - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/Logger.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/Logger.md. # Class: Logger **`Beta`** The logger class is a utility class which allows editor extensions to communicate with the player from the server to the client log window. The logger class presents 4 different output channels which can be used to send information to the client/player, depending on the context of the information. ## Methods ### debug() > **debug**(`message`, `properties?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### message `string` | [`LocalizationEntry`](/server-editor/interfaces/LocalizationEntry.md) The message string to send to the log window ##### properties? [`LogProperties`](/server-editor/interfaces/LogProperties.md) #### Returns `void` #### Remarks A `debug` output channel generally used during the development process of editor extensions. This channel defaults to `hidden` in the log window (unless explicitly enabled). Once your editor extension development process is complete, and you're ready to ship/share your extension - we generally recommend that you remove any references to this log channel to avoid a noisy experience for other users #### Throws This function can throw errors. *** ### error() > **error**(`message`, `properties?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### message `string` | [`LocalizationEntry`](/server-editor/interfaces/LocalizationEntry.md) The message string to send to the log window ##### properties? [`LogProperties`](/server-editor/interfaces/LogProperties.md) #### Returns `void` #### Remarks The error channel is generally used when the editor extension experiences an error (either a program error in executing logic unexpectedly, or an error in the input or output to/from a player). Use this channel sparingly - it's meant to communicate important problems to the player #### Throws This function can throw errors. *** ### info() > **info**(`message`, `properties?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### message `string` | [`LocalizationEntry`](/server-editor/interfaces/LocalizationEntry.md) The message string to send to the log window ##### properties? [`LogProperties`](/server-editor/interfaces/LogProperties.md) #### Returns `void` #### Remarks The info channel is intended to communicate general, non-fatal or non-erroneous information to the player that can generally be safely ignored if they choose to do so. #### Throws This function can throw errors. *** ### warning() > **warning**(`message`, `properties?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### message `string` | [`LocalizationEntry`](/server-editor/interfaces/LocalizationEntry.md) The message string to send to the log window ##### properties? [`LogProperties`](/server-editor/interfaces/LogProperties.md) #### Returns `void` #### Remarks The warning channel is intended to inform the user of "potential" issues (missing inputs, values out of range, things that cannot be found) but are not fatal and execution can still be completed. #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/MinecraftEditor.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/MinecraftEditor.md. # Class: MinecraftEditor **`Beta`** The MinecraftEditor class is a namespace container for Editor functionality which does not have any player context. ## Properties ### afterEvents 实验性 > `readonly` **afterEvents**: [`ProjectAfterEvents`](/server-editor/classes/ProjectAfterEvents.md) **`Early Execution`** **`Beta`** #### Remarks *** ### constants 实验性 > `readonly` **constants**: [`EditorConstants`](/server-editor/classes/EditorConstants.md) **`Beta`** *** ### log > `readonly` **log**: [`Logger`](/server-editor/classes/Logger.md) **`Beta`** #### Remarks A global instance of the log output class object. This is not contextualized to any particular player, and any messages sent to this instance will be broadcast to all connected editor client sessions #### Throws This property can throw when used. *** ### simulation 实验性 > `readonly` **simulation**: [`SimulationState`](/server-editor/classes/SimulationState.md) **`Beta`** #### Remarks Allows querying and modifying some properties of the simulation. *** ### worldGeneratorType? > `readonly` `optional` **worldGeneratorType?**: [`WorldGeneratorType`](/server-editor/enums/WorldGeneratorType.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/MinimapItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/MinimapItem.md. # Class: MinimapItem **`Beta`** A MinimapItem represents an individual minimap instance that manages map data, controls display state, and provides configuration for markers and visual properties. ## Properties ### freeCenter > `readonly` **freeCenter**: `VectorXZ` **`Beta`** *** ### id > `readonly` **id**: `string` **`Beta`** *** ### isActive > `readonly` **isActive**: `boolean` **`Beta`** #### Remarks Indicate whether this minimap instance is currently active and being displayed to the player. *** ### yLevel > `readonly` **yLevel**: `number` **`Beta`** ## Methods ### addCustomMarker() > **addCustomMarker**(`iconIdentifier`, `data`, `dimensionId`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### iconIdentifier `string` ##### data [`MinimapMarkerData`](/server-editor/interfaces/MinimapMarkerData.md)\[] ##### dimensionId `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### addLocationMarker() > **addLocationMarker**(`data`, `dimensionId`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### data [`MinimapMarkerData`](/server-editor/interfaces/MinimapMarkerData.md)\[] ##### dimensionId `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### addMultiplayerMarker() > **addMultiplayerMarker**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### getMarkerTypes() > **getMarkerTypes**(): [`MinimapMarkerType`](/server-editor/enums/MinimapMarkerType.md)\[] **`Beta`** #### Returns [`MinimapMarkerType`](/server-editor/enums/MinimapMarkerType.md)\[] *** ### getPlayerColor() > **getPlayerColor**(`playerId`): `RGBA` **`Beta`** #### Parameters ##### playerId `string` #### Returns `RGBA` #### Remarks Retrieve the color assigned to a specific player on the minimap. #### Throws This function can throw errors. *** ### hasCustomGroup() > **hasCustomGroup**(`iconIdentifier`): `boolean` **`Beta`** #### Parameters ##### iconIdentifier `string` #### Returns `boolean` *** ### hasMarkerOfType() > **hasMarkerOfType**(`type`): `boolean` **`Beta`** #### Parameters ##### type [`MinimapMarkerType`](/server-editor/enums/MinimapMarkerType.md) #### Returns `boolean` *** ### removeAllCustomMarkers() > **removeAllCustomMarkers**(`dimensionId`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### dimensionId `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### removeCustomMarker() > **removeCustomMarker**(`iconIdentifier`, `dimensionId`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### iconIdentifier `string` ##### dimensionId `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### removeLocationMarker() > **removeLocationMarker**(`dimensionId`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### dimensionId `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### removeMultiplayerMarker() > **removeMultiplayerMarker**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setActive() > **setActive**(`active`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### active `boolean` #### Returns `void` #### Remarks Control whether the minimap is currently active and visible to the player. #### Throws This function can throw errors. *** ### setFreeCenter() > **setFreeCenter**(`center`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### center `VectorXZ` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setSize() > **setSize**(`mapWidth`, `mapHeight`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### mapWidth `number` ##### mapHeight `number` #### Returns `void` #### Remarks Adjust the width and height dimensions of the minimap display. #### Throws This function can throw errors. *** ### setTrackingMode() > **setTrackingMode**(`mode`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### mode [`MinimapTrackingMode`](/server-editor/enums/MinimapTrackingMode.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setViewType() > **setViewType**(`viewType`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### viewType [`MinimapViewType`](/server-editor/enums/MinimapViewType.md) #### Returns `void` #### Remarks Change the visual perspective or style of the minimap view. #### Throws This function can throw errors. *** ### setYLevel() > **setYLevel**(`yLevel`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### yLevel `number` #### Returns `void` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/MinimapManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/MinimapManager.md. # Class: MinimapManager **`Beta`** Manage minimap instances within the editor, providing functionality to create, destroy, and retrieve minimap displays. ## Methods ### createMinimap() > **createMinimap**(`viewType`, `mapWidth`, `mapHeight`, `options?`): [`MinimapItem`](/server-editor/classes/MinimapItem.md) **`World Mutation`** **`Beta`** #### Parameters ##### viewType [`MinimapViewType`](/server-editor/enums/MinimapViewType.md) ##### mapWidth `number` ##### mapHeight `number` ##### options? [`MinimapCreateOptions`](/server-editor/interfaces/MinimapCreateOptions.md) #### Returns [`MinimapItem`](/server-editor/classes/MinimapItem.md) #### Remarks Create a new minimap instance with the specified view type and dimensions. #### Throws This function can throw errors. *** ### destroyMinimap() > **destroyMinimap**(`minimapId`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### minimapId `string` #### Returns `void` #### Remarks Remove an existing minimap instance from the manager using its unique identifier. #### Throws This function can throw errors. *** ### getAllMinimapIds() > **getAllMinimapIds**(): `string`\[] **`World Mutation`** **`Beta`** #### Returns `string`\[] #### Remarks Retrieve a list of all active minimap identifiers currently managed by the system. #### Throws This function can throw errors. *** ### getMinimap() > **getMinimap**(`minimapId`): [`MinimapItem`](/server-editor/classes/MinimapItem.md) **`World Mutation`** **`Beta`** #### Parameters ##### minimapId `string` #### Returns [`MinimapItem`](/server-editor/classes/MinimapItem.md) #### Remarks Retrieve a specific minimap instance using its unique identifier. #### Throws This function can throw errors. *** ### setVanillaBiomeColorMap() > **setVanillaBiomeColorMap**(`colorMap`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### colorMap `Record`\<`string`, `RGB`> #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### updateVanillaColorMap() > **updateVanillaColorMap**(`biomeType`, `color`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### biomeType `BiomeType` ##### color `RGB` #### Returns `void` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ModeChangeAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ModeChangeAfterEvent.md. # Class: ModeChangeAfterEvent event **`Beta`** Contains information related to changes in player editor mode. ## Properties ### mode > `readonly` **mode**: [`EditorMode`](/server-editor/enums/EditorMode.md) **`Beta`** #### Remarks The editor mode that the player is changed to. ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ModeChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ModeChangeAfterEventSignal.md. # Class: ModeChangeAfterEventSignal event **`Beta`** Manages callbacks that are connected to when a player editor mode changes. ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks Subscribes the specified callback to an editor mode change after event. *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks Removes the specified callback from an editor mode change after event. ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/NumberLimitObservableValidator.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/NumberLimitObservableValidator.md. # Class: NumberLimitObservableValidator **`Beta`** Validates min/max limits of observable objects that support number ## Implements - [`ObservableValidator`](/server-editor/classes/ObservableValidator.md)\<`number`> ## Constructors \{#constructors} ### Constructor \{#constructor} > **new NumberLimitObservableValidator**(`min`, `max`, `isInteger?`): `NumberLimitObservableValidator` **`Beta`** #### Parameters ##### min `number` | `undefined` ##### max `number` | `undefined` ##### isInteger? `boolean` #### Returns `NumberLimitObservableValidator` #### Remarks Constructs a new instance of the `NumberLimitObservableValidator` class ## Properties ### \_isInteger? > `protected` `optional` **\_isInteger?**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### \_max? > `protected` `optional` **\_max?**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### \_min? > `protected` `optional` **\_min?**: `number` **`World Mutation`** **`Beta`** #### Remarks ## Methods ### updateLimits() > **updateLimits**(`min`, `max`): `void` **`Beta`** #### Parameters ##### min `number` | `undefined` ##### max `number` | `undefined` #### Returns `void` *** ### validate() > **validate**(`newValue`): `number` **`Beta`** #### Parameters ##### newValue `number` #### Returns `number` #### Implementation of [`ObservableValidator`](/server-editor/classes/ObservableValidator.md).[`validate`](/server-editor/classes/ObservableValidator.md#validate) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ObservableValidator.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ObservableValidator.md. # Abstract Class: ObservableValidator\ **`Beta`** Used for validating an observable value before it gets set ## Type Parameters ### T `T` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ObservableValidator**\<`T`>(): `ObservableValidator`\<`T`> **`Beta`** #### Returns `ObservableValidator`\<`T`> ## Methods ### validate() > `abstract` **validate**(`newValue`): `T` | `undefined` **`Beta`** #### Parameters ##### newValue `T` #### Returns `T` | `undefined` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/PendingTransaction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/PendingTransaction.md. # Class: PendingTransaction **`Beta`** ## Methods ### addEntityOperation() > **addEntityOperation**(`entity`, `type`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### entity `Entity` ##### type [`EntityOperationType`](/server-editor/enums/EntityOperationType.md) #### Returns `boolean` #### Remarks #### Throws This function can throw errors. *** ### addUserDefinedOperation() > **addUserDefinedOperation**(`transactionHandler`, `operationData`, `operationName?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### transactionHandler [`UserDefinedTransactionOperationHandler`](/server-editor/classes/UserDefinedTransactionOperationHandler.md) ##### operationData `string` ##### operationName? `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### addVolumeListOperation() > **addVolumeListOperation**(`operationHandler`, `previous`, `current`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### operationHandler [`VolumeListTransactionOperationHandler`](/server-editor/classes/VolumeListTransactionOperationHandler.md) ##### previous [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)\[] ##### current [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)\[] #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### commitTrackedChanges() > **commitTrackedChanges**(): `number` **`World Mutation`** **`Beta`** #### Returns `number` #### Remarks #### Throws This function can throw errors. *** ### discard() > **discard**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### discardTrackedChanges() > **discardTrackedChanges**(): `number` **`World Mutation`** **`Beta`** #### Returns `number` #### Remarks #### Throws This function can throw errors. *** ### isValid() > **isValid**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks *** ### submit() > **submit**(`transactionHandler?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### transactionHandler? [`TransactionHandler`](/server-editor/classes/TransactionHandler.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### trackBlockChangeArea() > **trackBlockChangeArea**(`from`, `to`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### from `Vector3` ##### to `Vector3` #### Returns `boolean` #### Remarks #### Throws This function can throw errors. *** ### trackBlockChangeList() > **trackBlockChangeList**(`locations`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### locations `Vector3`\[] #### Returns `boolean` #### Remarks #### Throws This function can throw errors. *** ### trackBlockChangeVolume() > **trackBlockChangeVolume**(`blockVolume`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### blockVolume `BlockVolumeBase` #### Returns `boolean` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/PlaytestManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/PlaytestManager.md. # Class: PlaytestManager **`Beta`** ## Methods ### beginPlaytest() > **beginPlaytest**(`options`): `Promise`\<[`PlaytestSessionResult`](/server-editor/enums/PlaytestSessionResult.md)> **`World Mutation`** **`Beta`** #### Parameters ##### options [`GameOptions`](/server-editor/interfaces/GameOptions.md) #### Returns `Promise`\<[`PlaytestSessionResult`](/server-editor/enums/PlaytestSessionResult.md)> #### Remarks #### Throws This function can throw errors. *** ### getPlaytestSessionAvailability() > **getPlaytestSessionAvailability**(): [`PlaytestSessionResult`](/server-editor/enums/PlaytestSessionResult.md) **`World Mutation`** **`Beta`** #### Returns [`PlaytestSessionResult`](/server-editor/enums/PlaytestSessionResult.md) #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ProbabilityBlockPaletteItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ProbabilityBlockPaletteItem.md. # Class: ProbabilityBlockPaletteItem block **`Beta`** ## Extends - [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new ProbabilityBlockPaletteItem**(`displayName?`): `ProbabilityBlockPaletteItem` **`Beta`** #### Parameters ##### displayName? `string` #### Returns `ProbabilityBlockPaletteItem` #### Overrides `IBlockPaletteItem.constructor` ## Methods ### addBlock() > **addBlock**(`block`, `weight`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### block `any` ##### weight `number` Bounds: \[1, 100] #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### getBlock() > **getBlock**(): `any` **`Beta`** #### Returns `any` #### Inherited from [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md).[`getBlock`](/server-editor/classes/IBlockPaletteItem.md#getblock) *** ### getBlocks() > **getBlocks**(): [`WeightedBlock`](/server-editor/interfaces/WeightedBlock.md)\[] **`Beta`** #### Returns [`WeightedBlock`](/server-editor/interfaces/WeightedBlock.md)\[] *** ### getDisplayName() > **getDisplayName**(): `string` | `undefined` **`Beta`** #### Returns `string` | `undefined` #### Inherited from [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md).[`getDisplayName`](/server-editor/classes/IBlockPaletteItem.md#getdisplayname) *** ### getType() > **getType**(): [`BlockPaletteItemType`](/server-editor/enums/BlockPaletteItemType.md) **`Beta`** #### Returns [`BlockPaletteItemType`](/server-editor/enums/BlockPaletteItemType.md) #### Inherited from [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md).[`getType`](/server-editor/classes/IBlockPaletteItem.md#gettype) *** ### removeBlockAt() > **removeBlockAt**(`index`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### index `number` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setBlock() > **setBlock**(`block`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### block `any` #### Returns `void` #### Remarks #### Throws This function can throw errors. #### Inherited from [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md).[`setBlock`](/server-editor/classes/IBlockPaletteItem.md#setblock) ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ProjectAfterEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ProjectAfterEvents.md. # Class: ProjectAfterEvents event **`Beta`** ## Properties ### simulationStateChange > `readonly` **simulationStateChange**: [`SimulationStateChangeAfterEventSignal`](/server-editor/classes/SimulationStateChangeAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/PyramidBrushShape.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/PyramidBrushShape.md. # Class: PyramidBrushShape **`Beta`** ## Extends - [`BrushShape`](/server-editor/classes/BrushShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new PyramidBrushShape**(`settings?`): `PyramidBrushShape` **`Beta`** #### Parameters ##### settings? ###### depth? `number` ###### enableHollowSettings? `boolean` ###### height? `number` ###### hollow? `boolean` ###### maxHeight? `number` ###### maxSide? `number` ###### thickness? `number` ###### uniform? `boolean` ###### width? `number` ###### xRotation? `number` ###### yRotation? `number` ###### zRotation? `number` #### Returns `PyramidBrushShape` #### Remarks Constructs a new instance of the `PyramidBrushShape` class #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`constructor`](/server-editor/classes/BrushShape.md#constructor) ## Accessors ### displayName #### Get Signature > **get** **displayName**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`displayName`](/server-editor/classes/BrushShape.md#displayname) *** ### icon #### Get Signature > **get** **icon**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`icon`](/server-editor/classes/BrushShape.md#icon) *** ### id #### Get Signature > **get** **id**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`id`](/server-editor/classes/BrushShape.md#id) ## Methods ### applySetting() > **applySetting**(`brushSettings`): `void` **`Beta`** #### Parameters ##### brushSettings [`PyramidBrushShapeSettings`](/server-editor/interfaces/PyramidBrushShapeSettings.md) #### Returns `void` #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`applySetting`](/server-editor/classes/BrushShape.md#applysetting) *** ### calculateBounds() > **calculateBounds**(): `BlockBoundingBox` **`Beta`** #### Returns `BlockBoundingBox` Object with min and max Vector3 bounds #### Remarks Calculates the bounding box of the shape in local coordinates. Used for region allocation before shape placement. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`calculateBounds`](/server-editor/classes/BrushShape.md#calculatebounds) *** ### createSettingsPane() > **createSettingsPane**(`parentPane`, `onSettingsChange?`, `flatLayout?`): [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) **`Beta`** #### Parameters ##### parentPane [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) ##### onSettingsChange? () => `void` ##### flatLayout? `boolean` #### Returns [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createSettingsPane`](/server-editor/classes/BrushShape.md#createsettingspane) *** ### createShape() > **createShape**(): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`Beta`** #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShape`](/server-editor/classes/BrushShape.md#createshape) *** ### createShapeAsync() > **createShapeAsync**(`cancelToken?`, `yieldInterval?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`Beta`** #### Parameters ##### cancelToken? Optional token to cancel the operation. Set cancelled to true to abort. ###### cancelled `boolean` ##### yieldInterval? `number` Number of blocks to process before yielding. Default is 10000\. #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> Promise that resolves to the shape positions as Vector3 array. #### Remarks Asynchronously creates the shape, yielding control periodically to avoid timeouts. Use this for large shapes where createShape() may timeout. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShapeAsync`](/server-editor/classes/BrushShape.md#createshapeasync) *** ### estimateBlockCount() > **estimateBlockCount**(): `number` **`Beta`** #### Returns `number` Estimated block count #### Remarks Returns a mathematical estimate of the number of blocks in the shape. Used for UI display and validation before shape creation. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`estimateBlockCount`](/server-editor/classes/BrushShape.md#estimateblockcount) *** ### getSettings() > **getSettings**(): [`PyramidBrushShapeSettings`](/server-editor/interfaces/PyramidBrushShapeSettings.md) **`Beta`** #### Returns [`PyramidBrushShapeSettings`](/server-editor/interfaces/PyramidBrushShapeSettings.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`getSettings`](/server-editor/classes/BrushShape.md#getsettings) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/RelativeVolumeListBlockVolume.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/RelativeVolumeListBlockVolume.md. # Class: RelativeVolumeListBlockVolume block **`Beta`** ## Extends - `unknown` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new RelativeVolumeListBlockVolume**(`origin?`): `RelativeVolumeListBlockVolume` **`Beta`** #### Parameters ##### origin? `any` #### Returns `RelativeVolumeListBlockVolume` #### Overrides `BlockVolumeBase.constructor` ## Properties ### isEmpty > `readonly` **isEmpty**: `boolean` **`Beta`** *** ### origin? > `optional` **origin?**: `any` **`World Mutation`** **`Beta`** #### Remarks *** ### volumeCount > `readonly` **volumeCount**: `number` **`Beta`** ## Methods ### add() > **add**(`toAdd`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### toAdd `any` #### Returns `void` #### Remarks *** ### clear() > **clear**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks *** ### clone() > **clone**(): `RelativeVolumeListBlockVolume` **`Beta`** #### Returns `RelativeVolumeListBlockVolume` *** ### getVolumeList() > **getVolumeList**(): `BlockVolume`\[] **`World Mutation`** **`Beta`** #### Returns `BlockVolume`\[] #### Remarks *** ### hasAdjacent() > **hasAdjacent**(`location`, `normalizedOffset`): `boolean` **`Beta`** #### Parameters ##### location `Vector3` ##### normalizedOffset `Vector3` #### Returns `boolean` *** ### moveTo() > **moveTo**(`location`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` #### Returns `void` #### Remarks *** ### remove() > **remove**(`toRemove`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### toRemove `any` #### Returns `void` #### Remarks *** ### set() > **set**(`toSet`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### toSet `any` #### Returns `void` #### Remarks *** ### translate() > **translate**(`offset`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### offset `Vector3` #### Returns `void` #### Remarks ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SelectionChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SelectionChangeAfterEventSignal.md. # Class: SelectionChangeAfterEventSignal event **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SelectionContainerBase.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SelectionContainerBase.md. # Class: SelectionContainerBase inventory **`Beta`** ## Extended by - [`SelectionContainerEntity`](/server-editor/classes/SelectionContainerEntity.md) - [`SelectionContainerVolume`](/server-editor/classes/SelectionContainerVolume.md) ## 同领域相关 - [IMenuContainer](/server-editor/interfaces/IMenuContainer.md) - [IModalToolContainer](/server-editor/interfaces/IModalToolContainer.md) - [ITagContainerPropertyItem](/server-editor/interfaces/ITagContainerPropertyItem.md) - [ITagContainerPropertyItemOptions](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity.md) - [SelectionContainerVolume](/server-editor/classes/SelectionContainerVolume.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SelectionContainerEntity.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SelectionContainerEntity.md. # Class: SelectionContainerEntity entity inventory **`Beta`** ## Extends - [`SelectionContainerBase`](/server-editor/classes/SelectionContainerBase.md) ## 同领域相关 - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent.md) - [EntityContainerClosedAfterEventSignal](/server/classes/EntityContainerClosedAfterEventSignal.md) - [EntityContainerOpenedAfterEvent](/server/classes/EntityContainerOpenedAfterEvent.md) - [EntityContainerOpenedAfterEventSignal](/server/classes/EntityContainerOpenedAfterEventSignal.md) - [EntityEnderInventoryComponent](/server/classes/EntityEnderInventoryComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SelectionContainerVolume.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SelectionContainerVolume.md. # Class: SelectionContainerVolume inventory **`Beta`** ## Extends - [`SelectionContainerBase`](/server-editor/classes/SelectionContainerBase.md) ## Properties ### isEmpty > `readonly` **isEmpty**: `boolean` **`Beta`** *** ### volumeCount > `readonly` **volumeCount**: `number` **`Beta`** ## Methods ### add() > **add**(`volume`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` #### Returns `void` #### Remarks *** ### clear() > **clear**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks *** ### get() > **get**(): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`Beta`** #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) *** ### getBoundingBox() > **getBoundingBox**(): `BlockBoundingBox` **`Beta`** #### Returns `BlockBoundingBox` #### Throws This function can throw errors. *** ### moveTo() > **moveTo**(`location`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` #### Returns `void` #### Remarks *** ### remove() > **remove**(`volume`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` #### Returns `void` #### Remarks *** ### set() > **set**(`volume`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### volume `any` #### Returns `void` #### Remarks *** ### translate() > **translate**(`offset`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### offset `Vector3` #### Returns `void` #### Remarks ## 同领域相关 - [IMenuContainer](/server-editor/interfaces/IMenuContainer.md) - [IModalToolContainer](/server-editor/interfaces/IModalToolContainer.md) - [ITagContainerPropertyItem](/server-editor/interfaces/ITagContainerPropertyItem.md) - [ITagContainerPropertyItemOptions](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) - [SelectionContainerBase](/server-editor/classes/SelectionContainerBase.md) - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SelectionContainerVolumeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SelectionContainerVolumeEvent.md. # Class: SelectionContainerVolumeEvent event inventory **`Beta`** ## Properties ### type > `readonly` **type**: [`SelectionVolumeEventType`](/server-editor/enums/SelectionVolumeEventType.md) **`Beta`** ## 同领域相关 - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions.md) - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent.md) - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal.md) - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent.md) - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal.md) - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SelectionEventAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SelectionEventAfterEvent.md. # Class: SelectionEventAfterEvent event **`Beta`** ## Properties ### volumeEventData? > `readonly` `optional` **volumeEventData?**: [`SelectionContainerVolumeEvent`](/server-editor/classes/SelectionContainerVolumeEvent.md) **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SelectionManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SelectionManager.md. # Class: SelectionManager **`Beta`** The SelectionManager (accessible from the [ExtensionContext](/server-editor/classes/ExtensionContext.md)) is responsible for the management of all @minecraft/server-editor.Selection objects, and provides the user the ability to create new @minecraft/server-editor.Selection objects for use within an extension. ## Properties ### entity 实验性 > `readonly` **entity**: [`SelectionContainerEntity`](/server-editor/classes/SelectionContainerEntity.md) **`Beta`** *** ### volume 实验性 > `readonly` **volume**: [`SelectionContainerVolume`](/server-editor/classes/SelectionContainerVolume.md) **`Beta`** ## Methods ### deselectBlocks() > **deselectBlocks**(`blockIdentifier`): `Promise`\<`number`> **`World Mutation`** **`Beta`** #### Parameters ##### blockIdentifier `string` #### Returns `Promise`\<`number`> #### Remarks *** ### generateManifest() > **generateManifest**(): `Promise`\<[`SelectionManifestData`](/server-editor/interfaces/SelectionManifestData.md)> **`World Mutation`** **`Beta`** #### Returns `Promise`\<[`SelectionManifestData`](/server-editor/interfaces/SelectionManifestData.md)> #### Remarks *** ### getCurrentManifest() > **getCurrentManifest**(): [`SelectionManifestData`](/server-editor/interfaces/SelectionManifestData.md) | `undefined` **`World Mutation`** **`Beta`** #### Returns [`SelectionManifestData`](/server-editor/interfaces/SelectionManifestData.md) | `undefined` #### Remarks *** ### replaceBlocks() > **replaceBlocks**(`fromBlockIdentifier`, `toBlockIdentifier`): `Promise`\<`number`> **`World Mutation`** **`Beta`** #### Parameters ##### fromBlockIdentifier `string` ##### toBlockIdentifier `string` #### Returns `Promise`\<`number`> #### Remarks [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SettingsManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SettingsManager.md. # Class: SettingsManager **`Beta`** The SettingsManager (accessible from the [ExtensionContext](/server-editor/classes/ExtensionContext.md)) is responsible for the management all player settings. ## Properties ### audio > `readonly` **audio**: [`AudioSettings`](/server-editor/classes/AudioSettings.md) **`Beta`** *** ### graphics > `readonly` **graphics**: [`GraphicsSettings`](/server-editor/classes/GraphicsSettings.md) **`Beta`** #### Remarks Manages graphics settings properties. *** ### speed > `readonly` **speed**: [`SpeedSettings`](/server-editor/classes/SpeedSettings.md) **`Beta`** *** ### theme > `readonly` **theme**: [`ThemeSettings`](/server-editor/classes/ThemeSettings.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SimpleBlockPaletteItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SimpleBlockPaletteItem.md. # Class: SimpleBlockPaletteItem block **`Beta`** ## Extends - [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new SimpleBlockPaletteItem**(`displayName?`): `SimpleBlockPaletteItem` **`Beta`** #### Parameters ##### displayName? `string` #### Returns `SimpleBlockPaletteItem` #### Overrides `IBlockPaletteItem.constructor` ## Methods ### getBlock() > **getBlock**(): `any` **`Beta`** #### Returns `any` #### Inherited from [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md).[`getBlock`](/server-editor/classes/IBlockPaletteItem.md#getblock) *** ### getDisplayName() > **getDisplayName**(): `string` | `undefined` **`Beta`** #### Returns `string` | `undefined` #### Inherited from [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md).[`getDisplayName`](/server-editor/classes/IBlockPaletteItem.md#getdisplayname) *** ### getType() > **getType**(): [`BlockPaletteItemType`](/server-editor/enums/BlockPaletteItemType.md) **`Beta`** #### Returns [`BlockPaletteItemType`](/server-editor/enums/BlockPaletteItemType.md) #### Inherited from [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md).[`getType`](/server-editor/classes/IBlockPaletteItem.md#gettype) *** ### setBlock() > **setBlock**(`block`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### block `any` #### Returns `void` #### Remarks #### Throws This function can throw errors. #### Inherited from [`IBlockPaletteItem`](/server-editor/classes/IBlockPaletteItem.md).[`setBlock`](/server-editor/classes/IBlockPaletteItem.md#setblock) ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SimulationState.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SimulationState.md. # Class: SimulationState **`Beta`** Responsible for querying and modifying various properties of the simulation. ## Methods ### isPaused() > **isPaused**(): `boolean` **`Beta`** #### Returns `boolean` #### Remarks Returns `true` if mob simulation is paused. *** ### setPaused() > **setPaused**(`isPaused`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### isPaused `boolean` #### Returns `void` #### Remarks Sets the state of mob simulation. If set to `true`, mobs are paused. #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SimulationStateAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SimulationStateAfterEvent.md. # Class: SimulationStateAfterEvent event **`Beta`** ## Properties ### paused > `readonly` **paused**: `boolean` **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SimulationStateChangeAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SimulationStateChangeAfterEventSignal.md. # Class: SimulationStateChangeAfterEventSignal event **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SingleBlockBrushShape.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SingleBlockBrushShape.md. # Class: SingleBlockBrushShape block **`Beta`** ## Extends - [`BrushShape`](/server-editor/classes/BrushShape.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new SingleBlockBrushShape**(): `SingleBlockBrushShape` **`Beta`** #### Returns `SingleBlockBrushShape` #### Remarks Constructs a new instance of the `SingleBlockBrushShape` class #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`constructor`](/server-editor/classes/BrushShape.md#constructor) ## Accessors ### displayName #### Get Signature > **get** **displayName**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`displayName`](/server-editor/classes/BrushShape.md#displayname) *** ### icon #### Get Signature > **get** **icon**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`icon`](/server-editor/classes/BrushShape.md#icon) *** ### id #### Get Signature > **get** **id**(): `string` **`Beta`** ##### Returns `string` #### Inherited from [`BrushShape`](/server-editor/classes/BrushShape.md).[`id`](/server-editor/classes/BrushShape.md#id) ## Methods ### applySetting() > **applySetting**(`_settings`): `void` **`Beta`** #### Parameters ##### \_settings [`BrushShapeSettings`](/server-editor/types/BrushShapeSettings.md) #### Returns `void` #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`applySetting`](/server-editor/classes/BrushShape.md#applysetting) *** ### calculateBounds() > **calculateBounds**(): `BlockBoundingBox` **`Beta`** #### Returns `BlockBoundingBox` Object with min and max Vector3 bounds #### Remarks Calculates the bounding box of the shape in local coordinates. Used for region allocation before shape placement. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`calculateBounds`](/server-editor/classes/BrushShape.md#calculatebounds) *** ### createSettingsPane() > **createSettingsPane**(): `undefined` **`Beta`** #### Returns `undefined` #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createSettingsPane`](/server-editor/classes/BrushShape.md#createsettingspane) *** ### createShape() > **createShape**(): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) **`Beta`** #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShape`](/server-editor/classes/BrushShape.md#createshape) *** ### createShapeAsync() > **createShapeAsync**(`_cancelToken?`, `_yieldInterval?`): `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> **`Beta`** #### Parameters ##### \_cancelToken? ###### cancelled `boolean` ##### \_yieldInterval? `number` #### Returns `Promise`\<[`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md)> Promise that resolves to the shape positions as Vector3 array. #### Remarks Asynchronously creates the shape, yielding control periodically to avoid timeouts. Use this for large shapes where createShape() may timeout. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`createShapeAsync`](/server-editor/classes/BrushShape.md#createshapeasync) *** ### estimateBlockCount() > **estimateBlockCount**(): `number` **`Beta`** #### Returns `number` Estimated block count #### Remarks Returns a mathematical estimate of the number of blocks in the shape. Used for UI display and validation before shape creation. #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`estimateBlockCount`](/server-editor/classes/BrushShape.md#estimateblockcount) *** ### getSettings() > **getSettings**(): [`BrushShapeSettings`](/server-editor/types/BrushShapeSettings.md) **`Beta`** #### Returns [`BrushShapeSettings`](/server-editor/types/BrushShapeSettings.md) #### Overrides [`BrushShape`](/server-editor/classes/BrushShape.md).[`getSettings`](/server-editor/classes/BrushShape.md#getsettings) ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/SpeedSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/SpeedSettings.md. # Class: SpeedSettings **`Beta`** ## Methods ### get() > **get**\<`T`>(`property`): [`SpeedSettingsPropertyTypeMap`](/server-editor/types/SpeedSettingsPropertyTypeMap.md)\[`T`] | `undefined` **`Beta`** #### Type Parameters ##### T `T` _extends_ [`FlySpeedMultiplier`](/server-editor/enums/SpeedSettingsProperty.md#flyspeedmultiplier) #### Parameters ##### property `T` #### Returns [`SpeedSettingsPropertyTypeMap`](/server-editor/types/SpeedSettingsPropertyTypeMap.md)\[`T`] | `undefined` *** ### getAll() > **getAll**(): [`SpeedSettingsPropertyTypeMap`](/server-editor/types/SpeedSettingsPropertyTypeMap.md) **`Beta`** #### Returns [`SpeedSettingsPropertyTypeMap`](/server-editor/types/SpeedSettingsPropertyTypeMap.md) *** ### set() > **set**\<`T`>(`property`, `value`): `void` **`World Mutation`** **`Beta`** #### Type Parameters ##### T `T` _extends_ [`FlySpeedMultiplier`](/server-editor/enums/SpeedSettingsProperty.md#flyspeedmultiplier) #### Parameters ##### property `T` ##### value [`SpeedSettingsPropertyTypeMap`](/server-editor/types/SpeedSettingsPropertyTypeMap.md)\[`T`] #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setAll() > **setAll**(`properties`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### properties [`SpeedSettingsPropertyTypeMap`](/server-editor/types/SpeedSettingsPropertyTypeMap.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/ThemeSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/ThemeSettings.md. # Class: ThemeSettings **`Beta`** ## Methods ### addNewTheme() > **addNewTheme**(`id`, `name?`, `sourceThemeId?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### id `string` ##### name? `string` ##### sourceThemeId? `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### canThemeBeModified() > **canThemeBeModified**(`id`): `boolean` **`Beta`** #### Parameters ##### id `string` #### Returns `boolean` *** ### deleteTheme() > **deleteTheme**(`id`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### id `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### getCurrentTheme() > **getCurrentTheme**(): `string` **`Beta`** #### Returns `string` *** ### getThemeColors() > **getThemeColors**(`id`): `Record`\<`string`, `RGBA`> | `undefined` **`Beta`** #### Parameters ##### id `string` #### Returns `Record`\<`string`, `RGBA`> | `undefined` *** ### getThemeIdList() > **getThemeIdList**(): `string`\[] **`Beta`** #### Returns `string`\[] *** ### getThemeName() > **getThemeName**(`id`): `string` **`Beta`** #### Parameters ##### id `string` #### Returns `string` #### Throws This function can throw errors. *** ### resolveColorKey() > **resolveColorKey**(`key`): `RGBA` **`Beta`** #### Parameters ##### key [`ThemeSettingsColorKey`](/server-editor/enums/ThemeSettingsColorKey.md) #### Returns `RGBA` *** ### setCurrentTheme() > **setCurrentTheme**(`id`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### id `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### setThemeName() > **setThemeName**(`id`, `name`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### id `string` ##### name `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### updateThemeColor() > **updateThemeColor**(`id`, `key`, `newColor`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### id `string` ##### key [`ThemeSettingsColorKey`](/server-editor/enums/ThemeSettingsColorKey.md) ##### newColor `RGBA` #### Returns `void` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/TransactionEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/TransactionEvent.md. # Class: TransactionEvent event **`Beta`** ## Properties ### error? > `readonly` `optional` **error?**: `Error` **`Beta`** *** ### isUndo > `readonly` **isUndo**: `boolean` **`Beta`** *** ### state > `readonly` **state**: [`TransactionProcessState`](/server-editor/enums/TransactionProcessState.md) **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/TransactionHandler.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/TransactionHandler.md. # Class: TransactionHandler **`Beta`** ## Properties ### id > `readonly` **id**: `string` **`Beta`** ## Methods ### addUserDefinedOperationHandler() > **addUserDefinedOperationHandler**(`payloadClosure`): [`UserDefinedTransactionOperationHandler`](/server-editor/classes/UserDefinedTransactionOperationHandler.md) **`World Mutation`** **`Beta`** #### Parameters ##### payloadClosure (`arg0`) => `void` #### Returns [`UserDefinedTransactionOperationHandler`](/server-editor/classes/UserDefinedTransactionOperationHandler.md) #### Remarks #### Throws This function can throw errors. *** ### addVolumeListOperationHandler() > **addVolumeListOperationHandler**(`closure`): [`VolumeListTransactionOperationHandler`](/server-editor/classes/VolumeListTransactionOperationHandler.md) **`World Mutation`** **`Beta`** #### Parameters ##### closure (`arg0`) => `void` #### Returns [`VolumeListTransactionOperationHandler`](/server-editor/classes/VolumeListTransactionOperationHandler.md) #### Remarks #### Throws This function can throw errors. *** ### isValid() > **isValid**(): `boolean` **`Beta`** #### Returns `boolean` *** ### unregister() > **unregister**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/TransactionManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/TransactionManager.md. # Class: TransactionManager **`Beta`** The Transaction Manager is responsible for tracking and managing all of the registered transaction operations which represent creator changes in the world. Transaction Manager is the basis of the UNDO and REDO operations, and allows a creator to store the changes made to the world and the state of the world BEFORE those changes were applied, making it possible to UNDO those changes and restore the world state. The transactions are stored as a stack, and can be undone in stack order to restore the world to it's original state ## Methods ### createPendingTransaction() > **createPendingTransaction**(`name`): [`PendingTransaction`](/server-editor/classes/PendingTransaction.md) **`World Mutation`** **`Beta`** #### Parameters ##### name `string` #### Returns [`PendingTransaction`](/server-editor/classes/PendingTransaction.md) #### Remarks #### Throws This function can throw errors. *** ### redo() > **redo**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Perform an redo operation. This will take the last transaction record on the redo stack and store the current world state and then apply the changes in the record. This will reduce the redo record stack by one. The transaction record affected by this operation will be transferred to the undo stack in case the creator decides to undo it #### Throws This function can throw errors. *** ### redoSize() > **redoSize**(): `number` **`World Mutation`** **`Beta`** #### Returns `number` #### Remarks Return the number of transaction records on the redo stack. #### Throws This function can throw errors. *** ### registerTransactionHandler() > **registerTransactionHandler**(`onEvent?`): [`TransactionHandler`](/server-editor/classes/TransactionHandler.md) **`World Mutation`** **`Beta`** #### Parameters ##### onEvent? (`arg0`) => `void` #### Returns [`TransactionHandler`](/server-editor/classes/TransactionHandler.md) #### Remarks #### Throws This function can throw errors. *** ### undo() > **undo**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks Perform an undo operation. This will take the last transaction record on the stack and apply the stored world state from before the changes were made. This will reduce the record stack by one. The transaction record affected by this operation will be transferred to the redo stack in case the creator decides to reapply it #### Throws This function can throw errors. *** ### undoSize() > **undoSize**(): `number` **`World Mutation`** **`Beta`** #### Returns `number` #### Remarks Return how many transactions records currently exist on the stack #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/TransactionManagerNoChangesError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/TransactionManagerNoChangesError.md. # Class: TransactionManagerNoChangesError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) - [InvalidWidgetGroupError](/server-editor/classes/InvalidWidgetGroupError.md) - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) - [AllowListModificationError](/server-admin/classes/AllowListModificationError.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/TransactionOperationHandler.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/TransactionOperationHandler.md. # Class: TransactionOperationHandler **`Beta`** ## Extended by - [`UserDefinedTransactionOperationHandler`](/server-editor/classes/UserDefinedTransactionOperationHandler.md) - [`VolumeListTransactionOperationHandler`](/server-editor/classes/VolumeListTransactionOperationHandler.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/UserDefinedTransactionHandle.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/UserDefinedTransactionHandle.md. # Class: UserDefinedTransactionHandle\ **`Beta`** A strongly typed transaction handle to enforce type safety when adding user defined transactions.\
This transaction handle becomes the context for adding the transaction to the transaction manager.\
You can obtain one of these handles by calling [registerUserDefinedTransactionHandler](/server-editor/functions/registerUserDefinedTransactionHandler.md) ## Type Parameters ### T `T` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new UserDefinedTransactionHandle**\<`T`>(`transactionHandler`, `nativeHandle`, `transactionManager`): `UserDefinedTransactionHandle`\<`T`> **`Beta`** #### Parameters ##### transactionHandler [`TransactionHandler`](/server-editor/classes/TransactionHandler.md) ##### nativeHandle [`UserDefinedTransactionOperationHandler`](/server-editor/classes/UserDefinedTransactionOperationHandler.md) ##### transactionManager [`TransactionManager`](/server-editor/classes/TransactionManager.md) #### Returns `UserDefinedTransactionHandle`\<`T`> #### Remarks Constructs a new instance of the `UserDefinedTransactionHandle` class ## Methods ### addUserDefinedOperation() > **addUserDefinedOperation**(`payload`, `transactionName`, `pendingTransaction`): `void` **`Beta`** #### Parameters ##### payload `T` The data object to be inserted into the transaction log. ##### transactionName `string` A string name that will be associated with this operation ##### pendingTransaction [`PendingTransaction`](/server-editor/classes/PendingTransaction.md) #### Returns `void` #### Remarks Add a user defined transaction operation to the transaction manager with a payload of the specified type. This allows the extension to open a transaction, and insert custom data objects into the transaction log which are stored until an undo or redo event occurs. The payload data added here is stored and then passed to the undo/redo handlers (registered with [registerUserDefinedTransactionHandler](/server-editor/functions/registerUserDefinedTransactionHandler.md)) when an undo/redo event is requested. NOTE:\
Transactions can contain multiple operations - you can open a transaction and add any (reasonable) number of operations to it (of the same or differing types) before committing to the transaction log. 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. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/UserDefinedTransactionOperationHandler.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/UserDefinedTransactionOperationHandler.md. # Class: UserDefinedTransactionOperationHandler **`Beta`** ## Extends - [`TransactionOperationHandler`](/server-editor/classes/TransactionOperationHandler.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/Vector2LimitObservableValidator.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/Vector2LimitObservableValidator.md. # Class: Vector2LimitObservableValidator **`Beta`** Validates min/max limits of observable objects that support Vector2 ## Implements - [`ObservableValidator`](/server-editor/classes/ObservableValidator.md)\<`Vector2`> ## Constructors \{#constructors} ### Constructor \{#constructor} > **new Vector2LimitObservableValidator**(`min`, `max`, `isInteger?`): `Vector2LimitObservableValidator` **`Beta`** #### Parameters ##### min `Vector2` ##### max `Vector2` ##### isInteger? `boolean` #### Returns `Vector2LimitObservableValidator` #### Remarks Constructs a new instance of the `Vector2LimitObservableValidator` class ## Properties ### \_isInteger? > `protected` `optional` **\_isInteger?**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### \_max > `protected` **\_max**: `Vector2` **`World Mutation`** **`Beta`** #### Remarks *** ### \_min > `protected` **\_min**: `Vector2` **`World Mutation`** **`Beta`** #### Remarks ## Methods ### updateLimits() > **updateLimits**(`min`, `max`): `void` **`Beta`** #### Parameters ##### min `Vector2` ##### max `Vector2` #### Returns `void` *** ### validate() > **validate**(`newValue`): `Vector2` **`Beta`** #### Parameters ##### newValue `Vector2` #### Returns `Vector2` #### Implementation of [`ObservableValidator`](/server-editor/classes/ObservableValidator.md).[`validate`](/server-editor/classes/ObservableValidator.md#validate) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/Vector3LimitObservableValidator.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/Vector3LimitObservableValidator.md. # Class: Vector3LimitObservableValidator **`Beta`** Validates min/max limits of observable objects that support Vector3 ## Implements - [`ObservableValidator`](/server-editor/classes/ObservableValidator.md)\<`Vector3`> ## Constructors \{#constructors} ### Constructor \{#constructor} > **new Vector3LimitObservableValidator**(`min`, `max`, `isInteger?`): `Vector3LimitObservableValidator` **`Beta`** #### Parameters ##### min `Vector3` ##### max `Vector3` ##### isInteger? `boolean` #### Returns `Vector3LimitObservableValidator` #### Remarks Constructs a new instance of the `Vector3LimitObservableValidator` class ## Properties ### \_isInteger? > `protected` `optional` **\_isInteger?**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### \_max > `protected` **\_max**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### \_min > `protected` **\_min**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks ## Methods ### updateLimits() > **updateLimits**(`min`, `max`): `void` **`Beta`** #### Parameters ##### min `Vector3` ##### max `Vector3` #### Returns `void` *** ### validate() > **validate**(`newValue`): `Vector3` **`Beta`** #### Parameters ##### newValue `Vector3` #### Returns `Vector3` #### Implementation of [`ObservableValidator`](/server-editor/classes/ObservableValidator.md).[`validate`](/server-editor/classes/ObservableValidator.md#validate) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/VolumeListTransactionOperationHandler.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/VolumeListTransactionOperationHandler.md. # Class: VolumeListTransactionOperationHandler **`Beta`** ## Extends - [`TransactionOperationHandler`](/server-editor/classes/TransactionOperationHandler.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/Widget.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/Widget.md. # Class: Widget **`Beta`** ## Properties ### bindPositionToBlockCursor > **bindPositionToBlockCursor**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### collisionOffset > **collisionOffset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### collisionRadius > **collisionRadius**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### collisionType > **collisionType**: [`WidgetCollisionType`](/server-editor/enums/WidgetCollisionType.md) **`World Mutation`** **`Beta`** #### Remarks *** ### dimensionId? > `optional` **dimensionId?**: `string` **`Beta`** *** ### group > `readonly` **group**: [`WidgetGroup`](/server-editor/classes/WidgetGroup.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) *** ### ignoreEditorModeVisibilityOverride > **ignoreEditorModeVisibilityOverride**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### location > **location**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### lockPositionToSurface > **lockPositionToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### selectable > `readonly` **selectable**: `boolean` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) *** ### selected > **selected**: `boolean` **`Beta`** *** ### showBoundingBox > **showBoundingBox**: `boolean` **`Beta`** *** ### showCollisionRadius > **showCollisionRadius**: `boolean` **`Beta`** *** ### snapToBlockLocation > **snapToBlockLocation**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### visible > **visible**: `boolean` **`Beta`** *** ### widgetName > `readonly` **widgetName**: `string` **`Beta`** ## Methods ### addBoundingBox() > **addBoundingBox**(`componentName`, `size`, `options?`): [`WidgetComponentBoundingBox`](/server-editor/classes/WidgetComponentBoundingBox.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### size `Vector3` ##### options? [`WidgetComponentBoundingBoxOptions`](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) #### Returns [`WidgetComponentBoundingBox`](/server-editor/classes/WidgetComponentBoundingBox.md) #### Remarks #### Throws This function can throw errors. *** ### addClipboardComponent() > **addClipboardComponent**(`componentName`, `clipboardItem?`, `options?`): [`WidgetComponentClipboard`](/server-editor/classes/WidgetComponentClipboard.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### clipboardItem? [`ClipboardItem`](/server-editor/classes/ClipboardItem.md) | [`EditorStructure`](/server-editor/classes/EditorStructure.md) ##### options? [`WidgetComponentClipboardOptions`](/server-editor/interfaces/WidgetComponentClipboardOptions.md) #### Returns [`WidgetComponentClipboard`](/server-editor/classes/WidgetComponentClipboard.md) #### Remarks #### Throws This function can throw errors. *** ### addEntityComponent() > **addEntityComponent**(`componentName`, `actorNameId`, `options?`): [`WidgetComponentEntity`](/server-editor/classes/WidgetComponentEntity.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### actorNameId `string` ##### options? [`WidgetComponentEntityOptions`](/server-editor/interfaces/WidgetComponentEntityOptions.md) #### Returns [`WidgetComponentEntity`](/server-editor/classes/WidgetComponentEntity.md) #### Remarks #### Throws This function can throw errors. *** ### addGizmoComponent() > **addGizmoComponent**(`componentName`, `options?`): [`WidgetComponentGizmo`](/server-editor/classes/WidgetComponentGizmo.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### options? [`WidgetComponentGizmoOptions`](/server-editor/interfaces/WidgetComponentGizmoOptions.md) #### Returns [`WidgetComponentGizmo`](/server-editor/classes/WidgetComponentGizmo.md) #### Remarks #### Throws This function can throw errors. *** ### addGridComponent() > **addGridComponent**(`componentName`, `options?`): [`WidgetComponentGrid`](/server-editor/classes/WidgetComponentGrid.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### options? [`WidgetComponentGridOptions`](/server-editor/interfaces/WidgetComponentGridOptions.md) #### Returns [`WidgetComponentGrid`](/server-editor/classes/WidgetComponentGrid.md) #### Remarks #### Throws This function can throw errors. *** ### addGuideComponent() > **addGuideComponent**(`componentName`, `options?`): [`WidgetComponentGuide`](/server-editor/classes/WidgetComponentGuide.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### options? [`WidgetComponentGuideOptions`](/server-editor/interfaces/WidgetComponentGuideOptions.md) #### Returns [`WidgetComponentGuide`](/server-editor/classes/WidgetComponentGuide.md) #### Remarks #### Throws This function can throw errors. *** ### addRenderPlaneComponent() > **addRenderPlaneComponent**(`componentName`, `options?`): [`WidgetComponentRenderPlane`](/server-editor/classes/WidgetComponentRenderPlane.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### options? [`WidgetComponentRenderPlaneOptions`](/server-editor/interfaces/WidgetComponentRenderPlaneOptions.md) #### Returns [`WidgetComponentRenderPlane`](/server-editor/classes/WidgetComponentRenderPlane.md) #### Remarks #### Throws This function can throw errors. *** ### addRenderPrimitiveComponent() > **addRenderPrimitiveComponent**(`componentName`, `primitiveType`, `options?`): [`WidgetComponentRenderPrimitive`](/server-editor/classes/WidgetComponentRenderPrimitive.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### primitiveType [`WidgetComponentRenderPrimitiveTypeAxialSphere`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeAxialSphere.md) | [`WidgetComponentRenderPrimitiveTypeBox`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBox.md) | [`WidgetComponentRenderPrimitiveTypeCone`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCone.md) | [`WidgetComponentRenderPrimitiveTypeCuboid`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCuboid.md) | [`WidgetComponentRenderPrimitiveTypeCylinder`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCylinder.md) | [`WidgetComponentRenderPrimitiveTypeDisc`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeDisc.md) | [`WidgetComponentRenderPrimitiveTypeEllipsoid`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeEllipsoid.md) | [`WidgetComponentRenderPrimitiveTypeLine`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeLine.md) | [`WidgetComponentRenderPrimitiveTypePyramid`](/server-editor/classes/WidgetComponentRenderPrimitiveTypePyramid.md) | [`WidgetComponentRenderPrimitiveTypeWireframeMesh`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeWireframeMesh.md) ##### options? [`WidgetComponentRenderPrimitiveOptions`](/server-editor/interfaces/WidgetComponentRenderPrimitiveOptions.md) #### Returns [`WidgetComponentRenderPrimitive`](/server-editor/classes/WidgetComponentRenderPrimitive.md) #### Remarks #### Throws This function can throw errors. *** ### addSplineComponent() > **addSplineComponent**(`componentName`, `options?`): [`WidgetComponentSpline`](/server-editor/classes/WidgetComponentSpline.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### options? [`WidgetComponentSplineOptions`](/server-editor/interfaces/WidgetComponentSplineOptions.md) #### Returns [`WidgetComponentSpline`](/server-editor/classes/WidgetComponentSpline.md) #### Remarks #### Throws This function can throw errors. *** ### addTextComponent() > **addTextComponent**(`componentName`, `label`, `options?`): [`WidgetComponentText`](/server-editor/classes/WidgetComponentText.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### label `string` ##### options? [`WidgetComponentTextOptions`](/server-editor/interfaces/WidgetComponentTextOptions.md) #### Returns [`WidgetComponentText`](/server-editor/classes/WidgetComponentText.md) #### Remarks #### Throws This function can throw errors. *** ### addVolumeOutline() > **addVolumeOutline**(`componentName`, `volume?`, `options?`): [`WidgetComponentVolumeOutline`](/server-editor/classes/WidgetComponentVolumeOutline.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` ##### volume? `any` ##### options? [`WidgetComponentVolumeOutlineOptions`](/server-editor/interfaces/WidgetComponentVolumeOutlineOptions.md) #### Returns [`WidgetComponentVolumeOutline`](/server-editor/classes/WidgetComponentVolumeOutline.md) #### Remarks #### Throws This function can throw errors. *** ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### deleteComponent() > **deleteComponent**(`componentOrName`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### componentOrName `string` | [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### getComponent() > **getComponent**(`componentName`): [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) **`World Mutation`** **`Beta`** #### Parameters ##### componentName `string` #### Returns [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) #### Remarks #### Throws This function can throw errors. *** ### getComponents() > **getComponents**(): [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md)\[] **`World Mutation`** **`Beta`** #### Returns [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md)\[] #### Remarks #### Throws This function can throw errors. [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) *** ### setStateChangeEvent() > **setStateChangeEvent**(`eventFunction?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### eventFunction? (`arg0`) => `void` #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentBase.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentBase.md. # Class: WidgetComponentBase component **`Beta`** ## Extended by - [`WidgetComponentBoundingBox`](/server-editor/classes/WidgetComponentBoundingBox.md) - [`WidgetComponentClipboard`](/server-editor/classes/WidgetComponentClipboard.md) - [`WidgetComponentEntity`](/server-editor/classes/WidgetComponentEntity.md) - [`WidgetComponentGizmo`](/server-editor/classes/WidgetComponentGizmo.md) - [`WidgetComponentGrid`](/server-editor/classes/WidgetComponentGrid.md) - [`WidgetComponentGuide`](/server-editor/classes/WidgetComponentGuide.md) - [`WidgetComponentRenderPlane`](/server-editor/classes/WidgetComponentRenderPlane.md) - [`WidgetComponentRenderPrimitive`](/server-editor/classes/WidgetComponentRenderPrimitive.md) - [`WidgetComponentSpline`](/server-editor/classes/WidgetComponentSpline.md) - [`WidgetComponentText`](/server-editor/classes/WidgetComponentText.md) - [`WidgetComponentVolumeOutline`](/server-editor/classes/WidgetComponentVolumeOutline.md) ## Properties ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### valid > `readonly` **valid**: `boolean` **`Beta`** *** ### visible > **visible**: `boolean` **`Beta`** *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) - [WidgetComponentBoundingBoxStateChangeEventParameters](/server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentBoundingBox.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentBoundingBox.md. # Class: WidgetComponentBoundingBox component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### boundsOffset > **boundsOffset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### enableResizeHandles > **enableResizeHandles**: [`Axis`](/server-editor/enums/Axis.md) **`World Mutation`** **`Beta`** #### Remarks *** ### hullColor > **hullColor**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### mirror > **mirror**: `StructureMirrorAxis` **`World Mutation`** **`Beta`** #### Remarks *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### normalizedOrigin > **normalizedOrigin**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### outlineColor > **outlineColor**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### rotation > **rotation**: `StructureRotation` **`World Mutation`** **`Beta`** #### Remarks *** ### showWorldIntersections > **showWorldIntersections**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### size > **size**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### transformedWorldVolume > `readonly` **transformedWorldVolume**: `BlockVolume` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### visibleHull > **visibleHull**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) ## Methods ### deactivateHandles() > **deactivateHandles**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) *** ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) *** ### setStateChangeEvent() > **setStateChangeEvent**(`eventFunction?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### eventFunction? (`arg0`) => `void` #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) - [WidgetComponentBoundingBoxStateChangeEventParameters](/server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters.md. # Class: WidgetComponentBoundingBoxStateChangeEventParameters event component **`Beta`** ## Properties ### boundsOffset? > `readonly` `optional` **boundsOffset?**: `any` **`Beta`** *** ### boundsSize? > `readonly` `optional` **boundsSize?**: `any` **`Beta`** *** ### component > `readonly` **component**: [`WidgetComponentBoundingBox`](/server-editor/classes/WidgetComponentBoundingBox.md) **`Beta`** *** ### eventType > `readonly` **eventType**: [`WidgetGizmoEventType`](/server-editor/enums/WidgetGizmoEventType.md) **`Beta`** *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** ## 同领域相关 - [WidgetComponentGizmoStateChangeEventParameters](/server-editor/classes/WidgetComponentGizmoStateChangeEventParameters.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentClipboard.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentClipboard.md. # Class: WidgetComponentClipboard component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### clipboardOffset > **clipboardOffset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### highlightHullColor > **highlightHullColor**: `RGBA` **`Beta`** *** ### highlightOutlineColor > **highlightOutlineColor**: `RGBA` **`Beta`** *** ### hullColor > **hullColor**: `RGBA` **`Beta`** *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### mirror > **mirror**: `StructureMirrorAxis` **`Beta`** *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### normalizedOrigin > **normalizedOrigin**: `Vector3` **`Beta`** *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### outlineColor > **outlineColor**: `RGBA` **`Beta`** *** ### rotation > **rotation**: `StructureRotation` **`Beta`** *** ### showOutline > **showOutline**: `boolean` **`Beta`** *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentEntity.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentEntity.md. # Class: WidgetComponentEntity entity component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### clickable > **clickable**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) *** ### playAnimation() > **playAnimation**(`animationName`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### animationName `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) ## 同领域相关 - [WidgetComponentEntityOptions](/server-editor/interfaces/WidgetComponentEntityOptions.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentGizmo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentGizmo.md. # Class: WidgetComponentGizmo component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### activated > **activated**: `boolean` **`Beta`** *** ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### enabledAxes > **enabledAxes**: [`Axis`](/server-editor/enums/Axis.md) **`World Mutation`** **`Beta`** #### Remarks *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### normalizedOffsetOverride? > `optional` **normalizedOffsetOverride?**: `any` **`World Mutation`** **`Beta`** #### Remarks *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### scaleMode > **scaleMode**: [`WidgetGizmoScaleMode`](/server-editor/enums/WidgetGizmoScaleMode.md) **`World Mutation`** **`Beta`** #### Remarks *** ### screenScale > **screenScale**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) *** ### worldScale > **worldScale**: `number` **`World Mutation`** **`Beta`** #### Remarks ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) *** ### setStateChangeEvent() > **setStateChangeEvent**(`eventFunction?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### eventFunction? (`arg0`) => `void` #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentGizmoStateChangeEventParameters.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentGizmoStateChangeEventParameters.md. # Class: WidgetComponentGizmoStateChangeEventParameters event component **`Beta`** ## Properties ### component > `readonly` **component**: [`WidgetComponentGizmo`](/server-editor/classes/WidgetComponentGizmo.md) **`Beta`** *** ### eventType? > `readonly` `optional` **eventType?**: [`WidgetGizmoEventType`](/server-editor/enums/WidgetGizmoEventType.md) **`Beta`** *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** ## 同领域相关 - [WidgetComponentBoundingBoxStateChangeEventParameters](/server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters.md) - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent.md) - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentGrid.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentGrid.md. # Class: WidgetComponentGrid component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### gridColor > **gridColor**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### gridCount > **gridCount**: `Vector2` **`World Mutation`** **`Beta`** #### Remarks *** ### gridSize > **gridSize**: `Vector2` **`World Mutation`** **`Beta`** #### Remarks *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### plane > **plane**: [`Plane`](/server-editor/enums/Plane.md) **`World Mutation`** **`Beta`** #### Remarks *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentGuide.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentGuide.md. # Class: WidgetComponentGuide component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPlane.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPlane.md. # Class: WidgetComponentRenderPlane component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### fillColor > **fillColor**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### gridResolution > **gridResolution**: [`RenderPlaneGridResolution`](/server-editor/enums/RenderPlaneGridResolution.md) **`World Mutation`** **`Beta`** #### Remarks *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### maxSizeChunks > **maxSizeChunks**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### normal > **normal**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### outlineColor > **outlineColor**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitive.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitive.md. # Class: WidgetComponentRenderPrimitive component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) *** ### setPrimitive() > **setPrimitive**(`primitive`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### primitive [`WidgetComponentRenderPrimitiveTypeAxialSphere`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeAxialSphere.md) | [`WidgetComponentRenderPrimitiveTypeBox`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBox.md) | [`WidgetComponentRenderPrimitiveTypeCone`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCone.md) | [`WidgetComponentRenderPrimitiveTypeCuboid`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCuboid.md) | [`WidgetComponentRenderPrimitiveTypeCylinder`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCylinder.md) | [`WidgetComponentRenderPrimitiveTypeDisc`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeDisc.md) | [`WidgetComponentRenderPrimitiveTypeEllipsoid`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeEllipsoid.md) | [`WidgetComponentRenderPrimitiveTypeLine`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeLine.md) | [`WidgetComponentRenderPrimitiveTypePyramid`](/server-editor/classes/WidgetComponentRenderPrimitiveTypePyramid.md) | [`WidgetComponentRenderPrimitiveTypeWireframeMesh`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeWireframeMesh.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypeAxialSphere.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypeAxialSphere.md. # Class: WidgetComponentRenderPrimitiveTypeAxialSphere component **`Beta`** ## Extends - [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new WidgetComponentRenderPrimitiveTypeAxialSphere**(`center`, `radius`, `color?`): `WidgetComponentRenderPrimitiveTypeAxialSphere` **`Beta`** #### Parameters ##### center `Vector3` ##### radius `number` ##### color? `any` #### Returns `WidgetComponentRenderPrimitiveTypeAxialSphere` #### Overrides `WidgetComponentRenderPrimitiveTypeBase.constructor` ## Properties ### center > **center**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### color? > `optional` **color?**: `any` **`World Mutation`** **`Beta`** #### Remarks *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`primitiveType`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#primitivetype) *** ### radius > **radius**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`renderPriority`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#renderpriority) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md. # Class: WidgetComponentRenderPrimitiveTypeBase component **`Beta`** ## Extended by - [`WidgetComponentRenderPrimitiveTypeAxialSphere`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeAxialSphere.md) - [`WidgetComponentRenderPrimitiveTypeBox`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBox.md) - [`WidgetComponentRenderPrimitiveTypeCone`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCone.md) - [`WidgetComponentRenderPrimitiveTypeCuboid`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCuboid.md) - [`WidgetComponentRenderPrimitiveTypeCylinder`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCylinder.md) - [`WidgetComponentRenderPrimitiveTypeDisc`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeDisc.md) - [`WidgetComponentRenderPrimitiveTypeEllipsoid`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeEllipsoid.md) - [`WidgetComponentRenderPrimitiveTypeLine`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeLine.md) - [`WidgetComponentRenderPrimitiveTypePyramid`](/server-editor/classes/WidgetComponentRenderPrimitiveTypePyramid.md) - [`WidgetComponentRenderPrimitiveTypeWireframeMesh`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeWireframeMesh.md) ## Properties ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypeBox.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypeBox.md. # Class: WidgetComponentRenderPrimitiveTypeBox component **`Beta`** ## Extends - [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new WidgetComponentRenderPrimitiveTypeBox**(`center`, `color`, `size?`): `WidgetComponentRenderPrimitiveTypeBox` **`Beta`** #### Parameters ##### center `Vector3` ##### color `RGBA` ##### size? `any` #### Returns `WidgetComponentRenderPrimitiveTypeBox` #### Overrides `WidgetComponentRenderPrimitiveTypeBase.constructor` ## Properties ### center > **center**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### color > **color**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`primitiveType`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#primitivetype) *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`renderPriority`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#renderpriority) *** ### size? > `optional` **size?**: `any` **`World Mutation`** **`Beta`** #### Remarks ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypeCone.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypeCone.md. # Class: WidgetComponentRenderPrimitiveTypeCone component **`Beta`** ## Extends - [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new WidgetComponentRenderPrimitiveTypeCone**(`center`, `radiusX`, `radiusZ`, `height`, `color`, `numSegments?`, `rotation?`, `alpha?`): `WidgetComponentRenderPrimitiveTypeCone` **`Beta`** #### Parameters ##### center `Vector3` ##### radiusX `number` ##### radiusZ `number` ##### height `number` ##### color `RGBA` ##### numSegments? `number` ##### rotation? `any` ##### alpha? `number` #### Returns `WidgetComponentRenderPrimitiveTypeCone` #### Overrides `WidgetComponentRenderPrimitiveTypeBase.constructor` ## Properties ### alpha? > `optional` **alpha?**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### center > **center**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### color > **color**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### height > **height**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### numSegments? > `optional` **numSegments?**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`primitiveType`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#primitivetype) *** ### radiusX > **radiusX**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### radiusZ > **radiusZ**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`renderPriority`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#renderpriority) *** ### rotation? > `optional` **rotation?**: `any` **`World Mutation`** **`Beta`** #### Remarks ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypeCuboid.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypeCuboid.md. # Class: WidgetComponentRenderPrimitiveTypeCuboid component **`Beta`** ## Extends - [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new WidgetComponentRenderPrimitiveTypeCuboid**(`center`, `lengthX`, `lengthY`, `lengthZ`, `color`, `rotation?`, `alpha?`): `WidgetComponentRenderPrimitiveTypeCuboid` **`Beta`** #### Parameters ##### center `Vector3` ##### lengthX `number` ##### lengthY `number` ##### lengthZ `number` ##### color `RGBA` ##### rotation? `any` ##### alpha? `number` #### Returns `WidgetComponentRenderPrimitiveTypeCuboid` #### Overrides `WidgetComponentRenderPrimitiveTypeBase.constructor` ## Properties ### alpha? > `optional` **alpha?**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### center > **center**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### color > **color**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### lengthX > **lengthX**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### lengthY > **lengthY**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### lengthZ > **lengthZ**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`primitiveType`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#primitivetype) *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`renderPriority`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#renderpriority) *** ### rotation? > `optional` **rotation?**: `any` **`World Mutation`** **`Beta`** #### Remarks ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypeCylinder.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypeCylinder.md. # Class: WidgetComponentRenderPrimitiveTypeCylinder component **`Beta`** ## Extends - [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new WidgetComponentRenderPrimitiveTypeCylinder**(`center`, `radiusX`, `radiusZ`, `height`, `color`, `rotation?`, `alpha?`): `WidgetComponentRenderPrimitiveTypeCylinder` **`Beta`** #### Parameters ##### center `Vector3` ##### radiusX `number` ##### radiusZ `number` ##### height `number` ##### color `RGBA` ##### rotation? `any` ##### alpha? `number` #### Returns `WidgetComponentRenderPrimitiveTypeCylinder` #### Overrides `WidgetComponentRenderPrimitiveTypeBase.constructor` ## Properties ### alpha? > `optional` **alpha?**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### center > **center**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### color > **color**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### height > **height**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`primitiveType`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#primitivetype) *** ### radiusX > **radiusX**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### radiusZ > **radiusZ**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`renderPriority`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#renderpriority) *** ### rotation? > `optional` **rotation?**: `any` **`World Mutation`** **`Beta`** #### Remarks ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypeDisc.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypeDisc.md. # Class: WidgetComponentRenderPrimitiveTypeDisc component **`Beta`** ## Extends - [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new WidgetComponentRenderPrimitiveTypeDisc**(`center`, `radius`, `color`): `WidgetComponentRenderPrimitiveTypeDisc` **`Beta`** #### Parameters ##### center `Vector3` ##### radius `number` ##### color `RGBA` #### Returns `WidgetComponentRenderPrimitiveTypeDisc` #### Overrides `WidgetComponentRenderPrimitiveTypeBase.constructor` ## Properties ### center > **center**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### color > **color**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`primitiveType`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#primitivetype) *** ### radius > **radius**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`renderPriority`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#renderpriority) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypeEllipsoid.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypeEllipsoid.md. # Class: WidgetComponentRenderPrimitiveTypeEllipsoid component **`Beta`** ## Extends - [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new WidgetComponentRenderPrimitiveTypeEllipsoid**(`center`, `radii`, `color`, `rotation?`, `alpha?`): `WidgetComponentRenderPrimitiveTypeEllipsoid` **`Beta`** #### Parameters ##### center `Vector3` ##### radii `Vector3` ##### color `RGBA` ##### rotation? `any` ##### alpha? `number` #### Returns `WidgetComponentRenderPrimitiveTypeEllipsoid` #### Overrides `WidgetComponentRenderPrimitiveTypeBase.constructor` ## Properties ### alpha? > `optional` **alpha?**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### center > **center**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### color > **color**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`primitiveType`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#primitivetype) *** ### radii > **radii**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`renderPriority`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#renderpriority) *** ### rotation? > `optional` **rotation?**: `any` **`World Mutation`** **`Beta`** #### Remarks ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypeLine.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypeLine.md. # Class: WidgetComponentRenderPrimitiveTypeLine component **`Beta`** ## Extends - [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new WidgetComponentRenderPrimitiveTypeLine**(`start`, `end`, `color`): `WidgetComponentRenderPrimitiveTypeLine` **`Beta`** #### Parameters ##### start `Vector3` ##### end `Vector3` ##### color `RGBA` #### Returns `WidgetComponentRenderPrimitiveTypeLine` #### Overrides `WidgetComponentRenderPrimitiveTypeBase.constructor` ## Properties ### color > **color**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### end > **end**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`primitiveType`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#primitivetype) *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`renderPriority`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#renderpriority) *** ### start > **start**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypePyramid.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypePyramid.md. # Class: WidgetComponentRenderPrimitiveTypePyramid component **`Beta`** ## Extends - [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new WidgetComponentRenderPrimitiveTypePyramid**(`center`, `widthX`, `height`, `color`, `widthZ?`, `rotation?`, `alpha?`): `WidgetComponentRenderPrimitiveTypePyramid` **`Beta`** #### Parameters ##### center `Vector3` ##### widthX `number` ##### height `number` ##### color `RGBA` ##### widthZ? `number` ##### rotation? `any` ##### alpha? `number` #### Returns `WidgetComponentRenderPrimitiveTypePyramid` #### Overrides `WidgetComponentRenderPrimitiveTypeBase.constructor` ## Properties ### alpha? > `optional` **alpha?**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### center > **center**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### color > **color**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### height > **height**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`primitiveType`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#primitivetype) *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`renderPriority`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#renderpriority) *** ### rotation? > `optional` **rotation?**: `any` **`World Mutation`** **`Beta`** #### Remarks *** ### widthX > **widthX**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### widthZ? > `optional` **widthZ?**: `number` **`World Mutation`** **`Beta`** #### Remarks ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentRenderPrimitiveTypeWireframeMesh.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentRenderPrimitiveTypeWireframeMesh.md. # Class: WidgetComponentRenderPrimitiveTypeWireframeMesh component **`Beta`** ## Extends - [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) ## Constructors \{#constructors} ### Constructor \{#constructor} > **new WidgetComponentRenderPrimitiveTypeWireframeMesh**(`center`, `meshId`, `color`, `options?`): `WidgetComponentRenderPrimitiveTypeWireframeMesh` **`Beta`** #### Parameters ##### center `Vector3` ##### meshId `string` ##### color `RGBA` ##### options? [`WireframeMeshOptions`](/server-editor/interfaces/WireframeMeshOptions.md) #### Returns `WidgetComponentRenderPrimitiveTypeWireframeMesh` #### Overrides `WidgetComponentRenderPrimitiveTypeBase.constructor` ## Properties ### alpha? > `optional` **alpha?**: `number` **`World Mutation`** **`Beta`** #### Remarks *** ### center > **center**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### color > **color**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### meshId > **meshId**: `string` **`World Mutation`** **`Beta`** #### Remarks *** ### primitiveType > `readonly` **primitiveType**: [`PrimitiveType`](/server-editor/enums/PrimitiveType.md) **`Beta`** #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`primitiveType`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#primitivetype) *** ### renderPriority > **renderPriority**: `number` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentRenderPrimitiveTypeBase`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md).[`renderPriority`](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md#renderpriority) *** ### rotation? > `optional` **rotation?**: `any` **`World Mutation`** **`Beta`** #### Remarks *** ### scale? > `optional` **scale?**: `any` **`World Mutation`** **`Beta`** #### Remarks ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentSpline.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentSpline.md. # Class: WidgetComponentSpline component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### splineType > **splineType**: [`SplineType`](/server-editor/enums/SplineType.md) **`World Mutation`** **`Beta`** #### Remarks *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) *** ### getControlPoints() > **getControlPoints**(): [`Widget`](/server-editor/classes/Widget.md)\[] **`World Mutation`** **`Beta`** #### Returns [`Widget`](/server-editor/classes/Widget.md)\[] #### Remarks #### Throws This function can throw errors. Error [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) *** ### getInterpolatedPoints() > **getInterpolatedPoints**(`maxPointsPerControlSegment?`): `Vector3`\[] **`World Mutation`** **`Beta`** #### Parameters ##### maxPointsPerControlSegment? `number` #### Returns `Vector3`\[] #### Remarks #### Throws This function can throw errors. *** ### setControlPoints() > **setControlPoints**(`widgetList`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### widgetList [`Widget`](/server-editor/classes/Widget.md)\[] #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentText.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentText.md. # Class: WidgetComponentText component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### color > **color**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### label > **label**: `string` **`World Mutation`** **`Beta`** #### Remarks *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetComponentVolumeOutline.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetComponentVolumeOutline.md. # Class: WidgetComponentVolumeOutline component **`Beta`** ## Extends - [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md) ## Properties ### componentType > `readonly` **componentType**: [`WidgetComponentType`](/server-editor/enums/WidgetComponentType.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`componentType`](/server-editor/classes/WidgetComponentBase.md#componenttype) *** ### highlightHullColor > **highlightHullColor**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### highlightOutlineColor > **highlightOutlineColor**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### hullColor > **hullColor**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### location > `readonly` **location**: `Vector3` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`location`](/server-editor/classes/WidgetComponentBase.md#location) *** ### lockToSurface > **lockToSurface**: `boolean` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`lockToSurface`](/server-editor/classes/WidgetComponentBase.md#locktosurface) *** ### mirror > **mirror**: `StructureMirrorAxis` **`World Mutation`** **`Beta`** #### Remarks *** ### name > `readonly` **name**: `string` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`name`](/server-editor/classes/WidgetComponentBase.md#name) *** ### normalizedOrigin > **normalizedOrigin**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### offset > **offset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`offset`](/server-editor/classes/WidgetComponentBase.md#offset) *** ### outlineColor > **outlineColor**: `RGBA` **`World Mutation`** **`Beta`** #### Remarks *** ### rotation > **rotation**: `StructureRotation` **`World Mutation`** **`Beta`** #### Remarks *** ### showHighlightOutline > **showHighlightOutline**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### showOutline > **showOutline**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### transformedWorldVolume > `readonly` **transformedWorldVolume**: `BlockVolume` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) *** ### valid > `readonly` **valid**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`valid`](/server-editor/classes/WidgetComponentBase.md#valid) *** ### visible > **visible**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`visible`](/server-editor/classes/WidgetComponentBase.md#visible) *** ### volumeOffset > **volumeOffset**: `Vector3` **`World Mutation`** **`Beta`** #### Remarks *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** #### Throws This property can throw when used. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`widget`](/server-editor/classes/WidgetComponentBase.md#widget) ## Methods ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) #### Inherited from [`WidgetComponentBase`](/server-editor/classes/WidgetComponentBase.md).[`delete`](/server-editor/classes/WidgetComponentBase.md#delete) *** ### getVolume() > **getVolume**(): [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) | `undefined` **`World Mutation`** **`Beta`** #### Returns [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) | `undefined` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) *** ### setVolume() > **setVolume**(`volumeToSet?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### volumeToSet? `any` #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetGroup.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetGroup.md. # Class: WidgetGroup **`Beta`** ## Properties ### selectedWidgetCount > `readonly` **selectedWidgetCount**: `number` **`Beta`** #### Throws This property can throw when used. [InvalidWidgetGroupError](/server-editor/classes/InvalidWidgetGroupError.md) *** ### visible > **visible**: `boolean` **`World Mutation`** **`Beta`** #### Remarks *** ### visibleBounds > **visibleBounds**: `boolean` **`World Mutation`** **`Beta`** #### Remarks ## Methods ### createWidget() > **createWidget**(`location`, `options?`): [`Widget`](/server-editor/classes/Widget.md) **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` ##### options? [`WidgetCreateOptions`](/server-editor/interfaces/WidgetCreateOptions.md) #### Returns [`Widget`](/server-editor/classes/Widget.md) #### Remarks #### Throws This function can throw errors. *** ### delete() > **delete**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks *** ### deleteWidget() > **deleteWidget**(`widgetToDelete`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### widgetToDelete [`Widget`](/server-editor/classes/Widget.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### deselectAllWidgets() > **deselectAllWidgets**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetGroupError](/server-editor/classes/InvalidWidgetGroupError.md) *** ### selectAllWidgets() > **selectAllWidgets**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. [InvalidWidgetGroupError](/server-editor/classes/InvalidWidgetGroupError.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetManager.md. # Class: WidgetManager **`Beta`** ## Methods ### createGroup() > **createGroup**(`options?`): [`WidgetGroup`](/server-editor/classes/WidgetGroup.md) **`World Mutation`** **`Beta`** #### Parameters ##### options? [`WidgetGroupCreateOptions`](/server-editor/interfaces/WidgetGroupCreateOptions.md) #### Returns [`WidgetGroup`](/server-editor/classes/WidgetGroup.md) #### Remarks #### Throws This function can throw errors. *** ### deleteGroup() > **deleteGroup**(`groupToDelete`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### groupToDelete [`WidgetGroup`](/server-editor/classes/WidgetGroup.md) #### Returns `void` #### Remarks #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetMouseButtonEventData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetMouseButtonEventData.md. # Class: WidgetMouseButtonEventData event **`Beta`** ## Properties ### action > `readonly` **action**: [`WidgetMouseButtonActionType`](/server-editor/enums/WidgetMouseButtonActionType.md) **`Beta`** *** ### altPressed > `readonly` **altPressed**: `boolean` **`Beta`** *** ### controlPressed > `readonly` **controlPressed**: `boolean` **`Beta`** *** ### shiftPressed > `readonly` **shiftPressed**: `boolean` **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/classes/WidgetStateChangeEventData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/classes/WidgetStateChangeEventData.md. # Class: WidgetStateChangeEventData event **`Beta`** ## Properties ### group > `readonly` **group**: [`WidgetGroup`](/server-editor/classes/WidgetGroup.md) **`Beta`** *** ### location? > `readonly` `optional` **location?**: `any` **`Beta`** *** ### mouseEvent? > `readonly` `optional` **mouseEvent?**: [`WidgetMouseButtonEventData`](/server-editor/classes/WidgetMouseButtonEventData.md) **`Beta`** *** ### selected? > `readonly` `optional` **selected?**: `boolean` **`Beta`** *** ### visible? > `readonly` `optional` **visible?**: `boolean` **`Beta`** *** ### widget > `readonly` **widget**: [`Widget`](/server-editor/classes/Widget.md) **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ActionTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ActionTypes.md. # Enumeration: ActionTypes **`Beta`** The types of actions that are supported. This type corresponds to the expected arguments passed by the onExecute handler of an action. ## Enumeration Members ### ContinuousAction 实验性 > **ContinuousAction**: `"ContinuousAction"` **`Beta`** *** ### MouseRayCastAction > **MouseRayCastAction**: `"MouseRayCastAction"` **`Beta`** *** ### NoArgsAction > **NoArgsAction**: `"NoArgsAction"` **`Beta`** *** ### StatefulAction 实验性 > **StatefulAction**: `"StatefulAction"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/AudioSettingsProperty.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/AudioSettingsProperty.md. # Enumeration: AudioSettingsProperty **`Beta`** ## Enumeration Members ### AreSoundsMuted > **AreSoundsMuted**: `"AreSoundsMuted"` **`Beta`** *** ### IsMusicMuted > **IsMusicMuted**: `"IsMusicMuted"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/Axis.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/Axis.md. # Enumeration: Axis **`Beta`** ## Enumeration Members ### None > **None**: `0` **`Beta`** *** ### X > **X**: `1` **`Beta`** *** ### Y > **Y**: `2` **`Beta`** *** ### Z > **Z**: `4` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/BlockMaskListType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/BlockMaskListType.md. # Enumeration: BlockMaskListType block **`Beta`** ## Enumeration Members ### Disabled > **Disabled**: `"Disabled"` **`Beta`** *** ### Mask > **Mask**: `"Mask"` **`Beta`** *** ### Replace > **Replace**: `"Replace"` **`Beta`** ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [BlockPaletteManager](/server-editor/classes/BlockPaletteManager.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/BlockPaletteItemType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/BlockPaletteItemType.md. # Enumeration: BlockPaletteItemType item block **`Beta`** ## Enumeration Members ### Probability > **Probability**: `1` **`Beta`** *** ### Simple > **Simple**: `0` **`Beta`** ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteManager](/server-editor/classes/BlockPaletteManager.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/BlockTableOperationType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/BlockTableOperationType.md. # Enumeration: BlockTableOperationType block **`Beta`** The possible operation types supported by BlockTable property item. ## Enumeration Members ### Deselect > **Deselect**: `"deselect"` **`Beta`** *** ### Replace > **Replace**: `"replace"` **`Beta`** ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/BlockUtilityExtrudeDirection.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/BlockUtilityExtrudeDirection.md. # Enumeration: BlockUtilityExtrudeDirection block **`Beta`** ## Enumeration Members ### Down > **Down**: `0` **`Beta`** *** ### East > **East**: `5` **`Beta`** *** ### North > **North**: `2` **`Beta`** *** ### South > **South**: `3` **`Beta`** *** ### Up > **Up**: `1` **`Beta`** *** ### West > **West**: `4` **`Beta`** ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/BlockUtilityFloodMatchCriteria.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/BlockUtilityFloodMatchCriteria.md. # Enumeration: BlockUtilityFloodMatchCriteria block **`Beta`** ## Enumeration Members ### Custom > **Custom**: `3` **`Beta`** *** ### NonAir > **NonAir**: `0` **`Beta`** *** ### SameBlockType > **SameBlockType**: `1` **`Beta`** *** ### SameBlockTypeAndStates > **SameBlockTypeAndStates**: `4` **`Beta`** *** ### Solid > **Solid**: `2` **`Beta`** ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/BoolPropertyItemVariant.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/BoolPropertyItemVariant.md. # Enumeration: BoolPropertyItemVariant **`Beta`** The possible variants of a bool. ## Enumeration Members ### Checkbox > **Checkbox**: `0` **`Beta`** *** ### ToggleSwitch > **ToggleSwitch**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/BrushDirectionalPlacementMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/BrushDirectionalPlacementMode.md. # Enumeration: BrushDirectionalPlacementMode **`Beta`** ## Enumeration Members ### CameraFromAbove > **CameraFromAbove**: `5` **`Beta`** *** ### CameraFromBelow > **CameraFromBelow**: `6` **`Beta`** *** ### CameraLeft > **CameraLeft**: `3` **`Beta`** *** ### CameraRight > **CameraRight**: `4` **`Beta`** *** ### FrontFaceNegX > **FrontFaceNegX**: `8` **`Beta`** *** ### FrontFaceNegY > **FrontFaceNegY**: `12` **`Beta`** *** ### FrontFaceNegZ > **FrontFaceNegZ**: `10` **`Beta`** *** ### FrontFacePosX > **FrontFacePosX**: `7` **`Beta`** *** ### FrontFacePosY > **FrontFacePosY**: `11` **`Beta`** *** ### FrontFacePosZ > **FrontFacePosZ**: `9` **`Beta`** *** ### IgnoreCamera > **IgnoreCamera**: `0` **`Beta`** *** ### NormalCamera > **NormalCamera**: `1` **`Beta`** *** ### OppositeCamera > **OppositeCamera**: `2` **`Beta`** *** ### Random2Axes > **Random2Axes**: `13` **`Beta`** *** ### Random3Axes > **Random3Axes**: `14` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/BrushElevationMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/BrushElevationMode.md. # Enumeration: BrushElevationMode **`Beta`** ## Enumeration Members ### Lower > **Lower**: `1` **`Beta`** *** ### Raise > **Raise**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ButtonVariant.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ButtonVariant.md. # Enumeration: ButtonVariant **`Beta`** The possible variants of a Button property item. ## Enumeration Members ### Confirmation 实验性 > **Confirmation**: `2` **`Beta`** *** ### Destructive 实验性 > **Destructive**: `3` **`Beta`** *** ### Primary 实验性 > **Primary**: `0` **`Beta`** *** ### Secondary 实验性 > **Secondary**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/CollectionTreeEntryItemType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/CollectionTreeEntryItemType.md. # Enumeration: CollectionTreeEntryItemType item **`Beta`** ## Enumeration Members ### Dropdown > **Dropdown**: `2` **`Beta`** *** ### Number > **Number**: `1` **`Beta`** *** ### String > **String**: `0` **`Beta`** ## 同领域相关 - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [CoreActionBarItemType](/server-editor/enums/CoreActionBarItemType.md) - [PropertyItemType](/server-editor/enums/PropertyItemType.md) - [InvalidItemStackError](/server/classes/InvalidItemStackError.md) - [ItemLockMode](/server/enums/ItemLockMode.md) - [ItemStack](/server/classes/ItemStack.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/CollectionTreeSortType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/CollectionTreeSortType.md. # Enumeration: CollectionTreeSortType **`Beta`** Determines how collection tree folders will be sorted ## Enumeration Members ### AtoZ > **AtoZ**: `0` **`Beta`** *** ### ZtoA > **ZtoA**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ColorPickerPropertyItemVariant.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ColorPickerPropertyItemVariant.md. # Enumeration: ColorPickerPropertyItemVariant **`Beta`** The possible variants of a color picker. ## Enumeration Members ### Default > **Default**: `0` **`Beta`** *** ### Expanded > **Expanded**: `2` **`Beta`** *** ### Inline > **Inline**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ComboBoxPropertyItemDataType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ComboBoxPropertyItemDataType.md. # Enumeration: ComboBoxPropertyItemDataType **`Beta`** The possible data types supported by ComboBox property item. ## Enumeration Members ### Block > **Block**: `1` **`Beta`** *** ### Custom > **Custom**: `0` **`Beta`** *** ### Entity > **Entity**: `2` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ContiguousSelectionType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ContiguousSelectionType.md. # Enumeration: ContiguousSelectionType **`Beta`** ## Enumeration Members ### AllBlocks > **AllBlocks**: `3` **`Beta`** *** ### Custom > **Custom**: `4` **`Beta`** *** ### SameBlock > **SameBlock**: `0` **`Beta`** *** ### SameBlockAndStates > **SameBlockAndStates**: `1` **`Beta`** *** ### SolidBlocks > **SolidBlocks**: `2` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ContinuousActionState.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ContinuousActionState.md. # Enumeration: ContinuousActionState **`Beta`** Execution state of the continuous action ## Enumeration Members ### Begin > **Begin**: `0` **`Beta`** *** ### End > **End**: `2` **`Beta`** *** ### Repeat > **Repeat**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/CoreActionBarItemType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/CoreActionBarItemType.md. # Enumeration: CoreActionBarItemType item **`Beta`** Predefined action bar items ## Enumeration Members ### Export > **Export**: `"editor:actionBarItem:export"` **`Beta`** *** ### Fill > **Fill**: `"editor:actionBarItem:fill"` **`Beta`** *** ### Locate > **Locate**: `"editor:actionBarItem:locate"` **`Beta`** *** ### Playtest > **Playtest**: `"editor:actionBarItem:playtest"` **`Beta`** *** ### Realms > **Realms**: `"editor:actionBarItem:realms"` **`Beta`** *** ### Redo > **Redo**: `"editor:actionBarItem:redo"` **`Beta`** *** ### Settings > **Settings**: `"editor:actionBarItem:settings"` **`Beta`** *** ### Undo > **Undo**: `"editor:actionBarItem:undo"` **`Beta`** ## 同领域相关 - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [CollectionTreeEntryItemType](/server-editor/enums/CollectionTreeEntryItemType.md) - [PropertyItemType](/server-editor/enums/PropertyItemType.md) - [InvalidItemStackError](/server/classes/InvalidItemStackError.md) - [ItemLockMode](/server/enums/ItemLockMode.md) - [ItemStack](/server/classes/ItemStack.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/CoreBrushShapeType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/CoreBrushShapeType.md. # Enumeration: CoreBrushShapeType **`Beta`** Core brush shape types ## Enumeration Members ### Cone > **Cone**: `"editor:brushShape:cone"` **`Beta`** *** ### Cuboid > **Cuboid**: `"editor:brushShape:cuboid"` **`Beta`** *** ### Cylinder > **Cylinder**: `"editor:brushShape:cylinder"` **`Beta`** *** ### Ellipsoid > **Ellipsoid**: `"editor:brushShape:ellipsoid"` **`Beta`** *** ### Pyramid > **Pyramid**: `"editor:brushShape:pyramid"` **`Beta`** *** ### SingleBlock > **SingleBlock**: `"editor:brushShape:singleBlock"` **`Beta`** *** ### Star > **Star**: `"editor:brushShape:star"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/CoreInputBindingCategory.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/CoreInputBindingCategory.md. # Enumeration: CoreInputBindingCategory **`Beta`** Built-in control categories for use with [KeyBindingInfo.bindingCategory](/server-editor/types/KeyBindingInfo.md#bindingcategory). Pass any `CoreInputBindingCategory` value or a custom string to categorize a binding. ## Enumeration Members ### Camera > **Camera**: `"editor:camera"` **`Beta`** *** ### CursorMovement > **CursorMovement**: `"editor:cursorMovement"` **`Beta`** *** ### Fly > **Fly**: `"editor:fly"` **`Beta`** *** ### General > **General**: `"editor:general"` **`Beta`** *** ### Hotbar > **Hotbar**: `"editor:hotbar"` **`Beta`** *** ### MakeSelection > **MakeSelection**: `"editor:makeSelection"` **`Beta`** *** ### Modes > **Modes**: `"editor:modes"` **`Beta`** *** ### Move > **Move**: `"editor:move"` **`Beta`** *** ### Movement > **Movement**: `"editor:movement"` **`Beta`** *** ### Nudge > **Nudge**: `"editor:nudge"` **`Beta`** *** ### Offset > **Offset**: `"editor:offset"` **`Beta`** *** ### Operations > **Operations**: `"editor:operations"` **`Beta`** *** ### Paste > **Paste**: `"editor:paste"` **`Beta`** *** ### PastePreviewManipulation > **PastePreviewManipulation**: `"editor:pastePreviewManipulation"` **`Beta`** *** ### SizeSelection > **SizeSelection**: `"editor:sizeSelection"` **`Beta`** *** ### ToolActivation > **ToolActivation**: `"editor:toolActivation"` **`Beta`** *** ### TrimActions > **TrimActions**: `"editor:trimActions"` **`Beta`** *** ### Widget > **Widget**: `"editor:widget"` **`Beta`** *** ### Workbench > **Workbench**: `"editor:workbench"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/CoreMenuType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/CoreMenuType.md. # Enumeration: CoreMenuType **`Beta`** Predefined top level menus for core editor ## Enumeration Members ### Edit > **Edit**: `"editor:menu:edit"` **`Beta`** *** ### Experimental > **Experimental**: `"editor:menu:experimental"` **`Beta`** *** ### Extensions > **Extensions**: `"editor:menu:extensions"` **`Beta`** *** ### File > **File**: `"editor:menu:file"` **`Beta`** *** ### Help > **Help**: `"editor:menu:help"` **`Beta`** *** ### View > **View**: `"editor:menu:view"` **`Beta`** *** ### WorldOptions > **WorldOptions**: `"editor:menu:worldOptions"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/CoreModalDialogType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/CoreModalDialogType.md. # Enumeration: CoreModalDialogType **`Beta`** ## Enumeration Members ### DataPicker > **DataPicker**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/CursorControlMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/CursorControlMode.md. # Enumeration: CursorControlMode **`Beta`** An enumeration used by the 3D block cursor [Cursor](/server-editor/classes/Cursor.md) ## Enumeration Members ### Fixed > **Fixed**: `3` **`Beta`** #### Remarks When in fixed mode, the 3D block cursor will remain in a fixed position directly in front of the players facing direction. It cannot be moved without moving the player (or adjusting the fixed block distance). This mode is useful for addressing block locations in the air (put the cursor into fixed mode, and fly the player until the desired air block is beneath the cursor, at which point it is selectable without being clickable) *** ### Keyboard > **Keyboard**: `0` **`Beta`** #### Remarks Using Keyboard mode will remove the dependence of the 3D block cursor on the player mouse position. The 3D block cursor can be positioned using the keyboard (or the Cursor move methods on the cursor object) and the position will not be reset if the mouse is moved *** ### KeyboardAndMouse > **KeyboardAndMouse**: `2` **`Beta`** #### Remarks This is generally the default move mode for the 3D block cursor. The 3D block cursor can be positioned using the keyboard (or the Cursor move methods on the cursor object) but the position will be reset to the block location under the players mouse position if any mouse movement is detected. *** ### Mouse > **Mouse**: `1` **`Beta`** #### Remarks The Mouse movement mode will disable keyboard or manual 3D block cursor movement and make the 3D block cursor only react to player mouse movement [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/CursorTargetMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/CursorTargetMode.md. # Enumeration: CursorTargetMode **`Beta`** Describes how the cursor targets a point on the screen. ## Enumeration Members ### Block > **Block**: `0` **`Beta`** #### Remarks Target a nearest block. *** ### Face > **Face**: `1` **`Beta`** #### Remarks Targets the face of a nearest block. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/DataPickerModalDialogVariant.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/DataPickerModalDialogVariant.md. # Enumeration: DataPickerModalDialogVariant **`Beta`** ## Enumeration Members ### Block > **Block**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/DaylightCycle.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/DaylightCycle.md. # Enumeration: DaylightCycle **`Beta`** ## Enumeration Members ### AlwaysDay > **AlwaysDay**: `1` **`Beta`** *** ### LockTime > **LockTime**: `2` **`Beta`** *** ### Normal > **Normal**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/EditorInputContext.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/EditorInputContext.md. # Enumeration: EditorInputContext **`Beta`** Global editor input contexts ## Enumeration Members ### GlobalEditor > **GlobalEditor**: `"global.editor"` **`Beta`** *** ### GlobalToolMode > **GlobalToolMode**: `"global.toolMode"` **`Beta`** *** ### Viewport > **Viewport**: `"local.toolMode.viewport"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/EditorMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/EditorMode.md. # Enumeration: EditorMode **`Beta`** Enumeration representing the different modes Editor can be in. ## Enumeration Members ### Crosshair > **Crosshair**: `"Crosshair"` **`Beta`** #### Remarks Mode for single-block editing. *** ### Tool > **Tool**: `"Tool"` **`Beta`** #### Remarks Mode for multi-block editing UI and tools. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/EntityOperationType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/EntityOperationType.md. # Enumeration: EntityOperationType entity **`Beta`** ## Enumeration Members ### Create > **Create**: `0` **`Beta`** *** ### Delete > **Delete**: `1` **`Beta`** ## 同领域相关 - [EntityIdentifierObservableValidator](/server-editor/classes/EntityIdentifierObservableValidator.md) - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity.md) - [WidgetComponentEntity](/server-editor/classes/WidgetComponentEntity.md) - [WidgetComponentEntityOptions](/server-editor/interfaces/WidgetComponentEntityOptions.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ExportResult.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ExportResult.md. # Enumeration: ExportResult **`Beta`** ## Enumeration Members ### EditorSystemFailure > **EditorSystemFailure**: `7` **`Beta`** *** ### FileArchiverFetchFailed > **FileArchiverFetchFailed**: `2` **`Beta`** *** ### LevelFetchFailed > **LevelFetchFailed**: `1` **`Beta`** *** ### PlayerNotFound > **PlayerNotFound**: `4` **`Beta`** *** ### ProjectConverterFetchFailed > **ProjectConverterFetchFailed**: `3` **`Beta`** *** ### ValidWorldExport > **ValidWorldExport**: `0` **`Beta`** *** ### WorldExportBusy > **WorldExportBusy**: `6` **`Beta`** *** ### WorldExportFailed > **WorldExportFailed**: `5` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/FlattenMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/FlattenMode.md. # Enumeration: FlattenMode **`Beta`** ## Enumeration Members ### Both > **Both**: `0` **`Beta`** *** ### Down > **Down**: `1` **`Beta`** *** ### Up > **Up**: `2` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/GamePublishSetting.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/GamePublishSetting.md. # Enumeration: GamePublishSetting **`Beta`** ## Enumeration Members ### FriendsOfFriends > **FriendsOfFriends**: `3` **`Beta`** *** ### FriendsOnly > **FriendsOnly**: `2` **`Beta`** *** ### InviteOnly > **InviteOnly**: `1` **`Beta`** *** ### NoMultiPlay > **NoMultiPlay**: `0` **`Beta`** *** ### Public > **Public**: `4` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/GraphicsSettingsProperty.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/GraphicsSettingsProperty.md. # Enumeration: GraphicsSettingsProperty **`Beta`** Enumeration representing identifiers for graphics settings properties. ## Enumeration Members ### DisableBlockEntityRendering > **DisableBlockEntityRendering**: `"DisableBlockEntityRendering"` **`Beta`** *** ### DisableEntityRendering > **DisableEntityRendering**: `"DisableEntityRendering"` **`Beta`** *** ### DisableParticleRendering > **DisableParticleRendering**: `"DisableParticleRendering"` **`Beta`** *** ### DisableTerrainRendering > **DisableTerrainRendering**: `"DisableTerrainRendering"` **`Beta`** *** ### DisableWeatherRendering > **DisableWeatherRendering**: `"DisableWeatherRendering"` **`Beta`** *** ### GraphicsMode > **GraphicsMode**: `"GraphicsMode"` **`Beta`** *** ### NightVision > **NightVision**: `"NightVision"` **`Beta`** *** ### ShowChunkBoundaries > **ShowChunkBoundaries**: `"ShowChunkBoundaries"` **`Beta`** *** ### ShowCompass > **ShowCompass**: `"ShowCompass"` **`Beta`** *** ### ShowInvisibleBlocks > **ShowInvisibleBlocks**: `"ShowInvisibleBlocks"` **`Beta`** #### Remarks Manages rendering of invisible blocks (e.g., barrier, light, structure\_void). *** ### ShowToastNotifications > **ShowToastNotifications**: `"ShowToastNotifications"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ImageResourceType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ImageResourceType.md. # Enumeration: ImageResourceType **`Beta`** Supported image types. ## Enumeration Members ### Block > **Block**: `1` **`Beta`** *** ### Default > **Default**: `0` **`Beta`** *** ### Icon > **Icon**: `2` **`Beta`** *** ### Structure > **Structure**: `3` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/InputModifier.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/InputModifier.md. # Enumeration: InputModifier **`Beta`** Input modifier flags to create chorded bindings ## Enumeration Members ### Alt > **Alt**: `2` **`Beta`** *** ### Any > **Any**: `15` **`Beta`** *** ### Control > **Control**: `4` **`Beta`** *** ### None > **None**: `1` **`Beta`** *** ### Shift > **Shift**: `8` **`Beta`** *** ### Unused > **Unused**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/KeyProcessingState.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/KeyProcessingState.md. # Enumeration: KeyProcessingState **`Beta`** Determines how key binding should be processed to fire actions ## Enumeration Members ### Consume > **Consume**: `0` **`Beta`** #### Remarks Consume key input event and prevent propagation *** ### Disabled > **Disabled**: `2` **`Beta`** #### Remarks Skip key input event processing *** ### Passthrough > **Passthrough**: `1` **`Beta`** #### Remarks Pass key input event to parent context after processing it [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/KeyboardKey.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/KeyboardKey.md. # Enumeration: KeyboardKey **`Beta`** Keyboard key ## Enumeration Members ### ALT > **ALT**: `18` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_ALT *** ### BACK\_QUOTE > **BACK\_QUOTE**: `192` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_BACK\_QUOTE, ie. '\`' *** ### BACK\_SLASH > **BACK\_SLASH**: `220` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_BACK\_SLASH, ie. '' *** ### BACKSPACE > **BACKSPACE**: `8` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_BACK\_SPACE *** ### BRACKET\_CLOSE > **BRACKET\_CLOSE**: `221` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_CLOSE\_BRACKET, ie. ']' *** ### BRACKET\_OPEN > **BRACKET\_OPEN**: `219` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_OPEN\_BRACKET, ie. '\[' *** ### CAPS\_LOCK > **CAPS\_LOCK**: `20` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_CAPS\_LOCK *** ### COMMA > **COMMA**: `188` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_COMMA, ie. ',' *** ### CONTEXT\_MENU > **CONTEXT\_MENU**: `93` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_CONTEXT\_MENU, ie. Context Menu key *** ### CTRL > **CTRL**: `17` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_CONTROL *** ### DELETE > **DELETE**: `46` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_DELETE *** ### DOWN > **DOWN**: `40` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_DOWN *** ### END > **END**: `35` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_END *** ### ENTER > **ENTER**: `13` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_RETURN *** ### EQUALS 实验性 > **EQUALS**: `187` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_EQUALS, ie. '=' *** ### ESCAPE > **ESCAPE**: `27` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_ESCAPE *** ### F1 > **F1**: `112` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F1 *** ### F10 > **F10**: `121` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F10 *** ### F11 > **F11**: `122` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F11 *** ### F12 > **F12**: `123` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F12 *** ### F2 > **F2**: `113` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F2 *** ### F3 > **F3**: `114` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F3 *** ### F4 > **F4**: `115` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F4 *** ### F5 > **F5**: `116` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F5 *** ### F6 > **F6**: `117` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F6 *** ### F7 > **F7**: `118` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F7 *** ### F8 > **F8**: `119` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F8 *** ### F9 > **F9**: `120` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F9 *** ### HOME > **HOME**: `36` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_HOME *** ### HYPHEN 实验性 > **HYPHEN**: `189` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_HYPHEN, ie. '-' *** ### INSERT > **INSERT**: `45` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_INSERT *** ### KEY\_0 > **KEY\_0**: `48` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_0 *** ### KEY\_1 > **KEY\_1**: `49` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_1 *** ### KEY\_2 > **KEY\_2**: `50` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_2 *** ### KEY\_3 > **KEY\_3**: `51` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_3 *** ### KEY\_4 > **KEY\_4**: `52` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_4 *** ### KEY\_5 > **KEY\_5**: `53` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_5 *** ### KEY\_6 > **KEY\_6**: `54` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_6 *** ### KEY\_7 > **KEY\_7**: `55` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_7 *** ### KEY\_8 > **KEY\_8**: `56` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_8 *** ### KEY\_9 > **KEY\_9**: `57` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_9 *** ### KEY\_A > **KEY\_A**: `65` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_A *** ### KEY\_B > **KEY\_B**: `66` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_B *** ### KEY\_C > **KEY\_C**: `67` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_C *** ### KEY\_D > **KEY\_D**: `68` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_D *** ### KEY\_E > **KEY\_E**: `69` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_E *** ### KEY\_F > **KEY\_F**: `70` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_F *** ### KEY\_G > **KEY\_G**: `71` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_G *** ### KEY\_H > **KEY\_H**: `72` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_H *** ### KEY\_I > **KEY\_I**: `73` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_I *** ### KEY\_J > **KEY\_J**: `74` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_J *** ### KEY\_K > **KEY\_K**: `75` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_K *** ### KEY\_L > **KEY\_L**: `76` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_L *** ### KEY\_M > **KEY\_M**: `77` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_M *** ### KEY\_N > **KEY\_N**: `78` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_N *** ### KEY\_O > **KEY\_O**: `79` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_O *** ### KEY\_P > **KEY\_P**: `80` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_P *** ### KEY\_Q > **KEY\_Q**: `81` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_Q *** ### KEY\_R > **KEY\_R**: `82` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_R *** ### KEY\_S > **KEY\_S**: `83` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_S *** ### KEY\_T > **KEY\_T**: `84` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_T *** ### KEY\_U > **KEY\_U**: `85` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_U *** ### KEY\_V > **KEY\_V**: `86` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_V *** ### KEY\_W > **KEY\_W**: `87` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_W *** ### KEY\_X > **KEY\_X**: `88` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_X *** ### KEY\_Y > **KEY\_Y**: `89` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_Y *** ### KEY\_Z > **KEY\_Z**: `90` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_Z *** ### LEFT > **LEFT**: `37` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_LEFT *** ### NUM\_LOCK > **NUM\_LOCK**: `144` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUM\_LOCK *** ### NUMPAD\_0 > **NUMPAD\_0**: `96` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUMPAD0 *** ### NUMPAD\_1 > **NUMPAD\_1**: `97` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUMPAD1 *** ### NUMPAD\_2 > **NUMPAD\_2**: `98` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUMPAD2 *** ### NUMPAD\_3 > **NUMPAD\_3**: `99` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUMPAD3 *** ### NUMPAD\_4 > **NUMPAD\_4**: `100` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUMPAD4 *** ### NUMPAD\_5 > **NUMPAD\_5**: `101` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUMPAD5 *** ### NUMPAD\_6 > **NUMPAD\_6**: `102` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUMPAD6 *** ### NUMPAD\_7 > **NUMPAD\_7**: `103` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUMPAD7 *** ### NUMPAD\_8 > **NUMPAD\_8**: `104` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUMPAD8 *** ### NUMPAD\_9 > **NUMPAD\_9**: `105` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_NUMPAD9 *** ### NUMPAD\_ADD > **NUMPAD\_ADD**: `107` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_ADD *** ### NUMPAD\_DECIMAL > **NUMPAD\_DECIMAL**: `110` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_DECIMAL *** ### NUMPAD\_DIVIDE > **NUMPAD\_DIVIDE**: `111` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_DIVIDE *** ### NUMPAD\_MULTIPLY > **NUMPAD\_MULTIPLY**: `106` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_MULTIPLY *** ### NUMPAD\_SEPARATOR > **NUMPAD\_SEPARATOR**: `108` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_SEPARATOR *** ### NUMPAD\_SUBTRACT > **NUMPAD\_SUBTRACT**: `109` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_SUBTRACT *** ### PAGE\_DOWN > **PAGE\_DOWN**: `34` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_PAGE\_DOWN *** ### PAGE\_UP > **PAGE\_UP**: `33` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_PAGE\_UP *** ### PAUSE 实验性 > **PAUSE**: `19` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_PAUSE *** ### PERIOD > **PERIOD**: `190` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_PERIOD, ie. '.' *** ### PRINT\_SCREEN > **PRINT\_SCREEN**: `44` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_PRINTSCREEN *** ### QUOTE > **QUOTE**: `222` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_BACK\_QUOTE, ie. '"' *** ### RIGHT > **RIGHT**: `39` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_RIGHT *** ### SCROLL\_LOCK > **SCROLL\_LOCK**: `145` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_SCROLL\_LOCK *** ### SEMICOLON 实验性 > **SEMICOLON**: `186` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_SEMICOLON, ie. ';' *** ### SHIFT > **SHIFT**: `16` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_SHIFT *** ### SLASH > **SLASH**: `191` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_SLASH, ie. '/' *** ### SPACE > **SPACE**: `32` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_SPACE *** ### TAB > **TAB**: `9` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_TAB *** ### UNDEFINED 实验性 > **UNDEFINED**: `0` **`Beta`** *** ### UP > **UP**: `38` **`Beta`** #### Remarks KeyboardEvent.DOM\_VK\_UP *** ### WINDOWS\_LEFT > **WINDOWS\_LEFT**: `91` **`Beta`** #### Remarks KeyboardEvent.Meta\_LEFT, ie. Left Windows key *** ### WINDOWS\_RIGHT > **WINDOWS\_RIGHT**: `92` **`Beta`** #### Remarks KeyboardEvent.Meta\_RIGHT, ie. Right Windows key [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/LayoutAlignment.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/LayoutAlignment.md. # Enumeration: LayoutAlignment **`Beta`** Alignment options for UI elements ## Enumeration Members ### Center > **Center**: `1` **`Beta`** *** ### End > **End**: `2` **`Beta`** *** ### Start > **Start**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/LayoutFlex.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/LayoutFlex.md. # Enumeration: LayoutFlex **`Beta`** Flexible layout types ## Enumeration Members ### Grow > **Grow**: `"Grow"` **`Beta`** *** ### Shrink > **Shrink**: `"Shrink"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/LayoutSizeType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/LayoutSizeType.md. # Enumeration: LayoutSizeType **`Beta`** Layout size types ## Enumeration Members ### Default > **Default**: `0` **`Beta`** *** ### Percentage > **Percentage**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ListPaneEntryType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ListPaneEntryType.md. # Enumeration: ListPaneEntryType **`Beta`** ## Enumeration Members ### Bool > **Bool**: `1` **`Beta`** *** ### Button > **Button**: `0` **`Beta`** *** ### Image > **Image**: `2` **`Beta`** *** ### Text > **Text**: `3` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ListPaneSlotVariant.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ListPaneSlotVariant.md. # Enumeration: ListPaneSlotVariant **`Beta`** Determines theming variation for the list slot ## Enumeration Members ### Muted > **Muted**: `2` **`Beta`** *** ### Primary > **Primary**: `0` **`Beta`** *** ### Secondary > **Secondary**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ListPaneViewSortType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ListPaneViewSortType.md. # Enumeration: ListPaneViewSortType **`Beta`** Determines how list pane slots will be sorted ## Enumeration Members ### AtoZ > **AtoZ**: `1` **`Beta`** *** ### Default > **Default**: `0` **`Beta`** *** ### ZtoA > **ZtoA**: `2` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ListViewControlFilterFlags.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ListViewControlFilterFlags.md. # Enumeration: ListViewControlFilterFlags **`Beta`** ## Enumeration Members ### All > **All**: `3` **`Beta`** *** ### Name > **Name**: `1` **`Beta`** *** ### None > **None**: `0` **`Beta`** *** ### Tag > **Tag**: `2` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/LogChannel.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/LogChannel.md. # Enumeration: LogChannel **`Beta`** ## Enumeration Members ### All > **All**: `3` **`Beta`** #### Remarks Regular message and toast channels. *** ### Message > **Message**: `1` **`Beta`** #### Remarks Regular message channel. *** ### Toast > **Toast**: `2` **`Beta`** #### Remarks Toast channel. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/MinimapMarkerType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/MinimapMarkerType.md. # Enumeration: MinimapMarkerType **`Beta`** ## Enumeration Members ### Custom > **Custom**: `2` **`Beta`** *** ### Location > **Location**: `1` **`Beta`** *** ### Multiplayer > **Multiplayer**: `0` **`Beta`** #### Remarks Multiplayer markers shown on the minimap. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/MinimapTrackingMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/MinimapTrackingMode.md. # Enumeration: MinimapTrackingMode **`Beta`** ## Enumeration Members ### FollowPlayer > **FollowPlayer**: `0` **`Beta`** *** ### FreeCenter > **FreeCenter**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/MinimapViewType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/MinimapViewType.md. # Enumeration: MinimapViewType **`Beta`** ## Enumeration Members ### BlockView > **BlockView**: `0` **`Beta`** #### Remarks One-to-one mapping where each block equals one pixel on the minimap. *** ### CustomBiomeView > **CustomBiomeView**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ModalDialogResponseType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ModalDialogResponseType.md. # Enumeration: ModalDialogResponseType **`Beta`** Common response types for modal dialog ## Enumeration Members ### Confirm > **Confirm**: `"confirm"` **`Beta`** *** ### Dismiss > **Dismiss**: `"dismiss"` **`Beta`** *** ### Error > **Error**: `"error"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ModalDialogType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ModalDialogType.md. # Enumeration: ModalDialogType **`Beta`** ## Enumeration Members ### Custom > **Custom**: `1` **`Beta`** *** ### DataPicker > **DataPicker**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/MouseActionCategory.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/MouseActionCategory.md. # Enumeration: MouseActionCategory **`Beta`** Mouse device action categories ## Enumeration Members ### Button > **Button**: `1` **`Beta`** #### Remarks Mouse button was used. *** ### Drag > **Drag**: `3` **`Beta`** #### Remarks Mouse was dragged. *** ### Wheel > **Wheel**: `2` **`Beta`** #### Remarks Mouse wheel was used. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/MouseActionType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/MouseActionType.md. # Enumeration: MouseActionType **`Beta`** Detailed mouse device actions ## Enumeration Members ### LeftButton > **LeftButton**: `1` **`Beta`** *** ### MiddleButton > **MiddleButton**: `2` **`Beta`** *** ### RightButton > **RightButton**: `3` **`Beta`** *** ### Wheel > **Wheel**: `4` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/MouseCursorIconType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/MouseCursorIconType.md. # Enumeration: MouseCursorIconType **`Beta`** ## Enumeration Members ### Crosshair > **Crosshair**: `"Crosshair"` **`Beta`** *** ### Default > **Default**: `"Default"` **`Beta`** *** ### Move > **Move**: `"Move"` **`Beta`** *** ### NotAllowed > **NotAllowed**: `"NotAllowed"` **`Beta`** *** ### Wait > **Wait**: `"Wait"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/MouseInputType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/MouseInputType.md. # Enumeration: MouseInputType **`Beta`** Input event information about mouse actions ## Enumeration Members ### ButtonDown > **ButtonDown**: `1` **`Beta`** *** ### ButtonUp > **ButtonUp**: `2` **`Beta`** *** ### Drag > **Drag**: `6` **`Beta`** *** ### DragEnd > **DragEnd**: `7` **`Beta`** *** ### DragStart > **DragStart**: `5` **`Beta`** *** ### WheelIn > **WheelIn**: `3` **`Beta`** *** ### WheelOut > **WheelOut**: `4` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/NumberPropertyItemVariant.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/NumberPropertyItemVariant.md. # Enumeration: NumberPropertyItemVariant **`Beta`** The possible variants of a Number property item. ## Enumeration Members ### InputField > **InputField**: `0` **`Beta`** *** ### InputFieldAndSlider > **InputFieldAndSlider**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/PaintCompletionState.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/PaintCompletionState.md. # Enumeration: PaintCompletionState **`Beta`** ## Enumeration Members ### Canceled > **Canceled**: `1` **`Beta`** *** ### Failed > **Failed**: `2` **`Beta`** *** ### Success > **Success**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/PaintMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/PaintMode.md. # Enumeration: PaintMode **`Beta`** ## Enumeration Members ### BlockPaint > **BlockPaint**: `0` **`Beta`** *** ### Elevation > **Elevation**: `5` **`Beta`** *** ### Flatten > **Flatten**: `4` **`Beta`** *** ### FreehandSelect > **FreehandSelect**: `1` **`Beta`** *** ### Roughen > **Roughen**: `3` **`Beta`** *** ### Smooth > **Smooth**: `2` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/PaneLayoutType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/PaneLayoutType.md. # Enumeration: PaneLayoutType **`Beta`** Layout directions for property panes. ## Enumeration Members ### Horizontal > **Horizontal**: `1` **`Beta`** *** ### Vertical > **Vertical**: `0` **`Beta`** *** ### Wrapping > **Wrapping**: `2` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/Plane.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/Plane.md. # Enumeration: Plane **`Beta`** ## Enumeration Members ### None > **None**: `0` **`Beta`** *** ### XY > **XY**: `1` **`Beta`** *** ### XZ > **XZ**: `2` **`Beta`** *** ### YZ > **YZ**: `4` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/PlaytestSessionResult.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/PlaytestSessionResult.md. # Enumeration: PlaytestSessionResult **`Beta`** ## Enumeration Members ### EditorSystemFailure > **EditorSystemFailure**: `7` **`Beta`** *** ### InvalidLevelId > **InvalidLevelId**: `8` **`Beta`** *** ### InvalidSessionHandle > **InvalidSessionHandle**: `1` **`Beta`** *** ### OK > **OK**: `0` **`Beta`** *** ### PlayerNotFound > **PlayerNotFound**: `9` **`Beta`** *** ### ResponseTimeout > **ResponseTimeout**: `10` **`Beta`** *** ### SessionInfoNotFound > **SessionInfoNotFound**: `2` **`Beta`** *** ### TooManyPlayers > **TooManyPlayers**: `3` **`Beta`** *** ### UnspecifiedError > **UnspecifiedError**: `11` **`Beta`** *** ### UnsupportedScenario > **UnsupportedScenario**: `6` **`Beta`** *** ### WorldExportBusy > **WorldExportBusy**: `5` **`Beta`** *** ### WorldExportFailed > **WorldExportFailed**: `4` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/PrimitiveType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/PrimitiveType.md. # Enumeration: PrimitiveType **`Beta`** ## Enumeration Members ### AxialSphere > **AxialSphere**: `5` **`Beta`** *** ### Box > **Box**: `1` **`Beta`** *** ### Cone > **Cone**: `11` **`Beta`** *** ### Cuboid > **Cuboid**: `10` **`Beta`** *** ### Cylinder > **Cylinder**: `7` **`Beta`** *** ### Disc > **Disc**: `4` **`Beta`** *** ### Ellipsoid > **Ellipsoid**: `9` **`Beta`** *** ### Line > **Line**: `2` **`Beta`** *** ### Pyramid > **Pyramid**: `8` **`Beta`** *** ### Text > **Text**: `0` **`Beta`** *** ### WireframeMesh > **WireframeMesh**: `12` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ProgressIndicatorPropertyItemVariant.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ProgressIndicatorPropertyItemVariant.md. # Enumeration: ProgressIndicatorPropertyItemVariant **`Beta`** The possible variants of a ProgressIndicator property item. ## Enumeration Members ### ProgressBar > **ProgressBar**: `1` **`Beta`** *** ### Spinner > **Spinner**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ProjectExportType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ProjectExportType.md. # Enumeration: ProjectExportType **`Beta`** ## Enumeration Members ### PlayableWorld > **PlayableWorld**: `0` **`Beta`** *** ### ProjectBackup > **ProjectBackup**: `1` **`Beta`** *** ### ShareableWorld > **ShareableWorld**: `3` **`Beta`** *** ### WorldTemplate > **WorldTemplate**: `2` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/PropertyItemType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/PropertyItemType.md. # Enumeration: PropertyItemType item **`Beta`** Type of item that can be added to the property pane ## Enumeration Members ### BlockList > **BlockList**: `"editorUI:BlockList"` **`Beta`** *** ### BlockTable > **BlockTable**: `"editorUI:BlockTable"` **`Beta`** *** ### Boolean > **Boolean**: `"editorUI:Boolean"` **`Beta`** *** ### Button > **Button**: `"editorUI:Button"` **`Beta`** *** ### ButtonPane > **ButtonPane**: `"editorUI:ButtonPane"` **`Beta`** *** ### CollectionTree > **CollectionTree**: `"editorUI:CollectionTree"` **`Beta`** *** ### ColorPicker > **ColorPicker**: `"editorUI:ColorPicker"` **`Beta`** *** ### ColorTimeline > **ColorTimeline**: `"editorUI:ColorTimeline"` **`Beta`** *** ### ComboBox > **ComboBox**: `"editorUI:ComboBox"` **`Beta`** *** ### DataTable > **DataTable**: `"editorUI:DataTable"` **`Beta`** *** ### Divider > **Divider**: `"editorUI:Divider"` **`Beta`** *** ### Dropdown > **Dropdown**: `"editorUI:Dropdown"` **`Beta`** *** ### Image > **Image**: `"editorUI:Image"` **`Beta`** *** ### Link > **Link**: `"editorUI:Link"` **`Beta`** *** ### ListPane > **ListPane**: `"editorUI:ListPane"` **`Beta`** *** ### Menu > **Menu**: `"editorUI:Menu"` **`Beta`** *** ### Minimap > **Minimap**: `"editorUI:Minimap"` **`Beta`** *** ### Number > **Number**: `"editorUI:Number"` **`Beta`** *** ### NumberTimeline > **NumberTimeline**: `"editorUI:NumberTimeline"` **`Beta`** *** ### ProgressIndicator > **ProgressIndicator**: `"editorUI:ProgressIndicator"` **`Beta`** *** ### ProxyPane > **ProxyPane**: `"editorUI:ProxyPane"` **`Beta`** *** ### String > **String**: `"editorUI:String"` **`Beta`** *** ### SubPane > **SubPane**: `"editorUI:SubPane"` **`Beta`** *** ### TagContainer > **TagContainer**: `"editorUI:TagContainer"` **`Beta`** *** ### Text > **Text**: `"editorUI:Text"` **`Beta`** *** ### TimelinePlayer > **TimelinePlayer**: `"editorUI:TimelinePlayer"` **`Beta`** *** ### ToggleGroup > **ToggleGroup**: `"editorUI:ToggleGroup"` **`Beta`** *** ### Vector2 > **Vector2**: `"editorUI:Vector2"` **`Beta`** *** ### Vector3 > **Vector3**: `"editorUI:Vector3"` **`Beta`** *** ### Vector3Timeline > **Vector3Timeline**: `"editorUI:Vector3Timeline"` **`Beta`** ## 同领域相关 - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [CollectionTreeEntryItemType](/server-editor/enums/CollectionTreeEntryItemType.md) - [CoreActionBarItemType](/server-editor/enums/CoreActionBarItemType.md) - [InvalidItemStackError](/server/classes/InvalidItemStackError.md) - [ItemLockMode](/server/enums/ItemLockMode.md) - [ItemStack](/server/classes/ItemStack.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/RenderPlaneGridResolution.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/RenderPlaneGridResolution.md. # Enumeration: RenderPlaneGridResolution **`Beta`** ## Enumeration Members ### EightBlocks > **EightBlocks**: `"EightBlocks"` **`Beta`** *** ### FourBlocks > **FourBlocks**: `"FourBlocks"` **`Beta`** *** ### None > **None**: `"None"` **`Beta`** *** ### OneBlock > **OneBlock**: `"OneBlock"` **`Beta`** *** ### SixteenBlocks > **SixteenBlocks**: `"SixteenBlocks"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/RootPaneLocation.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/RootPaneLocation.md. # Enumeration: RootPaneLocation **`Beta`** Determines the location root pane will be displayed in ## Enumeration Members ### Bottom > **Bottom**: `2` **`Beta`** *** ### Drawer > **Drawer**: `0` **`Beta`** *** ### Viewport > **Viewport**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/SelectionVolumeEventType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/SelectionVolumeEventType.md. # Enumeration: SelectionVolumeEventType event **`Beta`** ## Enumeration Members ### Add > **Add**: `2` **`Beta`** *** ### Clear > **Clear**: `6` **`Beta`** *** ### Move > **Move**: `5` **`Beta`** *** ### Remove > **Remove**: `3` **`Beta`** *** ### Set > **Set**: `1` **`Beta`** *** ### Translate > **Translate**: `4` **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/SpeedSettingsProperty.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/SpeedSettingsProperty.md. # Enumeration: SpeedSettingsProperty **`Beta`** ## Enumeration Members ### FlySpeedMultiplier > **FlySpeedMultiplier**: `"FlySpeedMultiplier"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/SplineType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/SplineType.md. # Enumeration: SplineType **`Beta`** ## Enumeration Members ### Hermite > **Hermite**: `1` **`Beta`** *** ### Line > **Line**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/StatusBarAlignment.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/StatusBarAlignment.md. # Enumeration: StatusBarAlignment **`Beta`** Position for items on the status bar ## Enumeration Members ### Left > **Left**: `1` **`Beta`** *** ### Right > **Right**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/StructureSource.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/StructureSource.md. # Enumeration: StructureSource **`Beta`** ## Enumeration Members ### BehaviorPack > **BehaviorPack**: `0` **`Beta`** *** ### EditorProject > **EditorProject**: `1` **`Beta`** *** ### File > **File**: `2` **`Beta`** *** ### Level > **Level**: `3` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/TagContainerVariant.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/TagContainerVariant.md. # Enumeration: TagContainerVariant inventory **`Beta`** The possible variants of a TagContainer property item. ## Enumeration Members ### Inverted > **Inverted**: `1` **`Beta`** *** ### Primary > **Primary**: `0` **`Beta`** ## 同领域相关 - [IMenuContainer](/server-editor/interfaces/IMenuContainer.md) - [IModalToolContainer](/server-editor/interfaces/IModalToolContainer.md) - [ITagContainerPropertyItem](/server-editor/interfaces/ITagContainerPropertyItem.md) - [ITagContainerPropertyItemOptions](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) - [SelectionContainerBase](/server-editor/classes/SelectionContainerBase.md) - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/ThemeSettingsColorKey.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/ThemeSettingsColorKey.md. # Enumeration: ThemeSettingsColorKey **`Beta`** ## Enumeration Members ### Caret > **Caret**: `"Caret"` **`Beta`** *** ### Confirm1 > **Confirm1**: `"Confirm1"` **`Beta`** *** ### Confirm2 > **Confirm2**: `"Confirm2"` **`Beta`** *** ### Confirm3 > **Confirm3**: `"Confirm3"` **`Beta`** *** ### ConfirmFill > **ConfirmFill**: `"ConfirmFill"` **`Beta`** *** ### ControlsGeneralFill > **ControlsGeneralFill**: `"ControlsGeneralFill"` **`Beta`** *** ### ControlsGeneralHighlight > **ControlsGeneralHighlight**: `"ControlsGeneralHighlight"` **`Beta`** *** ### Coordinate1 > **Coordinate1**: `"Coordinate1"` **`Beta`** *** ### Coordinate2 > **Coordinate2**: `"Coordinate2"` **`Beta`** *** ### Coordinate3 > **Coordinate3**: `"Coordinate3"` **`Beta`** *** ### CoordinateControlX > **CoordinateControlX**: `"CoordinateControlX"` **`Beta`** *** ### CoordinateControlY > **CoordinateControlY**: `"CoordinateControlY"` **`Beta`** *** ### CoordinateControlZ > **CoordinateControlZ**: `"CoordinateControlZ"` **`Beta`** *** ### CursorVolumeBorder > **CursorVolumeBorder**: `"CursorVolumeBorder"` **`Beta`** *** ### CursorVolumeFill > **CursorVolumeFill**: `"CursorVolumeFill"` **`Beta`** *** ### Destroy1 > **Destroy1**: `"Destroy1"` **`Beta`** *** ### Destroy2 > **Destroy2**: `"Destroy2"` **`Beta`** *** ### Destroy3 > **Destroy3**: `"Destroy3"` **`Beta`** *** ### DestroyFill > **DestroyFill**: `"DestroyFill"` **`Beta`** *** ### DisableBackground > **DisableBackground**: `"DisableBackground"` **`Beta`** *** ### DisableFill > **DisableFill**: `"DisableFill"` **`Beta`** *** ### DisableOutline > **DisableOutline**: `"DisableOutline"` **`Beta`** *** ### DisableText > **DisableText**: `"DisableText"` **`Beta`** *** ### DropDown1 > **DropDown1**: `"DropDown1"` **`Beta`** *** ### DropDown2 > **DropDown2**: `"DropDown2"` **`Beta`** *** ### DropDown3 > **DropDown3**: `"DropDown3"` **`Beta`** *** ### ElementBorder > **ElementBorder**: `"ElementBorder"` **`Beta`** *** ### Error > **Error**: `"Error"` **`Beta`** *** ### FocusErrorOutline > **FocusErrorOutline**: `"FocusErrorOutline"` **`Beta`** *** ### FocusOutline > **FocusOutline**: `"FocusOutline"` **`Beta`** *** ### HeaderBackground > **HeaderBackground**: `"HeaderBackground"` **`Beta`** *** ### HotbarOutline > **HotbarOutline**: `"HotbarOutline"` **`Beta`** *** ### Info1 > **Info1**: `"Info1"` **`Beta`** *** ### Info2 > **Info2**: `"Info2"` **`Beta`** *** ### Info3 > **Info3**: `"Info3"` **`Beta`** *** ### InfoFill > **InfoFill**: `"InfoFill"` **`Beta`** *** ### PanelBackground > **PanelBackground**: `"PanelBackground"` **`Beta`** *** ### PanelBorder > **PanelBorder**: `"PanelBorder"` **`Beta`** *** ### PlacementVolumeBorder > **PlacementVolumeBorder**: `"PlacementVolumeBorder"` **`Beta`** *** ### PlacementVolumeFill > **PlacementVolumeFill**: `"PlacementVolumeFill"` **`Beta`** *** ### PrefillVolumeBorder > **PrefillVolumeBorder**: `"PrefillVolumeBorder"` **`Beta`** *** ### PrefillVolumeFill > **PrefillVolumeFill**: `"PrefillVolumeFill"` **`Beta`** *** ### PrimaryActive > **PrimaryActive**: `"PrimaryActive"` **`Beta`** *** ### PrimaryAttention > **PrimaryAttention**: `"PrimaryAttention"` **`Beta`** *** ### PrimaryBackground1 > **PrimaryBackground1**: `"PrimaryBackground1"` **`Beta`** *** ### PrimaryBackground2 > **PrimaryBackground2**: `"PrimaryBackground2"` **`Beta`** *** ### PrimaryBackground3 > **PrimaryBackground3**: `"PrimaryBackground3"` **`Beta`** *** ### PrimaryBackground4 > **PrimaryBackground4**: `"PrimaryBackground4"` **`Beta`** *** ### PrimaryDefault > **PrimaryDefault**: `"PrimaryDefault"` **`Beta`** *** ### PrimaryDisable > **PrimaryDisable**: `"PrimaryDisable"` **`Beta`** *** ### PrimaryMute > **PrimaryMute**: `"PrimaryMute"` **`Beta`** *** ### ScrollBar > **ScrollBar**: `"ScrollBar"` **`Beta`** *** ### SecondaryActive > **SecondaryActive**: `"SecondaryActive"` **`Beta`** *** ### SecondaryAttention > **SecondaryAttention**: `"SecondaryAttention"` **`Beta`** *** ### SecondaryBackground1 > **SecondaryBackground1**: `"SecondaryBackground1"` **`Beta`** *** ### SecondaryBackground2 > **SecondaryBackground2**: `"SecondaryBackground2"` **`Beta`** *** ### SecondaryBackground3 > **SecondaryBackground3**: `"SecondaryBackground3"` **`Beta`** *** ### SecondaryDefault > **SecondaryDefault**: `"SecondaryDefault"` **`Beta`** *** ### SecondaryDisable > **SecondaryDisable**: `"SecondaryDisable"` **`Beta`** *** ### SecondaryMute > **SecondaryMute**: `"SecondaryMute"` **`Beta`** *** ### SelectionVolumeBorder > **SelectionVolumeBorder**: `"SelectionVolumeBorder"` **`Beta`** *** ### SelectionVolumeFill > **SelectionVolumeFill**: `"SelectionVolumeFill"` **`Beta`** *** ### SelectionVolumeOutlineBorder > **SelectionVolumeOutlineBorder**: `"SelectionVolumeOutlineBorder"` **`Beta`** *** ### SelectionVolumeOutlineFill > **SelectionVolumeOutlineFill**: `"SelectionVolumeOutlineFill"` **`Beta`** *** ### TitleBarBackground > **TitleBarBackground**: `"TitleBarBackground"` **`Beta`** *** ### ViewportOutline > **ViewportOutline**: `"ViewportOutline"` **`Beta`** *** ### Warning > **Warning**: `"Warning"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/TimelinePlayerPlaybackState.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/TimelinePlayerPlaybackState.md. # Enumeration: TimelinePlayerPlaybackState player **`Beta`** Playback state for Timeline Player property item. ## Enumeration Members ### Playing > **Playing**: `"playing"` **`Beta`** *** ### Stopped > **Stopped**: `"stopped"` **`Beta`** ## 同领域相关 - [ITimelinePlayer](/server-editor/interfaces/ITimelinePlayer.md) - [ITimelinePlayerEntry](/server-editor/interfaces/ITimelinePlayerEntry.md) - [ITimelinePlayerGroup](/server-editor/interfaces/ITimelinePlayerGroup.md) - [ITimelinePlayerOptions](/server-editor/interfaces/ITimelinePlayerOptions.md) - [IVector3TimelinePlayerEntry](/server-editor/interfaces/IVector3TimelinePlayerEntry.md) - [IVector3TimelinePlayerEntryOptions](/server-editor/interfaces/IVector3TimelinePlayerEntryOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/TransactionProcessState.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/TransactionProcessState.md. # Enumeration: TransactionProcessState **`Beta`** ## Enumeration Members ### Ended > **Ended**: `"Ended"` **`Beta`** *** ### Started > **Started**: `"Started"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/WidgetCollisionType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/WidgetCollisionType.md. # Enumeration: WidgetCollisionType **`Beta`** ## Enumeration Members ### Bounds > **Bounds**: `2` **`Beta`** *** ### None > **None**: `0` **`Beta`** *** ### Radius > **Radius**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/WidgetComponentType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/WidgetComponentType.md. # Enumeration: WidgetComponentType component **`Beta`** ## Enumeration Members ### BoundingBox > **BoundingBox**: `"BoundingBox"` **`Beta`** *** ### Clipboard > **Clipboard**: `"Clipboard"` **`Beta`** *** ### Entity > **Entity**: `"Entity"` **`Beta`** *** ### Gizmo > **Gizmo**: `"Gizmo"` **`Beta`** *** ### Grid > **Grid**: `"Grid"` **`Beta`** *** ### Guide > **Guide**: `"Guide"` **`Beta`** *** ### RenderPlane > **RenderPlane**: `"RenderPlane"` **`Beta`** *** ### RenderPrim > **RenderPrim**: `"RenderPrim"` **`Beta`** *** ### Spline > **Spline**: `"Spline"` **`Beta`** *** ### Text > **Text**: `"Text"` **`Beta`** *** ### VolumeOutline > **VolumeOutline**: `"VolumeOutline"` **`Beta`** ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/WidgetGizmoEventType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/WidgetGizmoEventType.md. # Enumeration: WidgetGizmoEventType event **`Beta`** ## Enumeration Members ### CornerGrabbed > **CornerGrabbed**: `"CornerGrabbed"` **`Beta`** *** ### CornerMoved > **CornerMoved**: `"CornerMoved"` **`Beta`** *** ### CornerReleased > **CornerReleased**: `"CornerReleased"` **`Beta`** *** ### OriginActivated > **OriginActivated**: `"OriginActivated"` **`Beta`** *** ### OriginDeactivated > **OriginDeactivated**: `"OriginDeactivated"` **`Beta`** *** ### OriginGrabbed > **OriginGrabbed**: `"OriginGrabbed"` **`Beta`** *** ### OriginMoved > **OriginMoved**: `"OriginMoved"` **`Beta`** *** ### OriginReleased > **OriginReleased**: `"OriginReleased"` **`Beta`** ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/WidgetGizmoScaleMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/WidgetGizmoScaleMode.md. # Enumeration: WidgetGizmoScaleMode **`Beta`** ## Enumeration Members ### Screen > **Screen**: `1` **`Beta`** *** ### World > **World**: `0` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/WidgetGroupSelectionMode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/WidgetGroupSelectionMode.md. # Enumeration: WidgetGroupSelectionMode **`Beta`** ## Enumeration Members ### Multiple > **Multiple**: `"Multiple"` **`Beta`** *** ### None > **None**: `"None"` **`Beta`** *** ### Single > **Single**: `"Single"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/WidgetMouseButtonActionType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/WidgetMouseButtonActionType.md. # Enumeration: WidgetMouseButtonActionType **`Beta`** ## Enumeration Members ### Drag > **Drag**: `2` **`Beta`** *** ### Pressed > **Pressed**: `0` **`Beta`** *** ### Released > **Released**: `1` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/enums/WorldGeneratorType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/enums/WorldGeneratorType.md. # Enumeration: WorldGeneratorType world **`Beta`** ## Enumeration Members ### Flat > **Flat**: `"Flat"` **`Beta`** *** ### Nether > **Nether**: `"Nether"` **`Beta`** *** ### Overworld > **Overworld**: `"Overworld"` **`Beta`** *** ### TheEnd > **TheEnd**: `"TheEnd"` **`Beta`** *** ### Void > **Void**: `"Void"` **`Beta`** ## 同领域相关 - [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError.md) - [World](/server/classes/World.md) - [WorldAfterEvents](/server/classes/WorldAfterEvents.md) - [WorldBeforeEvents](/server/classes/WorldBeforeEvents.md) - [WorldLoadAfterEvent](/server/classes/WorldLoadAfterEvent.md) - [WorldLoadAfterEventSignal](/server/classes/WorldLoadAfterEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/deserialize.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/deserialize.md. # Function: deserialize() > **deserialize**(`s`): `unknown` **`Beta`** ## Parameters ### s `string` ## Returns `unknown` ## Remarks Deserialize anything, defaults to the same behavior as JSON.parse but will use custom deserializers passed into [registerSerializationForType](/server-editor/functions/registerSerializationForType.md). [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/executeLargeOperation.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/executeLargeOperation.md. # Function: executeLargeOperation() > **executeLargeOperation**(`volume`, `operation`): `Promise`\<`void`> **`Beta`** ## Parameters ### volume [`RelativeVolumeListBlockVolume`](/server-editor/classes/RelativeVolumeListBlockVolume.md) ### operation (`blockLocation`) => `void` the operation to apply over each block location ## Returns `Promise`\<`void`> ## Remarks Executes an operation over a selection via chunks to allow splitting operation over multiple game ticks [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/executeLargeOperationFromIterator.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/executeLargeOperationFromIterator.md. # Function: executeLargeOperationFromIterator() > **executeLargeOperationFromIterator**(`blockLocationIterator`, `operation`): `Promise`\<`void`> **`Beta`** ## Parameters ### blockLocationIterator `BlockLocationIterator` the selection to iterator over ### operation (`blockLocation`) => `void` the operation to apply over each block location ## Returns `Promise`\<`void`> ## Remarks Executes an operation over a BlockLocationIterator via chunks to allow splitting operation over multiple game ticks [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/getDefaultAllowBlockList.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/getDefaultAllowBlockList.md. # Function: getDefaultAllowBlockList() block > **getDefaultAllowBlockList**(): `string`\[] **`Beta`** ## Returns `string`\[] Default allowed block list ## Remarks 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. ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/getDefaultBrushShapes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/getDefaultBrushShapes.md. # Function: getDefaultBrushShapes() > **getDefaultBrushShapes**(`excludeList?`): [`BrushShape`](/server-editor/classes/BrushShape.md)\[] **`Beta`** ## Parameters ### excludeList? [`CoreBrushShapeType`](/server-editor/enums/CoreBrushShapeType.md)\[] List of shape types to exclude ## Returns [`BrushShape`](/server-editor/classes/BrushShape.md)\[] ## Remarks Returns a list of default core brush shapes [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/makeObservable.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/makeObservable.md. # Function: makeObservable() > **makeObservable**\<`T`>(`initialValue`, `validator?`): [`IObservable`](/server-editor/interfaces/IObservable.md)\<`T`> **`Beta`** ## Type Parameters ### T `T` ## Parameters ### initialValue `T` Initial value of the observable. ### validator? [`ObservableValidator`](/server-editor/classes/ObservableValidator.md)\<`T`> Optional validator to use for the setter. ## Returns [`IObservable`](/server-editor/interfaces/IObservable.md)\<`T`> ## Remarks Creates an observable object that stores a value state. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/registerEditorExtension.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/registerEditorExtension.md. # Function: registerEditorExtension() > **registerEditorExtension**\<`PerPlayerStorageType`>(`extensionName`, `activationFunction`, `shutdownFunction`, `options?`): [`Extension`](/server-editor/classes/Extension.md) **`Beta`** ## Type Parameters ### PerPlayerStorageType `PerPlayerStorageType` = `Record`\<`string`, `never`> ## Parameters ### extensionName `string` ### activationFunction [`ActivationFunctionType`](/server-editor/types/ActivationFunctionType.md)\<`PerPlayerStorageType`> ### shutdownFunction [`ShutdownFunctionType`](/server-editor/types/ShutdownFunctionType.md)\<`PerPlayerStorageType`> ### options? [`IRegisterExtensionOptionalParameters`](/server-editor/interfaces/IRegisterExtensionOptionalParameters.md) ## Returns [`Extension`](/server-editor/classes/Extension.md) ## Remarks 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. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/registerSerializationForType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/registerSerializationForType.md. # Function: registerSerializationForType() > **registerSerializationForType**\<`T`>(`typeConstructor`, `name`, `serializer`, `deserializer`): `void` **`Beta`** ## Type Parameters ### T `T` ## Parameters ### typeConstructor `Function` ### name `string` ### serializer (`obj`) => `Record`\<`string`, `unknown`> ### deserializer (`vals`) => `T` ## Returns `void` ## Remarks Register a type to have custom serialization/deserialization when using [serialize](/server-editor/functions/serialize.md) and [deserialize](/server-editor/functions/deserialize.md). [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/registerUserDefinedTransactionHandler.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/registerUserDefinedTransactionHandler.md. # Function: registerUserDefinedTransactionHandler() > **registerUserDefinedTransactionHandler**\<`T`>(`transactionManager`, `undoHandler`, `redoHandler`): [`UserDefinedTransactionHandle`](/server-editor/classes/UserDefinedTransactionHandle.md)\<`T`> **`Beta`** ## Type Parameters ### T `T` ## Parameters ### transactionManager [`TransactionManager`](/server-editor/classes/TransactionManager.md) A reference to the TransactionManager (from the extension context for your extension) ### undoHandler (`payload`) => `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`) => `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`](/server-editor/classes/UserDefinedTransactionHandle.md)\<`T`> - [UserDefinedTransactionHandle](/server-editor/classes/UserDefinedTransactionHandle.md) - A strongly typed transaction handle that can be used to add transactions to the transaction manager. ## Remarks 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. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/serialize.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/serialize.md. # Function: serialize() > **serialize**(`obj`): `string` **`Beta`** ## Parameters ### obj `unknown` ## Returns `string` ## Remarks Serialize anything, defaults to the same behavior as JSON.stringify but will use custom serializers passed into [registerSerializationForType](/server-editor/functions/registerSerializationForType.md). [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/functions/stringFromException.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/functions/stringFromException.md. # Function: stringFromException() > **stringFromException**(`e`): `string` **`Beta`** ## Parameters ### e `unknown` ## Returns `string` ## Remarks Small utility for getting a string from an unknown exception type [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/index.md. # Module: server-editor **`Beta`** Manifest Details ```json { "module_name": "@minecraft/server-editor", "version": "0.1.0-beta" } ``` ## Enumerations - [ActionTypes](/server-editor/enums/ActionTypes.md) - [AudioSettingsProperty](/server-editor/enums/AudioSettingsProperty.md) - [Axis](/server-editor/enums/Axis.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [BlockTableOperationType](/server-editor/enums/BlockTableOperationType.md) - [BlockUtilityExtrudeDirection](/server-editor/enums/BlockUtilityExtrudeDirection.md) - [BlockUtilityFloodMatchCriteria](/server-editor/enums/BlockUtilityFloodMatchCriteria.md) - [BoolPropertyItemVariant](/server-editor/enums/BoolPropertyItemVariant.md) - [BrushDirectionalPlacementMode](/server-editor/enums/BrushDirectionalPlacementMode.md) - [BrushElevationMode](/server-editor/enums/BrushElevationMode.md) - [ButtonVariant](/server-editor/enums/ButtonVariant.md) - [CollectionTreeEntryItemType](/server-editor/enums/CollectionTreeEntryItemType.md) - [CollectionTreeSortType](/server-editor/enums/CollectionTreeSortType.md) - [ColorPickerPropertyItemVariant](/server-editor/enums/ColorPickerPropertyItemVariant.md) - [ComboBoxPropertyItemDataType](/server-editor/enums/ComboBoxPropertyItemDataType.md) - [ContiguousSelectionType](/server-editor/enums/ContiguousSelectionType.md) - [ContinuousActionState](/server-editor/enums/ContinuousActionState.md) - [CoreActionBarItemType](/server-editor/enums/CoreActionBarItemType.md) - [CoreBrushShapeType](/server-editor/enums/CoreBrushShapeType.md) - [CoreInputBindingCategory](/server-editor/enums/CoreInputBindingCategory.md) - [CoreMenuType](/server-editor/enums/CoreMenuType.md) - [CoreModalDialogType](/server-editor/enums/CoreModalDialogType.md) - [CursorControlMode](/server-editor/enums/CursorControlMode.md) - [CursorTargetMode](/server-editor/enums/CursorTargetMode.md) - [DataPickerModalDialogVariant](/server-editor/enums/DataPickerModalDialogVariant.md) - [DaylightCycle](/server-editor/enums/DaylightCycle.md) - [EditorInputContext](/server-editor/enums/EditorInputContext.md) - [EditorMode](/server-editor/enums/EditorMode.md) - [EntityOperationType](/server-editor/enums/EntityOperationType.md) - [ExportResult](/server-editor/enums/ExportResult.md) - [FlattenMode](/server-editor/enums/FlattenMode.md) - [GamePublishSetting](/server-editor/enums/GamePublishSetting.md) - [GraphicsSettingsProperty](/server-editor/enums/GraphicsSettingsProperty.md) - [ImageResourceType](/server-editor/enums/ImageResourceType.md) - [InputModifier](/server-editor/enums/InputModifier.md) - [KeyboardKey](/server-editor/enums/KeyboardKey.md) - [KeyProcessingState](/server-editor/enums/KeyProcessingState.md) - [LayoutAlignment](/server-editor/enums/LayoutAlignment.md) - [LayoutFlex](/server-editor/enums/LayoutFlex.md) - [LayoutSizeType](/server-editor/enums/LayoutSizeType.md) - [ListPaneEntryType](/server-editor/enums/ListPaneEntryType.md) - [ListPaneSlotVariant](/server-editor/enums/ListPaneSlotVariant.md) - [ListPaneViewSortType](/server-editor/enums/ListPaneViewSortType.md) - [ListViewControlFilterFlags](/server-editor/enums/ListViewControlFilterFlags.md) - [LogChannel](/server-editor/enums/LogChannel.md) - [MinimapMarkerType](/server-editor/enums/MinimapMarkerType.md) - [MinimapTrackingMode](/server-editor/enums/MinimapTrackingMode.md) - [MinimapViewType](/server-editor/enums/MinimapViewType.md) - [ModalDialogResponseType](/server-editor/enums/ModalDialogResponseType.md) - [ModalDialogType](/server-editor/enums/ModalDialogType.md) - [MouseActionCategory](/server-editor/enums/MouseActionCategory.md) - [MouseActionType](/server-editor/enums/MouseActionType.md) - [MouseCursorIconType](/server-editor/enums/MouseCursorIconType.md) - [MouseInputType](/server-editor/enums/MouseInputType.md) - [NumberPropertyItemVariant](/server-editor/enums/NumberPropertyItemVariant.md) - [PaintCompletionState](/server-editor/enums/PaintCompletionState.md) - [PaintMode](/server-editor/enums/PaintMode.md) - [PaneLayoutType](/server-editor/enums/PaneLayoutType.md) - [Plane](/server-editor/enums/Plane.md) - [PlaytestSessionResult](/server-editor/enums/PlaytestSessionResult.md) - [PrimitiveType](/server-editor/enums/PrimitiveType.md) - [ProgressIndicatorPropertyItemVariant](/server-editor/enums/ProgressIndicatorPropertyItemVariant.md) - [ProjectExportType](/server-editor/enums/ProjectExportType.md) - [PropertyItemType](/server-editor/enums/PropertyItemType.md) - [RenderPlaneGridResolution](/server-editor/enums/RenderPlaneGridResolution.md) - [RootPaneLocation](/server-editor/enums/RootPaneLocation.md) - [SelectionVolumeEventType](/server-editor/enums/SelectionVolumeEventType.md) - [SpeedSettingsProperty](/server-editor/enums/SpeedSettingsProperty.md) - [SplineType](/server-editor/enums/SplineType.md) - [StatusBarAlignment](/server-editor/enums/StatusBarAlignment.md) - [StructureSource](/server-editor/enums/StructureSource.md) - [TagContainerVariant](/server-editor/enums/TagContainerVariant.md) - [ThemeSettingsColorKey](/server-editor/enums/ThemeSettingsColorKey.md) - [TimelinePlayerPlaybackState](/server-editor/enums/TimelinePlayerPlaybackState.md) - [TransactionProcessState](/server-editor/enums/TransactionProcessState.md) - [WidgetCollisionType](/server-editor/enums/WidgetCollisionType.md) - [WidgetComponentType](/server-editor/enums/WidgetComponentType.md) - [WidgetGizmoEventType](/server-editor/enums/WidgetGizmoEventType.md) - [WidgetGizmoScaleMode](/server-editor/enums/WidgetGizmoScaleMode.md) - [WidgetGroupSelectionMode](/server-editor/enums/WidgetGroupSelectionMode.md) - [WidgetMouseButtonActionType](/server-editor/enums/WidgetMouseButtonActionType.md) - [WorldGeneratorType](/server-editor/enums/WorldGeneratorType.md) ## Classes - [AudioSettings](/server-editor/classes/AudioSettings.md) - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteManager](/server-editor/classes/BlockPaletteManager.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [BlockUtilities](/server-editor/classes/BlockUtilities.md) - [BlockUtilityTasks](/server-editor/classes/BlockUtilityTasks.md) - [BrushShape](/server-editor/classes/BrushShape.md) - [BrushShapeManager](/server-editor/classes/BrushShapeManager.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [ClipboardItem](/server-editor/classes/ClipboardItem.md) - [ClipboardManager](/server-editor/classes/ClipboardManager.md) - [ConeBrushShape](/server-editor/classes/ConeBrushShape.md) - [CuboidBrushShape](/server-editor/classes/CuboidBrushShape.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) - [CurrentThemeChangeAfterEventSignal](/server-editor/classes/CurrentThemeChangeAfterEventSignal.md) - [CurrentThemeColorChangeAfterEvent](/server-editor/classes/CurrentThemeColorChangeAfterEvent.md) - [CurrentThemeColorChangeAfterEventSignal](/server-editor/classes/CurrentThemeColorChangeAfterEventSignal.md) - [Cursor](/server-editor/classes/Cursor.md) - [CursorPropertiesChangeAfterEvent](/server-editor/classes/CursorPropertiesChangeAfterEvent.md) - [CursorPropertyChangeAfterEventSignal](/server-editor/classes/CursorPropertyChangeAfterEventSignal.md) - [CylinderBrushShape](/server-editor/classes/CylinderBrushShape.md) - [EditorConstants](/server-editor/classes/EditorConstants.md) - [EditorStructure](/server-editor/classes/EditorStructure.md) - [EditorStructureManager](/server-editor/classes/EditorStructureManager.md) - [EllipsoidBrushShape](/server-editor/classes/EllipsoidBrushShape.md) - [EntityIdentifierObservableValidator](/server-editor/classes/EntityIdentifierObservableValidator.md) - [ExportManager](/server-editor/classes/ExportManager.md) - [Extension](/server-editor/classes/Extension.md) - [ExtensionContext](/server-editor/classes/ExtensionContext.md) - [ExtensionContextAfterEvents](/server-editor/classes/ExtensionContextAfterEvents.md) - [GraphicsSettings](/server-editor/classes/GraphicsSettings.md) - [GuidePlaneManager](/server-editor/classes/GuidePlaneManager.md) - [IBlockPaletteItem](/server-editor/classes/IBlockPaletteItem.md) - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [InvalidWidgetError](/server-editor/classes/InvalidWidgetError.md) - [InvalidWidgetGroupError](/server-editor/classes/InvalidWidgetGroupError.md) - [Logger](/server-editor/classes/Logger.md) - [MinecraftEditor](/server-editor/classes/MinecraftEditor.md) - [MinimapItem](/server-editor/classes/MinimapItem.md) - [MinimapManager](/server-editor/classes/MinimapManager.md) - [ModeChangeAfterEvent](/server-editor/classes/ModeChangeAfterEvent.md) - [ModeChangeAfterEventSignal](/server-editor/classes/ModeChangeAfterEventSignal.md) - [NumberLimitObservableValidator](/server-editor/classes/NumberLimitObservableValidator.md) - [ObservableValidator](/server-editor/classes/ObservableValidator.md) - [PendingTransaction](/server-editor/classes/PendingTransaction.md) - [PlaytestManager](/server-editor/classes/PlaytestManager.md) - [ProbabilityBlockPaletteItem](/server-editor/classes/ProbabilityBlockPaletteItem.md) - [ProjectAfterEvents](/server-editor/classes/ProjectAfterEvents.md) - [PyramidBrushShape](/server-editor/classes/PyramidBrushShape.md) - [RelativeVolumeListBlockVolume](/server-editor/classes/RelativeVolumeListBlockVolume.md) - [SelectionChangeAfterEventSignal](/server-editor/classes/SelectionChangeAfterEventSignal.md) - [SelectionContainerBase](/server-editor/classes/SelectionContainerBase.md) - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity.md) - [SelectionContainerVolume](/server-editor/classes/SelectionContainerVolume.md) - [SelectionContainerVolumeEvent](/server-editor/classes/SelectionContainerVolumeEvent.md) - [SelectionEventAfterEvent](/server-editor/classes/SelectionEventAfterEvent.md) - [SelectionManager](/server-editor/classes/SelectionManager.md) - [SettingsManager](/server-editor/classes/SettingsManager.md) - [SimpleBlockPaletteItem](/server-editor/classes/SimpleBlockPaletteItem.md) - [SimulationState](/server-editor/classes/SimulationState.md) - [SimulationStateAfterEvent](/server-editor/classes/SimulationStateAfterEvent.md) - [SimulationStateChangeAfterEventSignal](/server-editor/classes/SimulationStateChangeAfterEventSignal.md) - [SingleBlockBrushShape](/server-editor/classes/SingleBlockBrushShape.md) - [SpeedSettings](/server-editor/classes/SpeedSettings.md) - [ThemeSettings](/server-editor/classes/ThemeSettings.md) - [TransactionEvent](/server-editor/classes/TransactionEvent.md) - [TransactionHandler](/server-editor/classes/TransactionHandler.md) - [TransactionManager](/server-editor/classes/TransactionManager.md) - [TransactionManagerNoChangesError](/server-editor/classes/TransactionManagerNoChangesError.md) - [TransactionOperationHandler](/server-editor/classes/TransactionOperationHandler.md) - [UserDefinedTransactionHandle](/server-editor/classes/UserDefinedTransactionHandle.md) - [UserDefinedTransactionOperationHandler](/server-editor/classes/UserDefinedTransactionOperationHandler.md) - [Vector2LimitObservableValidator](/server-editor/classes/Vector2LimitObservableValidator.md) - [Vector3LimitObservableValidator](/server-editor/classes/Vector3LimitObservableValidator.md) - [VolumeListTransactionOperationHandler](/server-editor/classes/VolumeListTransactionOperationHandler.md) - [Widget](/server-editor/classes/Widget.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxStateChangeEventParameters](/server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters.md) - [WidgetComponentClipboard](/server-editor/classes/WidgetComponentClipboard.md) - [WidgetComponentEntity](/server-editor/classes/WidgetComponentEntity.md) - [WidgetComponentGizmo](/server-editor/classes/WidgetComponentGizmo.md) - [WidgetComponentGizmoStateChangeEventParameters](/server-editor/classes/WidgetComponentGizmoStateChangeEventParameters.md) - [WidgetComponentGrid](/server-editor/classes/WidgetComponentGrid.md) - [WidgetComponentGuide](/server-editor/classes/WidgetComponentGuide.md) - [WidgetComponentRenderPlane](/server-editor/classes/WidgetComponentRenderPlane.md) - [WidgetComponentRenderPrimitive](/server-editor/classes/WidgetComponentRenderPrimitive.md) - [WidgetComponentRenderPrimitiveTypeAxialSphere](/server-editor/classes/WidgetComponentRenderPrimitiveTypeAxialSphere.md) - [WidgetComponentRenderPrimitiveTypeBase](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase.md) - [WidgetComponentRenderPrimitiveTypeBox](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBox.md) - [WidgetComponentRenderPrimitiveTypeCone](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCone.md) - [WidgetComponentRenderPrimitiveTypeCuboid](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCuboid.md) - [WidgetComponentRenderPrimitiveTypeCylinder](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCylinder.md) - [WidgetComponentRenderPrimitiveTypeDisc](/server-editor/classes/WidgetComponentRenderPrimitiveTypeDisc.md) - [WidgetComponentRenderPrimitiveTypeEllipsoid](/server-editor/classes/WidgetComponentRenderPrimitiveTypeEllipsoid.md) - [WidgetComponentRenderPrimitiveTypeLine](/server-editor/classes/WidgetComponentRenderPrimitiveTypeLine.md) - [WidgetComponentRenderPrimitiveTypePyramid](/server-editor/classes/WidgetComponentRenderPrimitiveTypePyramid.md) - [WidgetComponentRenderPrimitiveTypeWireframeMesh](/server-editor/classes/WidgetComponentRenderPrimitiveTypeWireframeMesh.md) - [WidgetComponentSpline](/server-editor/classes/WidgetComponentSpline.md) - [WidgetComponentText](/server-editor/classes/WidgetComponentText.md) - [WidgetComponentVolumeOutline](/server-editor/classes/WidgetComponentVolumeOutline.md) - [WidgetGroup](/server-editor/classes/WidgetGroup.md) - [WidgetManager](/server-editor/classes/WidgetManager.md) - [WidgetMouseButtonEventData](/server-editor/classes/WidgetMouseButtonEventData.md) - [WidgetStateChangeEventData](/server-editor/classes/WidgetStateChangeEventData.md) ## Interfaces - [ActionManager](/server-editor/interfaces/ActionManager.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockUtilityManifest](/server-editor/interfaces/BlockUtilityManifest.md) - [BlockUtilityManifestEntry](/server-editor/interfaces/BlockUtilityManifestEntry.md) - [BuiltInUIManager](/server-editor/interfaces/BuiltInUIManager.md) - [ClipboardWriteOptions](/server-editor/interfaces/ClipboardWriteOptions.md) - [ConeBrushShapeSettings](/server-editor/interfaces/ConeBrushShapeSettings.md) - [ContiguousSelectionProperties](/server-editor/interfaces/ContiguousSelectionProperties.md) - [CuboidBrushShapeSettings](/server-editor/interfaces/CuboidBrushShapeSettings.md) - [CursorPosition](/server-editor/interfaces/CursorPosition.md) - [CursorProperties](/server-editor/interfaces/CursorProperties.md) - [CursorRay](/server-editor/interfaces/CursorRay.md) - [CylinderBrushShapeSettings](/server-editor/interfaces/CylinderBrushShapeSettings.md) - [EditorStructureSearchOptions](/server-editor/interfaces/EditorStructureSearchOptions.md) - [EllipsoidBrushShapeSettings](/server-editor/interfaces/EllipsoidBrushShapeSettings.md) - [EventSink](/server-editor/interfaces/EventSink.md) - [ExtensionOptionalParameters](/server-editor/interfaces/ExtensionOptionalParameters.md) - [GameOptions](/server-editor/interfaces/GameOptions.md) - [GuidePlane](/server-editor/interfaces/GuidePlane.md) - [IActionBar](/server-editor/interfaces/IActionBar.md) - [IActionBarItem](/server-editor/interfaces/IActionBarItem.md) - [IActionBarItemCreationParams](/server-editor/interfaces/IActionBarItemCreationParams.md) - [IBlockListPropertyItem](/server-editor/interfaces/IBlockListPropertyItem.md) - [IBlockListPropertyItemOptions](/server-editor/interfaces/IBlockListPropertyItemOptions.md) - [IBlockTableEntryInfo](/server-editor/interfaces/IBlockTableEntryInfo.md) - [IBlockTablePropertyItem](/server-editor/interfaces/IBlockTablePropertyItem.md) - [IBlockTablePropertyItemOptions](/server-editor/interfaces/IBlockTablePropertyItemOptions.md) - [IBoolPropertyItem](/server-editor/interfaces/IBoolPropertyItem.md) - [IBoolPropertyItemOptions](/server-editor/interfaces/IBoolPropertyItemOptions.md) - [IButtonPanePropertyItem](/server-editor/interfaces/IButtonPanePropertyItem.md) - [IButtonPanePropertyItemOptions](/server-editor/interfaces/IButtonPanePropertyItemOptions.md) - [IButtonPropertyItem](/server-editor/interfaces/IButtonPropertyItem.md) - [IButtonPropertyItemOptions](/server-editor/interfaces/IButtonPropertyItemOptions.md) - [ICollectionTreeEntry](/server-editor/interfaces/ICollectionTreeEntry.md) - [ICollectionTreeEntryDropdownItem](/server-editor/interfaces/ICollectionTreeEntryDropdownItem.md) - [ICollectionTreeEntryItem](/server-editor/interfaces/ICollectionTreeEntryItem.md) - [ICollectionTreeEntryNumberItem](/server-editor/interfaces/ICollectionTreeEntryNumberItem.md) - [ICollectionTreeEntryStringItem](/server-editor/interfaces/ICollectionTreeEntryStringItem.md) - [ICollectionTreeFolder](/server-editor/interfaces/ICollectionTreeFolder.md) - [ICollectionTreePropertyItem](/server-editor/interfaces/ICollectionTreePropertyItem.md) - [ICollectionTreePropertyItemOptions](/server-editor/interfaces/ICollectionTreePropertyItemOptions.md) - [ICollectionTreeViewControlPaneOptions](/server-editor/interfaces/ICollectionTreeViewControlPaneOptions.md) - [IColorPickerPropertyItem](/server-editor/interfaces/IColorPickerPropertyItem.md) - [IColorPickerPropertyItemOptions](/server-editor/interfaces/IColorPickerPropertyItemOptions.md) - [IColorTimelinePropertyItem](/server-editor/interfaces/IColorTimelinePropertyItem.md) - [IColorTimelinePropertyItemEntry](/server-editor/interfaces/IColorTimelinePropertyItemEntry.md) - [IColorTimelinePropertyItemOptions](/server-editor/interfaces/IColorTimelinePropertyItemOptions.md) - [IComboBoxPropertyItem](/server-editor/interfaces/IComboBoxPropertyItem.md) - [IComboBoxPropertyItemEntry](/server-editor/interfaces/IComboBoxPropertyItemEntry.md) - [IComboBoxPropertyItemOptions](/server-editor/interfaces/IComboBoxPropertyItemOptions.md) - [IContentBadgeManager](/server-editor/interfaces/IContentBadgeManager.md) - [IDataTablePropertyItem](/server-editor/interfaces/IDataTablePropertyItem.md) - [IDataTablePropertyItemEntry](/server-editor/interfaces/IDataTablePropertyItemEntry.md) - [IDataTablePropertyItemOptions](/server-editor/interfaces/IDataTablePropertyItemOptions.md) - [IDisposable](/server-editor/interfaces/IDisposable.md) - [IDividerPropertyItemOptions](/server-editor/interfaces/IDividerPropertyItemOptions.md) - [IDropdownPropertyItem](/server-editor/interfaces/IDropdownPropertyItem.md) - [IDropdownPropertyItemEntry](/server-editor/interfaces/IDropdownPropertyItemEntry.md) - [IDropdownPropertyItemOptions](/server-editor/interfaces/IDropdownPropertyItemOptions.md) - [IEventToken](/server-editor/interfaces/IEventToken.md) - [IGlobalInputManager](/server-editor/interfaces/IGlobalInputManager.md) - [IImagePropertyItem](/server-editor/interfaces/IImagePropertyItem.md) - [IImagePropertyItemOptions](/server-editor/interfaces/IImagePropertyItemOptions.md) - [IIntroductionPane](/server-editor/interfaces/IIntroductionPane.md) - [IIntroductionPaneOptions](/server-editor/interfaces/IIntroductionPaneOptions.md) - [ILinkPropertyItem](/server-editor/interfaces/ILinkPropertyItem.md) - [ILinkPropertyItemOptions](/server-editor/interfaces/ILinkPropertyItemOptions.md) - [IListPaneBoolEntry](/server-editor/interfaces/IListPaneBoolEntry.md) - [IListPaneButtonEntry](/server-editor/interfaces/IListPaneButtonEntry.md) - [IListPaneEntry](/server-editor/interfaces/IListPaneEntry.md) - [IListPaneImageEntry](/server-editor/interfaces/IListPaneImageEntry.md) - [IListPanePropertyItem](/server-editor/interfaces/IListPanePropertyItem.md) - [IListPanePropertyItemOptions](/server-editor/interfaces/IListPanePropertyItemOptions.md) - [IListPaneSlot](/server-editor/interfaces/IListPaneSlot.md) - [IListPaneSlotOptions](/server-editor/interfaces/IListPaneSlotOptions.md) - [IListPaneTextEntry](/server-editor/interfaces/IListPaneTextEntry.md) - [IListPaneViewControlPaneOptions](/server-editor/interfaces/IListPaneViewControlPaneOptions.md) - [IListViewControlPane](/server-editor/interfaces/IListViewControlPane.md) - [IListViewControlPaneOptions](/server-editor/interfaces/IListViewControlPaneOptions.md) - [IMenu](/server-editor/interfaces/IMenu.md) - [IMenuContainer](/server-editor/interfaces/IMenuContainer.md) - [IMenuCreationParams](/server-editor/interfaces/IMenuCreationParams.md) - [IMenuPropertyItem](/server-editor/interfaces/IMenuPropertyItem.md) - [IMenuPropertyItemOptions](/server-editor/interfaces/IMenuPropertyItemOptions.md) - [IMinimapPropertyItem](/server-editor/interfaces/IMinimapPropertyItem.md) - [IMinimapPropertyItemOptions](/server-editor/interfaces/IMinimapPropertyItemOptions.md) - [IModalControlPane](/server-editor/interfaces/IModalControlPane.md) - [IModalDialog](/server-editor/interfaces/IModalDialog.md) - [IModalDialogActivationRequest](/server-editor/interfaces/IModalDialogActivationRequest.md) - [IModalDialogManager](/server-editor/interfaces/IModalDialogManager.md) - [IModalOverlayPane](/server-editor/interfaces/IModalOverlayPane.md) - [IModalOverlayPaneOptions](/server-editor/interfaces/IModalOverlayPaneOptions.md) - [IModalTool](/server-editor/interfaces/IModalTool.md) - [IModalToolContainer](/server-editor/interfaces/IModalToolContainer.md) - [IntroductionPaneTabProps](/server-editor/interfaces/IntroductionPaneTabProps.md) - [INumberPropertyItem](/server-editor/interfaces/INumberPropertyItem.md) - [INumberPropertyItemOptions](/server-editor/interfaces/INumberPropertyItemOptions.md) - [INumberTimelinePropertyItem](/server-editor/interfaces/INumberTimelinePropertyItem.md) - [INumberTimelinePropertyItemEntry](/server-editor/interfaces/INumberTimelinePropertyItemEntry.md) - [INumberTimelinePropertyItemOptions](/server-editor/interfaces/INumberTimelinePropertyItemOptions.md) - [IObservable](/server-editor/interfaces/IObservable.md) - [IPane](/server-editor/interfaces/IPane.md) - [IPaneManager](/server-editor/interfaces/IPaneManager.md) - [IPlayerLogger](/server-editor/interfaces/IPlayerLogger.md) - [IPlayerLoggerProperties](/server-editor/interfaces/IPlayerLoggerProperties.md) - [IProgressIndicatorPropertyItem](/server-editor/interfaces/IProgressIndicatorPropertyItem.md) - [IProgressIndicatorPropertyItemOptions](/server-editor/interfaces/IProgressIndicatorPropertyItemOptions.md) - [IPropertyItemBase](/server-editor/interfaces/IPropertyItemBase.md) - [IPropertyItemOptionsBase](/server-editor/interfaces/IPropertyItemOptionsBase.md) - [IPropertyPane](/server-editor/interfaces/IPropertyPane.md) - [IPropertyPaneOptions](/server-editor/interfaces/IPropertyPaneOptions.md) - [IRegisteredKeyBinding](/server-editor/interfaces/IRegisteredKeyBinding.md) - [IRegisterExtensionOptionalParameters](/server-editor/interfaces/IRegisterExtensionOptionalParameters.md) - [IRootPropertyPane](/server-editor/interfaces/IRootPropertyPane.md) - [IRootPropertyPaneHeaderAction](/server-editor/interfaces/IRootPropertyPaneHeaderAction.md) - [IRootPropertyPaneOptions](/server-editor/interfaces/IRootPropertyPaneOptions.md) - [IStatusBar](/server-editor/interfaces/IStatusBar.md) - [IStatusBarItem](/server-editor/interfaces/IStatusBarItem.md) - [IStatusBarItemCreationParams](/server-editor/interfaces/IStatusBarItemCreationParams.md) - [IStringPropertyItem](/server-editor/interfaces/IStringPropertyItem.md) - [IStringPropertyItemOptions](/server-editor/interfaces/IStringPropertyItemOptions.md) - [ISubPanePropertyItem](/server-editor/interfaces/ISubPanePropertyItem.md) - [ISubPanePropertyItemOptions](/server-editor/interfaces/ISubPanePropertyItemOptions.md) - [ITagContainerPropertyItem](/server-editor/interfaces/ITagContainerPropertyItem.md) - [ITagContainerPropertyItemOptions](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) - [ITextPropertyItem](/server-editor/interfaces/ITextPropertyItem.md) - [ITextPropertyItemOptions](/server-editor/interfaces/ITextPropertyItemOptions.md) - [ITimelinePlayer](/server-editor/interfaces/ITimelinePlayer.md) - [ITimelinePlayerEntry](/server-editor/interfaces/ITimelinePlayerEntry.md) - [ITimelinePlayerGroup](/server-editor/interfaces/ITimelinePlayerGroup.md) - [ITimelinePlayerOptions](/server-editor/interfaces/ITimelinePlayerOptions.md) - [IToggleGroupPropertyItem](/server-editor/interfaces/IToggleGroupPropertyItem.md) - [IToggleGroupPropertyItemEntry](/server-editor/interfaces/IToggleGroupPropertyItemEntry.md) - [IToggleGroupPropertyItemOptions](/server-editor/interfaces/IToggleGroupPropertyItemOptions.md) - [IVector2PropertyItem](/server-editor/interfaces/IVector2PropertyItem.md) - [IVector2PropertyItemOptions](/server-editor/interfaces/IVector2PropertyItemOptions.md) - [IVector3Keyframe](/server-editor/interfaces/IVector3Keyframe.md) - [IVector3PropertyItem](/server-editor/interfaces/IVector3PropertyItem.md) - [IVector3PropertyItemOptions](/server-editor/interfaces/IVector3PropertyItemOptions.md) - [IVector3TimelinePlayerEntry](/server-editor/interfaces/IVector3TimelinePlayerEntry.md) - [IVector3TimelinePlayerEntryOptions](/server-editor/interfaces/IVector3TimelinePlayerEntryOptions.md) - [IVector3TimelinePropertyItem](/server-editor/interfaces/IVector3TimelinePropertyItem.md) - [IVector3TimelinePropertyItemEntry](/server-editor/interfaces/IVector3TimelinePropertyItemEntry.md) - [IVector3TimelinePropertyItemOptions](/server-editor/interfaces/IVector3TimelinePropertyItemOptions.md) - [LocalizationEntry](/server-editor/interfaces/LocalizationEntry.md) - [LogProperties](/server-editor/interfaces/LogProperties.md) - [MinimapCreateOptions](/server-editor/interfaces/MinimapCreateOptions.md) - [MinimapMarkerData](/server-editor/interfaces/MinimapMarkerData.md) - [ModalDialogCreationParams](/server-editor/interfaces/ModalDialogCreationParams.md) - [ModalToolCreationParameters](/server-editor/interfaces/ModalToolCreationParameters.md) - [ProjectExportOptions](/server-editor/interfaces/ProjectExportOptions.md) - [PyramidBrushShapeSettings](/server-editor/interfaces/PyramidBrushShapeSettings.md) - [QuickExtrudeProperties](/server-editor/interfaces/QuickExtrudeProperties.md) - [SelectionManifestData](/server-editor/interfaces/SelectionManifestData.md) - [SelectionManifestEntry](/server-editor/interfaces/SelectionManifestEntry.md) - [WeightedBlock](/server-editor/interfaces/WeightedBlock.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) - [WidgetComponentClipboardOptions](/server-editor/interfaces/WidgetComponentClipboardOptions.md) - [WidgetComponentEntityOptions](/server-editor/interfaces/WidgetComponentEntityOptions.md) - [WidgetComponentGizmoOptions](/server-editor/interfaces/WidgetComponentGizmoOptions.md) - [WidgetComponentGridOptions](/server-editor/interfaces/WidgetComponentGridOptions.md) - [WidgetComponentGuideOptions](/server-editor/interfaces/WidgetComponentGuideOptions.md) - [WidgetComponentRenderPlaneOptions](/server-editor/interfaces/WidgetComponentRenderPlaneOptions.md) - [WidgetComponentRenderPrimitiveOptions](/server-editor/interfaces/WidgetComponentRenderPrimitiveOptions.md) - [WidgetComponentSplineOptions](/server-editor/interfaces/WidgetComponentSplineOptions.md) - [WidgetComponentTextOptions](/server-editor/interfaces/WidgetComponentTextOptions.md) - [WidgetComponentVolumeOutlineOptions](/server-editor/interfaces/WidgetComponentVolumeOutlineOptions.md) - [WidgetCreateOptions](/server-editor/interfaces/WidgetCreateOptions.md) - [WidgetGroupCreateOptions](/server-editor/interfaces/WidgetGroupCreateOptions.md) - [WireframeMeshOptions](/server-editor/interfaces/WireframeMeshOptions.md) ## Type Aliases - [Action](/server-editor/types/Action.md) - [ActionID](/server-editor/types/ActionID.md) - [ActivationFunctionType](/server-editor/types/ActivationFunctionType.md) - [AudioSettingsPropertyTypeMap](/server-editor/types/AudioSettingsPropertyTypeMap.md) - [BasicTooltipContent](/server-editor/types/BasicTooltipContent.md) - [BrushShapeSettings](/server-editor/types/BrushShapeSettings.md) - [ButtonPropertyItemSupportedActionTypes](/server-editor/types/ButtonPropertyItemSupportedActionTypes.md) - [ContinuousAction](/server-editor/types/ContinuousAction.md) - [EventHandler](/server-editor/types/EventHandler.md) - [GraphicsSettingsPropertyTypeMap](/server-editor/types/GraphicsSettingsPropertyTypeMap.md) - [ICollectionTreeEntryDropdownItemMenuOption](/server-editor/types/ICollectionTreeEntryDropdownItemMenuOption.md) - [ICollectionTreeEntryDropdownItemParams](/server-editor/types/ICollectionTreeEntryDropdownItemParams.md) - [ICollectionTreeEntryNumberItemParams](/server-editor/types/ICollectionTreeEntryNumberItemParams.md) - [ICollectionTreeEntryOptions](/server-editor/types/ICollectionTreeEntryOptions.md) - [ICollectionTreeEntryStringItemParams](/server-editor/types/ICollectionTreeEntryStringItemParams.md) - [ICollectionTreeFolderHeaderActionParams](/server-editor/types/ICollectionTreeFolderHeaderActionParams.md) - [ICollectionTreeFolderOptions](/server-editor/types/ICollectionTreeFolderOptions.md) - [ImageAnimationData](/server-editor/types/ImageAnimationData.md) - [ImageResourceData](/server-editor/types/ImageResourceData.md) - [IObservableProp](/server-editor/types/IObservableProp.md) - [IPlayerUISession](/server-editor/types/IPlayerUISession.md) - [KeyBinding](/server-editor/types/KeyBinding.md) - [KeyBindingInfo](/server-editor/types/KeyBindingInfo.md) - [LayoutSize](/server-editor/types/LayoutSize.md) - [ListPaneBoolEntryParams](/server-editor/types/ListPaneBoolEntryParams.md) - [ListPaneButtonEntryParams](/server-editor/types/ListPaneButtonEntryParams.md) - [ListPaneEntryMap](/server-editor/types/ListPaneEntryMap.md) - [ListPaneEntryParams](/server-editor/types/ListPaneEntryParams.md) - [ListPaneImageEntryParams](/server-editor/types/ListPaneImageEntryParams.md) - [ListPaneSlotConfiguration](/server-editor/types/ListPaneSlotConfiguration.md) - [ListPaneSlotCreationProps](/server-editor/types/ListPaneSlotCreationProps.md) - [ListPaneSlotLayoutEntry](/server-editor/types/ListPaneSlotLayoutEntry.md) - [ListPaneSlotLayoutSections](/server-editor/types/ListPaneSlotLayoutSections.md) - [ListPaneTextEntryParams](/server-editor/types/ListPaneTextEntryParams.md) - [ListPaneViewFilter](/server-editor/types/ListPaneViewFilter.md) - [ListViewControlAction](/server-editor/types/ListViewControlAction.md) - [ListViewControlActionState](/server-editor/types/ListViewControlActionState.md) - [LocalizedString](/server-editor/types/LocalizedString.md) - [ModalDialogActivationParams](/server-editor/types/ModalDialogActivationParams.md) - [ModalDialogCoreResponseType](/server-editor/types/ModalDialogCoreResponseType.md) - [ModalDialogCustomResponse](/server-editor/types/ModalDialogCustomResponse.md) - [ModalDialogDataPickerResponse](/server-editor/types/ModalDialogDataPickerResponse.md) - [ModalDialogDismissResponse](/server-editor/types/ModalDialogDismissResponse.md) - [ModalDialogRequestData](/server-editor/types/ModalDialogRequestData.md) - [ModalToolLifecycleEventPayload](/server-editor/types/ModalToolLifecycleEventPayload.md) - [MouseModifiers](/server-editor/types/MouseModifiers.md) - [MouseProps](/server-editor/types/MouseProps.md) - [MouseRayCastAction](/server-editor/types/MouseRayCastAction.md) - [NoArgsAction](/server-editor/types/NoArgsAction.md) - [PaneItemStyle](/server-editor/types/PaneItemStyle.md) - [PropertyBag](/server-editor/types/PropertyBag.md) - [PropertyPaneVisibilityUpdate](/server-editor/types/PropertyPaneVisibilityUpdate.md) - [Ray](/server-editor/types/Ray.md) - [RegisteredAction](/server-editor/types/RegisteredAction.md) - [SelectedModalToolChangedEventPayload](/server-editor/types/SelectedModalToolChangedEventPayload.md) - [ShutdownFunctionType](/server-editor/types/ShutdownFunctionType.md) - [SpeedSettingsPropertyTypeMap](/server-editor/types/SpeedSettingsPropertyTypeMap.md) - [StatefulAction](/server-editor/types/StatefulAction.md) - [SupportedKeyboardActionTypes](/server-editor/types/SupportedKeyboardActionTypes.md) - [SupportedMouseActionTypes](/server-editor/types/SupportedMouseActionTypes.md) - [TooltipButton](/server-editor/types/TooltipButton.md) - [TooltipContent](/server-editor/types/TooltipContent.md) - [TooltipInteractiveContent](/server-editor/types/TooltipInteractiveContent.md) - [TooltipInteractiveContentDescriptionItem](/server-editor/types/TooltipInteractiveContentDescriptionItem.md) - [TooltipLink](/server-editor/types/TooltipLink.md) - [UnregisterInputBindingCallback](/server-editor/types/UnregisterInputBindingCallback.md) ## Variables - [editor](/server-editor/variables/editor.md) ## Functions - [deserialize](/server-editor/functions/deserialize.md) - [executeLargeOperation](/server-editor/functions/executeLargeOperation.md) - [executeLargeOperationFromIterator](/server-editor/functions/executeLargeOperationFromIterator.md) - [getDefaultAllowBlockList](/server-editor/functions/getDefaultAllowBlockList.md) - [getDefaultBrushShapes](/server-editor/functions/getDefaultBrushShapes.md) - [makeObservable](/server-editor/functions/makeObservable.md) - [registerEditorExtension](/server-editor/functions/registerEditorExtension.md) - [registerSerializationForType](/server-editor/functions/registerSerializationForType.md) - [registerUserDefinedTransactionHandler](/server-editor/functions/registerUserDefinedTransactionHandler.md) - [serialize](/server-editor/functions/serialize.md) - [stringFromException](/server-editor/functions/stringFromException.md) --- url: /server-editor/interfaces/ActionManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ActionManager.md. # Interface: ActionManager **`Beta`** Binds actions to the client and manages their lifetime. Action managers are managed on a per player basis since client side UI is per player. ## Methods ### createAction() > **createAction**\<`T`>(`rawAction`): [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<`T`> **`Beta`** #### Type Parameters ##### T `T` _extends_ [`Action`](/server-editor/types/Action.md) #### Parameters ##### rawAction `T` The raw action to create. See ActionTypes for supported parameters #### Returns [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<`T`> #### Remarks Creates an action and registers it on the client [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/BlockMaskList.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/BlockMaskList.md. # Interface: BlockMaskList block **`Beta`** ## Properties ### blockList > **blockList**: `any`\[] **`Beta`** *** ### maskType > **maskType**: [`BlockMaskListType`](/server-editor/enums/BlockMaskListType.md) **`Beta`** ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) - [BlockPaletteManager](/server-editor/classes/BlockPaletteManager.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/BlockUtilityManifest.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/BlockUtilityManifest.md. # Interface: BlockUtilityManifest block **`Beta`** ## Properties ### entries > **entries**: [`BlockUtilityManifestEntry`](/server-editor/interfaces/BlockUtilityManifestEntry.md)\[] **`Beta`** *** ### totalBlocks > **totalBlocks**: `number` **`Beta`** ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/BlockUtilityManifestEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/BlockUtilityManifestEntry.md. # Interface: BlockUtilityManifestEntry block **`Beta`** ## Properties ### blockIdentifier > **blockIdentifier**: `string` **`Beta`** *** ### count > **count**: `number` **`Beta`** ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/BuiltInUIManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/BuiltInUIManager.md. # Interface: BuiltInUIManager **`Beta`** Represents a UI session for a given player ## Methods ### activateTutorial() > **activateTutorial**(): `void` **`Beta`** #### Returns `void` #### Remarks Activates tutorial overlay *** ### navigateToDocumentation() > **navigateToDocumentation**(): `void` **`Beta`** #### Returns `void` #### Remarks Navigates to the documentation site. *** ### navigateToFeedback() > **navigateToFeedback**(): `void` **`Beta`** #### Returns `void` #### Remarks Navigates to the feedback site *** ### navigateToPauseScreen() > **navigateToPauseScreen**(): `void` **`Beta`** #### Returns `void` #### Remarks Navigates to the pause screen *** ### navigateToSamples() > **navigateToSamples**(): `void` **`Beta`** #### Returns `void` #### Remarks Navigates to the github-samples site *** ### saveAndExit() > **saveAndExit**(): `void` **`Beta`** #### Returns `void` #### Remarks Saves levels & exits back to Editor main menu. *** ### showKeyboardSettings() > **showKeyboardSettings**(): `void` **`Beta`** #### Returns `void` #### Remarks Shows the Keyboard Settings modal *** ### showUpdateInformation() > **showUpdateInformation**(): `void` **`Beta`** #### Returns `void` #### Remarks Shows update information for the current version *** ### updateControlHelpPanelVisibility() > **updateControlHelpPanelVisibility**(`visibility`): `void` **`Beta`** #### Parameters ##### visibility `boolean` #### Returns `void` #### Remarks Updates the visibility of the Control Help panel *** ### updateLogPanelVisibility() > **updateLogPanelVisibility**(`visibility`): `void` **`Beta`** #### Parameters ##### visibility `boolean` #### Returns `void` #### Remarks Updates the visibility of the log panel *** ### updateStructurePanelVisibility() > **updateStructurePanelVisibility**(`visibility`): `void` **`Beta`** #### Parameters ##### visibility `boolean` #### Returns `void` #### Remarks Updates the visibility of the Structure panel *** ### updateUISettingsPanelVisibility() > **updateUISettingsPanelVisibility**(`visibility`): `void` **`Beta`** #### Parameters ##### visibility `boolean` #### Returns `void` #### Remarks Updates the visibility of the control demo [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ClipboardWriteOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ClipboardWriteOptions.md. # Interface: ClipboardWriteOptions **`Beta`** Interface used to specify the options when a clipboard item is being written to the world ## Properties ### excludeAirBlocks? > `optional` **excludeAirBlocks?**: `boolean` **`Beta`** *** ### mirror? > `optional` **mirror?**: `any` **`Beta`** #### Remarks An enum which represents the axis (or combination of axis') along which the item should be mirrored - X - Z - XZ *** ### normalizedOrigin? > `optional` **normalizedOrigin?**: `any` **`Beta`** *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Remarks A position offset which should be applied to the paste location while the clipboard item is being written *** ### rotation? > `optional` **rotation?**: `any` **`Beta`** #### Remarks An enum representing the rotation around the Y-Axis which should be applied while the clipboard item is being written [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ConeBrushShapeSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ConeBrushShapeSettings.md. # Interface: ConeBrushShapeSettings **`Beta`** Settings for Cone brush shapes ## Properties ### depth > **depth**: `number` **`Beta`** *** ### height > **height**: `number` **`Beta`** *** ### hollow > **hollow**: `boolean` **`Beta`** *** ### radius > **radius**: `number` **`Beta`** *** ### thickness > **thickness**: `number` **`Beta`** *** ### uniform > **uniform**: `boolean` **`Beta`** *** ### width > **width**: `number` **`Beta`** *** ### xRotation > **xRotation**: `number` **`Beta`** *** ### yRotation > **yRotation**: `number` **`Beta`** *** ### zRotation > **zRotation**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ContiguousSelectionProperties.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ContiguousSelectionProperties.md. # Interface: ContiguousSelectionProperties **`Beta`** ## Properties ### checkForAdjacentFace? > `optional` **checkForAdjacentFace?**: `boolean` **`Beta`** *** ### contiguousSelectionBlockList? > `optional` **contiguousSelectionBlockList?**: `string`\[] **`Beta`** *** ### contiguousSelectionType? > `optional` **contiguousSelectionType?**: [`ContiguousSelectionType`](/server-editor/enums/ContiguousSelectionType.md) **`Beta`** *** ### fullSelectionToleranceLevel? > `optional` **fullSelectionToleranceLevel?**: `number` **`Beta`** *** ### isFace? > `optional` **isFace?**: `boolean` **`Beta`** *** ### selectionDirection? > `optional` **selectionDirection?**: `number` **`Beta`** *** ### size? > `optional` **size?**: `number` **`Beta`** *** ### startingLocation? > `optional` **startingLocation?**: `any` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/CuboidBrushShapeSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/CuboidBrushShapeSettings.md. # Interface: CuboidBrushShapeSettings **`Beta`** Settings for Cuboid brush shapes ## Properties ### depth > **depth**: `number` **`Beta`** *** ### height > **height**: `number` **`Beta`** *** ### hollow > **hollow**: `boolean` **`Beta`** *** ### thickness > **thickness**: `number` **`Beta`** *** ### uniform > **uniform**: `boolean` **`Beta`** *** ### width > **width**: `number` **`Beta`** *** ### xRotation > **xRotation**: `number` **`Beta`** *** ### yRotation > **yRotation**: `number` **`Beta`** *** ### zRotation > **zRotation**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/CursorPosition.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/CursorPosition.md. # Interface: CursorPosition **`Beta`** ## Properties ### FaceDirection > **FaceDirection**: `number` **`Beta`** *** ### Position > **Position**: `Vector3` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/CursorProperties.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/CursorProperties.md. # Interface: CursorProperties **`Beta`** The CursorProperties interface is used to describe the properties of the Editor 3D block cursor construct. The 3D block cursor can be queried to retrieve the current properties, and the same property class can be used to set the current properties of the cursor. This interface is generally used at the activation stage of the active tool to set up the color, visibility and input properties of the 3D block cursor ## Properties ### controlMode? > `optional` **controlMode?**: [`CursorControlMode`](/server-editor/enums/CursorControlMode.md) **`Beta`** #### Remarks Enum representing the cursor control mode - Fixed Mode locks the cursor to a position which is \ blocks offset from the current player position. The cursor is camera relative, so it will always appear \ blocks ahead of the players feet - Keyboard Mode puts the cursor under direct control of the API, and ignores any mouse input. The cursor can only be moved around using the moveBy method - KeyboardAndMouse mode puts the cursor under a shared control of onMouseMove and keyboard input. Any mouse movement events will set the cursor to the position of the mouse/world raycast. This can be modified using the moveBy method, but any subsequent mouse events will reset the position back to where the raycast intersection occurs - Mouse mode puts the cursor under control of mouse move events, and moveBy method will be ignored *** ### fillColor? > `optional` **fillColor?**: `any` **`Beta`** *** ### fixedModeDistance? > `optional` **fixedModeDistance?**: `number` **`Beta`** #### Remarks The fixed distance from the players feet at which the cursor is attached, relative to camera direction. This is only used when \[controlMode] is set to `Fixed` *** ### outlineColor? > `optional` **outlineColor?**: `any` **`Beta`** #### Remarks A \[Color] Property representing the color of the block cursor object outline *** ### projectThroughLiquid? > `optional` **projectThroughLiquid?**: `boolean` **`Beta`** *** ### targetMode? > `optional` **targetMode?**: [`CursorTargetMode`](/server-editor/enums/CursorTargetMode.md) **`Beta`** #### Remarks An enum representing the cursor target mode - Block Mode records the block position of the mouse/world raycast intersection - Face Mode records the block position of the block adjacent to the mouse/world raycast intersection, according to the face of the collision point of the selected block *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Boolean flag controlling the visibility of the 3D block cursor [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/CursorRay.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/CursorRay.md. # Interface: CursorRay **`Beta`** ## Properties ### end > **end**: `Vector3` **`Beta`** *** ### hit > **hit**: `boolean` **`Beta`** *** ### start > **start**: `Vector3` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/CylinderBrushShapeSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/CylinderBrushShapeSettings.md. # Interface: CylinderBrushShapeSettings **`Beta`** Settings for Cylinder brush shapes ## Properties ### depth > **depth**: `number` **`Beta`** *** ### height > **height**: `number` **`Beta`** *** ### hollow > **hollow**: `boolean` **`Beta`** *** ### radius > **radius**: `number` **`Beta`** *** ### thickness > **thickness**: `number` **`Beta`** *** ### uniform > **uniform**: `boolean` **`Beta`** *** ### width > **width**: `number` **`Beta`** *** ### xRotation > **xRotation**: `number` **`Beta`** *** ### yRotation > **yRotation**: `number` **`Beta`** *** ### zRotation > **zRotation**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/EditorStructureSearchOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/EditorStructureSearchOptions.md. # Interface: EditorStructureSearchOptions **`Beta`** ## Properties ### displayName? > `optional` **displayName?**: `string` **`Beta`** *** ### id? > `optional` **id?**: `string` **`Beta`** *** ### sources? > `optional` **sources?**: [`StructureSource`](/server-editor/enums/StructureSource.md)\[] **`Beta`** *** ### structureName? > `optional` **structureName?**: `string` **`Beta`** *** ### structureNamespace? > `optional` **structureNamespace?**: `string` **`Beta`** *** ### tags? > `optional` **tags?**: `string`\[] **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/EllipsoidBrushShapeSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/EllipsoidBrushShapeSettings.md. # Interface: EllipsoidBrushShapeSettings **`Beta`** Settings for Ellipsoid brush shapes ## Properties ### depth > **depth**: `number` **`Beta`** *** ### height > **height**: `number` **`Beta`** *** ### hollow > **hollow**: `boolean` **`Beta`** *** ### radius > **radius**: `number` **`Beta`** *** ### thickness > **thickness**: `number` **`Beta`** *** ### uniform > **uniform**: `boolean` **`Beta`** *** ### width > **width**: `number` **`Beta`** *** ### xRotation > **xRotation**: `number` **`Beta`** *** ### yRotation > **yRotation**: `number` **`Beta`** *** ### zRotation > **zRotation**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/EventSink.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/EventSink.md. # Interface: EventSink\ event **`Beta`** An event that can be subscribed to. You can use the token, returned from the subscribe method, to clean up handlers. ## Type Parameters ### T `T` ## Methods ### subscribe() > **subscribe**(`handler`): [`IEventToken`](/server-editor/interfaces/IEventToken.md) **`Beta`** #### Parameters ##### handler [`EventHandler`](/server-editor/types/EventHandler.md)\<`T`> Handler function to subscribe with. #### Returns [`IEventToken`](/server-editor/interfaces/IEventToken.md) An event handler subscription token that can be used to unsubscribe and clean-up handlers. #### Remarks Subscribes an event handler to a particular subscription. ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ExtensionOptionalParameters.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ExtensionOptionalParameters.md. # Interface: ExtensionOptionalParameters **`Beta`** An interface which defines the set of optional parameters which can be used when calling the `registerEditorExtension` function ## Properties ### description? > `optional` **description?**: `string` **`Beta`** #### Remarks An optional text description of the extension being registered. This can be a straight textual description or a string identifier key for a localized string in the extension's resource pack text files. The description is meant to be a very short snappy one-liner which quickly and uniquely identifies the extension The length of the string is capped to 256 characters *** ### notes? > `optional` **notes?**: `string` **`Beta`** #### Remarks Optional notes for the extension being registered. This can be a straight textual description or a string identifier key for a localized string in the extension's resource pack text files. The notes section is meant to convey more detailed information and notes (e.g. a link to the author's website) The length of this string is capped to 1024 characters *** ### toolGroupId? > `optional` **toolGroupId?**: `string` **`Beta`** #### Remarks An optional custom identifier that will be used for all Modal Tools created from the registered extension. The length of the string is capped to 256 characters [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/GameOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/GameOptions.md. # Interface: GameOptions **`Beta`** ## Properties ### bedsWork? > `optional` **bedsWork?**: `boolean` **`Beta`** *** ### bonusChest? > `optional` **bonusChest?**: `boolean` **`Beta`** *** ### cheats? > `optional` **cheats?**: `boolean` **`Beta`** *** ### commandBlockEnabled? > `optional` **commandBlockEnabled?**: `boolean` **`Beta`** *** ### commandBlockOutput? > `optional` **commandBlockOutput?**: `boolean` **`Beta`** *** ### daylightCycle? > `optional` **daylightCycle?**: [`DaylightCycle`](/server-editor/enums/DaylightCycle.md) **`Beta`** *** ### difficulty? > `optional` **difficulty?**: `any` **`Beta`** *** ### dimensionId? > `optional` **dimensionId?**: `string` **`Beta`** *** ### disableWeather? > `optional` **disableWeather?**: `boolean` **`Beta`** *** ### drowningDamage? > `optional` **drowningDamage?**: `boolean` **`Beta`** *** ### educationEdition? > `optional` **educationEdition?**: `boolean` **`Beta`** *** ### entitiesDropLoot? > `optional` **entitiesDropLoot?**: `boolean` **`Beta`** *** ### exportType? > `optional` **exportType?**: [`ProjectExportType`](/server-editor/enums/ProjectExportType.md) **`Beta`** *** ### fallDamage? > `optional` **fallDamage?**: `boolean` **`Beta`** *** ### fireDamage? > `optional` **fireDamage?**: `boolean` **`Beta`** *** ### fireSpreads? > `optional` **fireSpreads?**: `boolean` **`Beta`** *** ### freezeDamage? > `optional` **freezeDamage?**: `boolean` **`Beta`** *** ### friendlyFire? > `optional` **friendlyFire?**: `boolean` **`Beta`** *** ### functionCommandLimit? > `optional` **functionCommandLimit?**: `number` **`Beta`** *** ### gameMode? > `optional` **gameMode?**: `any` **`Beta`** *** ### hardcore? > `optional` **hardcore?**: `boolean` **`Beta`** *** ### immediateRespawn? > `optional` **immediateRespawn?**: `boolean` **`Beta`** *** ### insomnia? > `optional` **insomnia?**: `boolean` **`Beta`** *** ### keepInventory? > `optional` **keepInventory?**: `boolean` **`Beta`** *** ### keepPlayerData? > `optional` **keepPlayerData?**: `boolean` **`Beta`** *** ### lanVisibility? > `optional` **lanVisibility?**: `boolean` **`Beta`** *** ### limitedCrafting? > `optional` **limitedCrafting?**: `boolean` **`Beta`** *** ### maxCommandChainLength? > `optional` **maxCommandChainLength?**: `number` **`Beta`** *** ### mobGriefing? > `optional` **mobGriefing?**: `boolean` **`Beta`** *** ### mobLoot? > `optional` **mobLoot?**: `boolean` **`Beta`** *** ### mobSpawning? > `optional` **mobSpawning?**: `boolean` **`Beta`** *** ### multiplayerGame? > `optional` **multiplayerGame?**: `boolean` **`Beta`** *** ### naturalRegeneration? > `optional` **naturalRegeneration?**: `boolean` **`Beta`** *** ### playerAccess? > `optional` **playerAccess?**: [`GamePublishSetting`](/server-editor/enums/GamePublishSetting.md) **`Beta`** *** ### playerPermissions? > `optional` **playerPermissions?**: `any` **`Beta`** *** ### playerWaypoints? > `optional` **playerWaypoints?**: `any` **`Beta`** *** ### randomTickSpeed? > `optional` **randomTickSpeed?**: `number` **`Beta`** *** ### recipeUnlocking? > `optional` **recipeUnlocking?**: `boolean` **`Beta`** *** ### respawnBlocksExplode? > `optional` **respawnBlocksExplode?**: `boolean` **`Beta`** *** ### respawnRadius? > `optional` **respawnRadius?**: `number` **`Beta`** *** ### sendCommandFeedback? > `optional` **sendCommandFeedback?**: `boolean` **`Beta`** *** ### showBorderEffect? > `optional` **showBorderEffect?**: `boolean` **`Beta`** *** ### showCoordinates? > `optional` **showCoordinates?**: `boolean` **`Beta`** *** ### showDaysPlayed? > `optional` **showDaysPlayed?**: `boolean` **`Beta`** *** ### showDeathMessage? > `optional` **showDeathMessage?**: `boolean` **`Beta`** *** ### showItemTags? > `optional` **showItemTags?**: `boolean` **`Beta`** *** ### simulationDistance? > `optional` **simulationDistance?**: `number` **`Beta`** *** ### sleepSkipPercent? > `optional` **sleepSkipPercent?**: `number` **`Beta`** *** ### spawnPosition? > `optional` **spawnPosition?**: `any` **`Beta`** *** ### startingMap? > `optional` **startingMap?**: `boolean` **`Beta`** *** ### tileDrops? > `optional` **tileDrops?**: `boolean` **`Beta`** *** ### timeOfDay? > `optional` **timeOfDay?**: `number` **`Beta`** *** ### tntExplodes? > `optional` **tntExplodes?**: `boolean` **`Beta`** *** ### weather? > `optional` **weather?**: `number` **`Beta`** *** ### worldName? > `optional` **worldName?**: `string` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/GuidePlane.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/GuidePlane.md. # Interface: GuidePlane **`Beta`** ## Properties ### fillColor > **fillColor**: `RGBA` **`Beta`** *** ### normal > **normal**: `Vector3` **`Beta`** *** ### origin > **origin**: `Vector3` **`Beta`** *** ### outlineColor > **outlineColor**: `RGBA` **`Beta`** *** ### planeId > **planeId**: `string` **`Beta`** *** ### visible > **visible**: `boolean` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IActionBar.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IActionBar.md. # Interface: IActionBar **`Beta`** Manager for IActionBarItem objects. ## Methods ### registerItem() > **registerItem**(`id`, `action`, `props`): [`IActionBarItem`](/server-editor/interfaces/IActionBarItem.md) **`Beta`** #### Parameters ##### id `string` Unique item identifier. ##### action [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`NoArgsAction`](/server-editor/types/NoArgsAction.md)> Action to be invoked. ##### props [`IActionBarItemCreationParams`](/server-editor/interfaces/IActionBarItemCreationParams.md) Configuration for the item to create. #### Returns [`IActionBarItem`](/server-editor/interfaces/IActionBarItem.md) #### Remarks Add a new action bar item to the collection. *** ### unregisterItem() > **unregisterItem**(`id`): `void` **`Beta`** #### Parameters ##### id `string` Unique item identifier. #### Returns `void` #### Remarks Remove an action item from the collection. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IActionBarItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IActionBarItem.md. # Interface: IActionBarItem **`Beta`** Registered item handle in the Action Bar collection. ## Properties ### getEnabled > **getEnabled**: () => `boolean` **`Beta`** #### Returns `boolean` #### Remarks Returns the current enabled state of the item. *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier of the item. *** ### label > `readonly` **label**: `string` **`Beta`** #### Remarks Text label of the item. *** ### setEnabled > **setEnabled**: (`enabled`) => `void` **`Beta`** #### Parameters ##### enabled `boolean` #### Returns `void` #### Remarks Modify enabled state of the item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IActionBarItemCreationParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IActionBarItemCreationParams.md. # Interface: IActionBarItemCreationParams **`Beta`** Properties required to create an Action Bar item. ## Properties ### contentBadgeId? > `optional` **contentBadgeId?**: `string` **`Beta`** #### Remarks Optional content badge identifier associated with the item. *** ### enabled? > `optional` **enabled?**: `boolean` **`Beta`** #### Remarks Initial enabled state of the item. If not defined, default is true. *** ### executeOnAdd? > `optional` **executeOnAdd?**: `boolean` **`Beta`** #### Remarks Sets whether the Action Bar Item's execute is run when it is added to the Action Bar. If not defined, default is false. *** ### icon > **icon**: `string` **`Beta`** #### Remarks Icon resource for the item. *** ### iconAnimation? > `optional` **iconAnimation?**: [`ImageAnimationData`](/server-editor/types/ImageAnimationData.md) **`Beta`** #### Remarks Animation data for sprite sheet icon image *** ### label > **label**: `string` **`Beta`** #### Remarks Text label for item. *** ### tooltipDescription? > `optional` **tooltipDescription?**: `string` **`Beta`** #### Remarks Tooltip description for the item. *** ### tooltipTitle? > `optional` **tooltipTitle?**: `string` **`Beta`** #### Remarks Tooltip title for the item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IBlockListPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IBlockListPropertyItem.md. # Interface: IBlockListPropertyItem **`Beta`** A property item which supports block list properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: readonly `string`\[] **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IBlockListPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IBlockListPropertyItemOptions.md. # Interface: IBlockListPropertyItemOptions **`Beta`** Optional properties for Bool property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`) => `void` **`Beta`** #### Parameters ##### newValue readonly `string`\[] ##### oldValue readonly `string`\[] #### Returns `void` #### Remarks This callback is called when UI control value is changed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IBlockTableEntryInfo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IBlockTableEntryInfo.md. # Interface: IBlockTableEntryInfo **`Beta`** Block Table Entry info for block table property item ## Properties ### count? > `optional` **count?**: `number` **`Beta`** #### Remarks The quantity number of the same block in the selection. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IBlockTablePropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IBlockTablePropertyItem.md. # Interface: IBlockTablePropertyItem **`Beta`** A property item which supports Block Table properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addOrUpdateEntry() > **addOrUpdateEntry**(`block`, `blockInfo`): `void` **`Beta`** #### Parameters ##### block `any` a new entry in the block table. ##### blockInfo [`IBlockTableEntryInfo`](/server-editor/interfaces/IBlockTableEntryInfo.md) block info for the entry in the block table. #### Returns `void` #### Remarks Create new or update an existing entry in the block table *** ### deleteEntry() > **deleteEntry**(`block`): `void` **`Beta`** #### Parameters ##### block `string` an entry in the block table. #### Returns `void` #### Remarks Delete entry in the block table, by block name *** ### getEntry() > **getEntry**(`block`): [`IBlockTableEntryInfo`](/server-editor/interfaces/IBlockTableEntryInfo.md) | `undefined` **`Beta`** #### Parameters ##### block `any` an entry in the block table. #### Returns [`IBlockTableEntryInfo`](/server-editor/interfaces/IBlockTableEntryInfo.md) | `undefined` #### Remarks Read entry from the block table, by block name *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### updateEntries() > **updateEntries**(`entries`): `void` **`Beta`** #### Parameters ##### entries `Map`\<`string`, [`IBlockTableEntryInfo`](/server-editor/interfaces/IBlockTableEntryInfo.md)> The new value for the block table. #### Returns `void` #### Remarks Update the block table entries [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IBlockTablePropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IBlockTablePropertyItemOptions.md. # Interface: IBlockTablePropertyItemOptions **`Beta`** Properties of block table item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### entries? > `optional` **entries?**: `Map`\<`string`, [`IBlockTableEntryInfo`](/server-editor/interfaces/IBlockTableEntryInfo.md)> **`Beta`** #### Remarks Map of block entries in the block table. *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. It will be visible by default. *** ### onOperationClick? > `optional` **onOperationClick?**: (`block`, `operation`) => `void` **`Beta`** #### Parameters ##### block `string` ##### operation [`BlockTableOperationType`](/server-editor/enums/BlockTableOperationType.md) #### Returns `void` #### Remarks This callback is called when UI control operation is selected from the UI. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### tooltip? > `optional` **tooltip?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IBoolPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IBoolPropertyItem.md. # Interface: IBoolPropertyItem **`Beta`** A property item which supports boolean properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `boolean` **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` #### Returns `void` #### Remarks Sets title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` #### Returns `void` #### Remarks Sets tooltip description of the property item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IBoolPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IBoolPropertyItemOptions.md. # Interface: IBoolPropertyItemOptions **`Beta`** Optional properties for Bool property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### checkboxIcon? > `optional` **checkboxIcon?**: `string` **`Beta`** #### Remarks Changes checkbox variant to use a custom icon *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. It will be visible by default. *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`) => `void` **`Beta`** #### Parameters ##### newValue `boolean` ##### oldValue `boolean` #### Returns `void` #### Remarks This callback is called when UI control value is changed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the text item. *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item *** ### variant? > `optional` **variant?**: [`BoolPropertyItemVariant`](/server-editor/enums/BoolPropertyItemVariant.md) **`Beta`** #### Remarks Determines how we display bool as a UI element. If undefined, it will default to Checkbox. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IButtonPanePropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IButtonPanePropertyItem.md. # Interface: IButtonPanePropertyItem **`Beta`** A property item pane which supports multiple buttons ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`IPane`](/server-editor/interfaces/IPane.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addButton() > **addButton**(`action`, `options?`): [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) **`Beta`** #### Parameters ##### action [`ButtonPropertyItemSupportedActionTypes`](/server-editor/types/ButtonPropertyItemSupportedActionTypes.md) ##### options? [`IButtonPropertyItemOptions`](/server-editor/interfaces/IButtonPropertyItemOptions.md) #### Returns [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) #### Remarks Adds a button to the pane and binds the specified action to the button interaction. *** ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`hide`](/server-editor/interfaces/IPane.md#hide) *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the pane and all of its items. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`show`](/server-editor/interfaces/IPane.md#show) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IButtonPanePropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IButtonPanePropertyItemOptions.md. # Interface: IButtonPanePropertyItemOptions **`Beta`** Optional properties for Button Pane property item ## Properties ### itemMinWidth? > `optional` **itemMinWidth?**: `number` **`Beta`** #### Remarks Minimum width for each item within the layout. If undefined, it will default to 6. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IButtonPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IButtonPropertyItem.md. # Interface: IButtonPropertyItem **`Beta`** A property item which supports Button properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### replaceAction() > **replaceAction**(`action`): `void` **`Beta`** #### Parameters ##### action [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`NoArgsAction`](/server-editor/types/NoArgsAction.md)> New action to replace the existing with. #### Returns `void` #### Remarks Replace action assigned to the button. *** ### setIcon() > **setIcon**(`icon`): `void` **`Beta`** #### Parameters ##### icon `string` | `undefined` New button icon. #### Returns `void` #### Remarks Updates icon of the button. *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New button title. #### Returns `void` #### Remarks Updates title of the button. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` New button tooltip. #### Returns `void` #### Remarks Updates tooltip description of the button. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IButtonPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IButtonPropertyItemOptions.md. # Interface: IButtonPropertyItemOptions **`Beta`** Optional properties for Button property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. It will be visible by default. *** ### icon? > `optional` **icon?**: `string` **`Beta`** #### Remarks Icon image of the property item. *** ### shrinkToIcon? > `optional` **shrinkToIcon?**: `boolean` **`Beta`** #### Remarks Shrinks button to icon size if button has an icon. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### variant? > `optional` **variant?**: [`ButtonVariant`](/server-editor/enums/ButtonVariant.md) **`Beta`** #### Remarks The variant for the button. By default it is Primary. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ICollectionTreeEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ICollectionTreeEntry.md. # Interface: ICollectionTreeEntry **`Beta`** ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the entry. *** ### index > `readonly` **index**: `number` **`Beta`** #### Remarks Index of the entry in the folder *** ### parent > `readonly` **parent**: [`ICollectionTreeFolder`](/server-editor/interfaces/ICollectionTreeFolder.md) **`Beta`** #### Remarks Parent folder of the entry. *** ### selected > `readonly` **selected**: `boolean` **`Beta`** #### Remarks Selected state of the entry ## Methods ### addDropdownItem() > **addDropdownItem**(`params`): [`ICollectionTreeEntryDropdownItem`](/server-editor/interfaces/ICollectionTreeEntryDropdownItem.md) **`Beta`** #### Parameters ##### params [`ICollectionTreeEntryDropdownItemParams`](/server-editor/types/ICollectionTreeEntryDropdownItemParams.md) #### Returns [`ICollectionTreeEntryDropdownItem`](/server-editor/interfaces/ICollectionTreeEntryDropdownItem.md) #### Remarks Adds a dropdown item to the entry *** ### addNumberItem() > **addNumberItem**(`params`): [`ICollectionTreeEntryNumberItem`](/server-editor/interfaces/ICollectionTreeEntryNumberItem.md) **`Beta`** #### Parameters ##### params [`ICollectionTreeEntryNumberItemParams`](/server-editor/types/ICollectionTreeEntryNumberItemParams.md) #### Returns [`ICollectionTreeEntryNumberItem`](/server-editor/interfaces/ICollectionTreeEntryNumberItem.md) #### Remarks Adds a number item to the entry *** ### addStringItem() > **addStringItem**(`params`): [`ICollectionTreeEntryStringItem`](/server-editor/interfaces/ICollectionTreeEntryStringItem.md) **`Beta`** #### Parameters ##### params [`ICollectionTreeEntryStringItemParams`](/server-editor/types/ICollectionTreeEntryStringItemParams.md) #### Returns [`ICollectionTreeEntryStringItem`](/server-editor/interfaces/ICollectionTreeEntryStringItem.md) #### Remarks Adds a string item to the entry *** ### getItemByIndex() > **getItemByIndex**(`index`): [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md) | `undefined` **`Beta`** #### Parameters ##### index `number` Index of the entry item #### Returns [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md) | `undefined` #### Remarks Gets the tree entry item by index *** ### setColor() > **setColor**(`color`): `void` **`Beta`** #### Parameters ##### color `any` #### Returns `void` #### Remarks Set color associated with the entry *** ### setSelected() > **setSelected**(`selected`): `void` **`Beta`** #### Parameters ##### selected `boolean` New selected state #### Returns `void` #### Remarks Set selected state of the entry. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ICollectionTreeEntryDropdownItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ICollectionTreeEntryDropdownItem.md. # Interface: ICollectionTreeEntryDropdownItem **`Beta`** ## Extends - [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md) ## Properties ### enabled > `readonly` **enabled**: `boolean` **`Beta`** #### Remarks Enabled state of the entry. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`enabled`](/server-editor/interfaces/ICollectionTreeEntryItem.md#enabled) *** ### parentEntry > `readonly` **parentEntry**: [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) **`Beta`** #### Remarks Tree entry that owns the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`parentEntry`](/server-editor/interfaces/ICollectionTreeEntryItem.md#parententry) *** ### type > `readonly` **type**: [`CollectionTreeEntryItemType`](/server-editor/enums/CollectionTreeEntryItemType.md) **`Beta`** #### Remarks Type of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`type`](/server-editor/interfaces/ICollectionTreeEntryItem.md#type) *** ### value > `readonly` **value**: `string` **`Beta`** #### Remarks Value of the entry item. *** ### visible > `readonly` **visible**: `boolean` **`Beta`** #### Remarks Visibility state of the entry. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`visible`](/server-editor/interfaces/ICollectionTreeEntryItem.md#visible) ## Methods ### setEnabled() > **setEnabled**(`enabled`): `void` **`Beta`** #### Parameters ##### enabled `boolean` New value. #### Returns `void` #### Remarks Updates enabled state of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setEnabled`](/server-editor/interfaces/ICollectionTreeEntryItem.md#setenabled) *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setTitle`](/server-editor/interfaces/ICollectionTreeEntryItem.md#settitle) *** ### setTooltip() > **setTooltip**(`title`): `void` **`Beta`** #### Parameters ##### title [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` #### Returns `void` #### Remarks Updates tooltip of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setTooltip`](/server-editor/interfaces/ICollectionTreeEntryItem.md#settooltip) *** ### setVisible() > **setVisible**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New value. #### Returns `void` #### Remarks Updates visibility of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setVisible`](/server-editor/interfaces/ICollectionTreeEntryItem.md#setvisible) *** ### updateMenuOptions() > **updateMenuOptions**(`menuOptions`, `newValue?`): `void` **`Beta`** #### Parameters ##### menuOptions [`ICollectionTreeEntryDropdownItemMenuOption`](/server-editor/types/ICollectionTreeEntryDropdownItemMenuOption.md)\[] New list of updated menu options ##### newValue? `string` New value value to use for the dropdown #### Returns `void` #### Remarks Update list of dropdown menu options. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ICollectionTreeEntryItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ICollectionTreeEntryItem.md. # Interface: ICollectionTreeEntryItem **`Beta`** ## Extended by - [`ICollectionTreeEntryDropdownItem`](/server-editor/interfaces/ICollectionTreeEntryDropdownItem.md) - [`ICollectionTreeEntryNumberItem`](/server-editor/interfaces/ICollectionTreeEntryNumberItem.md) - [`ICollectionTreeEntryStringItem`](/server-editor/interfaces/ICollectionTreeEntryStringItem.md) ## Properties ### enabled > `readonly` **enabled**: `boolean` **`Beta`** #### Remarks Enabled state of the entry. *** ### parentEntry > `readonly` **parentEntry**: [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) **`Beta`** #### Remarks Tree entry that owns the item. *** ### type > `readonly` **type**: [`CollectionTreeEntryItemType`](/server-editor/enums/CollectionTreeEntryItemType.md) **`Beta`** #### Remarks Type of the item. *** ### visible > `readonly` **visible**: `boolean` **`Beta`** #### Remarks Visibility state of the entry. ## Methods ### setEnabled() > **setEnabled**(`enabled`): `void` **`Beta`** #### Parameters ##### enabled `boolean` New value. #### Returns `void` #### Remarks Updates enabled state of the item. *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the item. *** ### setTooltip() > **setTooltip**(`title`): `void` **`Beta`** #### Parameters ##### title [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` #### Returns `void` #### Remarks Updates tooltip of the item. *** ### setVisible() > **setVisible**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New value. #### Returns `void` #### Remarks Updates visibility of the item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ICollectionTreeEntryNumberItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ICollectionTreeEntryNumberItem.md. # Interface: ICollectionTreeEntryNumberItem **`Beta`** ## Extends - [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md) ## Properties ### enabled > `readonly` **enabled**: `boolean` **`Beta`** #### Remarks Enabled state of the entry. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`enabled`](/server-editor/interfaces/ICollectionTreeEntryItem.md#enabled) *** ### parentEntry > `readonly` **parentEntry**: [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) **`Beta`** #### Remarks Tree entry that owns the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`parentEntry`](/server-editor/interfaces/ICollectionTreeEntryItem.md#parententry) *** ### type > `readonly` **type**: [`CollectionTreeEntryItemType`](/server-editor/enums/CollectionTreeEntryItemType.md) **`Beta`** #### Remarks Type of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`type`](/server-editor/interfaces/ICollectionTreeEntryItem.md#type) *** ### value > `readonly` **value**: `number` **`Beta`** #### Remarks Value of the entry item. *** ### visible > `readonly` **visible**: `boolean` **`Beta`** #### Remarks Visibility state of the entry. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`visible`](/server-editor/interfaces/ICollectionTreeEntryItem.md#visible) ## Methods ### setEnabled() > **setEnabled**(`enabled`): `void` **`Beta`** #### Parameters ##### enabled `boolean` New value. #### Returns `void` #### Remarks Updates enabled state of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setEnabled`](/server-editor/interfaces/ICollectionTreeEntryItem.md#setenabled) *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setTitle`](/server-editor/interfaces/ICollectionTreeEntryItem.md#settitle) *** ### setTooltip() > **setTooltip**(`title`): `void` **`Beta`** #### Parameters ##### title [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` #### Returns `void` #### Remarks Updates tooltip of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setTooltip`](/server-editor/interfaces/ICollectionTreeEntryItem.md#settooltip) *** ### setVisible() > **setVisible**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New value. #### Returns `void` #### Remarks Updates visibility of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setVisible`](/server-editor/interfaces/ICollectionTreeEntryItem.md#setvisible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ICollectionTreeEntryStringItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ICollectionTreeEntryStringItem.md. # Interface: ICollectionTreeEntryStringItem **`Beta`** ## Extends - [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md) ## Properties ### enabled > `readonly` **enabled**: `boolean` **`Beta`** #### Remarks Enabled state of the entry. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`enabled`](/server-editor/interfaces/ICollectionTreeEntryItem.md#enabled) *** ### parentEntry > `readonly` **parentEntry**: [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) **`Beta`** #### Remarks Tree entry that owns the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`parentEntry`](/server-editor/interfaces/ICollectionTreeEntryItem.md#parententry) *** ### type > `readonly` **type**: [`CollectionTreeEntryItemType`](/server-editor/enums/CollectionTreeEntryItemType.md) **`Beta`** #### Remarks Type of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`type`](/server-editor/interfaces/ICollectionTreeEntryItem.md#type) *** ### value > `readonly` **value**: `string` **`Beta`** #### Remarks Value of the entry item. *** ### visible > `readonly` **visible**: `boolean` **`Beta`** #### Remarks Visibility state of the entry. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`visible`](/server-editor/interfaces/ICollectionTreeEntryItem.md#visible) ## Methods ### setEnabled() > **setEnabled**(`enabled`): `void` **`Beta`** #### Parameters ##### enabled `boolean` New value. #### Returns `void` #### Remarks Updates enabled state of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setEnabled`](/server-editor/interfaces/ICollectionTreeEntryItem.md#setenabled) *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setTitle`](/server-editor/interfaces/ICollectionTreeEntryItem.md#settitle) *** ### setTooltip() > **setTooltip**(`title`): `void` **`Beta`** #### Parameters ##### title [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` #### Returns `void` #### Remarks Updates tooltip of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setTooltip`](/server-editor/interfaces/ICollectionTreeEntryItem.md#settooltip) *** ### setVisible() > **setVisible**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New value. #### Returns `void` #### Remarks Updates visibility of the item. #### Inherited from [`ICollectionTreeEntryItem`](/server-editor/interfaces/ICollectionTreeEntryItem.md).[`setVisible`](/server-editor/interfaces/ICollectionTreeEntryItem.md#setvisible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ICollectionTreeFolder.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ICollectionTreeFolder.md. # Interface: ICollectionTreeFolder **`Beta`** Container for collection items ## Properties ### entryCount > `readonly` **entryCount**: `number` **`Beta`** #### Remarks Count of the entries *** ### expanded > `readonly` **expanded**: `boolean` **`Beta`** #### Remarks Expanded state of the folder *** ### folderCount > `readonly` **folderCount**: `number` **`Beta`** #### Remarks Count of the child folders *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier of the folder *** ### parent > `readonly` **parent**: `ICollectionTreeFolder` | `undefined` **`Beta`** #### Remarks Parent folder *** ### selected > `readonly` **selected**: `boolean` **`Beta`** #### Remarks Selected state of the folder *** ### title > `readonly` **title**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Title of the folder *** ### userData > `readonly` **userData**: `unknown` **`Beta`** #### Remarks User data associated with the folder ## Methods ### addEntry() > **addEntry**(`options`): [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) **`Beta`** #### Parameters ##### options [`ICollectionTreeEntryOptions`](/server-editor/types/ICollectionTreeEntryOptions.md) Options to create a folder #### Returns [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) #### Remarks Adds a new entry to the folder *** ### addFolder() > **addFolder**(`options`): `ICollectionTreeFolder` **`Beta`** #### Parameters ##### options [`ICollectionTreeFolderOptions`](/server-editor/types/ICollectionTreeFolderOptions.md) Options to create a folder #### Returns `ICollectionTreeFolder` #### Remarks Creates a new child folder *** ### forEachEntry() > **forEachEntry**(`callback`): `void` **`Beta`** #### Parameters ##### callback (`entry`, `index`) => `boolean` Returning false will stop the iteration #### Returns `void` #### Remarks Iterates over entries within the folder *** ### forEachFolder() #### Call Signature > **forEachFolder**(`callback`): `void` **`Beta`** ##### Parameters ###### callback (`folder`) => `boolean` Returning false will stop the iteration ##### Returns `void` ##### Remarks Iterates over the first layer of folders #### Call Signature > **forEachFolder**(`callback`): `void` **`Beta`** ##### Parameters ###### callback (`folder`) => `boolean` Returning false will stop the iteration ##### Returns `void` ##### Remarks Iterates over the first layer of folders *** ### getEntryById() > **getEntryById**(`id`): [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) | `undefined` **`Beta`** #### Parameters ##### id `string` Identifier of the folder #### Returns [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) | `undefined` #### Remarks Gets the entry by its unique identifier *** ### getEntryByIndex() > **getEntryByIndex**(`index`): [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) | `undefined` **`Beta`** #### Parameters ##### index `number` Index of the entry #### Returns [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) | `undefined` #### Remarks Gets the entry at the index *** ### getFolder() > **getFolder**(`id`): `ICollectionTreeFolder` | `undefined` **`Beta`** #### Parameters ##### id `string` Identifier of the folder #### Returns `ICollectionTreeFolder` | `undefined` #### Remarks Find the folder with the id if it exists *** ### removeEntryById() > **removeEntryById**(`id`): `boolean` **`Beta`** #### Parameters ##### id `string` Identifier of the folder #### Returns `boolean` #### Remarks Removes the entry by its unique identifier if it exists *** ### removeEntryByIndex() > **removeEntryByIndex**(`index`): `boolean` **`Beta`** #### Parameters ##### index `number` Index of the entry #### Returns `boolean` #### Remarks Removes the entry at the index if it exists *** ### removeFolder() > **removeFolder**(`id`): `boolean` **`Beta`** #### Parameters ##### id `string` Identifier of the folder #### Returns `boolean` #### Remarks Removes the folder with the id if it exists at the root *** ### setColor() > **setColor**(`color`): `void` **`Beta`** #### Parameters ##### color `any` New color state #### Returns `void` #### Remarks Set color of the entry. *** ### setExpanded() > **setExpanded**(`expanded`): `void` **`Beta`** #### Parameters ##### expanded `boolean` New expanded state #### Returns `void` #### Remarks Set expanded state of the entry. *** ### setHeaderAction() > **setHeaderAction**(`actionParams`): `void` **`Beta`** #### Parameters ##### actionParams [`ICollectionTreeFolderHeaderActionParams`](/server-editor/types/ICollectionTreeFolderHeaderActionParams.md) | `undefined` #### Returns `void` #### Remarks Updates the header action for the folder *** ### setMenu() > **setMenu**(`menu`): `void` **`Beta`** #### Parameters ##### menu [`IMenuCreationParams`](/server-editor/interfaces/IMenuCreationParams.md)\[] | `undefined` New menu items #### Returns `void` #### Remarks Updates menu items for the folder *** ### setSelected() > **setSelected**(`selected`): `void` **`Beta`** #### Parameters ##### selected `boolean` New selected state #### Returns `void` #### Remarks Set selected state of the entry. *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) New title state #### Returns `void` #### Remarks Set title of the entry. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ICollectionTreePropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ICollectionTreePropertyItem.md. # Interface: ICollectionTreePropertyItem **`Beta`** A property item which supports creating nested folders of collection items ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### canDragDropEntries > `readonly` **canDragDropEntries**: `boolean` **`Beta`** #### Remarks Drag and drop support for the entries *** ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### folderCount > `readonly` **folderCount**: `number` **`Beta`** #### Remarks Count of the child folders *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### viewControlPane > `readonly` **viewControlPane**: [`IListViewControlPane`](/server-editor/interfaces/IListViewControlPane.md) | `undefined` **`Beta`** #### Remarks View control pane for the collection tree *** ### viewSortType > `readonly` **viewSortType**: [`CollectionTreeSortType`](/server-editor/enums/CollectionTreeSortType.md) **`Beta`** #### Remarks Sort type for the folders. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addFolder() > **addFolder**(`options`): [`ICollectionTreeFolder`](/server-editor/interfaces/ICollectionTreeFolder.md) **`Beta`** #### Parameters ##### options [`ICollectionTreeFolderOptions`](/server-editor/types/ICollectionTreeFolderOptions.md) Options to create a folder #### Returns [`ICollectionTreeFolder`](/server-editor/interfaces/ICollectionTreeFolder.md) #### Remarks Creates a new folder at the root of the collection *** ### buildViewControl() > **buildViewControl**(`options`): [`IListViewControlPane`](/server-editor/interfaces/IListViewControlPane.md) **`Beta`** #### Parameters ##### options [`ICollectionTreeViewControlPaneOptions`](/server-editor/interfaces/ICollectionTreeViewControlPaneOptions.md) #### Returns [`IListViewControlPane`](/server-editor/interfaces/IListViewControlPane.md) #### Remarks Creates a pane that displays view and filtering configurations for the collection tree if the parent container supports it. *** ### forEachFolder() > **forEachFolder**(`callback`): `void` **`Beta`** #### Parameters ##### callback (`folder`) => `boolean` Returning false will stop the iteration #### Returns `void` #### Remarks Iterates over the first layer of folders *** ### getFolder() > **getFolder**(`id`): [`ICollectionTreeFolder`](/server-editor/interfaces/ICollectionTreeFolder.md) | `undefined` **`Beta`** #### Parameters ##### id `string` Identifier of the folder #### Returns [`ICollectionTreeFolder`](/server-editor/interfaces/ICollectionTreeFolder.md) | `undefined` #### Remarks Find the folder with the id if it exists at the root *** ### removeFolder() > **removeFolder**(`id`): `boolean` **`Beta`** #### Parameters ##### id `string` Identifier of the folder #### Returns `boolean` #### Remarks Removes the folder with the id if it exists at the root *** ### setCanDragDropEntries() > **setCanDragDropEntries**(`enabled`): `void` **`Beta`** #### Parameters ##### enabled `boolean` Whether to enable drag and drop #### Returns `void` #### Remarks Toggles drag and drop support for the entries *** ### setViewSortType() > **setViewSortType**(`sortType`): `void` **`Beta`** #### Parameters ##### sortType [`CollectionTreeSortType`](/server-editor/enums/CollectionTreeSortType.md) | `undefined` New sort type #### Returns `void` #### Remarks Updates the folder sort type for the whole view [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ICollectionTreePropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ICollectionTreePropertyItemOptions.md. # Interface: ICollectionTreePropertyItemOptions **`Beta`** Optional properties for Collection Tree Pane property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### canDragDropEntries? > `optional` **canDragDropEntries?**: `boolean` **`Beta`** #### Remarks Setting true will enable drag and drop support for entries. *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### viewSortType? > `optional` **viewSortType?**: [`CollectionTreeSortType`](/server-editor/enums/CollectionTreeSortType.md) **`Beta`** #### Remarks Custom sort type for folders view. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ICollectionTreeViewControlPaneOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ICollectionTreeViewControlPaneOptions.md. # Interface: ICollectionTreeViewControlPaneOptions **`Beta`** ## Extends - [`IListViewControlPaneOptions`](/server-editor/interfaces/IListViewControlPaneOptions.md) ## Properties ### actions? > `optional` **actions?**: [`ListViewControlAction`](/server-editor/types/ListViewControlAction.md)\[] **`Beta`** #### Remarks Default actions #### Inherited from [`IListViewControlPaneOptions`](/server-editor/interfaces/IListViewControlPaneOptions.md).[`actions`](/server-editor/interfaces/IListViewControlPaneOptions.md#actions) *** ### onActionClicked? > `optional` **onActionClicked?**: (`id`) => `void` **`Beta`** #### Parameters ##### id `string` #### Returns `void` #### Remarks This function will be called whenever user clicks an action #### Inherited from [`IListViewControlPaneOptions`](/server-editor/interfaces/IListViewControlPaneOptions.md).[`onActionClicked`](/server-editor/interfaces/IListViewControlPaneOptions.md#onactionclicked) *** ### onFilterChanged? > `optional` **onFilterChanged?**: (`visibleFolders`) => `void` **`Beta`** #### Parameters ##### visibleFolders `string`\[] #### Returns `void` #### Remarks This function will be called whenever the filter is changed by the user *** ### sortOptions? > `optional` **sortOptions?**: [`CollectionTreeSortType`](/server-editor/enums/CollectionTreeSortType.md)\[] **`Beta`** #### Remarks Custom sort options. If undefined, collection tree sort options will be used. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state. It undefined, it will be false. #### Inherited from [`IListViewControlPaneOptions`](/server-editor/interfaces/IListViewControlPaneOptions.md).[`visible`](/server-editor/interfaces/IListViewControlPaneOptions.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IColorPickerPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IColorPickerPropertyItem.md. # Interface: IColorPickerPropertyItem **`Beta`** A property item which supports Color Picker properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `RGBA` **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New tooltip. #### Returns `void` #### Remarks Updates tooltip of the property item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IColorPickerPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IColorPickerPropertyItemOptions.md. # Interface: IColorPickerPropertyItemOptions **`Beta`** Optional properties for Color Picker property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### hiddenAlpha? > `optional` **hiddenAlpha?**: `boolean` **`Beta`** #### Remarks If true alpha control will be hidden. If undefined, it will default to false. *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. It will be visible by default. *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`) => `void` **`Beta`** #### Parameters ##### newValue `RGBA` ##### oldValue `RGBA` #### Returns `void` #### Remarks This callback is called when UI control value is changed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### tooltip? > `optional` **tooltip?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### variant? > `optional` **variant?**: [`ColorPickerPropertyItemVariant`](/server-editor/enums/ColorPickerPropertyItemVariant.md) **`Beta`** #### Remarks The variant for the button. By default it is Primary. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IColorTimelinePropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IColorTimelinePropertyItem.md. # Interface: IColorTimelinePropertyItem **`Beta`** A property item which supports Color Timeline properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addNode() > **addNode**(`data`): `void` **`Beta`** #### Parameters ##### data [`IColorTimelinePropertyItemEntry`](/server-editor/interfaces/IColorTimelinePropertyItemEntry.md) New color node. #### Returns `void` #### Remarks Update color timeline entry *** ### getData() > **getData**(): [`IColorTimelinePropertyItemEntry`](/server-editor/interfaces/IColorTimelinePropertyItemEntry.md)\[] **`Beta`** #### Returns [`IColorTimelinePropertyItemEntry`](/server-editor/interfaces/IColorTimelinePropertyItemEntry.md)\[] #### Remarks Get the list of nodes in the property item. *** ### getTime() > **getTime**(): `number` **`Beta`** #### Returns `number` #### Remarks Get time current time value on the slider. *** ### removeNode() > **removeNode**(`data`): `void` **`Beta`** #### Parameters ##### data [`IColorTimelinePropertyItemEntry`](/server-editor/interfaces/IColorTimelinePropertyItemEntry.md) Node to be removed. #### Returns `void` #### Remarks Remove color node *** ### setPrecision() > **setPrecision**(`precision`): `void` **`Beta`** #### Parameters ##### precision `number` #### Returns `void` #### Remarks Set custom decimal precision for the calculations *** ### setTime() > **setTime**(`time`): `void` **`Beta`** #### Parameters ##### time `number` The new time value. #### Returns `void` #### Remarks Set time line slider value to a new value *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### updateNode() > **updateNode**(`data`): `void` **`Beta`** #### Parameters ##### data [`IColorTimelinePropertyItemEntry`](/server-editor/interfaces/IColorTimelinePropertyItemEntry.md) Node to be updated. #### Returns `void` #### Remarks Update node value [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IColorTimelinePropertyItemEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IColorTimelinePropertyItemEntry.md. # Interface: IColorTimelinePropertyItemEntry **`Beta`** Properties of color timeline property item entry ## Properties ### id > **id**: `string` **`Beta`** *** ### time > **time**: `number` **`Beta`** *** ### value > **value**: `RGBA` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IColorTimelinePropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IColorTimelinePropertyItemOptions.md. # Interface: IColorTimelinePropertyItemOptions **`Beta`** Optional properties for Color Timeline property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### decimalPrecision? > `optional` **decimalPrecision?**: `number` **`Beta`** #### Remarks Custom precision for the calculations *** ### disableAddRemoveNodes? > `optional` **disableAddRemoveNodes?**: `boolean` **`Beta`** #### Remarks If true, nodes cannot be added or removed *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### entries? > `optional` **entries?**: [`IColorTimelinePropertyItemEntry`](/server-editor/interfaces/IColorTimelinePropertyItemEntry.md)\[] **`Beta`** #### Remarks List of nodes entries in the color timeline. *** ### isGraphReadOnly? > `optional` **isGraphReadOnly?**: `boolean` **`Beta`** #### Remarks True means nodes cannot be dragged or modified *** ### onNodeAdded? > `optional` **onNodeAdded?**: (`node`) => `void` **`Beta`** #### Parameters ##### node [`IColorTimelinePropertyItemEntry`](/server-editor/interfaces/IColorTimelinePropertyItemEntry.md) #### Returns `void` #### Remarks Callback triggered when a new RGBA node is added to the timeline. *** ### onNodeChanged? > `optional` **onNodeChanged?**: (`node`) => `void` **`Beta`** #### Parameters ##### node [`IColorTimelinePropertyItemEntry`](/server-editor/interfaces/IColorTimelinePropertyItemEntry.md) #### Returns `void` #### Remarks Callback triggered when a timeline node's RGBA value changes. *** ### onNodeRemoved? > `optional` **onNodeRemoved?**: (`node`) => `void` **`Beta`** #### Parameters ##### node [`IColorTimelinePropertyItemEntry`](/server-editor/interfaces/IColorTimelinePropertyItemEntry.md) #### Returns `void` #### Remarks Callback triggered when an RGBA node is removed from the timeline. \* *** ### onTimeChanged? > `optional` **onTimeChanged?**: (`current`, `prev`) => `void` **`Beta`** #### Parameters ##### current `number` ##### prev `number` #### Returns `void` #### Remarks This callback is called when UI control time is changed. *** ### renderGradientBackground? > `optional` **renderGradientBackground?**: `boolean` **`Beta`** #### Remarks Flag that enables gradient background color on the timeline to be rendered, default is true *** ### showAlpha? > `optional` **showAlpha?**: `boolean` **`Beta`** #### Remarks False means the alpha elements will not be shown in the color picker *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IComboBoxPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IComboBoxPropertyItem.md. # Interface: IComboBoxPropertyItem **`Beta`** A property item which supports Combo Box properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `string` **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` New tooltip. #### Returns `void` #### Remarks Updates tooltip of the property item. *** ### updateEntries() > **updateEntries**(`entries`, `newValue?`): `void` **`Beta`** #### Parameters ##### entries [`IComboBoxPropertyItemEntry`](/server-editor/interfaces/IComboBoxPropertyItemEntry.md)\[] | `undefined` New list of updated entries. ##### newValue? `string` New value to use for the combo box. #### Returns `void` #### Remarks Update list of combo box entries. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IComboBoxPropertyItemEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IComboBoxPropertyItemEntry.md. # Interface: IComboBoxPropertyItemEntry **`Beta`** Properties of toggle group property item list entry ## Properties ### label? > `readonly` `optional` **label?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized display text of the entry. *** ### value > `readonly` **value**: `string` **`Beta`** #### Remarks The selectable value of the entry. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IComboBoxPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IComboBoxPropertyItemOptions.md. # Interface: IComboBoxPropertyItemOptions **`Beta`** Optional properties for ComboBox property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### dataType? > `optional` **dataType?**: [`ComboBoxPropertyItemDataType`](/server-editor/enums/ComboBoxPropertyItemDataType.md) **`Beta`** #### Remarks Possible data types supported by combo box. If undefined, it will be Custom by default. *** ### defaultValue? > `optional` **defaultValue?**: `string` **`Beta`** #### Remarks Default value to fall back to if entry is not found. If undefined, data type will determine the default value (empty string for Custom data type). *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### entries? > `optional` **entries?**: [`IComboBoxPropertyItemEntry`](/server-editor/interfaces/IComboBoxPropertyItemEntry.md)\[] **`Beta`** #### Remarks List of combo box entries. If undefined, data type will determine the default list (empty list for Custom data type). *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. It will be visible by default. *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`) => `void` **`Beta`** #### Parameters ##### newValue `string` ##### oldValue `string` #### Returns `void` #### Remarks This callback is called when UI control value is changed. *** ### showImage? > `optional` **showImage?**: `boolean` **`Beta`** #### Remarks If true the image for the selected value will be displayed (if data type supports it). If undefined, it will default to false. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IContentBadgeManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IContentBadgeManager.md. # Interface: IContentBadgeManager **`Beta`** ## Methods ### registerBadge() > **registerBadge**(`id`, `iteration?`): `void` **`Beta`** #### Parameters ##### id `string` The badge identifier ##### iteration? `number` The iteration number (default: 0) #### Returns `void` #### Remarks Register a badge to highlight a content. *** ### unregisterBadge() > **unregisterBadge**(`id`): `void` **`Beta`** #### Parameters ##### id `string` The badge identifier to unregister #### Returns `void` #### Remarks Unregister a badge. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IDataTablePropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IDataTablePropertyItem.md. # Interface: IDataTablePropertyItem **`Beta`** A property item which supports data entries displayed in a table ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### updateEntries() > **updateEntries**(`data`): `void` **`Beta`** #### Parameters ##### data [`IDataTablePropertyItemEntry`](/server-editor/interfaces/IDataTablePropertyItemEntry.md)\[]\[] New data entries. #### Returns `void` #### Remarks Update table entries *** ### updateEntry() > **updateEntry**(`data`, `row`, `column`): `void` **`Beta`** #### Parameters ##### data [`IDataTablePropertyItemEntry`](/server-editor/interfaces/IDataTablePropertyItemEntry.md) New data entry. ##### row `number` Cell row index. ##### column `number` Cell column index. #### Returns `void` #### Remarks Update table cell entry *** ### updateRow() > **updateRow**(`data`, `row`): `void` **`Beta`** #### Parameters ##### data [`IDataTablePropertyItemEntry`](/server-editor/interfaces/IDataTablePropertyItemEntry.md)\[] New data entries. ##### row `number` Cell row index. #### Returns `void` #### Remarks Update table row entries [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IDataTablePropertyItemEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IDataTablePropertyItemEntry.md. # Interface: IDataTablePropertyItemEntry **`Beta`** Properties of data table property item menu entry ## Properties ### image? > `optional` **image?**: [`ImageResourceData`](/server-editor/types/ImageResourceData.md) **`Beta`** *** ### text? > `optional` **text?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IDataTablePropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IDataTablePropertyItemOptions.md. # Interface: IDataTablePropertyItemOptions **`Beta`** Properties of data table item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### entries? > `optional` **entries?**: [`IDataTablePropertyItemEntry`](/server-editor/interfaces/IDataTablePropertyItemEntry.md)\[]\[] **`Beta`** #### Remarks List of default data table entries *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IDisposable.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IDisposable.md. # Interface: IDisposable **`Beta`** Simple abstraction for disposable objects. ## Methods ### teardown() > **teardown**(): `void` **`Beta`** #### Returns `void` #### Remarks Initiates the teardown and cleanup of this disposable item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IDividerPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IDividerPropertyItemOptions.md. # Interface: IDividerPropertyItemOptions **`Beta`** Optional properties for Divider property item ## Properties ### vertical? > `optional` **vertical?**: `boolean` **`Beta`** #### Remarks If true, renders the divider as a vertical line rather than horizontal. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IDropdownPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IDropdownPropertyItem.md. # Interface: IDropdownPropertyItem **`Beta`** A property item which supports Dropdown properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `number` **`Beta`** #### Remarks Current selected entry value of the property item list. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### getEntryByIndex() > **getEntryByIndex**(`index`): [`IDropdownPropertyItemEntry`](/server-editor/interfaces/IDropdownPropertyItemEntry.md) | `undefined` **`Beta`** #### Parameters ##### index `number` Index of the dropdown entry in the list. #### Returns [`IDropdownPropertyItemEntry`](/server-editor/interfaces/IDropdownPropertyItemEntry.md) | `undefined` #### Remarks Find a dropdown entry at an index in the dropdown list. *** ### getEntryByValue() > **getEntryByValue**(`value`): [`IDropdownPropertyItemEntry`](/server-editor/interfaces/IDropdownPropertyItemEntry.md) | `undefined` **`Beta`** #### Parameters ##### value `number` Value of the dropdown entry in the list. #### Returns [`IDropdownPropertyItemEntry`](/server-editor/interfaces/IDropdownPropertyItemEntry.md) | `undefined` #### Remarks Find a dropdown entry with a specific value associated with property item. *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` New tooltip. #### Returns `void` #### Remarks Updates tooltip of the property item. *** ### updateEntries() > **updateEntries**(`entries`, `newValue?`): `void` **`Beta`** #### Parameters ##### entries [`IDropdownPropertyItemEntry`](/server-editor/interfaces/IDropdownPropertyItemEntry.md)\[] New list of updated entries. ##### newValue? `number` New value value to use for the dropdown. #### Returns `void` #### Remarks Update list of dropdown entries. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IDropdownPropertyItemEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IDropdownPropertyItemEntry.md. # Interface: IDropdownPropertyItemEntry **`Beta`** Properties of dropdown property item menu entry ## Properties ### imageData? > `readonly` `optional` **imageData?**: [`ImageResourceData`](/server-editor/types/ImageResourceData.md) **`Beta`** #### Remarks Optional image of the dropdown entry. *** ### label > `readonly` **label**: `string` **`Beta`** #### Remarks Localized display text of the entry. *** ### value > `readonly` **value**: `number` **`Beta`** #### Remarks The selectable value of the entry. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IDropdownPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IDropdownPropertyItemOptions.md. # Interface: IDropdownPropertyItemOptions **`Beta`** Optional properties for Dropdown property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### entries? > `optional` **entries?**: [`IDropdownPropertyItemEntry`](/server-editor/interfaces/IDropdownPropertyItemEntry.md)\[] **`Beta`** #### Remarks List of dropdown entries associated with the property item. If undefined, list will be empty. *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. It will be visible by default. *** ### inlineLabel? > `optional` **inlineLabel?**: `boolean` **`Beta`** #### Remarks Displays label inline. If undefined, it will be true. *** ### maxVisibleEntries? > `optional` **maxVisibleEntries?**: `number` **`Beta`** #### Remarks Determines how many entries can be displayed before scrolling is enabled, based on available space. *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`, `items`) => `void` **`Beta`** #### Parameters ##### newValue `number` ##### oldValue `number` ##### items [`IDropdownPropertyItemEntry`](/server-editor/interfaces/IDropdownPropertyItemEntry.md)\[] #### Returns `void` #### Remarks This callback is called when UI control value is changed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IEventToken.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IEventToken.md. # Interface: IEventToken **`Beta`** Returned from an event subscription. Provides functionality for cleaning up listeners ## Methods ### unsubscribe() > **unsubscribe**(): `void` **`Beta`** #### Returns `void` #### Remarks Removes registered listener from an event [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IGlobalInputManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IGlobalInputManager.md. # Interface: IGlobalInputManager **`Beta`** ## Methods ### registerBindingCategory() > **registerBindingCategory**(`id`, `label`, `order`): `void` **`Beta`** #### Parameters ##### id `string` Unique category identifier (use a [CoreInputBindingCategory](/server-editor/enums/CoreInputBindingCategory.md) value or a custom string). ##### label `string` Localized display name shown as the group heading. ##### order `number` Numeric sort order; lower values appear first. #### Returns `void` #### Remarks Register a named control category for display in the Control Help panel. *** ### registerKeyBinding() > **registerKeyBinding**(`inputContextId`, `action`, `binding`, `info?`): [`IRegisteredKeyBinding`](/server-editor/interfaces/IRegisteredKeyBinding.md) **`Beta`** #### Parameters ##### inputContextId [`EditorInputContext`](/server-editor/enums/EditorInputContext.md) Id of the UI context to handle this binding. ##### action [`SupportedKeyboardActionTypes`](/server-editor/types/SupportedKeyboardActionTypes.md) Action to register the binding for. ##### binding [`KeyBinding`](/server-editor/types/KeyBinding.md) Keyboard binding to invoke action. ##### info? [`KeyBindingInfo`](/server-editor/types/KeyBindingInfo.md) Additional information about key binding. #### Returns [`IRegisteredKeyBinding`](/server-editor/interfaces/IRegisteredKeyBinding.md) #### Remarks Register a key press binding for an action which will be handled by the specified input context. *** ### setMouseIcon() > **setMouseIcon**(`contextId`, `mouseIcon`): `void` **`Beta`** #### Parameters ##### contextId [`EditorInputContext`](/server-editor/enums/EditorInputContext.md) The editor input context id (maps to EditorInputContext). ##### mouseIcon [`MouseCursorIconType`](/server-editor/enums/MouseCursorIconType.md) | `undefined` The MouseCursorIconType, or null to clear. #### Returns `void` #### Remarks Set or clear the mouse cursor icon for a given editor input context layer. #### Throws - [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IImagePropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IImagePropertyItem.md. # Interface: IImagePropertyItem **`Beta`** A property item which supports Image properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### imageHeight > `readonly` **imageHeight**: `number` **`Beta`** #### Remarks Height of the image. *** ### imageWidth > `readonly` **imageWidth**: `number` **`Beta`** #### Remarks Width of the image. *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `Readonly`\<`string` | [`ImageResourceData`](/server-editor/types/ImageResourceData.md)> **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### resizeImage() > **resizeImage**(`width`, `height`): `void` **`Beta`** #### Parameters ##### width `number` New width of the image. ##### height `number` New height of the image. #### Returns `void` #### Remarks Updates the size of the image. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IImagePropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IImagePropertyItemOptions.md. # Interface: IImagePropertyItemOptions **`Beta`** Optional properties for Image property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### alignment? > `optional` **alignment?**: [`LayoutAlignment`](/server-editor/enums/LayoutAlignment.md) **`Beta`** #### Remarks Alignment of the image in the container. If not defined, LayoutAlignment.Start is used. *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### imageSize? > `optional` **imageSize?**: `number` | \{ `height`: `number`; `width`: `number`; } **`Beta`** #### Remarks Size of the image. If undefined, defaults to 10. *** ### onClick? > `optional` **onClick?**: (`x`, `y`) => `void` **`Beta`** #### Parameters ##### x `number` ##### y `number` #### Returns `void` #### Remarks Called when image is clicked. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IIntroductionPane.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IIntroductionPane.md. # Interface: IIntroductionPane **`Beta`** A root pane that can store property items. ## Extends - [`IPane`](/server-editor/interfaces/IPane.md) ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`id`](/server-editor/interfaces/IPane.md#id) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks Check visibility of the pane #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`visible`](/server-editor/interfaces/IPane.md#visible) ## Methods ### addTab() > **addTab**(`props`): [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) **`Beta`** #### Parameters ##### props [`IntroductionPaneTabProps`](/server-editor/interfaces/IntroductionPaneTabProps.md) #### Returns [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) #### Remarks Adds a new tab to the introduction pane *** ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`hide`](/server-editor/interfaces/IPane.md#hide) *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the pane and all of its items. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`show`](/server-editor/interfaces/IPane.md#show) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IIntroductionPaneOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IIntroductionPaneOptions.md. # Interface: IIntroductionPaneOptions **`Beta`** The options to create introduction pane. ## Extends - [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md) ## Properties ### infoTooltip? > `optional` **infoTooltip?**: [`TooltipInteractiveContent`](/server-editor/types/TooltipInteractiveContent.md) **`Beta`** #### Remarks Optional information tooltip for the pane to be displayed on the header. #### Inherited from [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md).[`infoTooltip`](/server-editor/interfaces/IPropertyPaneOptions.md#infotooltip) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property pane #### Overrides [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md).[`title`](/server-editor/interfaces/IPropertyPaneOptions.md#title) *** ### uniqueId? > `optional` **uniqueId?**: `string` **`Beta`** #### Remarks Unique identifier for the pane #### Overrides [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md).[`uniqueId`](/server-editor/interfaces/IPropertyPaneOptions.md#uniqueid) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ILinkPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ILinkPropertyItem.md. # Interface: ILinkPropertyItem **`Beta`** A property item which supports Link properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `string` **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` #### Returns `void` #### Remarks Sets title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` #### Returns `void` #### Remarks Sets tooltip description of the property item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ILinkPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ILinkPropertyItemOptions.md. # Interface: ILinkPropertyItemOptions **`Beta`** Optional properties for Link property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### hideIcon? > `optional` **hideIcon?**: `boolean` **`Beta`** #### Remarks Hides the link icon. If undefined, it will default to false. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the text item. *** ### tooltip? > `optional` **tooltip?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Tooltip description of the property item *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListPaneBoolEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListPaneBoolEntry.md. # Interface: IListPaneBoolEntry **`Beta`** List Pane button entry ## Extends - [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md) ## Properties ### enabled > `readonly` **enabled**: `boolean` **`Beta`** #### Remarks Enabled state of the entry. *** ### index > `readonly` **index**: `number` **`Beta`** #### Remarks Sequence index of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`index`](/server-editor/interfaces/IListPaneEntry.md#index) *** ### slot > `readonly` **slot**: [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) **`Beta`** #### Remarks Slot that owns the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`slot`](/server-editor/interfaces/IListPaneEntry.md#slot) *** ### type > `readonly` **type**: [`ListPaneEntryType`](/server-editor/enums/ListPaneEntryType.md) **`Beta`** #### Remarks Type of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`type`](/server-editor/interfaces/IListPaneEntry.md#type) *** ### value > `readonly` **value**: `boolean` **`Beta`** #### Remarks Value of the entry. *** ### visible > `readonly` **visible**: `boolean` **`Beta`** #### Remarks Visibility state of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`visible`](/server-editor/interfaces/IListPaneEntry.md#visible) ## Methods ### setEnabled() > **setEnabled**(`enabled`): `void` **`Beta`** #### Parameters ##### enabled `true` New enabled state. #### Returns `void` #### Remarks Updates enabled state of the entry. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) New tooltip. #### Returns `void` #### Remarks Updates tooltip of the entry. *** ### setValue() > **setValue**(`value`): `void` **`Beta`** #### Parameters ##### value `boolean` New value. #### Returns `void` #### Remarks Updates value of the entry. *** ### setVisible() > **setVisible**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New value. #### Returns `void` #### Remarks Updates visibility of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`setVisible`](/server-editor/interfaces/IListPaneEntry.md#setvisible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListPaneButtonEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListPaneButtonEntry.md. # Interface: IListPaneButtonEntry **`Beta`** List Pane button entry ## Extends - [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md) ## Properties ### enabled > `readonly` **enabled**: `boolean` **`Beta`** #### Remarks Enabled state of the entry. *** ### index > `readonly` **index**: `number` **`Beta`** #### Remarks Sequence index of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`index`](/server-editor/interfaces/IListPaneEntry.md#index) *** ### slot > `readonly` **slot**: [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) **`Beta`** #### Remarks Slot that owns the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`slot`](/server-editor/interfaces/IListPaneEntry.md#slot) *** ### type > `readonly` **type**: [`ListPaneEntryType`](/server-editor/enums/ListPaneEntryType.md) **`Beta`** #### Remarks Type of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`type`](/server-editor/interfaces/IListPaneEntry.md#type) *** ### visible > `readonly` **visible**: `boolean` **`Beta`** #### Remarks Visibility state of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`visible`](/server-editor/interfaces/IListPaneEntry.md#visible) ## Methods ### setEnabled() > **setEnabled**(`enabled`): `void` **`Beta`** #### Parameters ##### enabled `true` New enabled state. #### Returns `void` #### Remarks Updates enabled state of the entry. *** ### setIcon() > **setIcon**(`icon`): `void` **`Beta`** #### Parameters ##### icon `string` New icon. #### Returns `void` #### Remarks Updates icon of the entry. *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title `string` New title. #### Returns `void` #### Remarks Updates title of the entry. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) New tooltip. #### Returns `void` #### Remarks Updates tooltip of the entry. *** ### setVisible() > **setVisible**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New value. #### Returns `void` #### Remarks Updates visibility of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`setVisible`](/server-editor/interfaces/IListPaneEntry.md#setvisible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListPaneEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListPaneEntry.md. # Interface: IListPaneEntry **`Beta`** List Pane entry ## Extended by - [`IListPaneBoolEntry`](/server-editor/interfaces/IListPaneBoolEntry.md) - [`IListPaneButtonEntry`](/server-editor/interfaces/IListPaneButtonEntry.md) - [`IListPaneImageEntry`](/server-editor/interfaces/IListPaneImageEntry.md) - [`IListPaneTextEntry`](/server-editor/interfaces/IListPaneTextEntry.md) ## Properties ### index > `readonly` **index**: `number` **`Beta`** #### Remarks Sequence index of the entry. *** ### slot > `readonly` **slot**: [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) **`Beta`** #### Remarks Slot that owns the entry. *** ### type > `readonly` **type**: [`ListPaneEntryType`](/server-editor/enums/ListPaneEntryType.md) **`Beta`** #### Remarks Type of the entry. *** ### visible > `readonly` **visible**: `boolean` **`Beta`** #### Remarks Visibility state of the entry. ## Methods ### setVisible() > **setVisible**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New value. #### Returns `void` #### Remarks Updates visibility of the entry. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListPaneImageEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListPaneImageEntry.md. # Interface: IListPaneImageEntry **`Beta`** List Pane image entry ## Extends - [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md) ## Properties ### index > `readonly` **index**: `number` **`Beta`** #### Remarks Sequence index of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`index`](/server-editor/interfaces/IListPaneEntry.md#index) *** ### slot > `readonly` **slot**: [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) **`Beta`** #### Remarks Slot that owns the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`slot`](/server-editor/interfaces/IListPaneEntry.md#slot) *** ### type > `readonly` **type**: [`ListPaneEntryType`](/server-editor/enums/ListPaneEntryType.md) **`Beta`** #### Remarks Type of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`type`](/server-editor/interfaces/IListPaneEntry.md#type) *** ### value > `readonly` **value**: `Readonly`\<[`ImageResourceData`](/server-editor/types/ImageResourceData.md)> **`Beta`** #### Remarks Value of the entry. *** ### visible > `readonly` **visible**: `boolean` **`Beta`** #### Remarks Visibility state of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`visible`](/server-editor/interfaces/IListPaneEntry.md#visible) ## Methods ### setValue() > **setValue**(`value`): `void` **`Beta`** #### Parameters ##### value [`ImageResourceData`](/server-editor/types/ImageResourceData.md) New value. #### Returns `void` #### Remarks Updates value of the entry. *** ### setVisible() > **setVisible**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New value. #### Returns `void` #### Remarks Updates visibility of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`setVisible`](/server-editor/interfaces/IListPaneEntry.md#setvisible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListPanePropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListPanePropertyItem.md. # Interface: IListPanePropertyItem **`Beta`** A property item which supports Sub Pane properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`IPane`](/server-editor/interfaces/IPane.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### slotCount > `readonly` **slotCount**: `number` **`Beta`** #### Remarks Count of the slots managed by the list. *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### viewControlPane > `readonly` **viewControlPane**: [`IListViewControlPane`](/server-editor/interfaces/IListViewControlPane.md) | `undefined` **`Beta`** #### Remarks View control pane for the list *** ### viewSortType > `readonly` **viewSortType**: [`ListPaneViewSortType`](/server-editor/enums/ListPaneViewSortType.md) **`Beta`** #### Remarks Current sorting type for the pane slots *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addSlot() > **addSlot**(`params`): [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) **`Beta`** #### Parameters ##### params [`ListPaneSlotCreationProps`](/server-editor/types/ListPaneSlotCreationProps.md) #### Returns [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) #### Remarks Adds a new slot to the list. *** ### buildViewControl() > **buildViewControl**(`options`): [`IListViewControlPane`](/server-editor/interfaces/IListViewControlPane.md) **`Beta`** #### Parameters ##### options [`IListPaneViewControlPaneOptions`](/server-editor/interfaces/IListPaneViewControlPaneOptions.md) #### Returns [`IListViewControlPane`](/server-editor/interfaces/IListViewControlPane.md) #### Remarks Creates a pane that displays view and filtering configurations for the list if the parent container supports it. *** ### getSlotById() > **getSlotById**(`id`): [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) | `undefined` **`Beta`** #### Parameters ##### id `string` Unique identifier of the slot. #### Returns [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) | `undefined` #### Remarks Finds the slot with the identifier. *** ### getSlotByIndex() > **getSlotByIndex**(`index`): [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) | `undefined` **`Beta`** #### Parameters ##### index `number` Index of the slot in the component list. #### Returns [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) | `undefined` #### Remarks Finds the slot with the index. *** ### getViewFilter() > **getViewFilter**(): [`ListPaneViewFilter`](/server-editor/types/ListPaneViewFilter.md) | `undefined` **`Beta`** #### Returns [`ListPaneViewFilter`](/server-editor/types/ListPaneViewFilter.md) | `undefined` Active view filter #### Remarks *** ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`hide`](/server-editor/interfaces/IPane.md#hide) *** ### removeSlot() > **removeSlot**(`id`): `void` **`Beta`** #### Parameters ##### id `string` Unique identifier of the slot. #### Returns `void` #### Remarks Removes the slot from the list. *** ### selectSlot() > **selectSlot**(`id`, `deselectOtherSlots?`): `void` **`Beta`** #### Parameters ##### id `string` Unique identifier of the slot. ##### deselectOtherSlots? `boolean` Deselects already selected slots if defined. #### Returns `void` #### Remarks Selects slot by id. *** ### setViewFilter() > **setViewFilter**(`filter`): `void` **`Beta`** #### Parameters ##### filter [`ListPaneViewFilter`](/server-editor/types/ListPaneViewFilter.md) | `undefined` Slots that don't match filter properties won't be included. #### Returns `void` #### Remarks Filters displaying slots to match the define properties *** ### setViewSortType() > **setViewSortType**(`sortType`): `void` **`Beta`** #### Parameters ##### sortType [`ListPaneViewSortType`](/server-editor/enums/ListPaneViewSortType.md) | `undefined` New sort type, it undefined Default will be used. #### Returns `void` #### Remarks Updates how slots will be sorted in the view *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the pane and all of its items. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`show`](/server-editor/interfaces/IPane.md#show) *** ### updateSlots() > **updateSlots**(`newSlots`): `void` **`Beta`** #### Parameters ##### newSlots [`ListPaneSlotCreationProps`](/server-editor/types/ListPaneSlotCreationProps.md)\[] Creation properties for the new slots. #### Returns `void` #### Remarks Updates all slots with the new list. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListPanePropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListPanePropertyItemOptions.md. # Interface: IListPanePropertyItemOptions **`Beta`** Optional properties for List Pane property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### defaultSlots? > `optional` **defaultSlots?**: [`ListPaneSlotCreationProps`](/server-editor/types/ListPaneSlotCreationProps.md)\[] **`Beta`** #### Remarks Default slots to initialize the list with. If undefined, the list will be empty. *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### fixedHeight? > `optional` **fixedHeight?**: `boolean` **`Beta`** #### Remarks If true, pane height will not change based on slot count. If undefined, it will default to false *** ### height? > `optional` **height?**: `number` **`Beta`** #### Remarks This will be the height of the list within the pane *** ### onSlotClicked? > `optional` **onSlotClicked?**: (`slot`) => `void` **`Beta`** #### Parameters ##### slot [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) #### Returns `void` #### Remarks This callback is fired whenever a clickable slot is pressed *** ### onSlotSelectionChange? > `optional` **onSlotSelectionChange?**: (`slot`, `state`) => `void` **`Beta`** #### Parameters ##### slot [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) ##### state `boolean` #### Returns `void` #### Remarks This callback is fired whenever selected state of a slot is changed *** ### slotConfig > **slotConfig**: [`ListPaneSlotConfiguration`](/server-editor/types/ListPaneSlotConfiguration.md) **`Beta`** #### Remarks Slot configuration for the list. The slot entry layout must be predefined, and using an incorrect layout while creating slots will throw an error. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### viewFilter? > `optional` **viewFilter?**: [`ListPaneViewFilter`](/server-editor/types/ListPaneViewFilter.md) **`Beta`** #### Remarks Filter properties for viewing subset of slots. *** ### viewSortType? > `optional` **viewSortType?**: [`ListPaneViewSortType`](/server-editor/enums/ListPaneViewSortType.md) **`Beta`** #### Remarks Sort type for the slots in the view. If undefined, default list order will be used. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListPaneSlot.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListPaneSlot.md. # Interface: IListPaneSlot **`Beta`** List Pane slot ## Properties ### entryCount > `readonly` **entryCount**: `number` **`Beta`** #### Remarks Count of entries. *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier of the slot. *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks Unique identifier of the parent pane. *** ### selected > `readonly` **selected**: `boolean` **`Beta`** #### Remarks Selected state of the slot. *** ### tags > `readonly` **tags**: readonly `string`\[] **`Beta`** #### Remarks List of tags associated with the slot. *** ### title > `readonly` **title**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Count of entries. ## Methods ### getEntry() > **getEntry**\<`K`>(`index`, `type?`): `K` _extends_ [`ListPaneEntryType`](/server-editor/enums/ListPaneEntryType.md) ? [`ListPaneEntryMap`](/server-editor/types/ListPaneEntryMap.md)\[`K`] : [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md) | `undefined` **`Beta`** #### Type Parameters ##### K `K` _extends_ [`ListPaneEntryType`](/server-editor/enums/ListPaneEntryType.md) | `undefined` = `undefined` #### Parameters ##### index `number` Sequence index of the entry in the slot. ##### type? `K` Optional type check for the entry. #### Returns `K` _extends_ [`ListPaneEntryType`](/server-editor/enums/ListPaneEntryType.md) ? [`ListPaneEntryMap`](/server-editor/types/ListPaneEntryMap.md)\[`K`] : [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md) | `undefined` #### Remarks Finds the entry with the index if it exists. *** ### getUserData() > **getUserData**(): `unknown` **`Beta`** #### Returns `unknown` User data associated with the slot. #### Remarks *** ### setSelected() > **setSelected**(`selected`): `void` **`Beta`** #### Parameters ##### selected `boolean` New selected state. #### Returns `void` #### Remarks Updates selected state of the slot. *** ### setTags() > **setTags**(`tags`): `void` **`Beta`** #### Parameters ##### tags `string`\[] | `undefined` New tag list. #### Returns `void` #### Remarks Updates tags of the slot. *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) New title. #### Returns `void` #### Remarks Updates title of the slot. *** ### setUserData() > **setUserData**(`data`): `void` **`Beta`** #### Parameters ##### data `unknown` New user data. #### Returns `void` #### Remarks Updates user data associated with the slot [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListPaneSlotOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListPaneSlotOptions.md. # Interface: IListPaneSlotOptions **`Beta`** List Pane slot optional properties ## Properties ### tags? > `optional` **tags?**: `string`\[] **`Beta`** #### Remarks List of tags associated with the slot. *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the slot. *** ### uniqueId? > `optional` **uniqueId?**: `string` **`Beta`** #### Remarks Unique identifier to use for the slot. *** ### userData? > `optional` **userData?**: `unknown` **`Beta`** #### Remarks Optional user data that can be associated with a slot. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListPaneTextEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListPaneTextEntry.md. # Interface: IListPaneTextEntry **`Beta`** List Pane text entry ## Extends - [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md) ## Properties ### index > `readonly` **index**: `number` **`Beta`** #### Remarks Sequence index of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`index`](/server-editor/interfaces/IListPaneEntry.md#index) *** ### slot > `readonly` **slot**: [`IListPaneSlot`](/server-editor/interfaces/IListPaneSlot.md) **`Beta`** #### Remarks Slot that owns the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`slot`](/server-editor/interfaces/IListPaneEntry.md#slot) *** ### type > `readonly` **type**: [`ListPaneEntryType`](/server-editor/enums/ListPaneEntryType.md) **`Beta`** #### Remarks Type of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`type`](/server-editor/interfaces/IListPaneEntry.md#type) *** ### value > `readonly` **value**: `Readonly`\<[`LocalizedString`](/server-editor/types/LocalizedString.md)> **`Beta`** #### Remarks Value of the entry. *** ### visible > `readonly` **visible**: `boolean` **`Beta`** #### Remarks Visibility state of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`visible`](/server-editor/interfaces/IListPaneEntry.md#visible) ## Methods ### setValue() > **setValue**(`value`): `void` **`Beta`** #### Parameters ##### value [`LocalizedString`](/server-editor/types/LocalizedString.md) New value. #### Returns `void` #### Remarks Updates value of the entry. *** ### setVisible() > **setVisible**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New value. #### Returns `void` #### Remarks Updates visibility of the entry. #### Inherited from [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md).[`setVisible`](/server-editor/interfaces/IListPaneEntry.md#setvisible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListPaneViewControlPaneOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListPaneViewControlPaneOptions.md. # Interface: IListPaneViewControlPaneOptions **`Beta`** ## Extends - [`IListViewControlPaneOptions`](/server-editor/interfaces/IListViewControlPaneOptions.md) ## Properties ### actions? > `optional` **actions?**: [`ListViewControlAction`](/server-editor/types/ListViewControlAction.md)\[] **`Beta`** #### Remarks Default actions #### Inherited from [`IListViewControlPaneOptions`](/server-editor/interfaces/IListViewControlPaneOptions.md).[`actions`](/server-editor/interfaces/IListViewControlPaneOptions.md#actions) *** ### filterFlags? > `optional` **filterFlags?**: [`ListViewControlFilterFlags`](/server-editor/enums/ListViewControlFilterFlags.md) **`Beta`** #### Remarks Flags to determine visible filters. If undefined it will be All. *** ### onActionClicked? > `optional` **onActionClicked?**: (`id`) => `void` **`Beta`** #### Parameters ##### id `string` #### Returns `void` #### Remarks This function will be called whenever user clicks an action #### Inherited from [`IListViewControlPaneOptions`](/server-editor/interfaces/IListViewControlPaneOptions.md).[`onActionClicked`](/server-editor/interfaces/IListViewControlPaneOptions.md#onactionclicked) *** ### onFilterChanged? > `optional` **onFilterChanged?**: (`visibleSlotIds`) => `void` **`Beta`** #### Parameters ##### visibleSlotIds `string`\[] #### Returns `void` #### Remarks This function will be called whenever the filter is changed by the user *** ### onShowOptionChanged? > `optional` **onShowOptionChanged?**: (`optionIndex`) => `void` **`Beta`** #### Parameters ##### optionIndex `number` #### Returns `void` #### Remarks Called when the user selects an entry in the "Show" dropdown. Receives the zero-based option index from the provided showOptions. *** ### renderInline? > `optional` **renderInline?**: `boolean` **`Beta`** #### Remarks When true, the view control renders inline at the bottom of the list element instead of in a footer. *** ### showOptions? > `optional` **showOptions?**: `object`\[] **`Beta`** #### label > **label**: [`LocalizedString`](/server-editor/types/LocalizedString.md) #### value > **value**: `number` #### Remarks Labels for the "Show" dropdown. When provided, a dropdown is shown and onShowOptionChanged is called with the selected index whenever the user changes the selection. *** ### sortOptions? > `optional` **sortOptions?**: [`ListPaneViewSortType`](/server-editor/enums/ListPaneViewSortType.md)\[] **`Beta`** #### Remarks Custom sort options. If undefined, list pane sort options will be used. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state. It undefined, it will be false. #### Inherited from [`IListViewControlPaneOptions`](/server-editor/interfaces/IListViewControlPaneOptions.md).[`visible`](/server-editor/interfaces/IListViewControlPaneOptions.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListViewControlPane.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListViewControlPane.md. # Interface: IListViewControlPane **`Beta`** ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier *** ### isFilterActive > `readonly` **isFilterActive**: `boolean` **`Beta`** #### Remarks Active state of the filter *** ### visible > `readonly` **visible**: `boolean` **`Beta`** #### Remarks Visible state of the pane ## Methods ### getActionState() > **getActionState**(`id`): [`ListViewControlActionState`](/server-editor/types/ListViewControlActionState.md) | `undefined` **`Beta`** #### Parameters ##### id `string` Identifier for the action #### Returns [`ListViewControlActionState`](/server-editor/types/ListViewControlActionState.md) | `undefined` #### Remarks Returns the state of an existing action *** ### setActionEnabledState() > **setActionEnabledState**(`id`, `enabled`): `void` **`Beta`** #### Parameters ##### id `string` Identifier for the action ##### enabled `boolean` New action enabled state #### Returns `void` #### Remarks Updates enabled state of the existing action *** ### setActionStates() > **setActionStates**(`newActions`): `void` **`Beta`** #### Parameters ##### newActions [`ListViewControlAction`](/server-editor/types/ListViewControlAction.md)\[] New actions #### Returns `void` #### Remarks Updates existing actions *** ### setVisible() > **setVisible**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New visibility state #### Returns `void` #### Remarks Updates visible state of the pane *** ### updateActionState() > **updateActionState**(`id`, `newState`): `void` **`Beta`** #### Parameters ##### id `string` Identifier for the action ##### newState [`ListViewControlActionState`](/server-editor/types/ListViewControlActionState.md) New action state #### Returns `void` #### Remarks Updates action item state for the view control [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IListViewControlPaneOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IListViewControlPaneOptions.md. # Interface: IListViewControlPaneOptions **`Beta`** ## Extended by - [`ICollectionTreeViewControlPaneOptions`](/server-editor/interfaces/ICollectionTreeViewControlPaneOptions.md) - [`IListPaneViewControlPaneOptions`](/server-editor/interfaces/IListPaneViewControlPaneOptions.md) ## Properties ### actions? > `optional` **actions?**: [`ListViewControlAction`](/server-editor/types/ListViewControlAction.md)\[] **`Beta`** #### Remarks Default actions *** ### onActionClicked? > `optional` **onActionClicked?**: (`id`) => `void` **`Beta`** #### Parameters ##### id `string` #### Returns `void` #### Remarks This function will be called whenever user clicks an action *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state. It undefined, it will be false. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IMenu.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IMenu.md. # Interface: IMenu **`Beta`** ## Properties ### checked? > `optional` **checked?**: `boolean` **`Beta`** #### Remarks If defined, the menu will show a checked or unchecked checkbox. *** ### enabled 实验性 > **enabled**: `boolean` **`Beta`** #### Remarks The menu will be in either an enabled or disabled state *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the menu *** ### submenu > `readonly` **submenu**: `IMenu`\[] **`Beta`** #### Remarks Sub menus of this menu ## Methods ### addItem() > **addItem**(`params`, `action?`): `IMenu` **`Beta`** #### Parameters ##### params [`IMenuCreationParams`](/server-editor/interfaces/IMenuCreationParams.md) The menu creation parameters for the sub item being added ##### action? [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`NoArgsAction`](/server-editor/types/NoArgsAction.md)> The action to associate with the menu item. Only a subset of actions are supported #### Returns `IMenu` #### Remarks Create a child menu on this menu. *** ### dispose() > **dispose**(): `void` **`Beta`** #### Returns `void` #### Remarks Destroy the menu and all of its children. *** ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the menu and all of its children. *** ### replaceAction() > **replaceAction**(`action`): `void` **`Beta`** #### Parameters ##### action [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`NoArgsAction`](/server-editor/types/NoArgsAction.md)> The registered action to associated with this menu item #### Returns `void` #### Remarks Replaces the current associated menu action with a new action *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the menu and all of its children. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IMenuContainer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IMenuContainer.md. # Interface: IMenuContainer inventory **`Beta`** Manager and container for IMenu objects ## Methods ### createMenu() > **createMenu**(`props`): [`IMenu`](/server-editor/interfaces/IMenu.md) **`Beta`** #### Parameters ##### props [`IMenuCreationParams`](/server-editor/interfaces/IMenuCreationParams.md) Configuration for the menu to create #### Returns [`IMenu`](/server-editor/interfaces/IMenu.md) #### Remarks Create a top level item in the container. *** ### getMenu() > **getMenu**(`id`): `Promise`\<[`IMenu`](/server-editor/interfaces/IMenu.md)> **`Beta`** #### Parameters ##### id `string` Menu identifier #### Returns `Promise`\<[`IMenu`](/server-editor/interfaces/IMenu.md)> #### Remarks Search for a menu item, if it's not found defer it to next tick. ## 同领域相关 - [IModalToolContainer](/server-editor/interfaces/IModalToolContainer.md) - [ITagContainerPropertyItem](/server-editor/interfaces/ITagContainerPropertyItem.md) - [ITagContainerPropertyItemOptions](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) - [SelectionContainerBase](/server-editor/classes/SelectionContainerBase.md) - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity.md) - [SelectionContainerVolume](/server-editor/classes/SelectionContainerVolume.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IMenuCreationParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IMenuCreationParams.md. # Interface: IMenuCreationParams **`Beta`** Properties required to create a Menu ## Properties ### checked? > `optional` **checked?**: `boolean` **`Beta`** #### Remarks Whether the menu should show a checkmark *** ### enabled? > `optional` **enabled?**: `boolean` **`Beta`** #### Remarks Whether the menu should be enabled or disabled *** ### icon? > `optional` **icon?**: `string` **`Beta`** #### Remarks Whether the menu should have an icon. *** ### label 实验性 > **label**: `string` **`Beta`** #### Remarks Localized display text of the menu *** ### sortIndex? > `optional` **sortIndex?**: `number` **`Beta`** #### Remarks Determines the order of the menu item among its siblings. *** ### tooltip? > `optional` **tooltip?**: `string` **`Beta`** #### Remarks Whether the menu should have a tooltip. *** ### uniqueId? > `optional` **uniqueId?**: `string` **`Beta`** #### Remarks Custom unique identifier that will replace random id [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IMenuPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IMenuPropertyItem.md. # Interface: IMenuPropertyItem **`Beta`** A property item which supports Menu properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addEntry() > **addEntry**(`props`, `action?`): [`IMenu`](/server-editor/interfaces/IMenu.md) **`Beta`** #### Parameters ##### props [`IMenuCreationParams`](/server-editor/interfaces/IMenuCreationParams.md) Menu creation parameters ##### action? [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`NoArgsAction`](/server-editor/types/NoArgsAction.md)> Optional action to trigger on menu click #### Returns [`IMenu`](/server-editor/interfaces/IMenu.md) #### Remarks Adds a new menu item entry to property item *** ### getEntries() > **getEntries**(): [`IMenu`](/server-editor/interfaces/IMenu.md)\[] **`Beta`** #### Returns [`IMenu`](/server-editor/interfaces/IMenu.md)\[] All first level menu entries #### Remarks *** ### getMenu() > **getMenu**(`menuId`): [`IMenu`](/server-editor/interfaces/IMenu.md) | `undefined` **`Beta`** #### Parameters ##### menuId `string` Identifier of the menu. #### Returns [`IMenu`](/server-editor/interfaces/IMenu.md) | `undefined` #### Remarks Find the menu item recursively if it exists *** ### removeEntry() > **removeEntry**(`menuId`): `void` **`Beta`** #### Parameters ##### menuId `string` Menu id to remove #### Returns `void` #### Remarks Removed the menu item entry if the id is found *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` New tooltip. #### Returns `void` #### Remarks Updates tooltip description of property item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IMenuPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IMenuPropertyItemOptions.md. # Interface: IMenuPropertyItemOptions **`Beta`** Optional properties for Menu property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### onMenuItemClick? > `optional` **onMenuItemClick?**: (`menuId`) => `void` **`Beta`** #### Parameters ##### menuId `string` #### Returns `void` #### Remarks Called when a menu item is clicked. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IMinimapPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IMinimapPropertyItem.md. # Interface: IMinimapPropertyItem **`Beta`** A property item which supports Minimap properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### mapId > `readonly` **mapId**: `string` **`Beta`** #### Remarks Id of the map. *** ### mapImageHeight > `readonly` **mapImageHeight**: `number` **`Beta`** #### Remarks Height of the map image. *** ### mapImageWidth > `readonly` **mapImageWidth**: `number` **`Beta`** #### Remarks Width of the map image. *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### isMarkerTypeVisible() > **isMarkerTypeVisible**(`type`): `boolean` **`Beta`** #### Parameters ##### type [`MinimapMarkerType`](/server-editor/enums/MinimapMarkerType.md) The marker type to query. #### Returns `boolean` #### Remarks Get visibility for a specific marker type. *** ### isMeMarkerShown() > **isMeMarkerShown**(): `boolean` **`Beta`** #### Returns `boolean` #### Remarks Get me marker visibility. *** ### registerCustomMarkerIcon() > **registerCustomMarkerIcon**(`iconIdentifier`, `imagePath`): `void` **`Beta`** #### Parameters ##### iconIdentifier `string` The iconIdentifier string. ##### imagePath `string` The image resource path. #### Returns `void` #### Remarks Register a custom marker icon for UI rendering. *** ### resizeMapImage() > **resizeMapImage**(`width`, `height`): `void` **`Beta`** #### Parameters ##### width `number` New width of the image. ##### height `number` New height of the image. #### Returns `void` #### Remarks Updates the size of the map image. *** ### setMarkerTypeVisible() > **setMarkerTypeVisible**(`type`, `visible`): `void` **`Beta`** #### Parameters ##### type [`MinimapMarkerType`](/server-editor/enums/MinimapMarkerType.md) The marker type to toggle. ##### visible `boolean` Whether the marker type should be visible. #### Returns `void` #### Remarks Set visibility for a specific marker type. *** ### setMeMarkerShown() > **setMeMarkerShown**(`shown`): `void` **`Beta`** #### Parameters ##### shown `boolean` #### Returns `void` #### Remarks Set me marker visibility. *** ### unregisterCustomMarkerIcon() > **unregisterCustomMarkerIcon**(`iconIdentifier`): `void` **`Beta`** #### Parameters ##### iconIdentifier `string` The iconIdentifier string. #### Returns `void` #### Remarks Unregister a custom marker icon. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IMinimapPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IMinimapPropertyItemOptions.md. # Interface: IMinimapPropertyItemOptions **`Beta`** Optional properties for Minimap property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### alignment? > `optional` **alignment?**: [`LayoutAlignment`](/server-editor/enums/LayoutAlignment.md) **`Beta`** #### Remarks Alignment of the map in the container. If not defined, LayoutAlignment.Center is used. *** ### clickable? > `optional` **clickable?**: `boolean` **`Beta`** #### Remarks Whether the minimap is clickable. If undefined, defaults to true. *** ### customMarkerIcons? > `optional` **customMarkerIcons?**: `Record`\<`string`, `string`> **`Beta`** #### Remarks Custom marker icon registration. Maps the iconIdentifier (used when adding custom markers via addCustomMarker) to image resource paths for UI rendering. Only needed for Custom marker type. Multiplayer and Location use built-in icons. *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### isMeMarkerShown? > `optional` **isMeMarkerShown?**: `boolean` **`Beta`** #### Remarks Whether to show me marker on the minimap. If undefined, defaults to true. *** ### mapImageSize? > `optional` **mapImageSize?**: `number` | \{ `height`: `number`; `width`: `number`; } **`Beta`** #### Remarks Size of the map image. If undefined, defaults to 35. *** ### onClick? > `optional` **onClick?**: (`worldX`, `worldY`, `worldZ`) => `void` **`Beta`** #### Parameters ##### worldX `number` ##### worldY `number` ##### worldZ `number` #### Returns `void` #### Remarks Called when the minimap is clicked. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) *** ### visibleMarkerTypes? > `optional` **visibleMarkerTypes?**: [`MinimapMarkerType`](/server-editor/enums/MinimapMarkerType.md)\[] **`Beta`** #### Remarks Per-type marker visibility. If omitted, no marker types are shown. Only controls presentation. Markers must be added via C++ API to exist. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IModalControlPane.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IModalControlPane.md. # Interface: IModalControlPane **`Beta`** A sub pane for modal control elements. ## Extends - [`IPane`](/server-editor/interfaces/IPane.md) ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`id`](/server-editor/interfaces/IPane.md#id) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks Check visibility of the pane #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`visible`](/server-editor/interfaces/IPane.md#visible) ## Methods ### addBool() > **addBool**(`value`, `options?`): [`IBoolPropertyItem`](/server-editor/interfaces/IBoolPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`boolean`> ##### options? [`IBoolPropertyItemOptions`](/server-editor/interfaces/IBoolPropertyItemOptions.md) #### Returns [`IBoolPropertyItem`](/server-editor/interfaces/IBoolPropertyItem.md) #### Remarks Adds a togglable boolean item to the pane. *** ### addButton() > **addButton**(`action`, `options?`): [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) **`Beta`** #### Parameters ##### action [`ButtonPropertyItemSupportedActionTypes`](/server-editor/types/ButtonPropertyItemSupportedActionTypes.md) ##### options? [`IButtonPropertyItemOptions`](/server-editor/interfaces/IButtonPropertyItemOptions.md) #### Returns [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) #### Remarks Adds a button to the pane and binds the specified action to the button activation. *** ### addButtonPane() > **addButtonPane**(`options?`): [`IButtonPanePropertyItem`](/server-editor/interfaces/IButtonPanePropertyItem.md) **`Beta`** #### Parameters ##### options? [`IButtonPanePropertyItemOptions`](/server-editor/interfaces/IButtonPanePropertyItemOptions.md) #### Returns [`IButtonPanePropertyItem`](/server-editor/interfaces/IButtonPanePropertyItem.md) #### Remarks Adds a pane for grouped button layout. *** ### addDivider() > **addDivider**(`options?`): [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) **`Beta`** #### Parameters ##### options? [`IDividerPropertyItemOptions`](/server-editor/interfaces/IDividerPropertyItemOptions.md) #### Returns [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) #### Remarks Adds an divider item to the pane. *** ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`hide`](/server-editor/interfaces/IPane.md#hide) *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the pane and all of its items. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`show`](/server-editor/interfaces/IPane.md#show) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IModalDialog.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IModalDialog.md. # Interface: IModalDialog **`Beta`** ## Properties ### activeRequestId > `readonly` **activeRequestId**: `string` | `undefined` **`Beta`** #### Remarks Identifier for the active request for this dialog *** ### contentPane > `readonly` **contentPane**: [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) **`Beta`** #### Remarks Custom pane layout for the dialog *** ### controlPane > `readonly` **controlPane**: [`IModalControlPane`](/server-editor/interfaces/IModalControlPane.md) **`Beta`** #### Remarks Custom pane layout for the dialog *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the dialog *** ### title > `readonly` **title**: [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` **`Beta`** #### Remarks Title of the dialog ## Methods ### sendDismiss() > **sendDismiss**(): `void` **`Beta`** #### Returns `void` #### Remarks Dispatches a dismiss message to the active request if it is available *** ### sendResponse() > **sendResponse**(`response`): `void` **`Beta`** #### Parameters ##### response [`ModalDialogCustomResponse`](/server-editor/types/ModalDialogCustomResponse.md) Response message to be handled by the active request #### Returns `void` #### Remarks Dispatches a response message to the active request if it is available *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title #### Returns `void` #### Remarks Updates the title of the modal dialog [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IModalDialogActivationRequest.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IModalDialogActivationRequest.md. # Interface: IModalDialogActivationRequest **`Beta`** Represents modal dialog state for the specific activation request ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the request *** ### isValid > `readonly` **isValid**: `boolean` **`Beta`** #### Remarks Determines if the request is still active ## Methods ### cancel() > **cancel**(): `void` **`Beta`** #### Returns `void` #### Remarks Cancels the request if it's still active [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IModalDialogManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IModalDialogManager.md. # Interface: IModalDialogManager **`Beta`** ## Methods ### activateDialog() > **activateDialog**\<`T`>(`params`): [`IModalDialogActivationRequest`](/server-editor/interfaces/IModalDialogActivationRequest.md) **`Beta`** #### Type Parameters ##### T `T` _extends_ `string` | [`DataPicker`](/server-editor/enums/CoreModalDialogType.md#datapicker) #### Parameters ##### params [`ModalDialogActivationParams`](/server-editor/types/ModalDialogActivationParams.md)\<`T`> Activation parameters #### Returns [`IModalDialogActivationRequest`](/server-editor/interfaces/IModalDialogActivationRequest.md) #### Remarks Creates a modal activation request for an existing modal template *** ### dismissActiveDialog() > **dismissActiveDialog**(): `void` **`Beta`** #### Returns `void` #### Remarks Removes the active modal from view *** ### registerDialog() > **registerDialog**(`params`): [`IModalDialog`](/server-editor/interfaces/IModalDialog.md) **`Beta`** #### Parameters ##### params [`ModalDialogCreationParams`](/server-editor/interfaces/ModalDialogCreationParams.md) Creation parameters #### Returns [`IModalDialog`](/server-editor/interfaces/IModalDialog.md) #### Remarks Creates a custom modal dialog with a property pane [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IModalOverlayPane.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IModalOverlayPane.md. # Interface: IModalOverlayPane **`Beta`** A modal overlay pane is displayed over a root pane. ## Extends - [`IPane`](/server-editor/interfaces/IPane.md) ## Properties ### contentPane > **contentPane**: [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) **`Beta`** #### Remarks A sub pane that represents content of the modal overlay. *** ### controlPane > **controlPane**: [`IModalControlPane`](/server-editor/interfaces/IModalControlPane.md) **`Beta`** #### Remarks A pane that represent modal control elements. *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`id`](/server-editor/interfaces/IPane.md#id) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks Check visibility of the pane #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`visible`](/server-editor/interfaces/IPane.md#visible) ## Methods ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`hide`](/server-editor/interfaces/IPane.md#hide) *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the pane and all of its items. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`show`](/server-editor/interfaces/IPane.md#show) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IModalOverlayPaneOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IModalOverlayPaneOptions.md. # Interface: IModalOverlayPaneOptions **`Beta`** The options to create a modal overlay pane. ## Properties ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the modal overlay. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IModalTool.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IModalTool.md. # Interface: IModalTool **`Beta`** ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the tool *** ### isActive 实验性 > `readonly` **isActive**: `boolean` **`Beta`** #### Remarks Active state of the modal tool *** ### onModalToolActivation > **onModalToolActivation**: [`EventSink`](/server-editor/interfaces/EventSink.md)\<[`ModalToolLifecycleEventPayload`](/server-editor/types/ModalToolLifecycleEventPayload.md)> **`Beta`** #### Remarks Provides lifecycle activation events for a modal tool ## Methods ### bindPropertyPane() > **bindPropertyPane**(`pane`): `void` **`Beta`** #### Parameters ##### pane [`IRootPropertyPane`](/server-editor/interfaces/IRootPropertyPane.md) Root pane associated with the modal tool #### Returns `void` #### Remarks Binds a property pane to the tool. When the tool is selected, the pane's visibility updates. Only one pane can be bound at a time. *** ### registerKeyBinding() > **registerKeyBinding**(`action`, `binding`, `info?`): [`IRegisteredKeyBinding`](/server-editor/interfaces/IRegisteredKeyBinding.md) **`Beta`** #### Parameters ##### action [`SupportedKeyboardActionTypes`](/server-editor/types/SupportedKeyboardActionTypes.md) Action to register the binding for. ##### binding [`KeyBinding`](/server-editor/types/KeyBinding.md) Keyboard binding to invoke action. ##### info? [`KeyBindingInfo`](/server-editor/types/KeyBindingInfo.md) Additional information about key binding. #### Returns [`IRegisteredKeyBinding`](/server-editor/interfaces/IRegisteredKeyBinding.md) #### Remarks Register a key press binding for an action which will be handled by the tool input context. *** ### registerMouseButtonBinding() > **registerMouseButtonBinding**(`action`): `void` **`Beta`** #### Parameters ##### action [`SupportedMouseActionTypes`](/server-editor/types/SupportedMouseActionTypes.md) Action to register the binding for. #### Returns `void` #### Remarks Register an action to be called when mouse left/middle/right buttons are pressed or released. *** ### registerMouseDragBinding() > **registerMouseDragBinding**(`action`): `void` **`Beta`** #### Parameters ##### action [`SupportedMouseActionTypes`](/server-editor/types/SupportedMouseActionTypes.md) Action to register the binding for. #### Returns `void` #### Remarks Register an action to be called when mouse is dragged while left mouse button is down. *** ### registerMouseWheelBinding() > **registerMouseWheelBinding**(`action`): `void` **`Beta`** #### Parameters ##### action [`SupportedMouseActionTypes`](/server-editor/types/SupportedMouseActionTypes.md) Action to register the binding for. #### Returns `void` #### Remarks Register an action to be called when mouse wheel is scrolled. *** ### setMouseIcon() > **setMouseIcon**(`mouseIcon`): `void` **`Beta`** #### Parameters ##### mouseIcon [`MouseCursorIconType`](/server-editor/enums/MouseCursorIconType.md) | `undefined` The mouse cursor icon, or undefined to reset to default. #### Returns `void` #### Remarks Set the mouse cursor icon for this tool when it's active. The icon will only be visible when this tool is the currently selected tool. *** ### unregisterInputBindings() > **unregisterInputBindings**(): `void` **`Beta`** #### Returns `void` #### Remarks Unregister all input binding for this tool. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IModalToolContainer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IModalToolContainer.md. # Interface: IModalToolContainer inventory **`Beta`** ## Properties ### currentTools > `readonly` **currentTools**: [`IModalTool`](/server-editor/interfaces/IModalTool.md)\[] **`Beta`** #### Remarks Tools within this container. *** ### onSelectedToolChanged 实验性 > **onSelectedToolChanged**: [`EventSink`](/server-editor/interfaces/EventSink.md)\<[`SelectedModalToolChangedEventPayload`](/server-editor/types/SelectedModalToolChangedEventPayload.md)> **`Beta`** #### Remarks Provides events when the selected modal tool changes. ## Methods ### addTool() > **addTool**(`id`, `params`): [`IModalTool`](/server-editor/interfaces/IModalTool.md) **`Beta`** #### Parameters ##### id `string` Unique identifier for the tool ##### params [`ModalToolCreationParameters`](/server-editor/interfaces/ModalToolCreationParameters.md) Construction parameters for the new tool #### Returns [`IModalTool`](/server-editor/interfaces/IModalTool.md) #### Remarks Create a new tool in the modal tool container represented via button on the tool rail. *** ### focusToolInputContext() > **focusToolInputContext**(): `void` **`Beta`** #### Returns `void` #### Remarks Activates input bindings for the selected tool by enabling viewport focus *** ### getSelectedToolId() > **getSelectedToolId**(): `string` | `undefined` **`Beta`** #### Returns `string` | `undefined` #### Remarks Returns identifier of the selected tool. *** ### getSortOrder() > **getSortOrder**(): `string`\[] | `undefined` **`Beta`** #### Returns `string`\[] | `undefined` Array of tool identifiers in sort order, or undefined if not set #### Remarks Returns the current sort order of tools. *** ### removeTool() > **removeTool**(`id`): `void` **`Beta`** #### Parameters ##### id `string` Name of the tool to remove. #### Returns `void` #### Remarks Remove an existing tool by id from the tool container *** ### setSelectedToolId() > **setSelectedToolId**(`id`): `void` **`Beta`** #### Parameters ##### id `string` | `undefined` Identifier of the tool #### Returns `void` #### Remarks Selects a tool in the container. *** ### setSortOrder() > **setSortOrder**(`ids`): `void` **`Beta`** #### Parameters ##### ids `string`\[] | `undefined` Array of tool identifiers in the desired order, or undefined to clear #### Returns `void` #### Remarks Sets the sort order for tools in the container. ## 同领域相关 - [IMenuContainer](/server-editor/interfaces/IMenuContainer.md) - [ITagContainerPropertyItem](/server-editor/interfaces/ITagContainerPropertyItem.md) - [ITagContainerPropertyItemOptions](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) - [SelectionContainerBase](/server-editor/classes/SelectionContainerBase.md) - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity.md) - [SelectionContainerVolume](/server-editor/classes/SelectionContainerVolume.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/INumberPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/INumberPropertyItem.md. # Interface: INumberPropertyItem **`Beta`** A property item which supports Number properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `number` **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` New tooltip. #### Returns `void` #### Remarks Updates tooltip description of property item. *** ### updateLimits() > **updateLimits**(`limits`): `void` **`Beta`** #### Parameters ##### limits ###### max? `number` ###### min? `number` #### Returns `void` #### Remarks Updates number limits and clamps the current value. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/INumberPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/INumberPropertyItemOptions.md. # Interface: INumberPropertyItemOptions **`Beta`** Optional properties for Number property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. If undefined, the label will be visible by default. *** ### isInteger? > `optional` **isInteger?**: `boolean` **`Beta`** #### Remarks If we should treat the number as integer. By default is false. *** ### max? > `optional` **max?**: `number` **`Beta`** #### Remarks The min possible number. If undefined, Number.MAX\_SAFE\_INTEGER will be used. *** ### min? > `optional` **min?**: `number` **`Beta`** #### Remarks The min possible number. If undefined, Number.MIN\_SAFE\_INTEGER will be used. *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`) => `void` **`Beta`** #### Parameters ##### newValue `number` ##### oldValue `number` #### Returns `void` #### Remarks This callback is called when UI control value is changed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### variant? > `optional` **variant?**: [`NumberPropertyItemVariant`](/server-editor/enums/NumberPropertyItemVariant.md) **`Beta`** #### Remarks Determines how we display bool as a UI element. If undefined, it will default to InputField. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/INumberTimelinePropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/INumberTimelinePropertyItem.md. # Interface: INumberTimelinePropertyItem **`Beta`** A property item which supports Number Timeline properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addNode() > **addNode**(`data`): `void` **`Beta`** #### Parameters ##### data [`INumberTimelinePropertyItemEntry`](/server-editor/interfaces/INumberTimelinePropertyItemEntry.md) New color node. #### Returns `void` #### Remarks Update color timeline entry *** ### getData() > **getData**(): [`INumberTimelinePropertyItemEntry`](/server-editor/interfaces/INumberTimelinePropertyItemEntry.md)\[] **`Beta`** #### Returns [`INumberTimelinePropertyItemEntry`](/server-editor/interfaces/INumberTimelinePropertyItemEntry.md)\[] #### Remarks Get the list of nodes in the property item. *** ### getTime() > **getTime**(): `number` **`Beta`** #### Returns `number` #### Remarks Get time current time value on the slider. *** ### removeNode() > **removeNode**(`data`): `void` **`Beta`** #### Parameters ##### data [`INumberTimelinePropertyItemEntry`](/server-editor/interfaces/INumberTimelinePropertyItemEntry.md) Node to be removed. #### Returns `void` #### Remarks Remove color node *** ### setBounds() > **setBounds**(`bounds`): `void` **`Beta`** #### Parameters ##### bounds ###### maxValue `number` ###### minValue `number` #### Returns `void` #### Remarks Updates data entries value bounds. *** ### setSeparatorSliceCount() > **setSeparatorSliceCount**(`counts`): `void` **`Beta`** #### Parameters ##### counts `Vector2` Counts for the thin grid lines. #### Returns `void` #### Remarks Set separator slice counts for x and y for the minor grid. *** ### setSeparatorStepCount() > **setSeparatorStepCount**(`counts`): `void` **`Beta`** #### Parameters ##### counts `Vector2` Counts for the thick grid lines. #### Returns `void` #### Remarks Set separator step counts for x and y for the major grid. *** ### setTime() > **setTime**(`time`): `void` **`Beta`** #### Parameters ##### time `number` The new time value. #### Returns `void` #### Remarks Set time line slider value to a new value *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### updateNode() > **updateNode**(`data`): `void` **`Beta`** #### Parameters ##### data [`INumberTimelinePropertyItemEntry`](/server-editor/interfaces/INumberTimelinePropertyItemEntry.md) Node to be updated. #### Returns `void` #### Remarks Update node value [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/INumberTimelinePropertyItemEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/INumberTimelinePropertyItemEntry.md. # Interface: INumberTimelinePropertyItemEntry **`Beta`** Properties of the Number timeline property item entry ## Properties ### color? > `optional` **color?**: `any` **`Beta`** *** ### id > **id**: `string` **`Beta`** *** ### time > **time**: `number` **`Beta`** *** ### value > **value**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/INumberTimelinePropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/INumberTimelinePropertyItemOptions.md. # Interface: INumberTimelinePropertyItemOptions **`Beta`** Optional properties for Number Timeline property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### bounds? > `optional` **bounds?**: `object` **`Beta`** #### maxValue > **maxValue**: `number` #### minValue > **minValue**: `number` #### Remarks The data bounds for the value node property *** ### decimalPrecision? > `optional` **decimalPrecision?**: `number` **`Beta`** #### Remarks Custom precision for the calculations *** ### disableAddRemoveNodes? > `optional` **disableAddRemoveNodes?**: `boolean` **`Beta`** #### Remarks If true, nodes cannot be added or removed *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### entries? > `optional` **entries?**: [`INumberTimelinePropertyItemEntry`](/server-editor/interfaces/INumberTimelinePropertyItemEntry.md)\[] **`Beta`** #### Remarks List of nodes entries in the color timeline. *** ### gridSeparatorSliceCount? > `optional` **gridSeparatorSliceCount?**: `any` **`Beta`** #### Remarks The separator slice count for the graph thin lines *** ### gridSeparatorStepCount? > `optional` **gridSeparatorStepCount?**: `any` **`Beta`** #### Remarks The separator step counts for the graph bold lines *** ### isGraphReadOnly? > `optional` **isGraphReadOnly?**: `boolean` **`Beta`** #### Remarks True means nodes cannot be dragged or modified *** ### onNodeAdded? > `optional` **onNodeAdded?**: (`node`) => `void` **`Beta`** #### Parameters ##### node [`INumberTimelinePropertyItemEntry`](/server-editor/interfaces/INumberTimelinePropertyItemEntry.md) #### Returns `void` #### Remarks Callback triggered when a new number node is added to the timeline. *** ### onNodeChanged? > `optional` **onNodeChanged?**: (`node`) => `void` **`Beta`** #### Parameters ##### node [`INumberTimelinePropertyItemEntry`](/server-editor/interfaces/INumberTimelinePropertyItemEntry.md) #### Returns `void` #### Remarks Callback triggered when a timeline node's number value changes. *** ### onNodeRemoved? > `optional` **onNodeRemoved?**: (`node`) => `void` **`Beta`** #### Parameters ##### node [`INumberTimelinePropertyItemEntry`](/server-editor/interfaces/INumberTimelinePropertyItemEntry.md) #### Returns `void` #### Remarks Callback triggered when an number node is removed from the timeline. \* *** ### onTimeChanged? > `optional` **onTimeChanged?**: (`current`, `prev`) => `void` **`Beta`** #### Parameters ##### current `number` ##### prev `number` #### Returns `void` #### Remarks This callback is called when UI control time is changed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IObservable.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IObservable.md. # Interface: IObservable\ **`Beta`** Represents a stateful value that can be observed by different objects. ## Type Parameters ### T `T` ## Properties ### validator? > `readonly` `optional` **validator?**: [`ObservableValidator`](/server-editor/classes/ObservableValidator.md)\<`T`> **`Beta`** #### Remarks Optional validator that will pre-process the new value. *** ### value > `readonly` **value**: `Readonly`\<`T`> **`Beta`** #### Remarks Current value of the observable. ## Methods ### set() > **set**(`newValue`): `boolean` **`Beta`** #### Parameters ##### newValue `T` New value to be set (will be processed by the validator if it exists). #### Returns `boolean` #### Remarks Updates the value and notifies dependent objects. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IPane.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IPane.md. # Interface: IPane **`Beta`** Pane represents a container for UI components. ## Extended by - [`IButtonPanePropertyItem`](/server-editor/interfaces/IButtonPanePropertyItem.md) - [`IIntroductionPane`](/server-editor/interfaces/IIntroductionPane.md) - [`IListPanePropertyItem`](/server-editor/interfaces/IListPanePropertyItem.md) - [`IModalControlPane`](/server-editor/interfaces/IModalControlPane.md) - [`IModalOverlayPane`](/server-editor/interfaces/IModalOverlayPane.md) - [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) - [`ITimelinePlayer`](/server-editor/interfaces/ITimelinePlayer.md) ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the pane. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks Check visibility of the pane ## Methods ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the pane. *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the pane and all of its items. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IPaneManager.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IPaneManager.md. # Interface: IPaneManager **`Beta`** Manager for creating and controlling property panes. ## Methods ### createIntroductionPane() > **createIntroductionPane**(`options`): [`IIntroductionPane`](/server-editor/interfaces/IIntroductionPane.md) **`Beta`** #### Parameters ##### options [`IIntroductionPaneOptions`](/server-editor/interfaces/IIntroductionPaneOptions.md) #### Returns [`IIntroductionPane`](/server-editor/interfaces/IIntroductionPane.md) #### Remarks Create a pane to be shown on the introduction window *** ### createRootPane() > **createRootPane**(`options`): [`IRootPropertyPane`](/server-editor/interfaces/IRootPropertyPane.md) **`Beta`** #### Parameters ##### options [`IRootPropertyPaneOptions`](/server-editor/interfaces/IRootPropertyPaneOptions.md) #### Returns [`IRootPropertyPane`](/server-editor/interfaces/IRootPropertyPane.md) #### Remarks Create a root pane [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IPlayerLogger.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IPlayerLogger.md. # Interface: IPlayerLogger **`Beta`** Log helper interface for Player. ## Methods ### debug() > **debug**(`message`, `props?`): `void` **`Beta`** #### Parameters ##### message [`LocalizedString`](/server-editor/types/LocalizedString.md) Message content ##### props? [`IPlayerLoggerProperties`](/server-editor/interfaces/IPlayerLoggerProperties.md) Optional player log properties #### Returns `void` #### Remarks Dispatch a player log message with Debug log level *** ### error() > **error**(`message`, `props?`): `void` **`Beta`** #### Parameters ##### message [`LocalizedString`](/server-editor/types/LocalizedString.md) Message content ##### props? [`IPlayerLoggerProperties`](/server-editor/interfaces/IPlayerLoggerProperties.md) Optional player log properties #### Returns `void` #### Remarks Dispatch a player log message with Error log level *** ### info() > **info**(`message`, `props?`): `void` **`Beta`** #### Parameters ##### message [`LocalizedString`](/server-editor/types/LocalizedString.md) Message content ##### props? [`IPlayerLoggerProperties`](/server-editor/interfaces/IPlayerLoggerProperties.md) Optional player log properties #### Returns `void` #### Remarks Dispatch a player log message with Info log level *** ### warning() > **warning**(`message`, `props?`): `void` **`Beta`** #### Parameters ##### message [`LocalizedString`](/server-editor/types/LocalizedString.md) Message content ##### props? [`IPlayerLoggerProperties`](/server-editor/interfaces/IPlayerLoggerProperties.md) Optional player log properties #### Returns `void` #### Remarks Dispatch a player log message with Warning log level [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IPlayerLoggerProperties.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IPlayerLoggerProperties.md. # Interface: IPlayerLoggerProperties **`Beta`** Player Logger Properties. ## Properties ### channelMask? > `optional` **channelMask?**: [`LogChannel`](/server-editor/enums/LogChannel.md) **`Beta`** #### Remarks A log channel mask, default is Message *** ### subMessage? > `optional` **subMessage?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks A player log sub message for the toast channel [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IProgressIndicatorPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IProgressIndicatorPropertyItem.md. # Interface: IProgressIndicatorPropertyItem **`Beta`** A property item which supports ProgressIndicator properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### progress > `readonly` **progress**: `number` | `undefined` **`Beta`** #### Remarks Current progress of the property item. *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New tooltip. #### Returns `void` #### Remarks Updates tooltip description of property item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IProgressIndicatorPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IProgressIndicatorPropertyItemOptions.md. # Interface: IProgressIndicatorPropertyItemOptions **`Beta`** Optional properties for progress indicator property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. If undefined, the label will be visible by default. *** ### progress? > `optional` **progress?**: [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> **`Beta`** #### Remarks Normalized loading progress (0 to 1). *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### tooltip? > `optional` **tooltip?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### variant? > `optional` **variant?**: [`ProgressIndicatorPropertyItemVariant`](/server-editor/enums/ProgressIndicatorPropertyItemVariant.md) **`Beta`** #### Remarks Determines how we display progress indicator. If undefined, it will default to Spinner. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IPropertyItemBase.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IPropertyItemBase.md. # Interface: IPropertyItemBase **`Beta`** Common base for all property items ## Extended by - [`IBlockListPropertyItem`](/server-editor/interfaces/IBlockListPropertyItem.md) - [`IBlockTablePropertyItem`](/server-editor/interfaces/IBlockTablePropertyItem.md) - [`IBoolPropertyItem`](/server-editor/interfaces/IBoolPropertyItem.md) - [`IButtonPanePropertyItem`](/server-editor/interfaces/IButtonPanePropertyItem.md) - [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) - [`ICollectionTreePropertyItem`](/server-editor/interfaces/ICollectionTreePropertyItem.md) - [`IColorPickerPropertyItem`](/server-editor/interfaces/IColorPickerPropertyItem.md) - [`IColorTimelinePropertyItem`](/server-editor/interfaces/IColorTimelinePropertyItem.md) - [`IComboBoxPropertyItem`](/server-editor/interfaces/IComboBoxPropertyItem.md) - [`IDataTablePropertyItem`](/server-editor/interfaces/IDataTablePropertyItem.md) - [`IDropdownPropertyItem`](/server-editor/interfaces/IDropdownPropertyItem.md) - [`IImagePropertyItem`](/server-editor/interfaces/IImagePropertyItem.md) - [`ILinkPropertyItem`](/server-editor/interfaces/ILinkPropertyItem.md) - [`IListPanePropertyItem`](/server-editor/interfaces/IListPanePropertyItem.md) - [`IMenuPropertyItem`](/server-editor/interfaces/IMenuPropertyItem.md) - [`IMinimapPropertyItem`](/server-editor/interfaces/IMinimapPropertyItem.md) - [`INumberPropertyItem`](/server-editor/interfaces/INumberPropertyItem.md) - [`INumberTimelinePropertyItem`](/server-editor/interfaces/INumberTimelinePropertyItem.md) - [`IProgressIndicatorPropertyItem`](/server-editor/interfaces/IProgressIndicatorPropertyItem.md) - [`IStringPropertyItem`](/server-editor/interfaces/IStringPropertyItem.md) - [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) - [`ITagContainerPropertyItem`](/server-editor/interfaces/ITagContainerPropertyItem.md) - [`ITextPropertyItem`](/server-editor/interfaces/ITextPropertyItem.md) - [`ITimelinePlayer`](/server-editor/interfaces/ITimelinePlayer.md) - [`IToggleGroupPropertyItem`](/server-editor/interfaces/IToggleGroupPropertyItem.md) - [`IVector2PropertyItem`](/server-editor/interfaces/IVector2PropertyItem.md) - [`IVector3PropertyItem`](/server-editor/interfaces/IVector3PropertyItem.md) - [`IVector3TimelinePropertyItem`](/server-editor/interfaces/IVector3TimelinePropertyItem.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IPropertyItemOptionsBase.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IPropertyItemOptionsBase.md. # Interface: IPropertyItemOptionsBase **`Beta`** Common optional properties for property items ## Extended by - [`IBlockListPropertyItemOptions`](/server-editor/interfaces/IBlockListPropertyItemOptions.md) - [`IBlockTablePropertyItemOptions`](/server-editor/interfaces/IBlockTablePropertyItemOptions.md) - [`IBoolPropertyItemOptions`](/server-editor/interfaces/IBoolPropertyItemOptions.md) - [`IButtonPropertyItemOptions`](/server-editor/interfaces/IButtonPropertyItemOptions.md) - [`ICollectionTreePropertyItemOptions`](/server-editor/interfaces/ICollectionTreePropertyItemOptions.md) - [`IColorPickerPropertyItemOptions`](/server-editor/interfaces/IColorPickerPropertyItemOptions.md) - [`IColorTimelinePropertyItemOptions`](/server-editor/interfaces/IColorTimelinePropertyItemOptions.md) - [`IComboBoxPropertyItemOptions`](/server-editor/interfaces/IComboBoxPropertyItemOptions.md) - [`IDataTablePropertyItemOptions`](/server-editor/interfaces/IDataTablePropertyItemOptions.md) - [`IDropdownPropertyItemOptions`](/server-editor/interfaces/IDropdownPropertyItemOptions.md) - [`IImagePropertyItemOptions`](/server-editor/interfaces/IImagePropertyItemOptions.md) - [`ILinkPropertyItemOptions`](/server-editor/interfaces/ILinkPropertyItemOptions.md) - [`IListPanePropertyItemOptions`](/server-editor/interfaces/IListPanePropertyItemOptions.md) - [`IMenuPropertyItemOptions`](/server-editor/interfaces/IMenuPropertyItemOptions.md) - [`IMinimapPropertyItemOptions`](/server-editor/interfaces/IMinimapPropertyItemOptions.md) - [`INumberPropertyItemOptions`](/server-editor/interfaces/INumberPropertyItemOptions.md) - [`INumberTimelinePropertyItemOptions`](/server-editor/interfaces/INumberTimelinePropertyItemOptions.md) - [`IProgressIndicatorPropertyItemOptions`](/server-editor/interfaces/IProgressIndicatorPropertyItemOptions.md) - [`IStringPropertyItemOptions`](/server-editor/interfaces/IStringPropertyItemOptions.md) - [`ITagContainerPropertyItemOptions`](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) - [`ITextPropertyItemOptions`](/server-editor/interfaces/ITextPropertyItemOptions.md) - [`ITimelinePlayerOptions`](/server-editor/interfaces/ITimelinePlayerOptions.md) - [`IToggleGroupPropertyItemOptions`](/server-editor/interfaces/IToggleGroupPropertyItemOptions.md) - [`IVector2PropertyItemOptions`](/server-editor/interfaces/IVector2PropertyItemOptions.md) - [`IVector3PropertyItemOptions`](/server-editor/interfaces/IVector3PropertyItemOptions.md) - [`IVector3TimelinePropertyItemOptions`](/server-editor/interfaces/IVector3TimelinePropertyItemOptions.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IPropertyPane.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IPropertyPane.md. # Interface: IPropertyPane **`Beta`** Property pane present dynamic content. It can be associated with an object and presented with different kind of controls. ## Extends - [`IPane`](/server-editor/interfaces/IPane.md) ## Extended by - [`IRootPropertyPane`](/server-editor/interfaces/IRootPropertyPane.md) - [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) ## Properties ### collapsed 实验性 > `readonly` **collapsed**: `boolean` **`Beta`** #### Remarks Pane state for being expanded or collapsed. *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`id`](/server-editor/interfaces/IPane.md#id) *** ### onPropertyPaneVisibilityUpdated > **onPropertyPaneVisibilityUpdated**: [`EventSink`](/server-editor/interfaces/EventSink.md)\<[`PropertyPaneVisibilityUpdate`](/server-editor/types/PropertyPaneVisibilityUpdate.md)> **`Beta`** #### Remarks Provides visibility change events *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks Check visibility of the pane #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`visible`](/server-editor/interfaces/IPane.md#visible) ## Methods ### addBlockList() > **addBlockList**(`value`, `options?`): [`IBlockListPropertyItem`](/server-editor/interfaces/IBlockListPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`\[]> ##### options? [`IBlockListPropertyItemOptions`](/server-editor/interfaces/IBlockListPropertyItemOptions.md) #### Returns [`IBlockListPropertyItem`](/server-editor/interfaces/IBlockListPropertyItem.md) #### Remarks Adds a block list to the pane. *** ### addBlockTable() > **addBlockTable**(`options?`): [`IBlockTablePropertyItem`](/server-editor/interfaces/IBlockTablePropertyItem.md) **`Beta`** #### Parameters ##### options? [`IBlockTablePropertyItemOptions`](/server-editor/interfaces/IBlockTablePropertyItemOptions.md) #### Returns [`IBlockTablePropertyItem`](/server-editor/interfaces/IBlockTablePropertyItem.md) #### Remarks Adds a block table to the pane. *** ### addBool() > **addBool**(`value`, `options?`): [`IBoolPropertyItem`](/server-editor/interfaces/IBoolPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`boolean`> ##### options? [`IBoolPropertyItemOptions`](/server-editor/interfaces/IBoolPropertyItemOptions.md) #### Returns [`IBoolPropertyItem`](/server-editor/interfaces/IBoolPropertyItem.md) #### Remarks Adds a togglable boolean item to the pane. *** ### addButton() > **addButton**(`action`, `options?`): [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) **`Beta`** #### Parameters ##### action [`ButtonPropertyItemSupportedActionTypes`](/server-editor/types/ButtonPropertyItemSupportedActionTypes.md) ##### options? [`IButtonPropertyItemOptions`](/server-editor/interfaces/IButtonPropertyItemOptions.md) #### Returns [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) #### Remarks Adds a button to the pane and binds the specified action to the button interaction. *** ### addButtonPane() > **addButtonPane**(`options?`): [`IButtonPanePropertyItem`](/server-editor/interfaces/IButtonPanePropertyItem.md) **`Beta`** #### Parameters ##### options? [`IButtonPanePropertyItemOptions`](/server-editor/interfaces/IButtonPanePropertyItemOptions.md) #### Returns [`IButtonPanePropertyItem`](/server-editor/interfaces/IButtonPanePropertyItem.md) #### Remarks Adds a pane for grouped button layout. *** ### addCollectionTree() > **addCollectionTree**(`options`): [`ICollectionTreePropertyItem`](/server-editor/interfaces/ICollectionTreePropertyItem.md) **`Beta`** #### Parameters ##### options [`ICollectionTreePropertyItemOptions`](/server-editor/interfaces/ICollectionTreePropertyItemOptions.md) #### Returns [`ICollectionTreePropertyItem`](/server-editor/interfaces/ICollectionTreePropertyItem.md) #### Remarks Adds a tree view for collections with folders and entries. *** ### addColorPicker() > **addColorPicker**(`value`, `options?`): [`IColorPickerPropertyItem`](/server-editor/interfaces/IColorPickerPropertyItem.md) **`Beta`** #### Parameters ##### value `any` ##### options? [`IColorPickerPropertyItemOptions`](/server-editor/interfaces/IColorPickerPropertyItemOptions.md) #### Returns [`IColorPickerPropertyItem`](/server-editor/interfaces/IColorPickerPropertyItem.md) #### Remarks Adds a color picker item to the pane. *** ### addColorTimeline() > **addColorTimeline**(`value`, `options?`): [`IColorTimelinePropertyItem`](/server-editor/interfaces/IColorTimelinePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IColorTimelinePropertyItemOptions`](/server-editor/interfaces/IColorTimelinePropertyItemOptions.md) #### Returns [`IColorTimelinePropertyItem`](/server-editor/interfaces/IColorTimelinePropertyItem.md) #### Remarks Adds a Color Timeline item to the pane. *** ### addComboBox() > **addComboBox**(`value`, `options?`): [`IComboBoxPropertyItem`](/server-editor/interfaces/IComboBoxPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> ##### options? [`IComboBoxPropertyItemOptions`](/server-editor/interfaces/IComboBoxPropertyItemOptions.md) #### Returns [`IComboBoxPropertyItem`](/server-editor/interfaces/IComboBoxPropertyItem.md) #### Remarks Adds a combo box item to the pane. *** ### addDataTable() > **addDataTable**(`options?`): [`IDataTablePropertyItem`](/server-editor/interfaces/IDataTablePropertyItem.md) **`Beta`** #### Parameters ##### options? [`IDataTablePropertyItemOptions`](/server-editor/interfaces/IDataTablePropertyItemOptions.md) #### Returns [`IDataTablePropertyItem`](/server-editor/interfaces/IDataTablePropertyItem.md) #### Remarks Adds a data table to the pane. *** ### addDivider() > **addDivider**(`options?`): [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) **`Beta`** #### Parameters ##### options? [`IDividerPropertyItemOptions`](/server-editor/interfaces/IDividerPropertyItemOptions.md) #### Returns [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) #### Remarks Adds an divider item to the pane. *** ### addDropdown() > **addDropdown**(`value`, `options?`): [`IDropdownPropertyItem`](/server-editor/interfaces/IDropdownPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IDropdownPropertyItemOptions`](/server-editor/interfaces/IDropdownPropertyItemOptions.md) #### Returns [`IDropdownPropertyItem`](/server-editor/interfaces/IDropdownPropertyItem.md) #### Remarks Adds an Dropdown item to the pane. *** ### addImage() > **addImage**(`value`, `options?`): [`IImagePropertyItem`](/server-editor/interfaces/IImagePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string` | [`ImageResourceData`](/server-editor/types/ImageResourceData.md)> ##### options? [`IImagePropertyItemOptions`](/server-editor/interfaces/IImagePropertyItemOptions.md) #### Returns [`IImagePropertyItem`](/server-editor/interfaces/IImagePropertyItem.md) #### Remarks Adds an image item to the pane. *** ### addLink() > **addLink**(`value`, `options?`): [`ILinkPropertyItem`](/server-editor/interfaces/ILinkPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> ##### options? [`ILinkPropertyItemOptions`](/server-editor/interfaces/ILinkPropertyItemOptions.md) #### Returns [`ILinkPropertyItem`](/server-editor/interfaces/ILinkPropertyItem.md) #### Remarks Adds a Link item to the pane. *** ### addListPane() > **addListPane**(`options`): [`IListPanePropertyItem`](/server-editor/interfaces/IListPanePropertyItem.md) **`Beta`** #### Parameters ##### options [`IListPanePropertyItemOptions`](/server-editor/interfaces/IListPanePropertyItemOptions.md) #### Returns [`IListPanePropertyItem`](/server-editor/interfaces/IListPanePropertyItem.md) #### Remarks Adds a pane for displaying list of items in a predefined layout. *** ### addMenu() > **addMenu**(`defaultEntries`, `options?`): [`IMenuPropertyItem`](/server-editor/interfaces/IMenuPropertyItem.md) **`Beta`** #### Parameters ##### defaultEntries `object`\[] ##### options? [`IMenuPropertyItemOptions`](/server-editor/interfaces/IMenuPropertyItemOptions.md) #### Returns [`IMenuPropertyItem`](/server-editor/interfaces/IMenuPropertyItem.md) #### Remarks Adds a menu button property item to the pane. *** ### addMinimap() > **addMinimap**(`mapId`, `options?`): [`IMinimapPropertyItem`](/server-editor/interfaces/IMinimapPropertyItem.md) **`Beta`** #### Parameters ##### mapId `string` ##### options? [`IMinimapPropertyItemOptions`](/server-editor/interfaces/IMinimapPropertyItemOptions.md) #### Returns [`IMinimapPropertyItem`](/server-editor/interfaces/IMinimapPropertyItem.md) #### Remarks Adds Map item to the pane. *** ### addNumber() > **addNumber**(`value`, `options?`): [`INumberPropertyItem`](/server-editor/interfaces/INumberPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`INumberPropertyItemOptions`](/server-editor/interfaces/INumberPropertyItemOptions.md) #### Returns [`INumberPropertyItem`](/server-editor/interfaces/INumberPropertyItem.md) #### Remarks Adds a number item to the pane. *** ### addNumberTimeline() > **addNumberTimeline**(`value`, `options?`): [`INumberTimelinePropertyItem`](/server-editor/interfaces/INumberTimelinePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`INumberTimelinePropertyItemOptions`](/server-editor/interfaces/INumberTimelinePropertyItemOptions.md) #### Returns [`INumberTimelinePropertyItem`](/server-editor/interfaces/INumberTimelinePropertyItem.md) #### Remarks Adds a Number Timeline item to the pane. *** ### addProgressIndicator() > **addProgressIndicator**(`options?`): [`IProgressIndicatorPropertyItem`](/server-editor/interfaces/IProgressIndicatorPropertyItem.md) **`Beta`** #### Parameters ##### options? [`IProgressIndicatorPropertyItemOptions`](/server-editor/interfaces/IProgressIndicatorPropertyItemOptions.md) #### Returns [`IProgressIndicatorPropertyItem`](/server-editor/interfaces/IProgressIndicatorPropertyItem.md) #### Remarks Adds a Progress Indicator item to the pane. *** ### addProxyPane() > **addProxyPane**(`paneId`): `void` **`Beta`** #### Parameters ##### paneId `string` #### Returns `void` #### Remarks Adds a proxy view of another supported pane *** ### addString() > **addString**(`value`, `options?`): [`IStringPropertyItem`](/server-editor/interfaces/IStringPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> ##### options? [`IStringPropertyItemOptions`](/server-editor/interfaces/IStringPropertyItemOptions.md) #### Returns [`IStringPropertyItem`](/server-editor/interfaces/IStringPropertyItem.md) #### Remarks Adds an editable string item to the pane *** ### addTagContainer() > **addTagContainer**(`options?`): [`ITagContainerPropertyItem`](/server-editor/interfaces/ITagContainerPropertyItem.md) **`Beta`** #### Parameters ##### options? [`ITagContainerPropertyItemOptions`](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) #### Returns [`ITagContainerPropertyItem`](/server-editor/interfaces/ITagContainerPropertyItem.md) #### Remarks Adds a tag container to the pane. *** ### addText() > **addText**(`value`, `options?`): [`ITextPropertyItem`](/server-editor/interfaces/ITextPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<[`LocalizedString`](/server-editor/types/LocalizedString.md)> ##### options? [`ITextPropertyItemOptions`](/server-editor/interfaces/ITextPropertyItemOptions.md) #### Returns [`ITextPropertyItem`](/server-editor/interfaces/ITextPropertyItem.md) #### Remarks Adds a multiline Text item to the pane. *** ### addTimelinePlayer() > **addTimelinePlayer**(`options?`): [`ITimelinePlayer`](/server-editor/interfaces/ITimelinePlayer.md) **`Beta`** #### Parameters ##### options? [`ITimelinePlayerOptions`](/server-editor/interfaces/ITimelinePlayerOptions.md) #### Returns [`ITimelinePlayer`](/server-editor/interfaces/ITimelinePlayer.md) #### Remarks Adds a timeline player pane to the pane. The player owns its own playhead and a collection of timeline entries that share that playhead. *** ### addToggleGroup() > **addToggleGroup**(`value`, `options?`): [`IToggleGroupPropertyItem`](/server-editor/interfaces/IToggleGroupPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IToggleGroupPropertyItemOptions`](/server-editor/interfaces/IToggleGroupPropertyItemOptions.md) #### Returns [`IToggleGroupPropertyItem`](/server-editor/interfaces/IToggleGroupPropertyItem.md) #### Remarks Adds a toggle button group to the pane. *** ### addVector2() > **addVector2**(`value`, `options?`): [`IVector2PropertyItem`](/server-editor/interfaces/IVector2PropertyItem.md) **`Beta`** #### Parameters ##### value `any` ##### options? [`IVector2PropertyItemOptions`](/server-editor/interfaces/IVector2PropertyItemOptions.md) #### Returns [`IVector2PropertyItem`](/server-editor/interfaces/IVector2PropertyItem.md) #### Remarks Adds a Vector2 item to the pane. *** ### addVector3() > **addVector3**(`value`, `options?`): [`IVector3PropertyItem`](/server-editor/interfaces/IVector3PropertyItem.md) **`Beta`** #### Parameters ##### value `any` ##### options? [`IVector3PropertyItemOptions`](/server-editor/interfaces/IVector3PropertyItemOptions.md) #### Returns [`IVector3PropertyItem`](/server-editor/interfaces/IVector3PropertyItem.md) #### Remarks Adds a Vector3 item to the pane. *** ### addVector3Timeline() > **addVector3Timeline**(`value`, `options?`): [`IVector3TimelinePropertyItem`](/server-editor/interfaces/IVector3TimelinePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IVector3TimelinePropertyItemOptions`](/server-editor/interfaces/IVector3TimelinePropertyItemOptions.md) #### Returns [`IVector3TimelinePropertyItem`](/server-editor/interfaces/IVector3TimelinePropertyItem.md) #### Remarks Adds a Vector3 Timeline item to the pane. *** ### collapse() > **collapse**(): `void` **`Beta`** #### Returns `void` #### Remarks Collapse the pane. *** ### createSubPane() > **createSubPane**(`options`): [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) **`Beta`** #### Parameters ##### options [`ISubPanePropertyItemOptions`](/server-editor/interfaces/ISubPanePropertyItemOptions.md) #### Returns [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) #### Remarks Creates an sub pane that can store property items. *** ### expand() > **expand**(): `void` **`Beta`** #### Returns `void` #### Remarks Expand the pane. *** ### getTitle() > **getTitle**(): [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` **`Beta`** #### Returns [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` #### Remarks Returns pane title. *** ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`hide`](/server-editor/interfaces/IPane.md#hide) *** ### removeSubPane() > **removeSubPane**(`paneToRemove`): `boolean` **`Beta`** #### Parameters ##### paneToRemove `IPropertyPane` #### Returns `boolean` #### Remarks Removes an existing sub pane. *** ### setTitle() > **setTitle**(`newTitle`): `void` **`Beta`** #### Parameters ##### newTitle [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title #### Returns `void` #### Remarks Updates title of pane. *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the pane and all of its items. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`show`](/server-editor/interfaces/IPane.md#show) *** ### toggleSubPaneVisibility() > **toggleSubPaneVisibility**(`subPaneId`): `void` **`Beta`** #### Parameters ##### subPaneId `string` | `undefined` Identifier of the sub pane to display. #### Returns `void` #### Remarks Shows only the specified sub-pane, hiding all others [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IPropertyPaneOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IPropertyPaneOptions.md. # Interface: IPropertyPaneOptions **`Beta`** Common optional properties used for constructing a property pane. ## Extended by - [`IIntroductionPaneOptions`](/server-editor/interfaces/IIntroductionPaneOptions.md) - [`IRootPropertyPaneOptions`](/server-editor/interfaces/IRootPropertyPaneOptions.md) - [`ISubPanePropertyItemOptions`](/server-editor/interfaces/ISubPanePropertyItemOptions.md) ## Properties ### infoTooltip? > `optional` **infoTooltip?**: [`TooltipInteractiveContent`](/server-editor/types/TooltipInteractiveContent.md) **`Beta`** #### Remarks Optional information tooltip for the pane to be displayed on the header. *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property pane *** ### uniqueId? > `optional` **uniqueId?**: `string` **`Beta`** #### Remarks Unique identifier for the pane [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IRegisterExtensionOptionalParameters.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IRegisterExtensionOptionalParameters.md. # Interface: IRegisterExtensionOptionalParameters **`Beta`** Optional parameter definition for RegisterEditorExtension function Allows the extension registrar to specify optional textual description and notes which would be visible through the extension manager ## Properties ### description? > `optional` **description?**: `string` **`Beta`** #### Remarks Description of the extension. *** ### notes? > `optional` **notes?**: `string` **`Beta`** #### Remarks Additional notes and description of the extension. *** ### toolGroupId? > `optional` **toolGroupId?**: `string` **`Beta`** #### Remarks An optional custom group identifier that will be used for all Modal Tools created from the registered extension. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IRegisteredKeyBinding.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IRegisteredKeyBinding.md. # Interface: IRegisteredKeyBinding **`Beta`** Key binding that is registered to an input context ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the binding. ## Methods ### getProcessingState() > **getProcessingState**(): [`KeyProcessingState`](/server-editor/enums/KeyProcessingState.md) **`Beta`** #### Returns [`KeyProcessingState`](/server-editor/enums/KeyProcessingState.md) #### Remarks Returns current processing state of the binding. *** ### setProcessingState() > **setProcessingState**(`newState`): `void` **`Beta`** #### Parameters ##### newState [`KeyProcessingState`](/server-editor/enums/KeyProcessingState.md) | `undefined` New binding processing state. #### Returns `void` #### Remarks Updates how the key input will be processed for this binding. If undefined, it will be consumed. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IRootPropertyPane.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IRootPropertyPane.md. # Interface: IRootPropertyPane **`Beta`** A root pane that can store property items. ## Extends - [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) ## Properties ### collapsed > `readonly` **collapsed**: `boolean` **`Beta`** #### Remarks Pane state for being expanded or collapsed. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`collapsed`](/server-editor/interfaces/IPropertyPane.md#collapsed) *** ### drawerPane > `readonly` **drawerPane**: [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) **`Beta`** #### Remarks Property pane that is displayed over the root pane content *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`id`](/server-editor/interfaces/IPropertyPane.md#id) *** ### onPropertyPaneVisibilityUpdated > **onPropertyPaneVisibilityUpdated**: [`EventSink`](/server-editor/interfaces/EventSink.md)\<[`PropertyPaneVisibilityUpdate`](/server-editor/types/PropertyPaneVisibilityUpdate.md)> **`Beta`** #### Remarks Provides visibility change events #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`onPropertyPaneVisibilityUpdated`](/server-editor/interfaces/IPropertyPane.md#onpropertypanevisibilityupdated) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks Check visibility of the pane #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`visible`](/server-editor/interfaces/IPropertyPane.md#visible) ## Methods ### addBlockList() > **addBlockList**(`value`, `options?`): [`IBlockListPropertyItem`](/server-editor/interfaces/IBlockListPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`\[]> ##### options? [`IBlockListPropertyItemOptions`](/server-editor/interfaces/IBlockListPropertyItemOptions.md) #### Returns [`IBlockListPropertyItem`](/server-editor/interfaces/IBlockListPropertyItem.md) #### Remarks Adds a block list to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addBlockList`](/server-editor/interfaces/IPropertyPane.md#addblocklist) *** ### addBlockTable() > **addBlockTable**(`options?`): [`IBlockTablePropertyItem`](/server-editor/interfaces/IBlockTablePropertyItem.md) **`Beta`** #### Parameters ##### options? [`IBlockTablePropertyItemOptions`](/server-editor/interfaces/IBlockTablePropertyItemOptions.md) #### Returns [`IBlockTablePropertyItem`](/server-editor/interfaces/IBlockTablePropertyItem.md) #### Remarks Adds a block table to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addBlockTable`](/server-editor/interfaces/IPropertyPane.md#addblocktable) *** ### addBool() > **addBool**(`value`, `options?`): [`IBoolPropertyItem`](/server-editor/interfaces/IBoolPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`boolean`> ##### options? [`IBoolPropertyItemOptions`](/server-editor/interfaces/IBoolPropertyItemOptions.md) #### Returns [`IBoolPropertyItem`](/server-editor/interfaces/IBoolPropertyItem.md) #### Remarks Adds a togglable boolean item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addBool`](/server-editor/interfaces/IPropertyPane.md#addbool) *** ### addButton() > **addButton**(`action`, `options?`): [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) **`Beta`** #### Parameters ##### action [`ButtonPropertyItemSupportedActionTypes`](/server-editor/types/ButtonPropertyItemSupportedActionTypes.md) ##### options? [`IButtonPropertyItemOptions`](/server-editor/interfaces/IButtonPropertyItemOptions.md) #### Returns [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) #### Remarks Adds a button to the pane and binds the specified action to the button interaction. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addButton`](/server-editor/interfaces/IPropertyPane.md#addbutton) *** ### addButtonPane() > **addButtonPane**(`options?`): [`IButtonPanePropertyItem`](/server-editor/interfaces/IButtonPanePropertyItem.md) **`Beta`** #### Parameters ##### options? [`IButtonPanePropertyItemOptions`](/server-editor/interfaces/IButtonPanePropertyItemOptions.md) #### Returns [`IButtonPanePropertyItem`](/server-editor/interfaces/IButtonPanePropertyItem.md) #### Remarks Adds a pane for grouped button layout. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addButtonPane`](/server-editor/interfaces/IPropertyPane.md#addbuttonpane) *** ### addCollectionTree() > **addCollectionTree**(`options`): [`ICollectionTreePropertyItem`](/server-editor/interfaces/ICollectionTreePropertyItem.md) **`Beta`** #### Parameters ##### options [`ICollectionTreePropertyItemOptions`](/server-editor/interfaces/ICollectionTreePropertyItemOptions.md) #### Returns [`ICollectionTreePropertyItem`](/server-editor/interfaces/ICollectionTreePropertyItem.md) #### Remarks Adds a tree view for collections with folders and entries. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addCollectionTree`](/server-editor/interfaces/IPropertyPane.md#addcollectiontree) *** ### addColorPicker() > **addColorPicker**(`value`, `options?`): [`IColorPickerPropertyItem`](/server-editor/interfaces/IColorPickerPropertyItem.md) **`Beta`** #### Parameters ##### value `any` ##### options? [`IColorPickerPropertyItemOptions`](/server-editor/interfaces/IColorPickerPropertyItemOptions.md) #### Returns [`IColorPickerPropertyItem`](/server-editor/interfaces/IColorPickerPropertyItem.md) #### Remarks Adds a color picker item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addColorPicker`](/server-editor/interfaces/IPropertyPane.md#addcolorpicker) *** ### addColorTimeline() > **addColorTimeline**(`value`, `options?`): [`IColorTimelinePropertyItem`](/server-editor/interfaces/IColorTimelinePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IColorTimelinePropertyItemOptions`](/server-editor/interfaces/IColorTimelinePropertyItemOptions.md) #### Returns [`IColorTimelinePropertyItem`](/server-editor/interfaces/IColorTimelinePropertyItem.md) #### Remarks Adds a Color Timeline item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addColorTimeline`](/server-editor/interfaces/IPropertyPane.md#addcolortimeline) *** ### addComboBox() > **addComboBox**(`value`, `options?`): [`IComboBoxPropertyItem`](/server-editor/interfaces/IComboBoxPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> ##### options? [`IComboBoxPropertyItemOptions`](/server-editor/interfaces/IComboBoxPropertyItemOptions.md) #### Returns [`IComboBoxPropertyItem`](/server-editor/interfaces/IComboBoxPropertyItem.md) #### Remarks Adds a combo box item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addComboBox`](/server-editor/interfaces/IPropertyPane.md#addcombobox) *** ### addDataTable() > **addDataTable**(`options?`): [`IDataTablePropertyItem`](/server-editor/interfaces/IDataTablePropertyItem.md) **`Beta`** #### Parameters ##### options? [`IDataTablePropertyItemOptions`](/server-editor/interfaces/IDataTablePropertyItemOptions.md) #### Returns [`IDataTablePropertyItem`](/server-editor/interfaces/IDataTablePropertyItem.md) #### Remarks Adds a data table to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addDataTable`](/server-editor/interfaces/IPropertyPane.md#adddatatable) *** ### addDivider() > **addDivider**(`options?`): [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) **`Beta`** #### Parameters ##### options? [`IDividerPropertyItemOptions`](/server-editor/interfaces/IDividerPropertyItemOptions.md) #### Returns [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) #### Remarks Adds an divider item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addDivider`](/server-editor/interfaces/IPropertyPane.md#adddivider) *** ### addDropdown() > **addDropdown**(`value`, `options?`): [`IDropdownPropertyItem`](/server-editor/interfaces/IDropdownPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IDropdownPropertyItemOptions`](/server-editor/interfaces/IDropdownPropertyItemOptions.md) #### Returns [`IDropdownPropertyItem`](/server-editor/interfaces/IDropdownPropertyItem.md) #### Remarks Adds an Dropdown item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addDropdown`](/server-editor/interfaces/IPropertyPane.md#adddropdown) *** ### addImage() > **addImage**(`value`, `options?`): [`IImagePropertyItem`](/server-editor/interfaces/IImagePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string` | [`ImageResourceData`](/server-editor/types/ImageResourceData.md)> ##### options? [`IImagePropertyItemOptions`](/server-editor/interfaces/IImagePropertyItemOptions.md) #### Returns [`IImagePropertyItem`](/server-editor/interfaces/IImagePropertyItem.md) #### Remarks Adds an image item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addImage`](/server-editor/interfaces/IPropertyPane.md#addimage) *** ### addLink() > **addLink**(`value`, `options?`): [`ILinkPropertyItem`](/server-editor/interfaces/ILinkPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> ##### options? [`ILinkPropertyItemOptions`](/server-editor/interfaces/ILinkPropertyItemOptions.md) #### Returns [`ILinkPropertyItem`](/server-editor/interfaces/ILinkPropertyItem.md) #### Remarks Adds a Link item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addLink`](/server-editor/interfaces/IPropertyPane.md#addlink) *** ### addListPane() > **addListPane**(`options`): [`IListPanePropertyItem`](/server-editor/interfaces/IListPanePropertyItem.md) **`Beta`** #### Parameters ##### options [`IListPanePropertyItemOptions`](/server-editor/interfaces/IListPanePropertyItemOptions.md) #### Returns [`IListPanePropertyItem`](/server-editor/interfaces/IListPanePropertyItem.md) #### Remarks Adds a pane for displaying list of items in a predefined layout. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addListPane`](/server-editor/interfaces/IPropertyPane.md#addlistpane) *** ### addMenu() > **addMenu**(`defaultEntries`, `options?`): [`IMenuPropertyItem`](/server-editor/interfaces/IMenuPropertyItem.md) **`Beta`** #### Parameters ##### defaultEntries `object`\[] ##### options? [`IMenuPropertyItemOptions`](/server-editor/interfaces/IMenuPropertyItemOptions.md) #### Returns [`IMenuPropertyItem`](/server-editor/interfaces/IMenuPropertyItem.md) #### Remarks Adds a menu button property item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addMenu`](/server-editor/interfaces/IPropertyPane.md#addmenu) *** ### addMinimap() > **addMinimap**(`mapId`, `options?`): [`IMinimapPropertyItem`](/server-editor/interfaces/IMinimapPropertyItem.md) **`Beta`** #### Parameters ##### mapId `string` ##### options? [`IMinimapPropertyItemOptions`](/server-editor/interfaces/IMinimapPropertyItemOptions.md) #### Returns [`IMinimapPropertyItem`](/server-editor/interfaces/IMinimapPropertyItem.md) #### Remarks Adds Map item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addMinimap`](/server-editor/interfaces/IPropertyPane.md#addminimap) *** ### addNumber() > **addNumber**(`value`, `options?`): [`INumberPropertyItem`](/server-editor/interfaces/INumberPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`INumberPropertyItemOptions`](/server-editor/interfaces/INumberPropertyItemOptions.md) #### Returns [`INumberPropertyItem`](/server-editor/interfaces/INumberPropertyItem.md) #### Remarks Adds a number item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addNumber`](/server-editor/interfaces/IPropertyPane.md#addnumber) *** ### addNumberTimeline() > **addNumberTimeline**(`value`, `options?`): [`INumberTimelinePropertyItem`](/server-editor/interfaces/INumberTimelinePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`INumberTimelinePropertyItemOptions`](/server-editor/interfaces/INumberTimelinePropertyItemOptions.md) #### Returns [`INumberTimelinePropertyItem`](/server-editor/interfaces/INumberTimelinePropertyItem.md) #### Remarks Adds a Number Timeline item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addNumberTimeline`](/server-editor/interfaces/IPropertyPane.md#addnumbertimeline) *** ### addProgressIndicator() > **addProgressIndicator**(`options?`): [`IProgressIndicatorPropertyItem`](/server-editor/interfaces/IProgressIndicatorPropertyItem.md) **`Beta`** #### Parameters ##### options? [`IProgressIndicatorPropertyItemOptions`](/server-editor/interfaces/IProgressIndicatorPropertyItemOptions.md) #### Returns [`IProgressIndicatorPropertyItem`](/server-editor/interfaces/IProgressIndicatorPropertyItem.md) #### Remarks Adds a Progress Indicator item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addProgressIndicator`](/server-editor/interfaces/IPropertyPane.md#addprogressindicator) *** ### addProxyPane() > **addProxyPane**(`paneId`): `void` **`Beta`** #### Parameters ##### paneId `string` #### Returns `void` #### Remarks Adds a proxy view of another supported pane #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addProxyPane`](/server-editor/interfaces/IPropertyPane.md#addproxypane) *** ### addString() > **addString**(`value`, `options?`): [`IStringPropertyItem`](/server-editor/interfaces/IStringPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> ##### options? [`IStringPropertyItemOptions`](/server-editor/interfaces/IStringPropertyItemOptions.md) #### Returns [`IStringPropertyItem`](/server-editor/interfaces/IStringPropertyItem.md) #### Remarks Adds an editable string item to the pane #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addString`](/server-editor/interfaces/IPropertyPane.md#addstring) *** ### addTagContainer() > **addTagContainer**(`options?`): [`ITagContainerPropertyItem`](/server-editor/interfaces/ITagContainerPropertyItem.md) **`Beta`** #### Parameters ##### options? [`ITagContainerPropertyItemOptions`](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) #### Returns [`ITagContainerPropertyItem`](/server-editor/interfaces/ITagContainerPropertyItem.md) #### Remarks Adds a tag container to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addTagContainer`](/server-editor/interfaces/IPropertyPane.md#addtagcontainer) *** ### addText() > **addText**(`value`, `options?`): [`ITextPropertyItem`](/server-editor/interfaces/ITextPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<[`LocalizedString`](/server-editor/types/LocalizedString.md)> ##### options? [`ITextPropertyItemOptions`](/server-editor/interfaces/ITextPropertyItemOptions.md) #### Returns [`ITextPropertyItem`](/server-editor/interfaces/ITextPropertyItem.md) #### Remarks Adds a multiline Text item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addText`](/server-editor/interfaces/IPropertyPane.md#addtext) *** ### addTimelinePlayer() > **addTimelinePlayer**(`options?`): [`ITimelinePlayer`](/server-editor/interfaces/ITimelinePlayer.md) **`Beta`** #### Parameters ##### options? [`ITimelinePlayerOptions`](/server-editor/interfaces/ITimelinePlayerOptions.md) #### Returns [`ITimelinePlayer`](/server-editor/interfaces/ITimelinePlayer.md) #### Remarks Adds a timeline player pane to the pane. The player owns its own playhead and a collection of timeline entries that share that playhead. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addTimelinePlayer`](/server-editor/interfaces/IPropertyPane.md#addtimelineplayer) *** ### addToggleGroup() > **addToggleGroup**(`value`, `options?`): [`IToggleGroupPropertyItem`](/server-editor/interfaces/IToggleGroupPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IToggleGroupPropertyItemOptions`](/server-editor/interfaces/IToggleGroupPropertyItemOptions.md) #### Returns [`IToggleGroupPropertyItem`](/server-editor/interfaces/IToggleGroupPropertyItem.md) #### Remarks Adds a toggle button group to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addToggleGroup`](/server-editor/interfaces/IPropertyPane.md#addtogglegroup) *** ### addVector2() > **addVector2**(`value`, `options?`): [`IVector2PropertyItem`](/server-editor/interfaces/IVector2PropertyItem.md) **`Beta`** #### Parameters ##### value `any` ##### options? [`IVector2PropertyItemOptions`](/server-editor/interfaces/IVector2PropertyItemOptions.md) #### Returns [`IVector2PropertyItem`](/server-editor/interfaces/IVector2PropertyItem.md) #### Remarks Adds a Vector2 item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addVector2`](/server-editor/interfaces/IPropertyPane.md#addvector2) *** ### addVector3() > **addVector3**(`value`, `options?`): [`IVector3PropertyItem`](/server-editor/interfaces/IVector3PropertyItem.md) **`Beta`** #### Parameters ##### value `any` ##### options? [`IVector3PropertyItemOptions`](/server-editor/interfaces/IVector3PropertyItemOptions.md) #### Returns [`IVector3PropertyItem`](/server-editor/interfaces/IVector3PropertyItem.md) #### Remarks Adds a Vector3 item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addVector3`](/server-editor/interfaces/IPropertyPane.md#addvector3) *** ### addVector3Timeline() > **addVector3Timeline**(`value`, `options?`): [`IVector3TimelinePropertyItem`](/server-editor/interfaces/IVector3TimelinePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IVector3TimelinePropertyItemOptions`](/server-editor/interfaces/IVector3TimelinePropertyItemOptions.md) #### Returns [`IVector3TimelinePropertyItem`](/server-editor/interfaces/IVector3TimelinePropertyItem.md) #### Remarks Adds a Vector3 Timeline item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addVector3Timeline`](/server-editor/interfaces/IPropertyPane.md#addvector3timeline) *** ### collapse() > **collapse**(): `void` **`Beta`** #### Returns `void` #### Remarks Collapse the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`collapse`](/server-editor/interfaces/IPropertyPane.md#collapse) *** ### createModalOverlayPane() > **createModalOverlayPane**(`options?`): [`IModalOverlayPane`](/server-editor/interfaces/IModalOverlayPane.md) **`Beta`** #### Parameters ##### options? [`IModalOverlayPaneOptions`](/server-editor/interfaces/IModalOverlayPaneOptions.md) Creation parameters for modal overlay pane. #### Returns [`IModalOverlayPane`](/server-editor/interfaces/IModalOverlayPane.md) #### Remarks Register a modal overlay to the root pane. It will be hidden by default, when shown it will display over the root pane content. Only one modal overlay can be shown at a time. *** ### createSubPane() > **createSubPane**(`options`): [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) **`Beta`** #### Parameters ##### options [`ISubPanePropertyItemOptions`](/server-editor/interfaces/ISubPanePropertyItemOptions.md) #### Returns [`ISubPanePropertyItem`](/server-editor/interfaces/ISubPanePropertyItem.md) #### Remarks Creates an sub pane that can store property items. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`createSubPane`](/server-editor/interfaces/IPropertyPane.md#createsubpane) *** ### expand() > **expand**(): `void` **`Beta`** #### Returns `void` #### Remarks Expand the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`expand`](/server-editor/interfaces/IPropertyPane.md#expand) *** ### getActiveModalOverlayId() > **getActiveModalOverlayId**(): `string` | `undefined` **`Beta`** #### Returns `string` | `undefined` Unique identifier of the active modal overlay #### Remarks *** ### getTitle() > **getTitle**(): [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` **`Beta`** #### Returns [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` #### Remarks Returns pane title. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`getTitle`](/server-editor/interfaces/IPropertyPane.md#gettitle) *** ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`hide`](/server-editor/interfaces/IPropertyPane.md#hide) *** ### isHeaderActionVisible() > **isHeaderActionVisible**(): `boolean` **`Beta`** #### Returns `boolean` Current visibility state of header action #### Remarks *** ### removeSubPane() > **removeSubPane**(`paneToRemove`): `boolean` **`Beta`** #### Parameters ##### paneToRemove [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) #### Returns `boolean` #### Remarks Removes an existing sub pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`removeSubPane`](/server-editor/interfaces/IPropertyPane.md#removesubpane) *** ### setActiveModalOverlay() > **setActiveModalOverlay**(`id`): `void` **`Beta`** #### Parameters ##### id `string` | `undefined` Unique id for modal overlay pane. #### Returns `void` #### Remarks Sets registered modal overlay as active, if not found it will hide the current. *** ### setHeaderActionVisibility() > **setHeaderActionVisibility**(`visible`): `void` **`Beta`** #### Parameters ##### visible `boolean` New visibility state of the action button. #### Returns `void` #### Remarks If a header action exists, updates visibility of the button. *** ### setTitle() > **setTitle**(`newTitle`): `void` **`Beta`** #### Parameters ##### newTitle [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title #### Returns `void` #### Remarks Updates title of pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`setTitle`](/server-editor/interfaces/IPropertyPane.md#settitle) *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the pane and all of its items. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`show`](/server-editor/interfaces/IPropertyPane.md#show) *** ### toggleSubPaneVisibility() > **toggleSubPaneVisibility**(`subPaneId`): `void` **`Beta`** #### Parameters ##### subPaneId `string` | `undefined` Identifier of the sub pane to display. #### Returns `void` #### Remarks Shows only the specified sub-pane, hiding all others #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`toggleSubPaneVisibility`](/server-editor/interfaces/IPropertyPane.md#togglesubpanevisibility) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IRootPropertyPaneHeaderAction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IRootPropertyPaneHeaderAction.md. # Interface: IRootPropertyPaneHeaderAction **`Beta`** Represents the data to display an action button on a root property pane header. ## Properties ### action? > `optional` **action?**: () => `void` **`Beta`** #### Returns `void` *** ### icon > **icon**: `string` **`Beta`** *** ### tooltip? > `optional` **tooltip?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IRootPropertyPaneOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IRootPropertyPaneOptions.md. # Interface: IRootPropertyPaneOptions **`Beta`** The options to create a root pane. ## Extends - [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md) ## Properties ### contentBadgeId? > `optional` **contentBadgeId?**: `string` **`Beta`** #### Remarks Optional content badge identifier associated with the root pane. *** ### headerAction? > `optional` **headerAction?**: [`IRootPropertyPaneHeaderAction`](/server-editor/interfaces/IRootPropertyPaneHeaderAction.md) **`Beta`** #### Remarks Optional action button to be displayed on the header. *** ### icon? > `optional` **icon?**: `string` **`Beta`** #### Remarks Pane icon shown in front of the pane header *** ### infoTooltip? > `optional` **infoTooltip?**: [`TooltipInteractiveContent`](/server-editor/types/TooltipInteractiveContent.md) **`Beta`** #### Remarks Optional information tooltip for the pane to be displayed on the header. #### Inherited from [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md).[`infoTooltip`](/server-editor/interfaces/IPropertyPaneOptions.md#infotooltip) *** ### location? > `optional` **location?**: [`RootPaneLocation`](/server-editor/enums/RootPaneLocation.md) **`Beta`** #### Remarks Determines how root pane will be displayed in the UI. *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property pane #### Inherited from [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md).[`title`](/server-editor/interfaces/IPropertyPaneOptions.md#title) *** ### uniqueId? > `optional` **uniqueId?**: `string` **`Beta`** #### Remarks Unique identifier for the pane #### Inherited from [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md).[`uniqueId`](/server-editor/interfaces/IPropertyPaneOptions.md#uniqueid) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IStatusBar.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IStatusBar.md. # Interface: IStatusBar **`Beta`** Manager and container for IStatusBarItem objects ## Methods ### createItem() > **createItem**(`props`): [`IStatusBarItem`](/server-editor/interfaces/IStatusBarItem.md) **`Beta`** #### Parameters ##### props [`IStatusBarItemCreationParams`](/server-editor/interfaces/IStatusBarItemCreationParams.md) Properties to create status bar item #### Returns [`IStatusBarItem`](/server-editor/interfaces/IStatusBarItem.md) #### Remarks Create a item in status bar *** ### removeItem() > **removeItem**(`id`): `void` **`Beta`** #### Parameters ##### id `string` Status bar item identifier #### Returns `void` #### Remarks Remove an existing status bar item [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IStatusBarItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IStatusBarItem.md. # Interface: IStatusBarItem **`Beta`** ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the item. ## Methods ### getText() > **getText**(): [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Returns [`LocalizedString`](/server-editor/types/LocalizedString.md) #### Remarks Returns display text of the item. *** ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the Status Bar Item. *** ### setText() > **setText**(`text`): `void` **`Beta`** #### Parameters ##### text [`LocalizedString`](/server-editor/types/LocalizedString.md) New display text #### Returns `void` #### Remarks Updates display text of the item. *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the Status Bar Item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IStatusBarItemCreationParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IStatusBarItemCreationParams.md. # Interface: IStatusBarItemCreationParams **`Beta`** Properties required to create a status bar item ## Properties ### alignment? > `optional` **alignment?**: [`StatusBarAlignment`](/server-editor/enums/StatusBarAlignment.md) **`Beta`** #### Remarks Alignment of item within status bar. If undefined, it will be left aligned. *** ### icon? > `optional` **icon?**: `string` **`Beta`** #### Remarks Optional icon image resource of the item. *** ### size? > `optional` **size?**: `number` **`Beta`** #### Remarks Size of the status bar item. If undefined, it will wrap text content. *** ### text? > `optional` **text?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Default localized display text of the item. If undefined, it will be empty string. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Default visibility of the item. If undefined, it will be true. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IStringPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IStringPropertyItem.md. # Interface: IStringPropertyItem **`Beta`** A property item which supports String properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `string` **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` New tooltip. #### Returns `void` #### Remarks Updates tooltip description of property item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IStringPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IStringPropertyItemOptions.md. # Interface: IStringPropertyItemOptions **`Beta`** Optional properties for String property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### filterProfanity? > `optional` **filterProfanity?**: `boolean` **`Beta`** #### Remarks If true, profanity filtering will be applied on blur and a warning modal will be shown. The field value will be cleared if profanity is detected. *** ### hasClearButton? > `optional` **hasClearButton?**: `boolean` **`Beta`** #### Remarks Shows clear button for the item. If undefined, it will be true. *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. If undefined, the label will be visible by default. *** ### inlineLabel? > `optional` **inlineLabel?**: `boolean` **`Beta`** #### Remarks Displays label inline. If undefined, it will be true. *** ### multilineHeight? > `optional` **multilineHeight?**: `number` **`Beta`** #### Remarks If defined, string will be handled as multiline input. *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`) => `void` **`Beta`** #### Parameters ##### newValue `string` ##### oldValue `string` #### Returns `void` #### Remarks This callback is called when UI control value is changed. *** ### regexPattern? > `optional` **regexPattern?**: `string` **`Beta`** #### Remarks Optional regular expression pattern to validate string. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ISubPanePropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ISubPanePropertyItem.md. # Interface: ISubPanePropertyItem **`Beta`** A property item which supports Sub Pane properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) ## Properties ### collapsed > `readonly` **collapsed**: `boolean` **`Beta`** #### Remarks Pane state for being expanded or collapsed. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`collapsed`](/server-editor/interfaces/IPropertyPane.md#collapsed) *** ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### onPropertyPaneVisibilityUpdated > **onPropertyPaneVisibilityUpdated**: [`EventSink`](/server-editor/interfaces/EventSink.md)\<[`PropertyPaneVisibilityUpdate`](/server-editor/types/PropertyPaneVisibilityUpdate.md)> **`Beta`** #### Remarks Provides visibility change events #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`onPropertyPaneVisibilityUpdated`](/server-editor/interfaces/IPropertyPane.md#onpropertypanevisibilityupdated) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addBlockList() > **addBlockList**(`value`, `options?`): [`IBlockListPropertyItem`](/server-editor/interfaces/IBlockListPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`\[]> ##### options? [`IBlockListPropertyItemOptions`](/server-editor/interfaces/IBlockListPropertyItemOptions.md) #### Returns [`IBlockListPropertyItem`](/server-editor/interfaces/IBlockListPropertyItem.md) #### Remarks Adds a block list to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addBlockList`](/server-editor/interfaces/IPropertyPane.md#addblocklist) *** ### addBlockTable() > **addBlockTable**(`options?`): [`IBlockTablePropertyItem`](/server-editor/interfaces/IBlockTablePropertyItem.md) **`Beta`** #### Parameters ##### options? [`IBlockTablePropertyItemOptions`](/server-editor/interfaces/IBlockTablePropertyItemOptions.md) #### Returns [`IBlockTablePropertyItem`](/server-editor/interfaces/IBlockTablePropertyItem.md) #### Remarks Adds a block table to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addBlockTable`](/server-editor/interfaces/IPropertyPane.md#addblocktable) *** ### addBool() > **addBool**(`value`, `options?`): [`IBoolPropertyItem`](/server-editor/interfaces/IBoolPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`boolean`> ##### options? [`IBoolPropertyItemOptions`](/server-editor/interfaces/IBoolPropertyItemOptions.md) #### Returns [`IBoolPropertyItem`](/server-editor/interfaces/IBoolPropertyItem.md) #### Remarks Adds a togglable boolean item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addBool`](/server-editor/interfaces/IPropertyPane.md#addbool) *** ### addButton() > **addButton**(`action`, `options?`): [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) **`Beta`** #### Parameters ##### action [`ButtonPropertyItemSupportedActionTypes`](/server-editor/types/ButtonPropertyItemSupportedActionTypes.md) ##### options? [`IButtonPropertyItemOptions`](/server-editor/interfaces/IButtonPropertyItemOptions.md) #### Returns [`IButtonPropertyItem`](/server-editor/interfaces/IButtonPropertyItem.md) #### Remarks Adds a button to the pane and binds the specified action to the button interaction. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addButton`](/server-editor/interfaces/IPropertyPane.md#addbutton) *** ### addButtonPane() > **addButtonPane**(`options?`): [`IButtonPanePropertyItem`](/server-editor/interfaces/IButtonPanePropertyItem.md) **`Beta`** #### Parameters ##### options? [`IButtonPanePropertyItemOptions`](/server-editor/interfaces/IButtonPanePropertyItemOptions.md) #### Returns [`IButtonPanePropertyItem`](/server-editor/interfaces/IButtonPanePropertyItem.md) #### Remarks Adds a pane for grouped button layout. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addButtonPane`](/server-editor/interfaces/IPropertyPane.md#addbuttonpane) *** ### addCollectionTree() > **addCollectionTree**(`options`): [`ICollectionTreePropertyItem`](/server-editor/interfaces/ICollectionTreePropertyItem.md) **`Beta`** #### Parameters ##### options [`ICollectionTreePropertyItemOptions`](/server-editor/interfaces/ICollectionTreePropertyItemOptions.md) #### Returns [`ICollectionTreePropertyItem`](/server-editor/interfaces/ICollectionTreePropertyItem.md) #### Remarks Adds a tree view for collections with folders and entries. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addCollectionTree`](/server-editor/interfaces/IPropertyPane.md#addcollectiontree) *** ### addColorPicker() > **addColorPicker**(`value`, `options?`): [`IColorPickerPropertyItem`](/server-editor/interfaces/IColorPickerPropertyItem.md) **`Beta`** #### Parameters ##### value `any` ##### options? [`IColorPickerPropertyItemOptions`](/server-editor/interfaces/IColorPickerPropertyItemOptions.md) #### Returns [`IColorPickerPropertyItem`](/server-editor/interfaces/IColorPickerPropertyItem.md) #### Remarks Adds a color picker item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addColorPicker`](/server-editor/interfaces/IPropertyPane.md#addcolorpicker) *** ### addColorTimeline() > **addColorTimeline**(`value`, `options?`): [`IColorTimelinePropertyItem`](/server-editor/interfaces/IColorTimelinePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IColorTimelinePropertyItemOptions`](/server-editor/interfaces/IColorTimelinePropertyItemOptions.md) #### Returns [`IColorTimelinePropertyItem`](/server-editor/interfaces/IColorTimelinePropertyItem.md) #### Remarks Adds a Color Timeline item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addColorTimeline`](/server-editor/interfaces/IPropertyPane.md#addcolortimeline) *** ### addComboBox() > **addComboBox**(`value`, `options?`): [`IComboBoxPropertyItem`](/server-editor/interfaces/IComboBoxPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> ##### options? [`IComboBoxPropertyItemOptions`](/server-editor/interfaces/IComboBoxPropertyItemOptions.md) #### Returns [`IComboBoxPropertyItem`](/server-editor/interfaces/IComboBoxPropertyItem.md) #### Remarks Adds a combo box item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addComboBox`](/server-editor/interfaces/IPropertyPane.md#addcombobox) *** ### addDataTable() > **addDataTable**(`options?`): [`IDataTablePropertyItem`](/server-editor/interfaces/IDataTablePropertyItem.md) **`Beta`** #### Parameters ##### options? [`IDataTablePropertyItemOptions`](/server-editor/interfaces/IDataTablePropertyItemOptions.md) #### Returns [`IDataTablePropertyItem`](/server-editor/interfaces/IDataTablePropertyItem.md) #### Remarks Adds a data table to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addDataTable`](/server-editor/interfaces/IPropertyPane.md#adddatatable) *** ### addDivider() > **addDivider**(`options?`): [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) **`Beta`** #### Parameters ##### options? [`IDividerPropertyItemOptions`](/server-editor/interfaces/IDividerPropertyItemOptions.md) #### Returns [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) #### Remarks Adds an divider item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addDivider`](/server-editor/interfaces/IPropertyPane.md#adddivider) *** ### addDropdown() > **addDropdown**(`value`, `options?`): [`IDropdownPropertyItem`](/server-editor/interfaces/IDropdownPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IDropdownPropertyItemOptions`](/server-editor/interfaces/IDropdownPropertyItemOptions.md) #### Returns [`IDropdownPropertyItem`](/server-editor/interfaces/IDropdownPropertyItem.md) #### Remarks Adds an Dropdown item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addDropdown`](/server-editor/interfaces/IPropertyPane.md#adddropdown) *** ### addImage() > **addImage**(`value`, `options?`): [`IImagePropertyItem`](/server-editor/interfaces/IImagePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string` | [`ImageResourceData`](/server-editor/types/ImageResourceData.md)> ##### options? [`IImagePropertyItemOptions`](/server-editor/interfaces/IImagePropertyItemOptions.md) #### Returns [`IImagePropertyItem`](/server-editor/interfaces/IImagePropertyItem.md) #### Remarks Adds an image item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addImage`](/server-editor/interfaces/IPropertyPane.md#addimage) *** ### addLink() > **addLink**(`value`, `options?`): [`ILinkPropertyItem`](/server-editor/interfaces/ILinkPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> ##### options? [`ILinkPropertyItemOptions`](/server-editor/interfaces/ILinkPropertyItemOptions.md) #### Returns [`ILinkPropertyItem`](/server-editor/interfaces/ILinkPropertyItem.md) #### Remarks Adds a Link item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addLink`](/server-editor/interfaces/IPropertyPane.md#addlink) *** ### addListPane() > **addListPane**(`options`): [`IListPanePropertyItem`](/server-editor/interfaces/IListPanePropertyItem.md) **`Beta`** #### Parameters ##### options [`IListPanePropertyItemOptions`](/server-editor/interfaces/IListPanePropertyItemOptions.md) #### Returns [`IListPanePropertyItem`](/server-editor/interfaces/IListPanePropertyItem.md) #### Remarks Adds a pane for displaying list of items in a predefined layout. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addListPane`](/server-editor/interfaces/IPropertyPane.md#addlistpane) *** ### addMenu() > **addMenu**(`defaultEntries`, `options?`): [`IMenuPropertyItem`](/server-editor/interfaces/IMenuPropertyItem.md) **`Beta`** #### Parameters ##### defaultEntries `object`\[] ##### options? [`IMenuPropertyItemOptions`](/server-editor/interfaces/IMenuPropertyItemOptions.md) #### Returns [`IMenuPropertyItem`](/server-editor/interfaces/IMenuPropertyItem.md) #### Remarks Adds a menu button property item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addMenu`](/server-editor/interfaces/IPropertyPane.md#addmenu) *** ### addMinimap() > **addMinimap**(`mapId`, `options?`): [`IMinimapPropertyItem`](/server-editor/interfaces/IMinimapPropertyItem.md) **`Beta`** #### Parameters ##### mapId `string` ##### options? [`IMinimapPropertyItemOptions`](/server-editor/interfaces/IMinimapPropertyItemOptions.md) #### Returns [`IMinimapPropertyItem`](/server-editor/interfaces/IMinimapPropertyItem.md) #### Remarks Adds Map item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addMinimap`](/server-editor/interfaces/IPropertyPane.md#addminimap) *** ### addNumber() > **addNumber**(`value`, `options?`): [`INumberPropertyItem`](/server-editor/interfaces/INumberPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`INumberPropertyItemOptions`](/server-editor/interfaces/INumberPropertyItemOptions.md) #### Returns [`INumberPropertyItem`](/server-editor/interfaces/INumberPropertyItem.md) #### Remarks Adds a number item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addNumber`](/server-editor/interfaces/IPropertyPane.md#addnumber) *** ### addNumberTimeline() > **addNumberTimeline**(`value`, `options?`): [`INumberTimelinePropertyItem`](/server-editor/interfaces/INumberTimelinePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`INumberTimelinePropertyItemOptions`](/server-editor/interfaces/INumberTimelinePropertyItemOptions.md) #### Returns [`INumberTimelinePropertyItem`](/server-editor/interfaces/INumberTimelinePropertyItem.md) #### Remarks Adds a Number Timeline item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addNumberTimeline`](/server-editor/interfaces/IPropertyPane.md#addnumbertimeline) *** ### addProgressIndicator() > **addProgressIndicator**(`options?`): [`IProgressIndicatorPropertyItem`](/server-editor/interfaces/IProgressIndicatorPropertyItem.md) **`Beta`** #### Parameters ##### options? [`IProgressIndicatorPropertyItemOptions`](/server-editor/interfaces/IProgressIndicatorPropertyItemOptions.md) #### Returns [`IProgressIndicatorPropertyItem`](/server-editor/interfaces/IProgressIndicatorPropertyItem.md) #### Remarks Adds a Progress Indicator item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addProgressIndicator`](/server-editor/interfaces/IPropertyPane.md#addprogressindicator) *** ### addProxyPane() > **addProxyPane**(`paneId`): `void` **`Beta`** #### Parameters ##### paneId `string` #### Returns `void` #### Remarks Adds a proxy view of another supported pane #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addProxyPane`](/server-editor/interfaces/IPropertyPane.md#addproxypane) *** ### addString() > **addString**(`value`, `options?`): [`IStringPropertyItem`](/server-editor/interfaces/IStringPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> ##### options? [`IStringPropertyItemOptions`](/server-editor/interfaces/IStringPropertyItemOptions.md) #### Returns [`IStringPropertyItem`](/server-editor/interfaces/IStringPropertyItem.md) #### Remarks Adds an editable string item to the pane #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addString`](/server-editor/interfaces/IPropertyPane.md#addstring) *** ### addTagContainer() > **addTagContainer**(`options?`): [`ITagContainerPropertyItem`](/server-editor/interfaces/ITagContainerPropertyItem.md) **`Beta`** #### Parameters ##### options? [`ITagContainerPropertyItemOptions`](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) #### Returns [`ITagContainerPropertyItem`](/server-editor/interfaces/ITagContainerPropertyItem.md) #### Remarks Adds a tag container to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addTagContainer`](/server-editor/interfaces/IPropertyPane.md#addtagcontainer) *** ### addText() > **addText**(`value`, `options?`): [`ITextPropertyItem`](/server-editor/interfaces/ITextPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<[`LocalizedString`](/server-editor/types/LocalizedString.md)> ##### options? [`ITextPropertyItemOptions`](/server-editor/interfaces/ITextPropertyItemOptions.md) #### Returns [`ITextPropertyItem`](/server-editor/interfaces/ITextPropertyItem.md) #### Remarks Adds a multiline Text item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addText`](/server-editor/interfaces/IPropertyPane.md#addtext) *** ### addTimelinePlayer() > **addTimelinePlayer**(`options?`): [`ITimelinePlayer`](/server-editor/interfaces/ITimelinePlayer.md) **`Beta`** #### Parameters ##### options? [`ITimelinePlayerOptions`](/server-editor/interfaces/ITimelinePlayerOptions.md) #### Returns [`ITimelinePlayer`](/server-editor/interfaces/ITimelinePlayer.md) #### Remarks Adds a timeline player pane to the pane. The player owns its own playhead and a collection of timeline entries that share that playhead. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addTimelinePlayer`](/server-editor/interfaces/IPropertyPane.md#addtimelineplayer) *** ### addToggleGroup() > **addToggleGroup**(`value`, `options?`): [`IToggleGroupPropertyItem`](/server-editor/interfaces/IToggleGroupPropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IToggleGroupPropertyItemOptions`](/server-editor/interfaces/IToggleGroupPropertyItemOptions.md) #### Returns [`IToggleGroupPropertyItem`](/server-editor/interfaces/IToggleGroupPropertyItem.md) #### Remarks Adds a toggle button group to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addToggleGroup`](/server-editor/interfaces/IPropertyPane.md#addtogglegroup) *** ### addVector2() > **addVector2**(`value`, `options?`): [`IVector2PropertyItem`](/server-editor/interfaces/IVector2PropertyItem.md) **`Beta`** #### Parameters ##### value `any` ##### options? [`IVector2PropertyItemOptions`](/server-editor/interfaces/IVector2PropertyItemOptions.md) #### Returns [`IVector2PropertyItem`](/server-editor/interfaces/IVector2PropertyItem.md) #### Remarks Adds a Vector2 item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addVector2`](/server-editor/interfaces/IPropertyPane.md#addvector2) *** ### addVector3() > **addVector3**(`value`, `options?`): [`IVector3PropertyItem`](/server-editor/interfaces/IVector3PropertyItem.md) **`Beta`** #### Parameters ##### value `any` ##### options? [`IVector3PropertyItemOptions`](/server-editor/interfaces/IVector3PropertyItemOptions.md) #### Returns [`IVector3PropertyItem`](/server-editor/interfaces/IVector3PropertyItem.md) #### Remarks Adds a Vector3 item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addVector3`](/server-editor/interfaces/IPropertyPane.md#addvector3) *** ### addVector3Timeline() > **addVector3Timeline**(`value`, `options?`): [`IVector3TimelinePropertyItem`](/server-editor/interfaces/IVector3TimelinePropertyItem.md) **`Beta`** #### Parameters ##### value [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> ##### options? [`IVector3TimelinePropertyItemOptions`](/server-editor/interfaces/IVector3TimelinePropertyItemOptions.md) #### Returns [`IVector3TimelinePropertyItem`](/server-editor/interfaces/IVector3TimelinePropertyItem.md) #### Remarks Adds a Vector3 Timeline item to the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`addVector3Timeline`](/server-editor/interfaces/IPropertyPane.md#addvector3timeline) *** ### collapse() > **collapse**(): `void` **`Beta`** #### Returns `void` #### Remarks Collapse the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`collapse`](/server-editor/interfaces/IPropertyPane.md#collapse) *** ### createSubPane() > **createSubPane**(`options`): `ISubPanePropertyItem` **`Beta`** #### Parameters ##### options [`ISubPanePropertyItemOptions`](/server-editor/interfaces/ISubPanePropertyItemOptions.md) #### Returns `ISubPanePropertyItem` #### Remarks Creates an sub pane that can store property items. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`createSubPane`](/server-editor/interfaces/IPropertyPane.md#createsubpane) *** ### expand() > **expand**(): `void` **`Beta`** #### Returns `void` #### Remarks Expand the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`expand`](/server-editor/interfaces/IPropertyPane.md#expand) *** ### getTitle() > **getTitle**(): [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` **`Beta`** #### Returns [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` #### Remarks Returns pane title. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`getTitle`](/server-editor/interfaces/IPropertyPane.md#gettitle) *** ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`hide`](/server-editor/interfaces/IPropertyPane.md#hide) *** ### removeSubPane() > **removeSubPane**(`paneToRemove`): `boolean` **`Beta`** #### Parameters ##### paneToRemove [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md) #### Returns `boolean` #### Remarks Removes an existing sub pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`removeSubPane`](/server-editor/interfaces/IPropertyPane.md#removesubpane) *** ### setAlignment() > **setAlignment**(`alignment`): `void` **`Beta`** #### Parameters ##### alignment [`LayoutAlignment`](/server-editor/enums/LayoutAlignment.md) New layout alignment. #### Returns `void` #### Remarks Updates layout alignment of the sub pane. *** ### setDirection() > **setDirection**(`layout`): `void` **`Beta`** #### Parameters ##### layout [`PaneLayoutType`](/server-editor/enums/PaneLayoutType.md) #### Returns `void` #### Remarks Updates layout direction of the sub pane. *** ### setTitle() > **setTitle**(`newTitle`): `void` **`Beta`** #### Parameters ##### newTitle [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title #### Returns `void` #### Remarks Updates title of pane. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`setTitle`](/server-editor/interfaces/IPropertyPane.md#settitle) *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the pane and all of its items. #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`show`](/server-editor/interfaces/IPropertyPane.md#show) *** ### toggleSubPaneVisibility() > **toggleSubPaneVisibility**(`subPaneId`): `void` **`Beta`** #### Parameters ##### subPaneId `string` | `undefined` Identifier of the sub pane to display. #### Returns `void` #### Remarks Shows only the specified sub-pane, hiding all others #### Inherited from [`IPropertyPane`](/server-editor/interfaces/IPropertyPane.md).[`toggleSubPaneVisibility`](/server-editor/interfaces/IPropertyPane.md#togglesubpanevisibility) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ISubPanePropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ISubPanePropertyItemOptions.md. # Interface: ISubPanePropertyItemOptions **`Beta`** Optional properties for Sub Pane property item ## Extends - [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md) ## Properties ### alignment? > `optional` **alignment?**: [`LayoutAlignment`](/server-editor/enums/LayoutAlignment.md) **`Beta`** #### Remarks Alignment of property items within the pane of the property pane. If undefined, it will default to Left. *** ### collapsed? > `optional` **collapsed?**: `boolean` **`Beta`** #### Remarks Initial expander state of sub pane. If undefined, it will default to false. *** ### hasExpander? > `optional` **hasExpander?**: `boolean` **`Beta`** #### Remarks Determines if sub pane should have an expander. If undefined, it will default to true. *** ### hasMargins? > `optional` **hasMargins?**: `boolean` **`Beta`** #### Remarks Adds additional margins to sub pane. If undefined, it will default to true. *** ### height? > `optional` **height?**: `number` | [`LayoutSize`](/server-editor/types/LayoutSize.md) | [`LayoutFlex`](/server-editor/enums/LayoutFlex.md) **`Beta`** #### Remarks Custom height of the property item. Use LayoutFlex.Grow to fill available vertical space. *** ### icon? > `optional` **icon?**: `string` **`Beta`** #### Remarks Pane icon shown in front of the pane header *** ### infoTooltip? > `optional` **infoTooltip?**: [`TooltipInteractiveContent`](/server-editor/types/TooltipInteractiveContent.md) **`Beta`** #### Remarks Optional information tooltip for the pane to be displayed on the header. #### Inherited from [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md).[`infoTooltip`](/server-editor/interfaces/IPropertyPaneOptions.md#infotooltip) *** ### layout? > `optional` **layout?**: [`PaneLayoutType`](/server-editor/enums/PaneLayoutType.md) **`Beta`** #### Remarks Determines layout of sub pane property items. If undefined, it will default to Vertical. *** ### maxHeight? > `optional` **maxHeight?**: `number` **`Beta`** #### Remarks Maximum height of the property item. *** ### scrollable? > `optional` **scrollable?**: `boolean` **`Beta`** #### Remarks Enables scrolling for the pane if it has a max height defined. *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property pane #### Inherited from [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md).[`title`](/server-editor/interfaces/IPropertyPaneOptions.md#title) *** ### uniqueId? > `optional` **uniqueId?**: `string` **`Beta`** #### Remarks Unique identifier for the pane #### Inherited from [`IPropertyPaneOptions`](/server-editor/interfaces/IPropertyPaneOptions.md).[`uniqueId`](/server-editor/interfaces/IPropertyPaneOptions.md#uniqueid) *** ### width? > `optional` **width?**: `number` | [`LayoutSize`](/server-editor/types/LayoutSize.md) **`Beta`** #### Remarks Custom width of the property item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ITagContainerPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ITagContainerPropertyItem.md. # Interface: ITagContainerPropertyItem inventory **`Beta`** A property item which supports Tag Container properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### tags > `readonly` **tags**: readonly `string`\[] **`Beta`** #### Remarks Current tags value of the property item. *** ### tagsPool > `readonly` **tagsPool**: readonly `string`\[] **`Beta`** #### Remarks Current tags pool value of the property item. *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addTag() > **addTag**(`tag`): `void` **`Beta`** #### Parameters ##### tag `string` Tag to add. #### Returns `void` #### Remarks Adds a tag to the current tags. *** ### addTagToPool() > **addTagToPool**(`tag`): `void` **`Beta`** #### Parameters ##### tag `string` Tag to add to the pool. #### Returns `void` #### Remarks Adds a tag to the tags pool. *** ### removeTag() > **removeTag**(`tag`): `void` **`Beta`** #### Parameters ##### tag `string` Tag to remove. #### Returns `void` #### Remarks Removes a tag from the current tags. *** ### removeTagFromPool() > **removeTagFromPool**(`tag`): `void` **`Beta`** #### Parameters ##### tag `string` Tag to remove from the pool. #### Returns `void` #### Remarks Removes a tag from the tags pool. *** ### setTags() > **setTags**(`tags`): `void` **`Beta`** #### Parameters ##### tags `string`\[] | `undefined` New tags array. #### Returns `void` #### Remarks Updates all tags. *** ### setTagsPool() > **setTagsPool**(`tagsPool`): `void` **`Beta`** #### Parameters ##### tagsPool `string`\[] | `undefined` New tags pool array. #### Returns `void` #### Remarks Updates the tags pool. *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) New title. #### Returns `void` #### Remarks Set title of the property item. *** ### setVariant() > **setVariant**(`variant`): `void` **`Beta`** #### Parameters ##### variant [`TagContainerVariant`](/server-editor/enums/TagContainerVariant.md) | `undefined` New variant. #### Returns `void` #### Remarks Sets the visual variant of the tag container. ## 同领域相关 - [IMenuContainer](/server-editor/interfaces/IMenuContainer.md) - [IModalToolContainer](/server-editor/interfaces/IModalToolContainer.md) - [ITagContainerPropertyItemOptions](/server-editor/interfaces/ITagContainerPropertyItemOptions.md) - [SelectionContainerBase](/server-editor/classes/SelectionContainerBase.md) - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity.md) - [SelectionContainerVolume](/server-editor/classes/SelectionContainerVolume.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ITagContainerPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ITagContainerPropertyItemOptions.md. # Interface: ITagContainerPropertyItemOptions inventory **`Beta`** Optional properties for Tag Container property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### onTagAdded? > `optional` **onTagAdded?**: (`tag`) => `void` **`Beta`** #### Parameters ##### tag `string` #### Returns `void` #### Remarks This callback is called when a tag is added. *** ### onTagRemoved? > `optional` **onTagRemoved?**: (`tag`) => `void` **`Beta`** #### Parameters ##### tag `string` #### Returns `void` #### Remarks This callback is called when a tag is removed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### tags? > `optional` **tags?**: `string`\[] **`Beta`** #### Remarks Initial tags for the container. *** ### tagsPool? > `optional` **tagsPool?**: `string`\[] **`Beta`** #### Remarks Available tags pool to select from. *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### variant? > `optional` **variant?**: [`TagContainerVariant`](/server-editor/enums/TagContainerVariant.md) **`Beta`** #### Remarks Visual variant of the tag container. If undefined, it will default to Inverted. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) ## 同领域相关 - [IMenuContainer](/server-editor/interfaces/IMenuContainer.md) - [IModalToolContainer](/server-editor/interfaces/IModalToolContainer.md) - [ITagContainerPropertyItem](/server-editor/interfaces/ITagContainerPropertyItem.md) - [SelectionContainerBase](/server-editor/classes/SelectionContainerBase.md) - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity.md) - [SelectionContainerVolume](/server-editor/classes/SelectionContainerVolume.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ITextPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ITextPropertyItem.md. # Interface: ITextPropertyItem **`Beta`** A property item which supports Text properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `Readonly`\<[`LocalizedString`](/server-editor/types/LocalizedString.md)> **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### setAlignment() > **setAlignment**(`alignment`): `void` **`Beta`** #### Parameters ##### alignment [`LayoutAlignment`](/server-editor/enums/LayoutAlignment.md) #### Returns `void` #### Remarks Gets layout alignment of the property item. *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` #### Returns `void` #### Remarks Sets title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` New tooltip. #### Returns `void` #### Remarks Updates tooltip description of property item. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ITextPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ITextPropertyItemOptions.md. # Interface: ITextPropertyItemOptions **`Beta`** Optional properties for Text property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### alignment? > `optional` **alignment?**: [`LayoutAlignment`](/server-editor/enums/LayoutAlignment.md) **`Beta`** #### Remarks Determines alignment of the text. If undefined, it will default to left aligned. *** ### border? > `optional` **border?**: `boolean` **`Beta`** #### Remarks Adds a border around the text. If undefined, it will default to true. *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the text item. *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ITimelinePlayer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ITimelinePlayer.md. # Interface: ITimelinePlayer player **`Beta`** A pane that hosts a single playhead and a collection of timeline entries that share it ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`IPane`](/server-editor/interfaces/IPane.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### entryCount > `readonly` **entryCount**: `number` **`Beta`** #### Remarks Number of timeline entries owned by this player. *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addGroup() > **addGroup**(`id`, `name`, `tooltip?`): `void` **`Beta`** #### Parameters ##### id `string` Unique identifier for the group. ##### name [`LocalizedString`](/server-editor/types/LocalizedString.md) Localized display name for the group. ##### tooltip? [`LocalizedString`](/server-editor/types/LocalizedString.md) Optional localized tooltip shown when hovering over the dropdown entry. #### Returns `void` #### Remarks Add a group to the dropdown. *** ### addVector3Timeline() > **addVector3Timeline**(`options`): [`IVector3TimelinePlayerEntry`](/server-editor/interfaces/IVector3TimelinePlayerEntry.md) **`Beta`** #### Parameters ##### options [`IVector3TimelinePlayerEntryOptions`](/server-editor/interfaces/IVector3TimelinePlayerEntryOptions.md) Per-entry options. #### Returns [`IVector3TimelinePlayerEntry`](/server-editor/interfaces/IVector3TimelinePlayerEntry.md) #### Remarks Add a Vector3 timeline entry to the player. *** ### getDuration() > **getDuration**(): `number` **`Beta`** #### Returns `number` #### Remarks Get the total duration in seconds. *** ### getEntryById() > **getEntryById**(`id`): [`ITimelinePlayerEntry`](/server-editor/interfaces/ITimelinePlayerEntry.md) | `undefined` **`Beta`** #### Parameters ##### id `string` Entry identifier. #### Returns [`ITimelinePlayerEntry`](/server-editor/interfaces/ITimelinePlayerEntry.md) | `undefined` #### Remarks Look up an entry by id. *** ### getEntryByIndex() > **getEntryByIndex**(`index`): [`ITimelinePlayerEntry`](/server-editor/interfaces/ITimelinePlayerEntry.md) | `undefined` **`Beta`** #### Parameters ##### index `number` Entry index. #### Returns [`ITimelinePlayerEntry`](/server-editor/interfaces/ITimelinePlayerEntry.md) | `undefined` #### Remarks Look up an entry by index. *** ### getGroups() > **getGroups**(): [`ITimelinePlayerGroup`](/server-editor/interfaces/ITimelinePlayerGroup.md)\[] **`Beta`** #### Returns [`ITimelinePlayerGroup`](/server-editor/interfaces/ITimelinePlayerGroup.md)\[] #### Remarks Get the current list of groups. *** ### getPlaybackState() > **getPlaybackState**(): [`TimelinePlayerPlaybackState`](/server-editor/enums/TimelinePlayerPlaybackState.md) **`Beta`** #### Returns [`TimelinePlayerPlaybackState`](/server-editor/enums/TimelinePlayerPlaybackState.md) #### Remarks Get the current playback state. *** ### getPrecision() > **getPrecision**(): `number` **`Beta`** #### Returns `number` #### Remarks Get the decimal precision used for keyframe time spacing. *** ### getSelectedGroupId() > **getSelectedGroupId**(): `string` **`Beta`** #### Returns `string` #### Remarks Get the currently selected group identifier. *** ### getTime() > **getTime**(): `number` **`Beta`** #### Returns `number` #### Remarks Get the playhead time in seconds. *** ### hide() > **hide**(): `void` **`Beta`** #### Returns `void` #### Remarks Hide the pane. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`hide`](/server-editor/interfaces/IPane.md#hide) *** ### removeEntry() > **removeEntry**(`id`): `boolean` **`Beta`** #### Parameters ##### id `string` Entry identifier. #### Returns `boolean` #### Remarks Remove an entry by id. *** ### removeGroup() > **removeGroup**(`id`): `void` **`Beta`** #### Parameters ##### id `string` Identifier of the group to remove. #### Returns `void` #### Remarks Remove a group from the dropdown. *** ### renameGroup() > **renameGroup**(`id`, `newName`): `void` **`Beta`** #### Parameters ##### id `string` Identifier of the group to rename. ##### newName [`LocalizedString`](/server-editor/types/LocalizedString.md) New localized display name. #### Returns `void` #### Remarks Rename a group in the dropdown. *** ### setDuration() > **setDuration**(`duration`): `void` **`Beta`** #### Parameters ##### duration `number` New duration in seconds. #### Returns `void` #### Remarks Set the total duration in seconds. *** ### setPlaybackState() > **setPlaybackState**(`state`): `void` **`Beta`** #### Parameters ##### state [`TimelinePlayerPlaybackState`](/server-editor/enums/TimelinePlayerPlaybackState.md) New playback state. #### Returns `void` #### Remarks Set the playback state. *** ### setPrecision() > **setPrecision**(`precision`): `void` **`Beta`** #### Parameters ##### precision `number` Decimal precision. #### Returns `void` #### Remarks Set the decimal precision used for keyframe time spacing. *** ### setSelectedGroupId() > **setSelectedGroupId**(`id`): `void` **`Beta`** #### Parameters ##### id `string` Identifier of the group to select. #### Returns `void` #### Remarks Set the selected group. *** ### setTime() > **setTime**(`time`): `void` **`Beta`** #### Parameters ##### time `number` New playhead time in seconds. #### Returns `void` #### Remarks Set the playhead time. *** ### show() > **show**(): `void` **`Beta`** #### Returns `void` #### Remarks Show the pane and all of its items. #### Inherited from [`IPane`](/server-editor/interfaces/IPane.md).[`show`](/server-editor/interfaces/IPane.md#show) ## 同领域相关 - [ITimelinePlayerEntry](/server-editor/interfaces/ITimelinePlayerEntry.md) - [ITimelinePlayerGroup](/server-editor/interfaces/ITimelinePlayerGroup.md) - [ITimelinePlayerOptions](/server-editor/interfaces/ITimelinePlayerOptions.md) - [IVector3TimelinePlayerEntry](/server-editor/interfaces/IVector3TimelinePlayerEntry.md) - [IVector3TimelinePlayerEntryOptions](/server-editor/interfaces/IVector3TimelinePlayerEntryOptions.md) - [TimelinePlayerPlaybackState](/server-editor/enums/TimelinePlayerPlaybackState.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ITimelinePlayerEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ITimelinePlayerEntry.md. # Interface: ITimelinePlayerEntry player **`Beta`** Common interface for all entries owned by a Timeline Player pane ## Extended by - [`IVector3TimelinePlayerEntry`](/server-editor/interfaces/IVector3TimelinePlayerEntry.md) ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the entry. *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks Identifier of the parent Timeline Player pane. *** ### title > `readonly` **title**: [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` **`Beta`** #### Remarks Display title shown next to the entry's graph. ## Methods ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the entry. ## 同领域相关 - [ITimelinePlayer](/server-editor/interfaces/ITimelinePlayer.md) - [ITimelinePlayerGroup](/server-editor/interfaces/ITimelinePlayerGroup.md) - [ITimelinePlayerOptions](/server-editor/interfaces/ITimelinePlayerOptions.md) - [IVector3TimelinePlayerEntry](/server-editor/interfaces/IVector3TimelinePlayerEntry.md) - [IVector3TimelinePlayerEntryOptions](/server-editor/interfaces/IVector3TimelinePlayerEntryOptions.md) - [TimelinePlayerPlaybackState](/server-editor/enums/TimelinePlayerPlaybackState.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ITimelinePlayerGroup.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ITimelinePlayerGroup.md. # Interface: ITimelinePlayerGroup player **`Beta`** A group entry shown in a Timeline Player's group dropdown ## Properties ### id > **id**: `string` **`Beta`** #### Remarks Unique identifier for the group. *** ### name > **name**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized display name shown in the dropdown. *** ### tooltip? > `optional` **tooltip?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Optional localized tooltip shown when hovering over the dropdown entry. ## 同领域相关 - [ITimelinePlayer](/server-editor/interfaces/ITimelinePlayer.md) - [ITimelinePlayerEntry](/server-editor/interfaces/ITimelinePlayerEntry.md) - [ITimelinePlayerOptions](/server-editor/interfaces/ITimelinePlayerOptions.md) - [IVector3TimelinePlayerEntry](/server-editor/interfaces/IVector3TimelinePlayerEntry.md) - [IVector3TimelinePlayerEntryOptions](/server-editor/interfaces/IVector3TimelinePlayerEntryOptions.md) - [TimelinePlayerPlaybackState](/server-editor/enums/TimelinePlayerPlaybackState.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ITimelinePlayerOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ITimelinePlayerOptions.md. # Interface: ITimelinePlayerOptions player **`Beta`** Optional properties for a Timeline Player pane ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### duration? > `optional` **duration?**: `number` **`Beta`** #### Remarks Total duration in seconds. *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### groups? > `optional` **groups?**: [`ITimelinePlayerGroup`](/server-editor/interfaces/ITimelinePlayerGroup.md)\[] **`Beta`** #### Remarks Group entries for the dropdown. *** ### onDurationChanged? > `optional` **onDurationChanged?**: (`duration`) => `void` **`Beta`** #### Parameters ##### duration `number` #### Returns `void` #### Remarks Callback triggered when the total duration changes (e.g. via the timeline drag handle). *** ### onGroupChanged? > `optional` **onGroupChanged?**: (`groupId`) => `void` **`Beta`** #### Parameters ##### groupId `string` #### Returns `void` #### Remarks Callback triggered when the group selection changes. *** ### onPlayStopToggled? > `optional` **onPlayStopToggled?**: () => `void` **`Beta`** #### Returns `void` #### Remarks Callback triggered when the play/stop toggle is clicked. *** ### onRedistributeClicked? > `optional` **onRedistributeClicked?**: () => `void` **`Beta`** #### Returns `void` #### Remarks Callback triggered when the redistribute button is clicked. *** ### onTimeChanged? > `optional` **onTimeChanged?**: (`current`, `prev`) => `void` **`Beta`** #### Parameters ##### current `number` ##### prev `number` #### Returns `void` #### Remarks Callback triggered when the playhead time changes. *** ### playbackState? > `optional` **playbackState?**: [`TimelinePlayerPlaybackState`](/server-editor/enums/TimelinePlayerPlaybackState.md) **`Beta`** #### Remarks Initial playback state. *** ### precision? > `optional` **precision?**: `number` **`Beta`** #### Remarks Decimal precision for keyframe time values. *** ### selectedGroupId? > `optional` **selectedGroupId?**: `string` **`Beta`** #### Remarks Initially selected group identifier. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) ## 同领域相关 - [ITimelinePlayer](/server-editor/interfaces/ITimelinePlayer.md) - [ITimelinePlayerEntry](/server-editor/interfaces/ITimelinePlayerEntry.md) - [ITimelinePlayerGroup](/server-editor/interfaces/ITimelinePlayerGroup.md) - [IVector3TimelinePlayerEntry](/server-editor/interfaces/IVector3TimelinePlayerEntry.md) - [IVector3TimelinePlayerEntryOptions](/server-editor/interfaces/IVector3TimelinePlayerEntryOptions.md) - [TimelinePlayerPlaybackState](/server-editor/enums/TimelinePlayerPlaybackState.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IToggleGroupPropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IToggleGroupPropertyItem.md. # Interface: IToggleGroupPropertyItem **`Beta`** A property item which supports toggle button properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `number` **`Beta`** #### Remarks Current selected entry value. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### getEntryByIndex() > **getEntryByIndex**(`index`): [`IToggleGroupPropertyItemEntry`](/server-editor/interfaces/IToggleGroupPropertyItemEntry.md) | `undefined` **`Beta`** #### Parameters ##### index `number` Index of the toggle entry in the list. #### Returns [`IToggleGroupPropertyItemEntry`](/server-editor/interfaces/IToggleGroupPropertyItemEntry.md) | `undefined` #### Remarks Find a toggle entry at an index in the group. *** ### getEntryByValue() > **getEntryByValue**(`value`): [`IToggleGroupPropertyItemEntry`](/server-editor/interfaces/IToggleGroupPropertyItemEntry.md) | `undefined` **`Beta`** #### Parameters ##### value `number` Value of the toggle entry in the group. #### Returns [`IToggleGroupPropertyItemEntry`](/server-editor/interfaces/IToggleGroupPropertyItemEntry.md) | `undefined` #### Remarks Find a toggle entry with a specific value associated with property item. *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` New tooltip. #### Returns `void` #### Remarks Updates tooltip of the property item. *** ### updateEntries() > **updateEntries**(`entries`, `newValue?`): `void` **`Beta`** #### Parameters ##### entries [`IToggleGroupPropertyItemEntry`](/server-editor/interfaces/IToggleGroupPropertyItemEntry.md)\[] New list of updated entries. ##### newValue? `number` New value value to use for the selected toggle button. #### Returns `void` #### Remarks Update list of toggle group entries. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IToggleGroupPropertyItemEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IToggleGroupPropertyItemEntry.md. # Interface: IToggleGroupPropertyItemEntry **`Beta`** Properties of toggle group property item list entry ## Properties ### enabled? > `readonly` `optional` **enabled?**: `boolean` **`Beta`** #### Remarks Optional enabled state of the entry. If undefined it will be true. *** ### icon? > `readonly` `optional` **icon?**: `string` **`Beta`** #### Remarks Optional icon of the dropdown entry. *** ### label? > `readonly` `optional` **label?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized display text of the entry. *** ### tooltip? > `readonly` `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Optional tooltip description text of the entry. *** ### value > `readonly` **value**: `number` **`Beta`** #### Remarks The selectable value of the entry. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IToggleGroupPropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IToggleGroupPropertyItemOptions.md. # Interface: IToggleGroupPropertyItemOptions **`Beta`** Optional properties for Toggle Group property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### entries? > `optional` **entries?**: [`IToggleGroupPropertyItemEntry`](/server-editor/interfaces/IToggleGroupPropertyItemEntry.md)\[] **`Beta`** #### Remarks List of toggle button entries associated with the property item. If undefined, list will be empty. *** ### hiddenEntryLabels? > `optional` **hiddenEntryLabels?**: `boolean` **`Beta`** #### Remarks If true toggle buttons will be displayed vertically with their labels. If undefined, labels will be hidden. *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. It will be visible by default. *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`, `items`) => `void` **`Beta`** #### Parameters ##### newValue `number` ##### oldValue `number` ##### items [`IToggleGroupPropertyItemEntry`](/server-editor/interfaces/IToggleGroupPropertyItemEntry.md)\[] #### Returns `void` #### Remarks This callback is called when UI control value is changed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item. *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item. *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IVector2PropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IVector2PropertyItem.md. # Interface: IVector2PropertyItem **`Beta`** A property item which supports Vector2 properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `Vector2` **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New button title. #### Returns `void` #### Remarks Updates title of the button. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` New button tooltip. #### Returns `void` #### Remarks Updates tooltip description of the button. *** ### updateAxisLimits() > **updateAxisLimits**(`limits`): `void` **`Beta`** #### Parameters ##### limits ###### max? `any` ###### min? `any` #### Returns `void` #### Remarks Updates Vector2 limits and clamps the current value. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IVector2PropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IVector2PropertyItemOptions.md. # Interface: IVector2PropertyItemOptions **`Beta`** Optional properties for Vector2 property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### hasClearButton? > `optional` **hasClearButton?**: `boolean` **`Beta`** #### Remarks Shows clear button for the item. If undefined, it will be true. *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. It will be visible by default. *** ### isInteger? > `optional` **isInteger?**: `boolean` **`Beta`** #### Remarks If we should treat the Vector2 properties as integer values. By default is false. *** ### max? > `optional` **max?**: `any` **`Beta`** #### Remarks The min possible limits. If undefined, Number.MAX\_SAFE\_INTEGER will be used. *** ### min? > `optional` **min?**: `any` **`Beta`** #### Remarks The min possible limits. If undefined, Number.MIN\_SAFE\_INTEGER will be used. *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`) => `void` **`Beta`** #### Parameters ##### newValue `Vector2` ##### oldValue `Vector2` #### Returns `void` #### Remarks This callback is called when UI control is changed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IVector3Keyframe.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IVector3Keyframe.md. # Interface: IVector3Keyframe **`Beta`** A keyframe in a Vector3 Timeline Player entry ## Properties ### id > **id**: `string` **`Beta`** *** ### time > **time**: `number` **`Beta`** *** ### value > **value**: `Vector3` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IVector3PropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IVector3PropertyItem.md. # Interface: IVector3PropertyItem **`Beta`** A property item which supports Vector3 properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### value > `readonly` **value**: `Vector3` **`Beta`** #### Remarks Current value of the property item. *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New button title. #### Returns `void` #### Remarks Updates title of the button. *** ### setTooltip() > **setTooltip**(`tooltip`): `void` **`Beta`** #### Parameters ##### tooltip [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) | `undefined` New button tooltip. #### Returns `void` #### Remarks Updates tooltip description of the button. *** ### updateAxisLimits() > **updateAxisLimits**(`limits`): `void` **`Beta`** #### Parameters ##### limits ###### max? `any` ###### min? `any` #### Returns `void` #### Remarks Updates Vector3 limits and clamps the current value. [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IVector3PropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IVector3PropertyItemOptions.md. # Interface: IVector3PropertyItemOptions **`Beta`** Optional properties for Vector3 property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### hasClearButton? > `optional` **hasClearButton?**: `boolean` **`Beta`** #### Remarks Shows clear button for the item. If undefined, it will be true. *** ### hiddenLabel? > `optional` **hiddenLabel?**: `boolean` **`Beta`** #### Remarks If true label text will be hidden. It will be visible by default. *** ### hideYAxis? > `optional` **hideYAxis?**: `boolean` **`Beta`** #### Remarks Hides Y axis input field. If undefined, it will be false. *** ### isInteger? > `optional` **isInteger?**: `boolean` **`Beta`** #### Remarks If we should treat the Vector3 properties as integer values. By default is false. *** ### max? > `optional` **max?**: `any` **`Beta`** #### Remarks The min possible limits. If undefined, Number.MAX\_SAFE\_INTEGER will be used. *** ### min? > `optional` **min?**: `any` **`Beta`** #### Remarks The min possible limits. If undefined, Number.MIN\_SAFE\_INTEGER will be used. *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`) => `void` **`Beta`** #### Parameters ##### newValue `Vector3` ##### oldValue `Vector3` #### Returns `void` #### Remarks This callback is called when UI control is changed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the property item *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IVector3TimelinePlayerEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IVector3TimelinePlayerEntry.md. # Interface: IVector3TimelinePlayerEntry player **`Beta`** A Vector3 timeline entry owned by a Timeline Player pane ## Extends - [`ITimelinePlayerEntry`](/server-editor/interfaces/ITimelinePlayerEntry.md) ## Properties ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique identifier for the entry. #### Inherited from [`ITimelinePlayerEntry`](/server-editor/interfaces/ITimelinePlayerEntry.md).[`id`](/server-editor/interfaces/ITimelinePlayerEntry.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks Identifier of the parent Timeline Player pane. #### Inherited from [`ITimelinePlayerEntry`](/server-editor/interfaces/ITimelinePlayerEntry.md).[`paneId`](/server-editor/interfaces/ITimelinePlayerEntry.md#paneid) *** ### title > `readonly` **title**: [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` **`Beta`** #### Remarks Display title shown next to the entry's graph. #### Inherited from [`ITimelinePlayerEntry`](/server-editor/interfaces/ITimelinePlayerEntry.md).[`title`](/server-editor/interfaces/ITimelinePlayerEntry.md#title) ## Methods ### addKeyframe() > **addKeyframe**(`keyframe`): `void` **`Beta`** #### Parameters ##### keyframe [`IVector3Keyframe`](/server-editor/interfaces/IVector3Keyframe.md) Keyframe to add. #### Returns `void` #### Remarks Add a keyframe. *** ### getKeyframes() > **getKeyframes**(): [`IVector3Keyframe`](/server-editor/interfaces/IVector3Keyframe.md)\[] **`Beta`** #### Returns [`IVector3Keyframe`](/server-editor/interfaces/IVector3Keyframe.md)\[] #### Remarks Get the list of keyframes for this entry. *** ### getSelectedKeyframeId() > **getSelectedKeyframeId**(): `string` | `undefined` **`Beta`** #### Returns `string` | `undefined` #### Remarks Get the currently selected keyframe identifier for this entry, or undefined if no keyframe in this entry is selected. *** ### removeKeyframe() > **removeKeyframe**(`id`): `void` **`Beta`** #### Parameters ##### id `string` Identifier of the keyframe to remove. #### Returns `void` #### Remarks Remove a keyframe by its identifier. *** ### setKeyframes() > **setKeyframes**(`keyframes`): `void` **`Beta`** #### Parameters ##### keyframes [`IVector3Keyframe`](/server-editor/interfaces/IVector3Keyframe.md)\[] New set of keyframes. #### Returns `void` #### Remarks Bulk replace all keyframes. *** ### setSelectedKeyframeId() > **setSelectedKeyframeId**(`keyframeId`): `void` **`Beta`** #### Parameters ##### keyframeId `string` | `undefined` Identifier of the keyframe to select, or undefined to deselect. #### Returns `void` #### Remarks Set the selected keyframe for this entry. *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) | `undefined` New title. #### Returns `void` #### Remarks Updates title of the entry. #### Inherited from [`ITimelinePlayerEntry`](/server-editor/interfaces/ITimelinePlayerEntry.md).[`setTitle`](/server-editor/interfaces/ITimelinePlayerEntry.md#settitle) *** ### updateKeyframe() > **updateKeyframe**(`keyframe`): `void` **`Beta`** #### Parameters ##### keyframe [`IVector3Keyframe`](/server-editor/interfaces/IVector3Keyframe.md) Keyframe with updated time/value. #### Returns `void` #### Remarks Update an existing keyframe. Matched by the id field. ## 同领域相关 - [ITimelinePlayer](/server-editor/interfaces/ITimelinePlayer.md) - [ITimelinePlayerEntry](/server-editor/interfaces/ITimelinePlayerEntry.md) - [ITimelinePlayerGroup](/server-editor/interfaces/ITimelinePlayerGroup.md) - [ITimelinePlayerOptions](/server-editor/interfaces/ITimelinePlayerOptions.md) - [IVector3TimelinePlayerEntryOptions](/server-editor/interfaces/IVector3TimelinePlayerEntryOptions.md) - [TimelinePlayerPlaybackState](/server-editor/enums/TimelinePlayerPlaybackState.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IVector3TimelinePlayerEntryOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IVector3TimelinePlayerEntryOptions.md. # Interface: IVector3TimelinePlayerEntryOptions player **`Beta`** Optional properties for a Vector3 timeline entry inside a Timeline Player pane ## Properties ### keyframes? > `optional` **keyframes?**: [`IVector3Keyframe`](/server-editor/interfaces/IVector3Keyframe.md)\[] **`Beta`** #### Remarks Initial keyframe entries for this timeline. *** ### onKeyframeAdded? > `optional` **onKeyframeAdded?**: (`keyframe`) => `void` **`Beta`** #### Parameters ##### keyframe [`IVector3Keyframe`](/server-editor/interfaces/IVector3Keyframe.md) #### Returns `void` #### Remarks Callback triggered when a keyframe is added. *** ### onKeyframeChanged? > `optional` **onKeyframeChanged?**: (`keyframe`) => `void` **`Beta`** #### Parameters ##### keyframe [`IVector3Keyframe`](/server-editor/interfaces/IVector3Keyframe.md) #### Returns `void` #### Remarks Callback triggered when a keyframe is moved or its value changes. *** ### onKeyframeRemoved? > `optional` **onKeyframeRemoved?**: (`keyframe`) => `void` **`Beta`** #### Parameters ##### keyframe [`IVector3Keyframe`](/server-editor/interfaces/IVector3Keyframe.md) #### Returns `void` #### Remarks Callback triggered when a keyframe is removed. *** ### onKeyframeSelected? > `optional` **onKeyframeSelected?**: (`keyframe`) => `void` **`Beta`** #### Parameters ##### keyframe [`IVector3Keyframe`](/server-editor/interfaces/IVector3Keyframe.md) #### Returns `void` #### Remarks Callback triggered when a keyframe is selected. *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Display title shown next to the entry's graph. ## 同领域相关 - [ITimelinePlayer](/server-editor/interfaces/ITimelinePlayer.md) - [ITimelinePlayerEntry](/server-editor/interfaces/ITimelinePlayerEntry.md) - [ITimelinePlayerGroup](/server-editor/interfaces/ITimelinePlayerGroup.md) - [ITimelinePlayerOptions](/server-editor/interfaces/ITimelinePlayerOptions.md) - [IVector3TimelinePlayerEntry](/server-editor/interfaces/IVector3TimelinePlayerEntry.md) - [TimelinePlayerPlaybackState](/server-editor/enums/TimelinePlayerPlaybackState.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IVector3TimelinePropertyItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IVector3TimelinePropertyItem.md. # Interface: IVector3TimelinePropertyItem **`Beta`** A property item which supports Vector3 Timeline properties ## Extends - [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md) ## Properties ### enable > **enable**: `boolean` **`Beta`** #### Remarks If the item is enabled in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`enable`](/server-editor/interfaces/IPropertyItemBase.md#enable) *** ### id > `readonly` **id**: `string` **`Beta`** #### Remarks Unique ID for the property item. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`id`](/server-editor/interfaces/IPropertyItemBase.md#id) *** ### paneId > `readonly` **paneId**: `string` **`Beta`** #### Remarks The parent pane id. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`paneId`](/server-editor/interfaces/IPropertyItemBase.md#paneid) *** ### typeName > `readonly` **typeName**: [`PropertyItemType`](/server-editor/enums/PropertyItemType.md) **`Beta`** #### Remarks The type name of the target property. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`typeName`](/server-editor/interfaces/IPropertyItemBase.md#typename) *** ### visible > **visible**: `boolean` **`Beta`** #### Remarks If the item should be visible in the UI. #### Inherited from [`IPropertyItemBase`](/server-editor/interfaces/IPropertyItemBase.md).[`visible`](/server-editor/interfaces/IPropertyItemBase.md#visible) ## Methods ### addNode() > **addNode**(`data`): `void` **`Beta`** #### Parameters ##### data [`IVector3TimelinePropertyItemEntry`](/server-editor/interfaces/IVector3TimelinePropertyItemEntry.md) New vector3 node. #### Returns `void` #### Remarks Update vector3 timeline entry *** ### getData() > **getData**(): [`IVector3TimelinePropertyItemEntry`](/server-editor/interfaces/IVector3TimelinePropertyItemEntry.md)\[] **`Beta`** #### Returns [`IVector3TimelinePropertyItemEntry`](/server-editor/interfaces/IVector3TimelinePropertyItemEntry.md)\[] #### Remarks Get the list of nodes in the property item. *** ### getTime() > **getTime**(): `number` **`Beta`** #### Returns `number` #### Remarks Get time current time value on the slider. *** ### removeNode() > **removeNode**(`data`): `void` **`Beta`** #### Parameters ##### data [`IVector3TimelinePropertyItemEntry`](/server-editor/interfaces/IVector3TimelinePropertyItemEntry.md) Node to be removed. #### Returns `void` #### Remarks Remove vector3 node *** ### setBounds() > **setBounds**(`bounds`): `void` **`Beta`** #### Parameters ##### bounds ###### maxValue `number` ###### minValue `number` #### Returns `void` #### Remarks Updates data entries value bounds. *** ### setPrecision() > **setPrecision**(`precision`): `void` **`Beta`** #### Parameters ##### precision `number` #### Returns `void` #### Remarks Set custom decimal precision for the calculations *** ### setTime() > **setTime**(`time`): `void` **`Beta`** #### Parameters ##### time `number` The new time value. #### Returns `void` #### Remarks Set time line slider value to a new value *** ### setTitle() > **setTitle**(`title`): `void` **`Beta`** #### Parameters ##### title [`LocalizedString`](/server-editor/types/LocalizedString.md) New title. #### Returns `void` #### Remarks Updates title of the property item. *** ### updateNode() > **updateNode**(`data`): `void` **`Beta`** #### Parameters ##### data [`IVector3TimelinePropertyItemEntry`](/server-editor/interfaces/IVector3TimelinePropertyItemEntry.md) Node to be updated. #### Returns `void` #### Remarks Update node value [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IVector3TimelinePropertyItemEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IVector3TimelinePropertyItemEntry.md. # Interface: IVector3TimelinePropertyItemEntry **`Beta`** Properties of vector3 timeline property item entry ## Properties ### color? > `optional` **color?**: `any` **`Beta`** *** ### id > **id**: `string` **`Beta`** *** ### time > **time**: `number` **`Beta`** *** ### value > **value**: `Vector3` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IVector3TimelinePropertyItemOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IVector3TimelinePropertyItemOptions.md. # Interface: IVector3TimelinePropertyItemOptions **`Beta`** Optional properties for Vector3 Timeline property item ## Extends - [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md) ## Properties ### bounds? > `optional` **bounds?**: `object` **`Beta`** #### maxValue > **maxValue**: `number` #### minValue > **minValue**: `number` #### Remarks The data bounds for the value node property *** ### decimalPrecision? > `optional` **decimalPrecision?**: `number` **`Beta`** #### Remarks Custom precision for the calculations *** ### disableAddRemoveNodes? > `optional` **disableAddRemoveNodes?**: `boolean` **`Beta`** #### Remarks If true, nodes cannot be added or removed *** ### enable? > `optional` **enable?**: `boolean` **`Beta`** #### Remarks Initial enabled state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`enable`](/server-editor/interfaces/IPropertyItemOptionsBase.md#enable) *** ### entries? > `optional` **entries?**: [`IVector3TimelinePropertyItemEntry`](/server-editor/interfaces/IVector3TimelinePropertyItemEntry.md)\[] **`Beta`** #### Remarks List of nodes entries in the vector3 timeline. *** ### isGraphReadOnly? > `optional` **isGraphReadOnly?**: `boolean` **`Beta`** #### Remarks True means nodes cannot be dragged or modified *** ### onNodeAdded? > `optional` **onNodeAdded?**: (`node`) => `void` **`Beta`** #### Parameters ##### node [`IVector3TimelinePropertyItemEntry`](/server-editor/interfaces/IVector3TimelinePropertyItemEntry.md) #### Returns `void` #### Remarks Callback triggered when a new vector3 node is added to the timeline. *** ### onNodeChanged? > `optional` **onNodeChanged?**: (`node`) => `void` **`Beta`** #### Parameters ##### node [`IVector3TimelinePropertyItemEntry`](/server-editor/interfaces/IVector3TimelinePropertyItemEntry.md) #### Returns `void` #### Remarks Callback triggered when a timeline node's vector3 value changes. *** ### onNodeRemoved? > `optional` **onNodeRemoved?**: (`node`) => `void` **`Beta`** #### Parameters ##### node [`IVector3TimelinePropertyItemEntry`](/server-editor/interfaces/IVector3TimelinePropertyItemEntry.md) #### Returns `void` #### Remarks Callback triggered when a vector3 node is removed from the timeline. \* *** ### onTimeChanged? > `optional` **onTimeChanged?**: (`current`, `prev`) => `void` **`Beta`** #### Parameters ##### current `number` ##### prev `number` #### Returns `void` #### Remarks This callback is called when UI control time is changed. *** ### style? > `optional` **style?**: [`PaneItemStyle`](/server-editor/types/PaneItemStyle.md) **`Beta`** #### Remarks Optional styling overrides for the item. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`style`](/server-editor/interfaces/IPropertyItemOptionsBase.md#style) *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the property item *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Remarks Initial visibility state of property item. If undefined, it will default to true. #### Inherited from [`IPropertyItemOptionsBase`](/server-editor/interfaces/IPropertyItemOptionsBase.md).[`visible`](/server-editor/interfaces/IPropertyItemOptionsBase.md#visible) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/IntroductionPaneTabProps.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/IntroductionPaneTabProps.md. # Interface: IntroductionPaneTabProps **`Beta`** Properties for introduction pane tab. ## Properties ### contentHeader? > `optional` **contentHeader?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Optional header for the tab content *** ### contentImage? > `optional` **contentImage?**: `string` **`Beta`** #### Remarks Optional image for the tab content *** ### icon? > `optional` **icon?**: `string` **`Beta`** #### Remarks Icon for the tab *** ### id > **id**: `string` **`Beta`** #### Remarks Unique identifier for the tab *** ### label > **label**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Localized title of the tab [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/LocalizationEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/LocalizationEntry.md. # Interface: LocalizationEntry **`Beta`** ## Properties ### id > **id**: `string` **`Beta`** *** ### props? > `optional` **props?**: `string`\[] **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/LogProperties.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/LogProperties.md. # Interface: LogProperties **`Beta`** A properties class for the global instance of the logger object. While the logger object is available through the [ExtensionContext](/server-editor/classes/ExtensionContext.md) - using the global instance allows the creator to use this properties class to perform direct server->client messaging and broadcasts. ## Properties ### channelMask? > `optional` **channelMask?**: [`LogChannel`](/server-editor/enums/LogChannel.md) **`Beta`** #### Remarks Display the log message to a log channel. If no channel is specified, default channel is regular message. *** ### player? > `optional` **player?**: `any` **`Beta`** #### Remarks Direct a log message to a specific player. If no player is specified, then all players will receive the message *** ### subMessage? > `optional` **subMessage?**: `string` | [`LocalizationEntry`](/server-editor/interfaces/LocalizationEntry.md) **`Beta`** #### Remarks Message to be shown under the message when toast channel is selected. *** ### tags? > `optional` **tags?**: `string`\[] **`Beta`** #### Remarks Add additional tags to the log message which can be used by the client session to filter/search in the log window [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/MinimapCreateOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/MinimapCreateOptions.md. # Interface: MinimapCreateOptions **`Beta`** ## Properties ### dataId? > `optional` **dataId?**: `string` **`Beta`** *** ### freeCenter? > `optional` **freeCenter?**: `any` **`Beta`** *** ### trackingMode? > `optional` **trackingMode?**: [`MinimapTrackingMode`](/server-editor/enums/MinimapTrackingMode.md) **`Beta`** *** ### yLevel? > `optional` **yLevel?**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/MinimapMarkerData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/MinimapMarkerData.md. # Interface: MinimapMarkerData **`Beta`** ## Properties ### clickable > **clickable**: `boolean` **`Beta`** *** ### color > **color**: `RGBA` **`Beta`** *** ### label > **label**: `string` **`Beta`** *** ### position > **position**: `Vector3` **`Beta`** *** ### rotation > **rotation**: `number` **`Beta`** *** ### tooltip > **tooltip**: `string` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ModalDialogCreationParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ModalDialogCreationParams.md. # Interface: ModalDialogCreationParams **`Beta`** Represents parameters to create a modal dialog ## Properties ### canUserDismiss? > `optional` **canUserDismiss?**: `boolean` **`Beta`** #### Remarks Determines if the panel can be dismissed by the user actions. If undefined, it will be true. *** ### height? > `optional` **height?**: `number` **`Beta`** #### Remarks Panel height for the dialog *** ### onActiveRequestChange? > `optional` **onActiveRequestChange?**: (`requestId`) => `void` **`Beta`** #### Parameters ##### requestId `string` | `undefined` #### Returns `void` #### Remarks Callback to notify changes in active request *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) **`Beta`** #### Remarks Dialog title *** ### uniqueId? > `optional` **uniqueId?**: `string` **`Beta`** #### Remarks Optional user defined unique identifier *** ### width? > `optional` **width?**: `number` **`Beta`** #### Remarks Panel width for the dialog [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ModalToolCreationParameters.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ModalToolCreationParameters.md. # Interface: ModalToolCreationParameters **`Beta`** Parameters for creating a modal tool in the tool container ## Properties ### action? > `optional` **action?**: [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`NoArgsAction`](/server-editor/types/NoArgsAction.md)> **`Beta`** #### Remarks Action associated with tool activation *** ### contentBadgeId? > `optional` **contentBadgeId?**: `string` **`Beta`** #### Remarks Content badge id associated with the modal tool *** ### icon? > `optional` **icon?**: `string` **`Beta`** #### Remarks Icon resource *** ### staging? > `optional` **staging?**: `boolean` **`Beta`** #### Remarks When true, the tool will be excluded from tool groups and tool rail *** ### title? > `optional` **title?**: `string` **`Beta`** #### Remarks Localized title of the tool *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) **`Beta`** #### Remarks Tooltip description of the tool [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/ProjectExportOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/ProjectExportOptions.md. # Interface: ProjectExportOptions **`Beta`** ## Properties ### alwaysDay? > `optional` **alwaysDay?**: `boolean` **`Beta`** *** ### difficulty? > `optional` **difficulty?**: `any` **`Beta`** *** ### disableWeather? > `optional` **disableWeather?**: `boolean` **`Beta`** *** ### exportName? > `optional` **exportName?**: `string` **`Beta`** *** ### exportType > **exportType**: [`ProjectExportType`](/server-editor/enums/ProjectExportType.md) **`Beta`** *** ### gameMode? > `optional` **gameMode?**: `any` **`Beta`** *** ### initialTimOfDay? > `optional` **initialTimOfDay?**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/PyramidBrushShapeSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/PyramidBrushShapeSettings.md. # Interface: PyramidBrushShapeSettings **`Beta`** Settings for Pyramid brush shapes ## Properties ### depth > **depth**: `number` **`Beta`** *** ### height > **height**: `number` **`Beta`** *** ### hollow > **hollow**: `boolean` **`Beta`** *** ### thickness > **thickness**: `number` **`Beta`** *** ### uniform > **uniform**: `boolean` **`Beta`** *** ### width > **width**: `number` **`Beta`** *** ### xRotation > **xRotation**: `number` **`Beta`** *** ### yRotation > **yRotation**: `number` **`Beta`** *** ### zRotation > **zRotation**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/QuickExtrudeProperties.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/QuickExtrudeProperties.md. # Interface: QuickExtrudeProperties **`Beta`** ## Properties ### checkForAdjacentFace? > `optional` **checkForAdjacentFace?**: `boolean` **`Beta`** *** ### contiguousSelectionBlockList? > `optional` **contiguousSelectionBlockList?**: `string`\[] **`Beta`** *** ### contiguousSelectionType? > `optional` **contiguousSelectionType?**: [`ContiguousSelectionType`](/server-editor/enums/ContiguousSelectionType.md) **`Beta`** *** ### isShrink? > `optional` **isShrink?**: `boolean` **`Beta`** *** ### layerCount? > `optional` **layerCount?**: `number` **`Beta`** *** ### selectionDirection? > `optional` **selectionDirection?**: `number` **`Beta`** *** ### size? > `optional` **size?**: `number` **`Beta`** *** ### startingLocation? > `optional` **startingLocation?**: `any` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/SelectionManifestData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/SelectionManifestData.md. # Interface: SelectionManifestData **`Beta`** ## Properties ### entries > **entries**: [`SelectionManifestEntry`](/server-editor/interfaces/SelectionManifestEntry.md)\[] **`Beta`** *** ### generationId > **generationId**: `number` **`Beta`** *** ### inProgress > **inProgress**: `boolean` **`Beta`** *** ### processedBlocks > **processedBlocks**: `number` **`Beta`** *** ### progress > **progress**: `number` **`Beta`** *** ### totalBlocks > **totalBlocks**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/SelectionManifestEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/SelectionManifestEntry.md. # Interface: SelectionManifestEntry **`Beta`** ## Properties ### blockIdentifier > **blockIdentifier**: `string` **`Beta`** *** ### count > **count**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WeightedBlock.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WeightedBlock.md. # Interface: WeightedBlock block **`Beta`** ## Properties ### block > **block**: `BlockType` **`Beta`** *** ### weight > **weight**: `number` **`Beta`** ## 同领域相关 - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator.md) - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator.md) - [BlockMaskList](/server-editor/interfaces/BlockMaskList.md) - [BlockMaskListType](/server-editor/enums/BlockMaskListType.md) - [BlockPalette](/server-editor/classes/BlockPalette.md) - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentBaseOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentBaseOptions.md. # Interface: WidgetComponentBaseOptions component **`Beta`** ## Extended by - [`WidgetComponentBoundingBoxOptions`](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) - [`WidgetComponentClipboardOptions`](/server-editor/interfaces/WidgetComponentClipboardOptions.md) - [`WidgetComponentEntityOptions`](/server-editor/interfaces/WidgetComponentEntityOptions.md) - [`WidgetComponentGizmoOptions`](/server-editor/interfaces/WidgetComponentGizmoOptions.md) - [`WidgetComponentGridOptions`](/server-editor/interfaces/WidgetComponentGridOptions.md) - [`WidgetComponentGuideOptions`](/server-editor/interfaces/WidgetComponentGuideOptions.md) - [`WidgetComponentRenderPlaneOptions`](/server-editor/interfaces/WidgetComponentRenderPlaneOptions.md) - [`WidgetComponentRenderPrimitiveOptions`](/server-editor/interfaces/WidgetComponentRenderPrimitiveOptions.md) - [`WidgetComponentSplineOptions`](/server-editor/interfaces/WidgetComponentSplineOptions.md) - [`WidgetComponentTextOptions`](/server-editor/interfaces/WidgetComponentTextOptions.md) - [`WidgetComponentVolumeOutlineOptions`](/server-editor/interfaces/WidgetComponentVolumeOutlineOptions.md) ## Properties ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** *** ### offset? > `optional` **offset?**: `any` **`Beta`** *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) - [WidgetComponentBoundingBoxStateChangeEventParameters](/server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentBoundingBoxLimit.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentBoundingBoxLimit.md. # Interface: WidgetComponentBoundingBoxLimit component **`Beta`** ## Properties ### max > **max**: `Vector3` **`Beta`** *** ### maxBlockVolume? > `optional` **maxBlockVolume?**: `number` **`Beta`** *** ### min > **min**: `Vector3` **`Beta`** ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) - [WidgetComponentBoundingBoxStateChangeEventParameters](/server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentBoundingBoxOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentBoundingBoxOptions.md. # Interface: WidgetComponentBoundingBoxOptions component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### boundsOffset? > `optional` **boundsOffset?**: `any` **`Beta`** *** ### enableResizeHandles? > `optional` **enableResizeHandles?**: [`Axis`](/server-editor/enums/Axis.md) **`Beta`** *** ### hullColor? > `optional` **hullColor?**: `any` **`Beta`** *** ### limit? > `optional` **limit?**: [`WidgetComponentBoundingBoxLimit`](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) **`Beta`** *** ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### mirror? > `optional` **mirror?**: `any` **`Beta`** *** ### normalizedOrigin? > `optional` **normalizedOrigin?**: `any` **`Beta`** *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### outlineColor? > `optional` **outlineColor?**: `any` **`Beta`** *** ### rotation? > `optional` **rotation?**: `any` **`Beta`** *** ### scaleMode? > `optional` **scaleMode?**: [`WidgetGizmoScaleMode`](/server-editor/enums/WidgetGizmoScaleMode.md) **`Beta`** *** ### showWorldIntersections? > `optional` **showWorldIntersections?**: `boolean` **`Beta`** *** ### stateChangeEvent? > `optional` **stateChangeEvent?**: (`arg0`) => `void` **`Beta`** #### Parameters ##### arg0 [`WidgetComponentBoundingBoxStateChangeEventParameters`](/server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters.md) #### Returns `void` *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) *** ### visibleHull? > `optional` **visibleHull?**: `boolean` **`Beta`** ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxStateChangeEventParameters](/server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentClipboardOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentClipboardOptions.md. # Interface: WidgetComponentClipboardOptions component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### clipboardOffset? > `optional` **clipboardOffset?**: `any` **`Beta`** *** ### highlightHullColor? > `optional` **highlightHullColor?**: `any` **`Beta`** *** ### highlightOutlineColor? > `optional` **highlightOutlineColor?**: `any` **`Beta`** *** ### hullColor? > `optional` **hullColor?**: `any` **`Beta`** *** ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### mirror? > `optional` **mirror?**: `any` **`Beta`** *** ### normalizedOrigin? > `optional` **normalizedOrigin?**: `any` **`Beta`** *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### outlineColor? > `optional` **outlineColor?**: `any` **`Beta`** *** ### rotation? > `optional` **rotation?**: `any` **`Beta`** *** ### showOutline? > `optional` **showOutline?**: `boolean` **`Beta`** *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentEntityOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentEntityOptions.md. # Interface: WidgetComponentEntityOptions entity component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### deselectedAnimation? > `optional` **deselectedAnimation?**: `string` **`Beta`** *** ### isClickable? > `optional` **isClickable?**: `boolean` **`Beta`** *** ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### selectedAnimation? > `optional` **selectedAnimation?**: `string` **`Beta`** *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) ## 同领域相关 - [WidgetComponentEntity](/server-editor/classes/WidgetComponentEntity.md) - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent.md) - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent.md) - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent.md) - [EntityAgeableComponent](/server/classes/EntityAgeableComponent.md) - [EntityAttributeComponent](/server/classes/EntityAttributeComponent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentGizmoOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentGizmoOptions.md. # Interface: WidgetComponentGizmoOptions component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### axes? > `optional` **axes?**: [`Axis`](/server-editor/enums/Axis.md) **`Beta`** *** ### enablePlanes? > `optional` **enablePlanes?**: `boolean` **`Beta`** *** ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### normalizedAutoOffset? > `optional` **normalizedAutoOffset?**: `any` **`Beta`** *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### scaleMode? > `optional` **scaleMode?**: [`WidgetGizmoScaleMode`](/server-editor/enums/WidgetGizmoScaleMode.md) **`Beta`** *** ### stateChangeEvent? > `optional` **stateChangeEvent?**: (`arg0`) => `void` **`Beta`** #### Parameters ##### arg0 [`WidgetComponentGizmoStateChangeEventParameters`](/server-editor/classes/WidgetComponentGizmoStateChangeEventParameters.md) #### Returns `void` *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentGridOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentGridOptions.md. # Interface: WidgetComponentGridOptions component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### color? > `optional` **color?**: `any` **`Beta`** *** ### gridCount? > `optional` **gridCount?**: `any` **`Beta`** *** ### gridSize? > `optional` **gridSize?**: `any` **`Beta`** *** ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### plane? > `optional` **plane?**: [`Plane`](/server-editor/enums/Plane.md) **`Beta`** *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentGuideOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentGuideOptions.md. # Interface: WidgetComponentGuideOptions component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentRenderPlaneOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentRenderPlaneOptions.md. # Interface: WidgetComponentRenderPlaneOptions component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### fillColor? > `optional` **fillColor?**: `any` **`Beta`** *** ### gridResolution? > `optional` **gridResolution?**: [`RenderPlaneGridResolution`](/server-editor/enums/RenderPlaneGridResolution.md) **`Beta`** *** ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### maxSizeChunks? > `optional` **maxSizeChunks?**: `number` **`Beta`** *** ### normal? > `optional` **normal?**: `any` **`Beta`** *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### outlineColor? > `optional` **outlineColor?**: `any` **`Beta`** *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentRenderPrimitiveOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentRenderPrimitiveOptions.md. # Interface: WidgetComponentRenderPrimitiveOptions component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentSplineOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentSplineOptions.md. # Interface: WidgetComponentSplineOptions component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### controlPoints > **controlPoints**: [`Widget`](/server-editor/classes/Widget.md)\[] **`Beta`** *** ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### splineType? > `optional` **splineType?**: [`SplineType`](/server-editor/enums/SplineType.md) **`Beta`** *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentTextOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentTextOptions.md. # Interface: WidgetComponentTextOptions component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### color? > `optional` **color?**: `any` **`Beta`** *** ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetComponentVolumeOutlineOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetComponentVolumeOutlineOptions.md. # Interface: WidgetComponentVolumeOutlineOptions component **`Beta`** ## Extends - [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md) ## Properties ### highlightHullColor? > `optional` **highlightHullColor?**: `any` **`Beta`** *** ### highlightOutlineColor? > `optional` **highlightOutlineColor?**: `any` **`Beta`** *** ### hullColor? > `optional` **hullColor?**: `any` **`Beta`** *** ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`lockToSurface`](/server-editor/interfaces/WidgetComponentBaseOptions.md#locktosurface) *** ### mirror? > `optional` **mirror?**: `any` **`Beta`** *** ### normalizedOrigin? > `optional` **normalizedOrigin?**: `any` **`Beta`** *** ### offset? > `optional` **offset?**: `any` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`offset`](/server-editor/interfaces/WidgetComponentBaseOptions.md#offset) *** ### outlineColor? > `optional` **outlineColor?**: `any` **`Beta`** *** ### rotation? > `optional` **rotation?**: `any` **`Beta`** *** ### showHighlightOutline? > `optional` **showHighlightOutline?**: `boolean` **`Beta`** *** ### showOutline? > `optional` **showOutline?**: `boolean` **`Beta`** *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** #### Inherited from [`WidgetComponentBaseOptions`](/server-editor/interfaces/WidgetComponentBaseOptions.md).[`visible`](/server-editor/interfaces/WidgetComponentBaseOptions.md#visible) *** ### volumeOffset? > `optional` **volumeOffset?**: `any` **`Beta`** ## 同领域相关 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError.md) - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase.md) - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions.md) - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox.md) - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit.md) - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetCreateOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetCreateOptions.md. # Interface: WidgetCreateOptions **`Beta`** ## Properties ### bindPositionToBlockCursor? > `optional` **bindPositionToBlockCursor?**: `boolean` **`Beta`** *** ### collisionOffset? > `optional` **collisionOffset?**: `any` **`Beta`** *** ### collisionRadius? > `optional` **collisionRadius?**: `number` **`Beta`** *** ### collisionType? > `optional` **collisionType?**: [`WidgetCollisionType`](/server-editor/enums/WidgetCollisionType.md) **`Beta`** *** ### dimensionId? > `optional` **dimensionId?**: `string` **`Beta`** *** ### ignoreEditorModeVisibilityOverride? > `optional` **ignoreEditorModeVisibilityOverride?**: `boolean` **`Beta`** *** ### lockToSurface? > `optional` **lockToSurface?**: `boolean` **`Beta`** *** ### selectable? > `optional` **selectable?**: `boolean` **`Beta`** *** ### snapToBlockLocation? > `optional` **snapToBlockLocation?**: `boolean` **`Beta`** *** ### stateChangeEvent? > `optional` **stateChangeEvent?**: (`arg0`) => `void` **`Beta`** #### Parameters ##### arg0 [`WidgetStateChangeEventData`](/server-editor/classes/WidgetStateChangeEventData.md) #### Returns `void` *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** *** ### widgetName? > `optional` **widgetName?**: `string` **`Beta`** *** ### worldBoundsMax? > `optional` **worldBoundsMax?**: `any` **`Beta`** *** ### worldBoundsMin? > `optional` **worldBoundsMin?**: `any` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WidgetGroupCreateOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WidgetGroupCreateOptions.md. # Interface: WidgetGroupCreateOptions **`Beta`** ## Properties ### groupSelectionMode? > `optional` **groupSelectionMode?**: [`WidgetGroupSelectionMode`](/server-editor/enums/WidgetGroupSelectionMode.md) **`Beta`** *** ### showBounds? > `optional` **showBounds?**: `boolean` **`Beta`** *** ### visible? > `optional` **visible?**: `boolean` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/interfaces/WireframeMeshOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/interfaces/WireframeMeshOptions.md. # Interface: WireframeMeshOptions **`Beta`** ## Properties ### alpha? > `optional` **alpha?**: `number` **`Beta`** *** ### rotation? > `optional` **rotation?**: `any` **`Beta`** *** ### scale? > `optional` **scale?**: `any` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/Action.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/Action.md. # Type Alias: Action > **Action** = [`NoArgsAction`](/server-editor/types/NoArgsAction.md) | [`MouseRayCastAction`](/server-editor/types/MouseRayCastAction.md) | [`StatefulAction`](/server-editor/types/StatefulAction.md) | [`ContinuousAction`](/server-editor/types/ContinuousAction.md) **`Beta`** Full set of all possible raw actions [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ActionID.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ActionID.md. # Type Alias: ActionID > **ActionID** = `object` **`Beta`** All actions have a unique identifier. Identifiers are globally unique and often GUIDs ## Properties ### id > **id**: `string` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ActivationFunctionType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ActivationFunctionType.md. # Type Alias: ActivationFunctionType\ > **ActivationFunctionType**\<`PerPlayerStorageType`> = (`uiSession`) => [`IDisposable`](/server-editor/interfaces/IDisposable.md)\[] **`Beta`** Callback type when an extension instance is activated for a given player. It is expected to return an array of disposables that will automatically be cleaned up on shutdown. ## Type Parameters ### PerPlayerStorageType `PerPlayerStorageType` ## Parameters ### uiSession [`IPlayerUISession`](/server-editor/types/IPlayerUISession.md)\<`PerPlayerStorageType`> ## Returns [`IDisposable`](/server-editor/interfaces/IDisposable.md)\[] [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/AudioSettingsPropertyTypeMap.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/AudioSettingsPropertyTypeMap.md. # Type Alias: AudioSettingsPropertyTypeMap > **AudioSettingsPropertyTypeMap** = `object` **`Beta`** ## Properties ### AreSoundsMuted? > `optional` **AreSoundsMuted?**: `boolean` *** ### IsMusicMuted? > `optional` **IsMusicMuted?**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/BasicTooltipContent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/BasicTooltipContent.md. # Type Alias: BasicTooltipContent > **BasicTooltipContent** = [`LocalizedString`](/server-editor/types/LocalizedString.md) | [`TooltipContent`](/server-editor/types/TooltipContent.md) **`Beta`** Possible tooltip types [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/BrushShapeSettings.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/BrushShapeSettings.md. # Type Alias: BrushShapeSettings > **BrushShapeSettings** = [`ConeBrushShapeSettings`](/server-editor/interfaces/ConeBrushShapeSettings.md) | [`CuboidBrushShapeSettings`](/server-editor/interfaces/CuboidBrushShapeSettings.md) | [`CylinderBrushShapeSettings`](/server-editor/interfaces/CylinderBrushShapeSettings.md) | [`EllipsoidBrushShapeSettings`](/server-editor/interfaces/EllipsoidBrushShapeSettings.md) | [`PyramidBrushShapeSettings`](/server-editor/interfaces/PyramidBrushShapeSettings.md) | `undefined` **`Beta`** Setting types for all brush shapes [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ButtonPropertyItemSupportedActionTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ButtonPropertyItemSupportedActionTypes.md. # Type Alias: ButtonPropertyItemSupportedActionTypes > **ButtonPropertyItemSupportedActionTypes** = (() => `void`) | [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`NoArgsAction`](/server-editor/types/NoArgsAction.md)> **`Beta`** All possible button item action types [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ContinuousAction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ContinuousAction.md. # Type Alias: ContinuousAction > **ContinuousAction** = `object` **`Beta`** An action that continues to execute after activation ## Properties ### actionType > `readonly` **actionType**: [`ContinuousAction`](/server-editor/enums/ActionTypes.md#continuousaction) *** ### onExecute > `readonly` **onExecute**: (`state`, `repeatCount`) => `void` #### Parameters ##### state [`ContinuousActionState`](/server-editor/enums/ContinuousActionState.md) ##### repeatCount `number` #### Returns `void` *** ### repeatDelay? > `optional` **repeatDelay?**: `number` *** ### repeatInterval? > `optional` **repeatInterval?**: `number` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/EventHandler.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/EventHandler.md. # Type Alias: EventHandler\ event > **EventHandler**\<`T`> = (`eventArg`) => `void` **`Beta`** A generic handler for an event sink. ## Type Parameters ### T `T` ## Parameters ### eventArg `T` ## Returns `void` ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/GraphicsSettingsPropertyTypeMap.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/GraphicsSettingsPropertyTypeMap.md. # Type Alias: GraphicsSettingsPropertyTypeMap > **GraphicsSettingsPropertyTypeMap** = `object` **`Beta`** Defines type information for graphics settings properties. ## Properties ### DisableBlockEntityRendering? > `optional` **DisableBlockEntityRendering?**: `boolean` *** ### DisableEntityRendering? > `optional` **DisableEntityRendering?**: `boolean` *** ### DisableParticleRendering? > `optional` **DisableParticleRendering?**: `boolean` *** ### DisableTerrainRendering? > `optional` **DisableTerrainRendering?**: `boolean` *** ### DisableWeatherRendering? > `optional` **DisableWeatherRendering?**: `boolean` *** ### GraphicsMode? > `optional` **GraphicsMode?**: `GraphicsMode` *** ### NightVision? > `optional` **NightVision?**: `boolean` *** ### ShowChunkBoundaries? > `optional` **ShowChunkBoundaries?**: `boolean` *** ### ShowCompass? > `optional` **ShowCompass?**: `boolean` *** ### ShowInvisibleBlocks? > `optional` **ShowInvisibleBlocks?**: `boolean` *** ### ShowToastNotifications? > `optional` **ShowToastNotifications?**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ICollectionTreeEntryDropdownItemMenuOption.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ICollectionTreeEntryDropdownItemMenuOption.md. # Type Alias: ICollectionTreeEntryDropdownItemMenuOption > **ICollectionTreeEntryDropdownItemMenuOption** = `object` **`Beta`** Menu options for the collection tree entry dropdown item ## Properties ### imageData? > `readonly` `optional` **imageData?**: [`ImageResourceData`](/server-editor/types/ImageResourceData.md) *** ### label > `readonly` **label**: `string` *** ### value > `readonly` **value**: `string` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ICollectionTreeEntryDropdownItemParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ICollectionTreeEntryDropdownItemParams.md. # Type Alias: ICollectionTreeEntryDropdownItemParams > **ICollectionTreeEntryDropdownItemParams** = `object` **`Beta`** Parameters to create dropdown in a collection tree entry ## Properties ### enabled? > `optional` **enabled?**: `boolean` *** ### menuOptions? > `optional` **menuOptions?**: [`ICollectionTreeEntryDropdownItemMenuOption`](/server-editor/types/ICollectionTreeEntryDropdownItemMenuOption.md)\[] *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`, `item`) => `void` #### Parameters ##### newValue `string` ##### oldValue `string` ##### item [`ICollectionTreeEntryDropdownItem`](/server-editor/interfaces/ICollectionTreeEntryDropdownItem.md) #### Returns `void` *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) *** ### value > **value**: [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> *** ### visible? > `optional` **visible?**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ICollectionTreeEntryNumberItemParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ICollectionTreeEntryNumberItemParams.md. # Type Alias: ICollectionTreeEntryNumberItemParams > **ICollectionTreeEntryNumberItemParams** = `object` **`Beta`** Parameters to create number field in a collection tree entry ## Properties ### enabled? > `optional` **enabled?**: `boolean` *** ### isInteger? > `optional` **isInteger?**: `boolean` *** ### max? > `optional` **max?**: `number` *** ### min? > `optional` **min?**: `number` *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`, `item`) => `void` #### Parameters ##### newValue `number` ##### oldValue `number` ##### item [`ICollectionTreeEntryNumberItem`](/server-editor/interfaces/ICollectionTreeEntryNumberItem.md) #### Returns `void` *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) *** ### value > **value**: [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`number`> *** ### visible? > `optional` **visible?**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ICollectionTreeEntryOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ICollectionTreeEntryOptions.md. # Type Alias: ICollectionTreeEntryOptions > **ICollectionTreeEntryOptions** = `object` **`Beta`** Options to create an entry in a collection tree folder ## Properties ### color? > `optional` **color?**: `RGBA` *** ### image? > `optional` **image?**: [`ImageResourceData`](/server-editor/types/ImageResourceData.md) *** ### onBeforeRelocated? > `optional` **onBeforeRelocated?**: (`toFolder`, `toIndex`, `entry`) => `boolean` #### Parameters ##### toFolder [`ICollectionTreeFolder`](/server-editor/interfaces/ICollectionTreeFolder.md) ##### toIndex `number` ##### entry [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) #### Returns `boolean` *** ### onSelectedChange? > `optional` **onSelectedChange?**: (`selected`, `folder`) => `void` #### Parameters ##### selected `boolean` ##### folder [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) #### Returns `void` *** ### removable? > `optional` **removable?**: `boolean` *** ### selectable? > `optional` **selectable?**: `boolean` *** ### selected? > `optional` **selected?**: `boolean` *** ### userData? > `optional` **userData?**: `unknown` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ICollectionTreeEntryStringItemParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ICollectionTreeEntryStringItemParams.md. # Type Alias: ICollectionTreeEntryStringItemParams > **ICollectionTreeEntryStringItemParams** = `object` **`Beta`** Parameters to create string field in a collection tree entry ## Properties ### enabled? > `optional` **enabled?**: `boolean` *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`, `item`) => `void` #### Parameters ##### newValue `string` ##### oldValue `string` ##### item [`ICollectionTreeEntryStringItem`](/server-editor/interfaces/ICollectionTreeEntryStringItem.md) #### Returns `void` *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) *** ### value > **value**: [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`string`> *** ### visible? > `optional` **visible?**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ICollectionTreeFolderHeaderActionParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ICollectionTreeFolderHeaderActionParams.md. # Type Alias: ICollectionTreeFolderHeaderActionParams > **ICollectionTreeFolderHeaderActionParams** = `object` **`Beta`** Parameters to create an action button on the folder header ## Properties ### enabled? > `optional` **enabled?**: `boolean` *** ### onClick > **onClick**: (`folder`) => `void` #### Parameters ##### folder [`ICollectionTreeFolder`](/server-editor/interfaces/ICollectionTreeFolder.md) #### Returns `void` *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ICollectionTreeFolderOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ICollectionTreeFolderOptions.md. # Type Alias: ICollectionTreeFolderOptions > **ICollectionTreeFolderOptions** = `object` **`Beta`** Contains collection folders and entries ## Properties ### action? > `optional` **action?**: [`ICollectionTreeFolderHeaderActionParams`](/server-editor/types/ICollectionTreeFolderHeaderActionParams.md) *** ### color? > `optional` **color?**: `RGBA` *** ### expanded? > `optional` **expanded?**: `boolean` *** ### menu? > `optional` **menu?**: [`IMenuCreationParams`](/server-editor/interfaces/IMenuCreationParams.md)\[] *** ### onBeforeEntryRemoved? > `optional` **onBeforeEntryRemoved?**: (`entry`) => `boolean` #### Parameters ##### entry [`ICollectionTreeEntry`](/server-editor/interfaces/ICollectionTreeEntry.md) #### Returns `boolean` *** ### onBeforeRemoved? > `optional` **onBeforeRemoved?**: (`folder`) => `boolean` #### Parameters ##### folder [`ICollectionTreeFolder`](/server-editor/interfaces/ICollectionTreeFolder.md) #### Returns `boolean` *** ### onMenuClicked? > `optional` **onMenuClicked?**: (`menuId`, `folder`) => `void` #### Parameters ##### menuId `string` ##### folder [`ICollectionTreeFolder`](/server-editor/interfaces/ICollectionTreeFolder.md) #### Returns `void` *** ### onSelectedChange? > `optional` **onSelectedChange?**: (`selected`, `folder`) => `void` #### Parameters ##### selected `boolean` ##### folder [`ICollectionTreeFolder`](/server-editor/interfaces/ICollectionTreeFolder.md) #### Returns `void` *** ### removable? > `optional` **removable?**: `boolean` *** ### selectable? > `optional` **selectable?**: `boolean` *** ### selected? > `optional` **selected?**: `boolean` *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) *** ### uniqueId? > `optional` **uniqueId?**: `string` *** ### userData? > `optional` **userData?**: `unknown` *** ### visible? > `optional` **visible?**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/IObservableProp.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/IObservableProp.md. # Type Alias: IObservableProp\ > **IObservableProp**\<`T`> = [`IObservable`](/server-editor/interfaces/IObservable.md)\<`T`> | `T` **`Beta`** Type that can be an observable or a value. ## Type Parameters ### T `T` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/IPlayerUISession.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/IPlayerUISession.md. # Type Alias: IPlayerUISession\ > **IPlayerUISession**\<`PerPlayerStorage`> = `object` **`Beta`** The IPlayerUISession represents the editor user interface for a given player and given extension. Extensions registered with Minecraft are instantiated for each player which joins a server, and this interface provides the set of functionality needed to create and modify the editor UI for that player. The associated Editor Context for this session object is also player specific. From a given IPlayerUISession object, there is no way to interact with the UI of another player, that must be done from global extension scope registration and/or data sharing independent of the UI object. ## Type Parameters ### PerPlayerStorage `PerPlayerStorage` = `Record`\<`string`, `never`> ## Properties ### actionBar > `readonly` **actionBar**: [`IActionBar`](/server-editor/interfaces/IActionBar.md) *** ### actionManager > `readonly` **actionManager**: [`ActionManager`](/server-editor/interfaces/ActionManager.md) *** ### badgeManager > `readonly` **badgeManager**: [`IContentBadgeManager`](/server-editor/interfaces/IContentBadgeManager.md) *** ### builtInUIManager > `readonly` **builtInUIManager**: [`BuiltInUIManager`](/server-editor/interfaces/BuiltInUIManager.md) *** ### dialogManager > `readonly` **dialogManager**: [`IModalDialogManager`](/server-editor/interfaces/IModalDialogManager.md) *** ### eventSubscriptionCache > `readonly` **eventSubscriptionCache**: [`BedrockEventSubscriptionCache`](/server-editor/classes/BedrockEventSubscriptionCache.md) *** ### extensionContext > `readonly` **extensionContext**: [`ExtensionContext`](/server-editor/classes/ExtensionContext.md) *** ### inputManager > `readonly` **inputManager**: [`IGlobalInputManager`](/server-editor/interfaces/IGlobalInputManager.md) *** ### log > `readonly` **log**: [`IPlayerLogger`](/server-editor/interfaces/IPlayerLogger.md) *** ### menuBar > `readonly` **menuBar**: [`IMenuContainer`](/server-editor/interfaces/IMenuContainer.md) *** ### paneManager > `readonly` **paneManager**: [`IPaneManager`](/server-editor/interfaces/IPaneManager.md) *** ### scratchStorage > **scratchStorage**: `PerPlayerStorage` | `undefined` *** ### statusBar > `readonly` **statusBar**: [`IStatusBar`](/server-editor/interfaces/IStatusBar.md) *** ### toolRail > `readonly` **toolRail**: [`IModalToolContainer`](/server-editor/interfaces/IModalToolContainer.md) ## Methods ### createPropertyPane() > **createPropertyPane**(`options`): [`IRootPropertyPane`](/server-editor/interfaces/IRootPropertyPane.md) #### Parameters ##### options [`IRootPropertyPaneOptions`](/server-editor/interfaces/IRootPropertyPaneOptions.md) #### Returns [`IRootPropertyPane`](/server-editor/interfaces/IRootPropertyPane.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ImageAnimationData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ImageAnimationData.md. # Type Alias: ImageAnimationData animation > **ImageAnimationData** = `object` **`Beta`** Animation properties for a horizontally laid out sprite sheet image ## Properties ### delay? > `optional` **delay?**: `number` *** ### duration? > `optional` **duration?**: `number` *** ### frames > **frames**: `number` ## 同领域相关 - [AnimationOptions](/server/interfaces/AnimationOptions.md) - [PlayAnimationOptions](/server/interfaces/PlayAnimationOptions.md) - [SplineAnimation](/server/interfaces/SplineAnimation.md) - [StructureAnimationMode](/server/enums/StructureAnimationMode.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ImageResourceData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ImageResourceData.md. # Type Alias: ImageResourceData > **ImageResourceData** = `object` **`Beta`** ## Properties ### path > **path**: `string` *** ### type > **type**: [`ImageResourceType`](/server-editor/enums/ImageResourceType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/KeyBinding.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/KeyBinding.md. # Type Alias: KeyBinding > **KeyBinding** = `object` **`Beta`** Keyboard binding properties. ## Properties ### key > **key**: [`KeyboardKey`](/server-editor/enums/KeyboardKey.md) *** ### modifier? > `optional` **modifier?**: [`InputModifier`](/server-editor/enums/InputModifier.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/KeyBindingInfo.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/KeyBindingInfo.md. # Type Alias: KeyBindingInfo > **KeyBindingInfo** = `object` **`Beta`** Additional information about key binding. ## Properties ### bindingCategory? > `optional` **bindingCategory?**: `string` *** ### bindingPriority? > `optional` **bindingPriority?**: `number` *** ### label? > `optional` **label?**: `string` *** ### tooltip? > `optional` **tooltip?**: `string` *** ### uniqueId > **uniqueId**: `string` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/LayoutSize.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/LayoutSize.md. # Type Alias: LayoutSize > **LayoutSize** = `object` **`Beta`** Layout size definition ## Properties ### type? > `optional` **type?**: [`LayoutSizeType`](/server-editor/enums/LayoutSizeType.md) *** ### value > **value**: `number` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneBoolEntryParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneBoolEntryParams.md. # Type Alias: ListPaneBoolEntryParams > **ListPaneBoolEntryParams** = `object` **`Beta`** List Pane Bool entry creation parameter ## Properties ### enabled? > `optional` **enabled?**: `boolean` *** ### icon? > `optional` **icon?**: `string` *** ### onChange? > `optional` **onChange?**: (`newValue`, `oldValue`, `entry`) => `void` #### Parameters ##### newValue `boolean` ##### oldValue `boolean` ##### entry [`IListPaneBoolEntry`](/server-editor/interfaces/IListPaneBoolEntry.md) #### Returns `void` *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) *** ### type > **type**: [`Bool`](/server-editor/enums/ListPaneEntryType.md#bool) *** ### value > **value**: [`IObservableProp`](/server-editor/types/IObservableProp.md)\<`boolean`> *** ### visible? > `optional` **visible?**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneButtonEntryParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneButtonEntryParams.md. # Type Alias: ListPaneButtonEntryParams > **ListPaneButtonEntryParams** = `object` **`Beta`** List Pane Button entry creation parameter ## Properties ### enabled? > `optional` **enabled?**: `boolean` *** ### icon? > `optional` **icon?**: `string` *** ### onClick > **onClick**: (`entry`) => `void` #### Parameters ##### entry [`IListPaneButtonEntry`](/server-editor/interfaces/IListPaneButtonEntry.md) #### Returns `void` *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) *** ### tooltip? > `optional` **tooltip?**: [`BasicTooltipContent`](/server-editor/types/BasicTooltipContent.md) *** ### type > **type**: [`Button`](/server-editor/enums/ListPaneEntryType.md#button) *** ### variant? > `optional` **variant?**: [`ButtonVariant`](/server-editor/enums/ButtonVariant.md) *** ### visible? > `optional` **visible?**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneEntryMap.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneEntryMap.md. # Type Alias: ListPaneEntryMap > **ListPaneEntryMap** = `object` **`Beta`** List Pane entry type map ## Properties ### 0 > **0**: [`IListPaneEntry`](/server-editor/interfaces/IListPaneEntry.md) *** ### 1 > **1**: [`IListPaneBoolEntry`](/server-editor/interfaces/IListPaneBoolEntry.md) *** ### 2 > **2**: [`IListPaneImageEntry`](/server-editor/interfaces/IListPaneImageEntry.md) *** ### 3 > **3**: [`IListPaneTextEntry`](/server-editor/interfaces/IListPaneTextEntry.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneEntryParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneEntryParams.md. # Type Alias: ListPaneEntryParams > **ListPaneEntryParams** = [`ListPaneButtonEntryParams`](/server-editor/types/ListPaneButtonEntryParams.md) | [`ListPaneBoolEntryParams`](/server-editor/types/ListPaneBoolEntryParams.md) | [`ListPaneTextEntryParams`](/server-editor/types/ListPaneTextEntryParams.md) | [`ListPaneImageEntryParams`](/server-editor/types/ListPaneImageEntryParams.md) **`Beta`** List Pane entry creation parameters [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneImageEntryParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneImageEntryParams.md. # Type Alias: ListPaneImageEntryParams > **ListPaneImageEntryParams** = `object` **`Beta`** List Pane Image entry creation parameter ## Properties ### type > **type**: [`Image`](/server-editor/enums/ListPaneEntryType.md#image) *** ### value > **value**: [`IObservableProp`](/server-editor/types/IObservableProp.md)\<[`ImageResourceData`](/server-editor/types/ImageResourceData.md)> *** ### visible? > `optional` **visible?**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneSlotConfiguration.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneSlotConfiguration.md. # Type Alias: ListPaneSlotConfiguration > **ListPaneSlotConfiguration** = `object` **`Beta`** ## Properties ### clickable? > `optional` **clickable?**: `boolean` *** ### columns? > `optional` **columns?**: `number` *** ### entryLayout > **entryLayout**: [`ListPaneSlotLayoutEntry`](/server-editor/types/ListPaneSlotLayoutEntry.md)\[] | [`ListPaneSlotLayoutSections`](/server-editor/types/ListPaneSlotLayoutSections.md) *** ### height > **height**: `number` *** ### outline? > `optional` **outline?**: `boolean` *** ### variant? > `optional` **variant?**: [`ListPaneSlotVariant`](/server-editor/enums/ListPaneSlotVariant.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneSlotCreationProps.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneSlotCreationProps.md. # Type Alias: ListPaneSlotCreationProps > **ListPaneSlotCreationProps** = `object` **`Beta`** Properties required to create a slot ## Properties ### entries > **entries**: [`ListPaneEntryParams`](/server-editor/types/ListPaneEntryParams.md)\[] *** ### options? > `optional` **options?**: [`IListPaneSlotOptions`](/server-editor/interfaces/IListPaneSlotOptions.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneSlotLayoutEntry.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneSlotLayoutEntry.md. # Type Alias: ListPaneSlotLayoutEntry > **ListPaneSlotLayoutEntry** = `object` **`Beta`** ## Properties ### alignment? > `optional` **alignment?**: [`LayoutAlignment`](/server-editor/enums/LayoutAlignment.md) *** ### size? > `optional` **size?**: `number` | [`LayoutSize`](/server-editor/types/LayoutSize.md) | [`LayoutFlex`](/server-editor/enums/LayoutFlex.md) *** ### type > **type**: [`ListPaneEntryType`](/server-editor/enums/ListPaneEntryType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneSlotLayoutSections.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneSlotLayoutSections.md. # Type Alias: ListPaneSlotLayoutSections > **ListPaneSlotLayoutSections** = `object` **`Beta`** ## Properties ### mainSection > **mainSection**: [`ListPaneSlotLayoutEntry`](/server-editor/types/ListPaneSlotLayoutEntry.md)\[] *** ### outerSection > **outerSection**: [`ListPaneSlotLayoutEntry`](/server-editor/types/ListPaneSlotLayoutEntry.md)\[] [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneTextEntryParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneTextEntryParams.md. # Type Alias: ListPaneTextEntryParams > **ListPaneTextEntryParams** = `object` **`Beta`** List Pane Text entry creation parameter ## Properties ### type > **type**: [`Text`](/server-editor/enums/ListPaneEntryType.md#text) *** ### value? > `optional` **value?**: [`IObservableProp`](/server-editor/types/IObservableProp.md)\<[`LocalizedString`](/server-editor/types/LocalizedString.md)> *** ### visible? > `optional` **visible?**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListPaneViewFilter.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListPaneViewFilter.md. # Type Alias: ListPaneViewFilter > **ListPaneViewFilter** = `object` **`Beta`** Determines filtering properties for list pane ## Properties ### slots? > `optional` **slots?**: `string`\[] *** ### tags? > `optional` **tags?**: `string`\[] [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListViewControlAction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListViewControlAction.md. # Type Alias: ListViewControlAction > **ListViewControlAction** = `object` & [`ListViewControlActionState`](/server-editor/types/ListViewControlActionState.md) **`Beta`** Action item to be displayed on a list view control ## Type Declaration ### id > **id**: `string` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ListViewControlActionState.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ListViewControlActionState.md. # Type Alias: ListViewControlActionState > **ListViewControlActionState** = `object` **`Beta`** Action item state for list view control ## Properties ### disabled? > `optional` **disabled?**: `boolean` *** ### displayInMenu? > `optional` **displayInMenu?**: `boolean` *** ### icon > **icon**: `string` *** ### label > **label**: [`LocalizedString`](/server-editor/types/LocalizedString.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/LocalizedString.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/LocalizedString.md. # Type Alias: LocalizedString > **LocalizedString** = `string` | \{ `id`: `string`; `props?`: `string`\[]; } **`Beta`** Represents a localized string or an object with a localized string and optional properties [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ModalDialogActivationParams.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ModalDialogActivationParams.md. # Type Alias: ModalDialogActivationParams\ > **ModalDialogActivationParams**\<`T`> = `object` & `T` _extends_ [`CoreModalDialogType`](/server-editor/enums/CoreModalDialogType.md) ? `object` : `object` **`Beta`** Parameters required to activate a modal dialog instance ## Type Declaration ### dialogId > **dialogId**: `T` ### onResponse? > `optional` **onResponse?**: (`payload`) => `void` #### Parameters ##### payload `T` _extends_ [`CoreModalDialogType`](/server-editor/enums/CoreModalDialogType.md) ? [`ModalDialogCoreResponseType`](/server-editor/types/ModalDialogCoreResponseType.md)\[`T`] : [`ModalDialogCustomResponse`](/server-editor/types/ModalDialogCustomResponse.md) | [`ModalDialogDismissResponse`](/server-editor/types/ModalDialogDismissResponse.md) #### Returns `void` ## Type Parameters ### T `T` _extends_ [`CoreModalDialogType`](/server-editor/enums/CoreModalDialogType.md) | `string` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ModalDialogCoreResponseType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ModalDialogCoreResponseType.md. # Type Alias: ModalDialogCoreResponseType > **ModalDialogCoreResponseType** = `object` **`Beta`** Response data for core modal dialogs ## Properties ### 0 > **0**: [`ModalDialogDataPickerResponse`](/server-editor/types/ModalDialogDataPickerResponse.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ModalDialogCustomResponse.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ModalDialogCustomResponse.md. # Type Alias: ModalDialogCustomResponse > **ModalDialogCustomResponse** = `object` **`Beta`** Response data for custom modal dialog ## Properties ### payload? > `optional` **payload?**: `unknown` *** ### type > **type**: [`ModalDialogResponseType`](/server-editor/enums/ModalDialogResponseType.md) | `string` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ModalDialogDataPickerResponse.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ModalDialogDataPickerResponse.md. # Type Alias: ModalDialogDataPickerResponse > **ModalDialogDataPickerResponse** = `object` **`Beta`** Payloads that confirm data picker selection ## Properties ### selected > **selected**: `string` *** ### type > **type**: [`Confirm`](/server-editor/enums/ModalDialogResponseType.md#confirm) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ModalDialogDismissResponse.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ModalDialogDismissResponse.md. # Type Alias: ModalDialogDismissResponse > **ModalDialogDismissResponse** = `object` **`Beta`** ## Properties ### type > **type**: [`Dismiss`](/server-editor/enums/ModalDialogResponseType.md#dismiss) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ModalDialogRequestData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ModalDialogRequestData.md. # Type Alias: ModalDialogRequestData > **ModalDialogRequestData** = `object` **`Beta`** Data types supported by a modal dialog request ## Properties ### 0 > **0**: `object` #### default > **default**: `string` #### variant > **variant**: [`DataPickerModalDialogVariant`](/server-editor/enums/DataPickerModalDialogVariant.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ModalToolLifecycleEventPayload.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ModalToolLifecycleEventPayload.md. # Type Alias: ModalToolLifecycleEventPayload event > **ModalToolLifecycleEventPayload** = `object` **`Beta`** Modal tool lifecycle event payload ## Properties ### isActiveTool > **isActiveTool**: `boolean` ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/MouseModifiers.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/MouseModifiers.md. # Type Alias: MouseModifiers > **MouseModifiers** = `object` **`Beta`** Input modifier states for mouse actions ## Properties ### alt > **alt**: `boolean` *** ### ctrl > **ctrl**: `boolean` *** ### shift > **shift**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/MouseProps.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/MouseProps.md. # Type Alias: MouseProps > **MouseProps** = `object` **`Beta`** Mouse properties that provide additional information from client event handling ## Properties ### inputType > **inputType**: [`MouseInputType`](/server-editor/enums/MouseInputType.md) *** ### modifiers > **modifiers**: [`MouseModifiers`](/server-editor/types/MouseModifiers.md) *** ### mouseAction > **mouseAction**: [`MouseActionType`](/server-editor/enums/MouseActionType.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/MouseRayCastAction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/MouseRayCastAction.md. # Type Alias: MouseRayCastAction > **MouseRayCastAction** = `object` **`Beta`** An action which returns the ray corresponding to a vector from the users mouse click in the viewport. ## Properties ### actionType > `readonly` **actionType**: [`MouseRayCastAction`](/server-editor/enums/ActionTypes.md#mouseraycastaction) *** ### onExecute > `readonly` **onExecute**: (`mouseRay`, `mouseProps`) => `void` #### Parameters ##### mouseRay [`Ray`](/server-editor/types/Ray.md) ##### mouseProps [`MouseProps`](/server-editor/types/MouseProps.md) #### Returns `void` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/NoArgsAction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/NoArgsAction.md. # Type Alias: NoArgsAction > **NoArgsAction** = `object` **`Beta`** An action which needs no additional client side arguments on execute ## Properties ### actionType > `readonly` **actionType**: [`NoArgsAction`](/server-editor/enums/ActionTypes.md#noargsaction) *** ### onExecute > `readonly` **onExecute**: () => `void` #### Returns `void` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/PaneItemStyle.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/PaneItemStyle.md. # Type Alias: PaneItemStyle > **PaneItemStyle** = `object` **`Beta`** Optional style arguments for pane items ## Properties ### maxWidth? > `optional` **maxWidth?**: `number` | [`LayoutSize`](/server-editor/types/LayoutSize.md) *** ### minWidth? > `optional` **minWidth?**: `number` | [`LayoutSize`](/server-editor/types/LayoutSize.md) *** ### verticalAlignment? > `optional` **verticalAlignment?**: [`LayoutAlignment`](/server-editor/enums/LayoutAlignment.md) *** ### width? > `optional` **width?**: `number` | [`LayoutSize`](/server-editor/types/LayoutSize.md) | [`LayoutFlex`](/server-editor/enums/LayoutFlex.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/PropertyBag.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/PropertyBag.md. # Type Alias: PropertyBag > **PropertyBag** = `Record`\<`string`, `unknown`> **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/PropertyPaneVisibilityUpdate.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/PropertyPaneVisibilityUpdate.md. # Type Alias: PropertyPaneVisibilityUpdate > **PropertyPaneVisibilityUpdate** = `object` **`Beta`** Callback to execute when a visibility of a property pane is updated. ## Properties ### isVisible > **isVisible**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/Ray.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/Ray.md. # Type Alias: Ray > **Ray** = `object` **`Beta`** Ray representing a direction from a set location. This location typically corresponds to the location of a mouse click performed on the client. ## Properties ### cursorBlockLocation > **cursorBlockLocation**: `Vector3` *** ### direction > **direction**: `Vector3` *** ### location > **location**: `Vector3` *** ### rayHit > **rayHit**: `boolean` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/RegisteredAction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/RegisteredAction.md. # Type Alias: RegisteredAction\ > **RegisteredAction**\<`T`> = `T` & [`ActionID`](/server-editor/types/ActionID.md) **`Beta`** A registered action is an action that has been registered with the action manager system and has a unique ID representing the action now. An action must be registered before it can be used in other systems. ## Type Parameters ### T `T` _extends_ [`Action`](/server-editor/types/Action.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/SelectedModalToolChangedEventPayload.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/SelectedModalToolChangedEventPayload.md. # Type Alias: SelectedModalToolChangedEventPayload event > **SelectedModalToolChangedEventPayload** = `object` **`Beta`** Modal tool state event payload ## Properties ### tool > **tool**: \{ `id`: `string`; `isActive`: `boolean`; } | `undefined` ## 同领域相关 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache.md) - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent.md) - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal.md) - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent.md) - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal.md) - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/ShutdownFunctionType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/ShutdownFunctionType.md. # Type Alias: ShutdownFunctionType\ > **ShutdownFunctionType**\<`PerPlayerStorageType`> = (`uiSession`) => `void` **`Beta`** Callback type when an extension instance is shutdown for a given player. Used for performing any final work or clean up that can't be handled automatically via Disposables. ## Type Parameters ### PerPlayerStorageType `PerPlayerStorageType` ## Parameters ### uiSession [`IPlayerUISession`](/server-editor/types/IPlayerUISession.md)\<`PerPlayerStorageType`> ## Returns `void` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/SpeedSettingsPropertyTypeMap.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/SpeedSettingsPropertyTypeMap.md. # Type Alias: SpeedSettingsPropertyTypeMap > **SpeedSettingsPropertyTypeMap** = `object` **`Beta`** ## Properties ### FlySpeedMultiplier? > `optional` **FlySpeedMultiplier?**: `number` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/StatefulAction.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/StatefulAction.md. # Type Alias: StatefulAction > **StatefulAction** = `object` **`Beta`** An action which returns the activation state. ## Properties ### actionType > `readonly` **actionType**: [`StatefulAction`](/server-editor/enums/ActionTypes.md#statefulaction) *** ### onExecute > `readonly` **onExecute**: (`active`) => `void` #### Parameters ##### active `boolean` #### Returns `void` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/SupportedKeyboardActionTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/SupportedKeyboardActionTypes.md. # Type Alias: SupportedKeyboardActionTypes > **SupportedKeyboardActionTypes** = [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`NoArgsAction`](/server-editor/types/NoArgsAction.md)> | [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`StatefulAction`](/server-editor/types/StatefulAction.md)> | [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`ContinuousAction`](/server-editor/types/ContinuousAction.md)> **`Beta`** Full set of all possible keyboard actions [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/SupportedMouseActionTypes.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/SupportedMouseActionTypes.md. # Type Alias: SupportedMouseActionTypes > **SupportedMouseActionTypes** = [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`MouseRayCastAction`](/server-editor/types/MouseRayCastAction.md)> **`Beta`** Full set of all possible mouse actions [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/TooltipButton.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/TooltipButton.md. # Type Alias: TooltipButton > **TooltipButton** = `object` **`Beta`** Tooltip action description ## Properties ### action > **action**: [`RegisteredAction`](/server-editor/types/RegisteredAction.md)\<[`NoArgsAction`](/server-editor/types/NoArgsAction.md)> *** ### text > **text**: [`LocalizedString`](/server-editor/types/LocalizedString.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/TooltipContent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/TooltipContent.md. # Type Alias: TooltipContent > **TooltipContent** = `object` **`Beta`** Content properties to display tooltips ## Properties ### description? > `optional` **description?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) *** ### image? > `optional` **image?**: `string` *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/TooltipInteractiveContent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/TooltipInteractiveContent.md. # Type Alias: TooltipInteractiveContent > **TooltipInteractiveContent** = `object` **`Beta`** Content properties to display interactive tooltips ## Properties ### description? > `optional` **description?**: ([`TooltipInteractiveContentDescriptionItem`](/server-editor/types/TooltipInteractiveContentDescriptionItem.md) | [`TooltipInteractiveContentDescriptionItem`](/server-editor/types/TooltipInteractiveContentDescriptionItem.md)\[])\[] *** ### title? > `optional` **title?**: [`LocalizedString`](/server-editor/types/LocalizedString.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/TooltipInteractiveContentDescriptionItem.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/TooltipInteractiveContentDescriptionItem.md. # Type Alias: TooltipInteractiveContentDescriptionItem > **TooltipInteractiveContentDescriptionItem** = [`LocalizedString`](/server-editor/types/LocalizedString.md) | [`TooltipLink`](/server-editor/types/TooltipLink.md) | [`TooltipButton`](/server-editor/types/TooltipButton.md) **`Beta`** Supported description elements for interactive tooltips [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/TooltipLink.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/TooltipLink.md. # Type Alias: TooltipLink > **TooltipLink** = `object` **`Beta`** Tooltip link description ## Properties ### link > **link**: `string` *** ### text > **text**: [`LocalizedString`](/server-editor/types/LocalizedString.md) [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/types/UnregisterInputBindingCallback.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/types/UnregisterInputBindingCallback.md. # Type Alias: UnregisterInputBindingCallback > **UnregisterInputBindingCallback** = () => `void` **`Beta`** ## Returns `void` [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-editor/variables/editor.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-editor/variables/editor.md. # Variable: editor > `const` **editor**: [`MinecraftEditor`](/server-editor/classes/MinecraftEditor.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-editor) --- url: /server-gametest/classes/FenceConnectivity.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/classes/FenceConnectivity.md. # Class: FenceConnectivity **`Beta`** 返回此栅栏是否在多个方向上与其他栅栏连接的信息。 Returns information about whether this fence is connected to other fences in several directions. ## Properties ### east > `readonly` **east**: `boolean` **`Beta`** #### Remarks 表示此栅栏方块是否与东侧(x + 1)的另一个栅栏连接。 Represents whether this fence block is connected to another fence to the east (x + 1). *** ### north > `readonly` **north**: `boolean` **`Beta`** #### Remarks 表示此栅栏方块是否与北侧(z - 1)的另一个栅栏连接。 Represents whether this fence block is connected to another fence to the north (z - 1). *** ### south > `readonly` **south**: `boolean` **`Beta`** #### Remarks 表示此栅栏方块是否与南侧(z + 1)的另一个栅栏连接。 Represents whether this fence block is connected to another fence to the south (z + 1). *** ### west > `readonly` **west**: `boolean` **`Beta`** #### Remarks 表示此栅栏方块是否与西侧(x - 1)的另一个栅栏连接。 Represents whether this fence block is connected to another fence to the west (x - 1). [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/classes/GameTestCompletedError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/classes/GameTestCompletedError.md. # Class: GameTestCompletedError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### reason > `readonly` **reason**: [`GameTestCompletedErrorReason`](/server-gametest/enums/GameTestCompletedErrorReason.md) **`Early Execution`** **`Beta`** #### Remarks *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [GameTestCompletedErrorReason](/server-gametest/enums/GameTestCompletedErrorReason.md) - [GameTestError](/server-gametest/classes/GameTestError.md) - [GameTestErrorContext](/server-gametest/interfaces/GameTestErrorContext.md) - [GameTestErrorType](/server-gametest/enums/GameTestErrorType.md) - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/classes/GameTestError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/classes/GameTestError.md. # Class: GameTestError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### context? > `readonly` `optional` **context?**: [`GameTestErrorContext`](/server-gametest/interfaces/GameTestErrorContext.md) **`Early Execution`** **`Beta`** #### Remarks *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### messageParameters > `readonly` **messageParameters**: `string`\[] **`Early Execution`** **`Beta`** #### Remarks *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### type > `readonly` **type**: [`GameTestErrorType`](/server-gametest/enums/GameTestErrorType.md) **`Early Execution`** **`Beta`** #### Remarks *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) - [GameTestCompletedErrorReason](/server-gametest/enums/GameTestCompletedErrorReason.md) - [GameTestErrorContext](/server-gametest/interfaces/GameTestErrorContext.md) - [GameTestErrorType](/server-gametest/enums/GameTestErrorType.md) - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/classes/GameTestSequence.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/classes/GameTestSequence.md. # Class: GameTestSequence **`Beta`** 按顺序执行通过链式 .thenXyz 方法定义的一系列步骤。 这便于按时间顺序编写 GameTest 设置方法与断言的「脚本」。 Executes a set of steps defined via chained .thenXyz methods, sequentially. This facilitates a 'script' of GameTest setup methods and assertions over time. ## Methods ### thenExecute() > **thenExecute**(`callback`): `GameTestSequence` **`World Mutation`** **`Beta`** #### Parameters ##### callback () => `void` 要执行的回调函数。 Callback function to execute. #### Returns `GameTestSequence` 返回一个 GameTestSequence 对象,可继续向其添加更多 .thenXyz 步骤。 Returns a GameTestSequence object where additional .thenXyz method steps can be added. #### Remarks 将给定的回调作为一步运行在 GameTest 序列中。回调中抛出的异常将终止序列执行。 Runs the given callback as a step within a GameTest sequence. Exceptions thrown within the callback will end sequence execution. *** ### thenExecuteAfter() > **thenExecuteAfter**(`delayTicks`, `callback`): `GameTestSequence` **`World Mutation`** **`Beta`** #### Parameters ##### delayTicks `number` 执行回调前等待的游戏刻数。 Number of ticks to wait before executing the callback. ##### callback () => `void` 要执行的回调函数。 Callback function to execute. #### Returns `GameTestSequence` 返回一个 GameTestSequence 对象,可继续向其添加更多 .thenXyz 步骤。 Returns a GameTestSequence object where additional .thenXyz method steps can be added. #### Remarks 经过一段延迟后,将给定的回调作为一步运行在 GameTest 序列中。回调中抛出的异常将终止序列执行。 After a delay, runs the given callback as a step within a GameTest sequence. Exceptions thrown within the callback will end sequence execution. *** ### thenExecuteFor() > **thenExecuteFor**(`tickCount`, `callback`): `GameTestSequence` **`World Mutation`** **`Beta`** #### Parameters ##### tickCount `number` ##### callback () => `void` 要执行的回调函数。 Callback function to execute. #### Returns `GameTestSequence` 返回一个 GameTestSequence 对象,可继续向其添加更多 .thenXyz 步骤。 Returns a GameTestSequence object where additional .thenXyz method steps can be added. #### Remarks 在指定的刻数内,每游戏刻执行一次给定的回调。 Runs the given callback every tick for the given number of ticks. *** ### thenFail() > **thenFail**(`errorMessage`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### errorMessage `string` 概括失败原因的错误信息。 Error message summarizing the failure condition. #### Returns `void` #### Remarks 如果 GameTest 序列执行到该步骤,则让测试失败。 Causes the test to fail if this step in the GameTest sequence is reached. *** ### thenIdle() > **thenIdle**(`delayTicks`): `GameTestSequence` **`World Mutation`** **`Beta`** #### Parameters ##### delayTicks `number` GameTest 序列在该步骤要延迟的游戏刻数。 Number of ticks to delay for this step in the GameTest sequence. #### Returns `GameTestSequence` 返回一个 GameTestSequence 对象,可继续向其添加更多 .thenXyz 步骤。 Returns a GameTestSequence object where additional .thenXyz method steps can be added. #### Remarks 让 GameTest 序列在指定的 delayTicks 内空转等待。 Idles the GameTest sequence for the specified delayTicks. *** ### thenSucceed() > **thenSucceed**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 如果 GameTest 序列执行到该步骤,则将 GameTest 标记为成功。 Marks the GameTest a success if this step is reached in the GameTest sequence. *** ### thenWait() > **thenWait**(`callback`): `GameTestSequence` **`World Mutation`** **`Beta`** #### Parameters ##### callback () => `void` 要执行的测试回调函数,通常其内部会调用各种 .assertXyz 断言方法。 Testing callback function to execute. Typically, this function will have .assertXyz functions within it. #### Returns `GameTestSequence` 返回一个 GameTestSequence 对象,可继续向其添加更多 .thenXyz 步骤。 Returns a GameTestSequence object where additional .thenXyz method steps can be added. #### Remarks 每游戏刻执行给定的回调,直到其成功为止。回调中抛出的异常将终止序列执行。 Executes the given callback every tick until it succeeds. Exceptions thrown within the callback will end sequence execution. *** ### thenWaitAfter() > **thenWaitAfter**(`delayTicks`, `callback`): `GameTestSequence` **`World Mutation`** **`Beta`** #### Parameters ##### delayTicks `number` 距 GameTest 序列上一步结束之后,运行回调的游戏刻。 Tick (after the previous step in the GameTest sequence) to run the callback at. ##### callback () => `void` 要执行的测试回调函数,通常其内部会调用各种 .assertXyz 断言方法。 Testing callback function to execute. Typically, this function will have .assertXyz functions within it. #### Returns `GameTestSequence` 返回一个 GameTestSequence 对象,可继续向其添加更多 .thenXyz 步骤。 Returns a GameTestSequence object where additional .thenXyz method steps can be added. #### Remarks 从上一步完成起,经过一段延迟后,每游戏刻执行给定的回调直到其成功。回调中抛出的异常将终止序列执行。 After a delay from the previous step, executes the given callback every tick until it succeeds. Exceptions thrown within the callback will end sequence execution. [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/classes/NavigationResult.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/classes/NavigationResult.md. # Class: NavigationResult **`Beta`** ## Properties ### isFullPath > `readonly` **isFullPath**: `boolean` **`Beta`** ## Methods ### getPath() > **getPath**(): `Vector3`\[] **`Beta`** #### Returns `Vector3`\[] [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/classes/RegistrationBuilder.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/classes/RegistrationBuilder.md. # Class: RegistrationBuilder **`Beta`** 用于为测试设置 GameTest 参数的工具类。可以将多个方法链式 调用以设置多个属性。 A utility class to set GameTest parameters for a test. Methods can be chained together to set multiple properties. ## Methods ### batch() > **batch**(`batchName`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### batchName `string` 测试所属批次的名称。 Name of the batch for the test. #### Returns `RegistrationBuilder` RegistrationBuilder 对象,可在其上调用其他配置方法。 RegistrationBuilder object where additional configuration methods can be called. #### Remarks 设置测试所运行的批次。 Sets the batch for the test to run in. *** ### maxAttempts() > **maxAttempts**(`attemptCount`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### attemptCount `number` #### Returns `RegistrationBuilder` RegistrationBuilder 对象,可在其上调用其他配置方法。 RegistrationBuilder object where additional configuration methods can be called. #### Remarks 设置测试失败后尝试重新运行的最大次数。 Sets the maximum number of times a test will try to rerun if it fails. *** ### maxTicks() > **maxTicks**(`tickCount`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### tickCount `number` #### Returns `RegistrationBuilder` RegistrationBuilder 对象,可在其上调用其他配置方法。 RegistrationBuilder object where additional configuration methods can be called. #### Remarks 设置测试在超时并判定失败之前运行的最大刻数。 Sets the maximum number of ticks a test will run for before timing out and failing. *** ### padding() > **padding**(`paddingBlocks`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### paddingBlocks `number` 该 GameTest 周围不应创建其他 GameTest 的空间大小(以方块为 单位)。 Size, in blocks, around the GameTest where additional GameTests should not be created. #### Returns `RegistrationBuilder` RegistrationBuilder 对象,可在其上调用其他配置方法。 RegistrationBuilder object where additional configuration methods can be called. #### Remarks 在同时运行多个测试时,应为该 GameTest 预留的周围空间大小 (以方块为单位)。 Size around the GameTest, in blocks, that should be reserved for the test when running multiple tests together. *** ### required() > **required**(`isRequired`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### isRequired `boolean` 若设为 true,则该测试必须通过,整个测试运行才能通过。 If set to true, the test must pass in order for the entire run of tests to pass. #### Returns `RegistrationBuilder` RegistrationBuilder 对象,可在其上调用其他配置方法。 RegistrationBuilder object where additional configuration methods can be called. #### Remarks 该测试是否必须作为其所属更大测试集的一部分而通过。 Whether this test is required to pass as part of its broader set of tests. *** ### requiredSuccessfulAttempts() > **requiredSuccessfulAttempts**(`attemptCount`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### attemptCount `number` #### Returns `RegistrationBuilder` RegistrationBuilder 对象,可在其上调用其他配置方法。 RegistrationBuilder object where additional configuration methods can be called. #### Remarks 设置视为成功所需的测试成功运行次数。 Sets the number of successful test runs to be considered successful. *** ### rotateTest() > **rotateTest**(`rotate`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### rotate `boolean` #### Returns `RegistrationBuilder` #### Remarks 若为 true,则通过 /gametest runset 运行时会以全部四个旋转方 向运行该测试。 If true, runs the test in all four rotations when run via /gametest runset. *** ### setupTicks() > **setupTicks**(`tickCount`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### tickCount `number` #### Returns `RegistrationBuilder` RegistrationBuilder 对象,可在其上调用其他配置方法。 RegistrationBuilder object where additional configuration methods can be called. #### Remarks 设置结构生成后,测试在执行前等待的刻数。 Sets the number of ticks for a test to wait before executing when the structure is spawned. *** ### structureLocation() > **structureLocation**(`structureLocation`, `structureDimension?`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### structureLocation `Vector3` ##### structureDimension? `any` #### Returns `RegistrationBuilder` RegistrationBuilder 对象,可在其上调用其他配置方法。 RegistrationBuilder object where additional configuration methods can be called. #### Remarks 以指定的位置和维度覆盖默认的结构放置。若高度(y)设为 Dimension.heightRange.max,则结构将吸附到地面。若未指定维 度,则将在运行命令所在的维度中运行。 Overrides the default structure placement with a specific location and dimension. If height (y) is set to Dimension.heightRange.max, the structure will snap to the ground. If the dimension is not specified, it will run in the dimension the command was run from. #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### structureName() > **structureName**(`structureName`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### structureName `string` #### Returns `RegistrationBuilder` RegistrationBuilder 对象,可在其上调用其他配置方法。 RegistrationBuilder object where additional configuration methods can be called. #### Remarks 设置测试要使用的结构名称。"xyz:bar" 将从行为包栈中加载 `/structures/xyz/bar.mcstructure`。 Sets the name of the structure for a test to use. "xyz:bar" will load `/structures/xyz/bar.mcstructure` from the behavior pack stack. #### Example **phantomsShouldFlyFromCats.ts** ```typescript import { Test, register } from '@minecraft/server-gametest'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function phantomsShouldFlyFromCats(test: Test) { test.spawn(MinecraftEntityTypes.Cat, { x: 4, y: 3, z: 3 }); test.spawn(MinecraftEntityTypes.Phantom, { x: 4, y: 3, z: 3 }); test.succeedWhenEntityPresent(MinecraftEntityTypes.Phantom, { x: 4, y: 6, z: 3 }, true); } register('MobBehaviorTests', 'phantoms_should_fly_from_cats', phantomsShouldFlyFromCats).structureName( 'gametests:glass_cells' ); ``` *** ### tag() > **tag**(`tag`): `RegistrationBuilder` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### tag `string` #### Returns `RegistrationBuilder` RegistrationBuilder 对象,可在其上调用其他配置方法。 RegistrationBuilder object where additional configuration methods can be called. #### Remarks 为测试添加一个标签。你可以使用 `/gametest runset ` 运行 具有指定标签的所有测试。 Adds a tag to a test. You can run all tests with a given tag with `/gametest runset `. #### Example **phantomsShouldFlyFromCats.ts** ```typescript import { Test, register } from '@minecraft/server-gametest'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function phantomsShouldFlyFromCats(test: Test) { test.spawn(MinecraftEntityTypes.Cat, { x: 4, y: 3, z: 3 }); test.spawn(MinecraftEntityTypes.Phantom, { x: 4, y: 3, z: 3 }); test.succeedWhenEntityPresent(MinecraftEntityTypes.Phantom, { x: 4, y: 6, z: 3 }, true); } register('MobBehaviorTests', 'phantoms_should_fly_from_cats', phantomsShouldFlyFromCats).structureName( 'gametests:glass_cells' ); ``` [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/classes/SculkSpreader.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/classes/SculkSpreader.md. # Class: SculkSpreader **`Beta`** 实现一个可用于测试幽匿蔓延行为的类。此幽匿蔓延器类可以驱动特定方块周围的幽匿生长。 Implements a class that can be used for testing sculk spreading behaviors. This sculk spreader class can drive the growth of sculk around a particular block. ## Properties ### maxCharge > `readonly` **maxCharge**: `number` **`Beta`** #### Remarks 获取幽匿蔓延器的最大能量值。 Gets the maximum charge of a sculk spreader. #### Throws This property can throw when used. ## Methods ### addCursorsWithOffset() > **addCursorsWithOffset**(`offset`, `charge`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### offset `Vector3` ##### charge `number` #### Returns `void` #### Remarks 添加一个游标——它是幽匿将朝其方向蔓延的概念性路径点。 Adds a cursor - which is a notional waypoint that the sculk will spread in the direction of. *** ### getCursorPosition() > **getCursorPosition**(`index`): `Vector3` **`World Mutation`** **`Beta`** #### Parameters ##### index `number` #### Returns `Vector3` #### Remarks 获取指定游标的当前位置。 Retrieves the current position of the specified cursor. #### Throws This function can throw errors. *** ### getNumberOfCursors() > **getNumberOfCursors**(): `number` **`World Mutation`** **`Beta`** #### Returns `number` #### Remarks 返回此幽匿蔓延器的游标总数。 Returns a number of overall cursors for this sculk spreader. #### Throws This function can throw errors. *** ### getTotalCharge() > **getTotalCharge**(): `number` **`World Mutation`** **`Beta`** #### Returns `number` #### Remarks 获取幽匿蔓延器当前的总能量值。 Gets the total current charge of the sculk spreader. #### Throws This function can throw errors. [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/classes/SimulatedPlayer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/classes/SimulatedPlayer.md. # Class: SimulatedPlayer player **`Beta`** 可在 GameTest 中使用的模拟玩家,用于表示 玩家在世界中如何移动,并用于测试实体和 环境对玩家的反应。该类型的大部分结构和方法 都来自 [Player](/server/enums/ScoreboardIdentityType.md#player) 类型。请注意,许多 在更广泛的实体上可用的事件类型, 例如物品使用事件,可能不会以相同的 形式在模拟玩家上触发。 A simulated player can be used within GameTests to represent how a player moves throughout the world and to support testing of how entities and the environment will react to a player. This type derives much of its structure and methods from the [Player](/server/enums/ScoreboardIdentityType.md#player) type. Note that many types of events that may be available for entities more broadly, such as item use events, may not fire in the same capacity for simulated players. ## Extends - `unknown` ## Properties ### headRotation > `readonly` **headRotation**: `Vector2` **`Beta`** #### Remarks 头部在俯仰角和偏航角上的旋转。 Rotation of the head across pitch and yaw angles. #### Throws This property can throw when used. *** ### isSprinting > **isSprinting**: `boolean` **`World Mutation`** **`Beta`** #### Remarks 返回模拟玩家是否在冲刺。 Returns whether the simulated player is sprinting. ## Methods ### attack() > **attack**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks 让模拟玩家执行一次攻击"挥砍"。 若攻击成功执行则返回 true —— 例如,玩家未 处于冷却状态且拥有有效目标。目标选取 通过从玩家头部进行射线检测来完成。 Causes the simulated player to make an attack 'swipe'. Returns true if the attack was performed - for example, the player was not on cooldown and had a valid target. Target selection is performed by raycasting from the player's head. #### Throws This function can throw errors. *** ### attackEntity() > **attackEntity**(`entity`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### entity `Entity` #### Returns `boolean` #### Remarks 让模拟玩家攻击指定的目标。 若攻击成功执行则返回 true —— 例如,玩家未 处于冷却状态且拥有有效目标。该 攻击可在任意距离执行,且不需要与 目标实体保持视线接触。 Causes the simulated player to attack the provided target. Returns true if the attack was performed - for example, the player was not on cooldown and had a valid target. The attack can be performed at any distance and does not require line of sight to the target entity. #### Throws This function can throw errors. *** ### breakBlock() > **breakBlock**(`blockLocation`, `direction?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 要交互的方块位置。 Location of the block to interact with. ##### direction? `any` 放置指定物品时所朝的方向。 Direction to place the specified item within. Defaults to: 1 #### Returns `boolean` #### Remarks 破坏 blockLocation 处的方块,并遵循服务器 玩家的游戏模式规则。将会持续挖掘该方块, 直到方块被破坏、玩家使用了某个物品, 或调用了 stopBreakingBlock。 如果 blockLocation 处的方块是实心方块则返回 true。 Destroys the block at blockLocation, respecting the rules of the server player's game mode. The block will be hit until broken, an item is used or stopBreakingBlock is called. Returns true if the block at blockLocation is solid. #### Throws This function can throw errors. [GameTestError](/server-gametest/classes/GameTestError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### chat() > **chat**(`message`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### message `string` #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### disconnect() > **disconnect**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 模拟并执行模拟玩家从世界中 断开连接的操作。 Simulates and performs a disconnection of the simulated player from the world. #### Throws This function can throw errors. *** ### dropSelectedItem() > **dropSelectedItem**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks 丢弃模拟玩家当前选中的物品。 Drops the simulated player's selected item #### Throws This function can throw errors. *** ### fly() > **fly**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 让模拟玩家开始飞行,就像在 创造模式下飞行一样。若要使用鞘翅滑翔, 请参阅 glide 函数。 Causes the simulated player to start flying as though they were flying in creative mode. For flying with Elytra, see function glide. #### Throws This function can throw errors. *** ### giveItem() > **giveItem**(`itemStack`, `selectSlot?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### itemStack `ItemStack` 要给予的物品。 Item to give. ##### selectSlot? `boolean` 给予后是否将该槽位设为当前选中槽位。 Whether to set the selected slot once given. Defaults to: false #### Returns `boolean` #### Remarks 给模拟玩家一个指定的物品堆。 Gives the simulated player a particular item stack. #### Throws This function can throw errors. *** ### glide() > **glide**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` 若模拟玩家成功开始滑翔则返回 true。 若玩家已经在滑翔,或者玩家 未装备鞘翅、处于水中或位于 地面,则返回 false。 Returns true if the simulated player begins to glide. Returns false if the player is already gliding, or the player does not have Elytra equipped, is in water or is on the ground. #### Remarks 让模拟玩家开始滑翔。玩家必须装备 鞘翅,且必须处于空中。 Causes the simulated player to start gliding. Elytra must be equipped and the player must be in the air. #### Throws This function can throw errors. *** ### interact() > **interact**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks 从玩家头部进行射线检测,并与 命中的第一个方块或实体进行交互。若交互成功 则返回 true。最大范围为 6 个方块。 Performs a raycast from the player’s head and interacts with the first intersected block or entity. Returns true if the interaction was successful. Maximum range is 6 blocks. #### Throws This function can throw errors. *** ### interactWithBlock() > **interactWithBlock**(`blockLocation`, `direction?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 要交互的方块位置。 Location of the block to interact with. ##### direction? `any` 放置指定物品时所朝的方向。 Direction to place the specified item within. Defaults to: 1 #### Returns `boolean` #### Remarks 让模拟玩家与一个方块进行交互。指定 方块位置处的方块必须是实心方块。若 交互成功执行则返回 true。 Causes the simulated player to interact with a block. The block at the specified block location must be solid. Returns true if the interaction was performed. #### Throws This function can throw errors. [GameTestError](/server-gametest/classes/GameTestError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### interactWithEntity() > **interactWithEntity**(`entity`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### entity `Entity` 要交互的实体。 Entity to interact with. #### Returns `boolean` #### Remarks 让模拟玩家与一个生物交互。若 交互成功执行则返回 true。 Causes the simulated player to interact with a mob. Returns true if the interaction was performed. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### jump() > **jump**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` 若成功执行跳跃则返回 true。 True if a jump was performed. #### Remarks 让模拟玩家跳跃。 Causes the simulated player to jump. #### Throws This function can throw errors. *** ### lookAtBlock() > **lookAtBlock**(`blockLocation`, `duration?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` ##### duration? [`LookDuration`](/server-gametest/enums/LookDuration.md) Defaults to: 2 #### Returns `void` #### Remarks 旋转模拟玩家的头部/身体,使其看向 给定的方块位置。 Rotates the simulated player's head/body to look at the given block location. #### Throws This function can throw errors. [GameTestError](/server-gametest/classes/GameTestError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### lookAtEntity() > **lookAtEntity**(`entity`, `duration?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### entity `Entity` ##### duration? [`LookDuration`](/server-gametest/enums/LookDuration.md) Defaults to: 2 #### Returns `void` #### Remarks 旋转模拟玩家的头部/身体,使其看向 给定的实体。 Rotates the simulated player's head/body to look at the given entity. #### Throws This function can throw errors. *** ### lookAtLocation() > **lookAtLocation**(`location`, `duration?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` ##### duration? [`LookDuration`](/server-gametest/enums/LookDuration.md) Defaults to: 2 #### Returns `void` #### Remarks 旋转模拟玩家的头部/身体,使其看向 给定的位置。 Rotates the simulated player's head/body to look at the given location. #### Throws This function can throw errors. *** ### move() > **move**(`westEast`, `northSouth`, `speed?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### westEast `number` ##### northSouth `number` ##### speed? `number` Defaults to: 1 Bounds: \[0, 1] #### Returns `void` #### Remarks 让模拟玩家沿相对于 GameTest 的给定 方向行走。 Orders the simulated player to walk in the given direction relative to the GameTest. #### Throws This function can throw errors. *** ### moveRelative() > **moveRelative**(`leftRight`, `backwardForward`, `speed?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### leftRight `number` ##### backwardForward `number` ##### speed? `number` Defaults to: 1 Bounds: \[0, 1] #### Returns `void` #### Remarks 让模拟玩家沿相对于玩家当前 朝向的给定方向行走。 Orders the simulated player to walk in the given direction relative to the player's current rotation. #### Throws This function can throw errors. *** ### moveToBlock() > **moveToBlock**(`blockLocation`, `options?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` ##### options? [`MoveToOptions`](/server-gametest/interfaces/MoveToOptions.md) #### Returns `void` #### Remarks 让模拟玩家沿直线移动到给定的方块 位置。如果已有移动或寻路正在 进行中,此操作将覆盖上一次的 移动/寻路。 Orders the simulated player to move to the given block location in a straight line. If a move or navigation is already playing, this will override the last move/navigation. #### Throws This function can throw errors. *** ### moveToLocation() > **moveToLocation**(`location`, `options?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` ##### options? [`MoveToOptions`](/server-gametest/interfaces/MoveToOptions.md) #### Returns `void` #### Remarks 让模拟玩家沿直线移动到给定的位置。 如果已有移动或寻路正在进行中, 此操作将覆盖上一次的移动/寻路。 Orders the simulated player to move to the given location in a straight line. If a move or navigation is already playing, this will override the last move/navigation. #### Throws This function can throw errors. Error [GameTestError](/server-gametest/classes/GameTestError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### navigateToBlock() > **navigateToBlock**(`blockLocation`, `speed?`): [`NavigationResult`](/server-gametest/classes/NavigationResult.md) **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` ##### speed? `number` Defaults to: 1 Bounds: \[0, 1] #### Returns [`NavigationResult`](/server-gametest/classes/NavigationResult.md) #### Remarks 让模拟玩家使用寻路移动到指定的方块 位置。如果已有移动或寻路正在 进行中,此操作将覆盖上一次的移动/行走。请注意, 若模拟玩家被卡住,该模拟玩家 将停止移动。玩家必须接触地面 才能开始寻路。 Orders the simulated player to move to a specific block location using navigation. If a move or navigation is already playing, this will override the last move/walk. Note that if the simulated player gets stuck, that simulated player will stop. The player must be touching the ground in order to start navigation. #### Throws This function can throw errors. [GameTestError](/server-gametest/classes/GameTestError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### navigateToEntity() > **navigateToEntity**(`entity`, `speed?`): [`NavigationResult`](/server-gametest/classes/NavigationResult.md) **`World Mutation`** **`Beta`** #### Parameters ##### entity `Entity` ##### speed? `number` Defaults to: 1 Bounds: \[0, 1] #### Returns [`NavigationResult`](/server-gametest/classes/NavigationResult.md) #### Remarks 将使用寻路跟随指定实体,保持 在一个方块的半径范围内。如果已有移动或寻路 正在进行中,此操作将覆盖上一次的移动/寻路。 Will use navigation to follow the selected entity to within a one block radius. If a move or navigation is already playing, this will override the last move/navigation. #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### navigateToLocation() > **navigateToLocation**(`location`, `speed?`): [`NavigationResult`](/server-gametest/classes/NavigationResult.md) **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` ##### speed? `number` Defaults to: 1 Bounds: \[0, 1] #### Returns [`NavigationResult`](/server-gametest/classes/NavigationResult.md) #### Remarks 让模拟玩家使用寻路移动到指定的 位置。如果已有移动或寻路正在 进行中,此操作将覆盖上一次的移动/行走。请注意, 若模拟玩家被卡住,该模拟玩家将 停止移动。玩家必须接触地面才能 开始寻路。 Orders the simulated player to move to a specific location using navigation. If a move or navigation is already playing, this will override the last move/walk. Note that if the simulated player gets stuck, that simulated player will stop. The player must be touching the ground in order to start navigation. #### Throws This function can throw errors. [GameTestError](/server-gametest/classes/GameTestError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### navigateToLocations() > **navigateToLocations**(`locations`, `speed?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### locations `Vector3`\[] 用于规划路径的位置列表。 A list of locations to use for routing. ##### speed? `number` 执行寻路时使用的净速度。 Net speed to use for doing the navigation. Defaults to: 1 Bounds: \[0, 1] #### Returns `void` #### Remarks 使用寻路跟随 locations 参数所提供的 路线。如果已有移动或寻路正在 进行中,此操作将覆盖上一次的移动/寻路。 Use navigation to follow the route provided via the locations parameter. If a move or navigation is already playing, this will override the last move/navigation. #### Throws This function can throw errors. [GameTestError](/server-gametest/classes/GameTestError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### respawn() > **respawn**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks 重生指定的模拟玩家。 Respawns the particular simulated player. #### Throws This function can throw errors. *** ### rotateBody() > **rotateBody**(`angleInDegrees`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### angleInDegrees `number` #### Returns `void` #### Remarks 让模拟玩家按指定角度旋转身体, 旋转角度相对于玩家当前的朝向。 Causes the simulated player to turn by the provided angle, relative to the player's current rotation. #### Throws This function can throw errors. *** ### setBodyRotation() > **setBodyRotation**(`angleInDegrees`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### angleInDegrees `number` #### Returns `void` #### Remarks 让模拟玩家旋转身体以朝向指定 角度,相对于 GameTest 的朝向。 Causes the simulated player to turn to face the provided angle, relative to the GameTest. #### Throws This function can throw errors. *** ### setItem() > **setItem**(`itemStack`, `slot`, `selectSlot?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### itemStack `ItemStack` 要设置的物品。 Item to set. ##### slot `number` 放置指定物品的槽位。 Slot to place the given item in. ##### selectSlot? `boolean` 设置后是否将该槽位设为当前选中槽位。 Whether to set the selected slot once set. Defaults to: false #### Returns `boolean` #### Remarks 为模拟玩家设置一个指定的物品。 Sets a particular item for the simulated player. #### Throws This function can throw errors. *** ### setSkin() > **setSkin**(`options`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### options [`PlayerSkinData`](/server-gametest/interfaces/PlayerSkinData.md) 要在玩家身上设置的皮肤选项。 Options for the skin to set on the player. #### Returns `void` #### Remarks 更新玩家皮肤的相关信息。 Updates information about the player's skin. #### Throws This function can throw errors. [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### startBuild() > **startBuild**(`slot?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### slot? `number` Defaults to: 0 #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### stopBreakingBlock() > **stopBreakingBlock**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 停止挖掘当前正在被连续破坏的方块。 Stops destroying the block that is currently being hit. #### Throws This function can throw errors. *** ### stopBuild() > **stopBuild**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks #### Throws This function can throw errors. *** ### stopFlying() > **stopFlying**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 让模拟玩家停止飞行。 Causes the simulated player to stop flying. #### Throws This function can throw errors. *** ### stopGliding() > **stopGliding**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 让模拟玩家停止滑翔。 Causes the simulated player to stop gliding. #### Throws This function can throw errors. *** ### stopInteracting() > **stopInteracting**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 停止与实体或方块的交互。 Stops interacting with entities or blocks. #### Throws This function can throw errors. *** ### stopMoving() > **stopMoving**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 若模拟玩家正在移动,则停止 移动/行走/跟随。 Stops moving/walking/following if the simulated player is moving. #### Throws This function can throw errors. *** ### stopSwimming() > **stopSwimming**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 让模拟玩家停止游泳。 Causes the simulated player to stop swimming. #### Throws This function can throw errors. *** ### stopUsingItem() > **stopUsingItem**(): `any` **`World Mutation`** **`Beta`** #### Returns `any` 返回正在被使用的物品。若无物品 正在使用则返回 undefined。 Returns the item that was in use. Undefined if no item was in use. #### Remarks 停止使用当前激活的物品。 Stops using the currently active item. #### Throws This function can throw errors. *** ### swim() > **swim**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 让模拟玩家开始游泳。 Causes the simulated player to start swimming. #### Throws This function can throw errors. *** ### useItem() > **useItem**(`itemStack`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### itemStack `ItemStack` 要使用的物品。 Item to use. #### Returns `boolean` #### Remarks 让模拟玩家使用一个物品。不会消耗 该物品。若物品处于冷却状态则返回 false。 Causes the simulated player to use an item. Does not consume the item. Returns false if the item is on cooldown. #### Throws This function can throw errors. *** ### useItemInSlot() > **useItemInSlot**(`slot`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### slot `number` 物品栏槽位索引。 Index of the inventory slot. #### Returns `boolean` #### Remarks 让模拟玩家手持并使用其物品栏中 的一个物品。 Causes the simulated player to hold and use an item in their inventory. #### Throws This function can throw errors. *** ### useItemInSlotOnBlock() > **useItemInSlotOnBlock**(`slot`, `blockLocation`, `direction?`, `faceLocation?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### slot `number` 要使用的槽位索引。 Index of the slot to use. ##### blockLocation `Vector3` 物品所作用的位置。 Location to use the item upon. ##### direction? `any` 放置指定物品时所朝的方向。 Direction to place the specified item within. Defaults to: 1 ##### faceLocation? `any` 相对于方块西北下角的位置, 物品将放置在此处。 Location relative to the bottom north-west corner of the block where the item is placed. Defaults to: null #### Returns `boolean` #### Remarks 让模拟玩家对其物品栏中的物品 在方块上使用。指定方块位置处的方块 必须是实心方块。若物品被使用则返回 true。 Causes the simulated player to use an item in their inventory on a block. The block at the specified block location must be solid. Returns true if the item was used. #### Throws This function can throw errors. [GameTestError](/server-gametest/classes/GameTestError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) *** ### useItemOnBlock() > **useItemOnBlock**(`itemStack`, `blockLocation`, `direction?`, `faceLocation?`): `boolean` **`World Mutation`** **`Beta`** #### Parameters ##### itemStack `ItemStack` 要使用的物品。 Item to use. ##### blockLocation `Vector3` 物品所作用的位置。 Location to use the item upon. ##### direction? `any` 放置指定物品时所朝的方向。 Direction to place the specified item within. Defaults to: 1 ##### faceLocation? `any` 相对于方块西北下角的位置, 物品将放置在此处。 Location relative to the bottom north-west corner of the block where the item is placed. Defaults to: null #### Returns `boolean` #### Remarks 让模拟玩家在方块上使用一个物品。 指定方块位置处的方块必须是实心方块。若 物品被使用则返回 true。 Causes the simulated player to use an item on a block. The block at the specified block location must be solid. Returns true if the item was used. #### Throws This function can throw errors. [GameTestError](/server-gametest/classes/GameTestError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) ## 同领域相关 - [getPlayerSkin](/server-gametest/functions/getPlayerSkin.md) - [PlayerPersonaPiece](/server-gametest/interfaces/PlayerPersonaPiece.md) - [PlayerSkinData](/server-gametest/interfaces/PlayerSkinData.md) - [spawnSimulatedPlayer](/server-gametest/functions/spawnSimulatedPlayer.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/classes/Tags.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/classes/Tags.md. # Class: Tags **`Beta`** 这些众所周知的标签可用于将不同测试分类到要运行的测试套件中。 These well-known tags can be used to classify different tests into suites to run. ## Properties ### suiteAll > `readonly` `static` **suiteAll**: `"suite:all"` = `'suite:all'` **`Beta`** #### Remarks 表示带有该标签的测试应属于所有测试套件。 Indicates that the tagged test should be a part of all suites. *** ### suiteDebug > `readonly` `static` **suiteDebug**: `"suite:debug"` = `'suite:debug'` **`Beta`** #### Remarks 表示带有该标签的测试应属于内部(调试)测试套件。 Indicates that the tagged test should be a part of an internal (debug) test suite. *** ### suiteDefault > `readonly` `static` **suiteDefault**: `"suite:default"` = `'suite:default'` **`Beta`** #### Remarks 表示带有该标签的测试应属于默认测试套件。 Indicates that the tagged test should be a part of the default test suite. *** ### suiteDisabled > `readonly` `static` **suiteDisabled**: `"suite:disabled"` = `'suite:disabled'` **`Beta`** #### Remarks 表示带有该标签的测试应属于已禁用测试套件。 Indicates that the tagged test should be a part of a suite of disabled tests. *** ### suiteNextUpdate > `readonly` `static` **suiteNextUpdate**: `"suite:nextupdate"` = `'suite:nextupdate'` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/classes/Test.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/classes/Test.md. # Class: Test **`Beta`** GameTest 函数的主类,附带用于操作相应测试的辅助工具和数据。请注意,该类的所有方法都期望传入相对于 GameTest 结构方块的位置(BlockLocation 与 Location)。 Main class for GameTest functions, with helpers and data for manipulating the respective test. Note that all methods of this class expect BlockLocations and Locations relative to the GameTest structure block. ## Methods ### assert() > **assert**(`condition`, `message`): `void` **`Beta`** #### Parameters ##### condition `boolean` 待求值条件表达式。 Expression of the condition to evaluate. ##### message `string` 当 _condition_ 求值结果不为真时所传递的消息。 Message that is passed if the _condition_ does not evaluate to true. #### Returns `void` #### Remarks 断言 _condition_ 所指定的条件为真。如果不为真,则抛出带有指定 _message_ 的错误。 Tests that the condition specified in _condition_ is true. If not, an error with the specified _message_ is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertBlockPresent() > **assertBlockPresent**(`blockType`, `blockLocation`, `isPresent?`): `void` **`Beta`** #### Parameters ##### blockType `any` 期望的方块类型。 Expected block type. ##### blockLocation `Vector3` 待检查的方块位置。 Location of the block to test at. ##### isPresent? `boolean` 若为 true,此函数检查指定位置上是否存在指定类型的方块;若为 false,则检查指定位置上不存在指定类型的方块。 If true, this function tests whether a block of the specified type is at the location. If false, tests that a block of the specified type is not present. Defaults to: true #### Returns `void` #### Remarks 断言在指定位置上存在指定类型的方块。如果不存在,则抛出异常。 Tests that a block of the specified type is present at the specified location. If it is not, an exception is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertBlockState() > **assertBlockState**(`blockLocation`, `callback`): `void` **`Beta`** #### Parameters ##### blockLocation `Vector3` 待检查的方块位置。 Location of the block to test at. ##### callback (`arg0`) => `boolean` 回调函数,其中包含基于该位置方块的额外检查。 Callback function that contains additional tests based on the block at the specified location. #### Returns `void` #### Remarks 断言在指定位置的方块具有特定的状态值。若不具有该状态值,则抛出异常。 Tests that a block has a particular state value at the specified location. If it does not have that state value, an exception is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertCanReachLocation() > **assertCanReachLocation**(`mob`, `blockLocation`, `canReach?`): `void` **`Beta`** #### Parameters ##### mob `Entity` 用于针对位置进行测试的实体。 Entity that you wish to test the location against. ##### blockLocation `Vector3` 结构方块相对位置,用于测试指定 mob 是否能够抵达。 Structure-relative location to test whether the specified mob can reach. ##### canReach? `boolean` 若为 true,检查 mob 是否能抵达该位置;若为 false,检查该 mob 是否无法抵达该位置。 If true, tests whether the mob can reach the location. If false, tests whether the mob is not able to reach the location. Defaults to: true #### Returns `void` #### Remarks 断言实体能够抵达指定位置。根据 canReach 的取值,若条件未满足则抛出异常。 Tests that an entity can reach a particular location. Depending on the value of canReach, throws an exception if the condition is not met. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertContainerContains() > **assertContainerContains**(`itemStack`, `blockLocation`): `void` **`Beta`** #### Parameters ##### itemStack `ItemStack` 表示要检查的物品类型。指定容器必须至少包含 1 个与 _itemStack_ 中定义的物品类型相匹配的物品。 Represents the type of item to check for. The specified container must contain at least 1 item matching the item type defined in _itemStack_. ##### blockLocation `Vector3` 带容器的方块(例如箱子)的位置,将针对其内容进行测试。 Location of the block with a container (for example, a chest) to test the contents of. #### Returns `void` #### Remarks 断言位于指定位置的容器(如箱子)内含有指定物品堆。否则抛出错误。 Tests that a container (e.g., a chest) at the specified location contains a specified of item stack. If not, an error is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertContainerEmpty() > **assertContainerEmpty**(`blockLocation`): `void` **`Beta`** #### Parameters ##### blockLocation `Vector3` 带容器的方块(例如箱子)的位置,将针对其是否为空进行测试。 Location of the block with a container (for example, a chest) to test is empty of contents. #### Returns `void` #### Remarks 断言位于指定位置的容器(如箱子)为空。否则抛出错误。 Tests that a container (e.g., a chest) at the specified location is empty. If not, an error is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertEntityHasArmor() > **assertEntityHasArmor**(`entityTypeIdentifier`, `armorSlot`, `armorName`, `armorData`, `blockLocation`, `hasArmor?`): `void` **`Beta`** #### Parameters ##### entityTypeIdentifier `string` 要匹配的实体标识符(例如 'minecraft:skeleton')。 Identifier of the entity to match (e.g., 'minecraft:skeleton'). ##### armorSlot `number` 待检查的容器槽位索引。 Container slot index to test. ##### armorName `string` 要查找的护甲名称。 Name of the armor to look for. ##### armorData `number` 要查找的整型数据值。 Data value integer to look for. ##### blockLocation `Vector3` 装备护甲的待测实体的位置。 Location of the entity with armor to test for. ##### hasArmor? `boolean` 是否期望该实体装备了指定的护甲。 Whether or not the entity is expected to have the specified armor equipped. Defaults to: true #### Returns `void` #### Remarks 断言实体已装备特定护甲。否则抛出错误。 Tests that an entity has a specific piece of armor equipped. If not, an error is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertEntityHasComponent() > **assertEntityHasComponent**(`entityTypeIdentifier`, `componentIdentifier`, `blockLocation`, `hasComponent?`): `void` **`Beta`** #### Parameters ##### entityTypeIdentifier `string` 指定实体的标识符(例如 'minecraft:skeleton')。若未指定命名空间,则默认为 'minecraft:'。 Identifier of the specified entity (e.g., 'minecraft:skeleton'). If the namespace is not specified, 'minecraft:' is assumed. ##### componentIdentifier `string` 要检查的组件标识符。若未指定命名空间,则默认为 'minecraft:'。 Identifier of the component to check for. If the namespace is not specified, 'minecraft:' is assumed. ##### blockLocation `Vector3` 带容器的方块(例如箱子)所在的位置。 Location of the block with a container (for example, a chest.) ##### hasComponent? `boolean` 决定是测试该组件存在,还是测试其不存在。 Determines whether to test that the component exists, or does not. Defaults to: true #### Returns `void` #### Remarks 断言实体具有特定组件。否则抛出异常。 Tests that an entity has a particular component. If not, an exception is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertEntityInstancePresent() > **assertEntityInstancePresent**(`entity`, `blockLocation`, `isPresent?`): `void` **`Beta`** #### Parameters ##### entity `Entity` 要测试的特定实体。 Specific entity to test for. ##### blockLocation `Vector3` 实体待测试的位置。 Location of the entity to test for. ##### isPresent? `boolean` 指明应测试在指定位置存在或不存在实体。 Whether to test that an entity is present or not present at the specified location. Defaults to: true #### Returns `void` #### Remarks 根据 isPresent 的取值,断言指定位置上存在或不存在特定实体。根据 isPresent 的取值,若找到或未找到实体,则抛出错误。 Depending on the value for isPresent, tests that a particular entity is present or not present at the specified location. Depending on the value of isPresent, if the entity is found or not found, an error is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertEntityInstancePresentInArea() > **assertEntityInstancePresentInArea**(`entity`, `isPresent?`): `void` **`Beta`** #### Parameters ##### entity `Entity` 待测试的实体实例。 Entity instance to test for. ##### isPresent? `boolean` 若为 true,则测试指定实体是否存在于 GameTest 区域内;若为 false,则测试指定实体不存在于该区域。 If true, this function tests whether the specified entity is present in the GameTest area. If false, tests that the specified entity is not present. Defaults to: true #### Returns `void` #### Remarks 断言在 GameTest 区域内存在一个实体实例。否则抛出异常。 Tests that an entity instance is present within the GameTest area. If not, an exception is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) #### Example **simpleMobTest.ts** ```typescript import * as gameTest from '@minecraft/server-gametest'; gameTest .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => { const attackerId = 'fox'; const victimId = 'chicken'; test.spawn(attackerId, { x: 5, y: 2, z: 5 }); const victim = test.spawn(victimId, { x: 2, y: 2, z: 2 }); test.assertEntityInstancePresentInArea(victim, true); test.succeedWhen(() => { test.assertEntityInstancePresentInArea(victim, false); }); }) .maxTicks(400) .structureName('gametests:mediumglass'); ``` *** ### assertEntityPresent() > **assertEntityPresent**(`entityTypeIdentifier`, `blockLocation`, `searchDistance?`, `isPresent?`): `void` **`Beta`** #### Parameters ##### entityTypeIdentifier `string` 待测试实体的类型(例如 'minecraft:skeleton')。若未指定实体命名空间,则默认为 'minecraft:'。 Type of entity to test for (e.g., 'minecraft:skeleton'). If an entity namespace is not specified, 'minecraft:' is assumed. ##### blockLocation `Vector3` 待测试实体的位置。 Location of the entity to test for. ##### searchDistance? `number` 以 blockLocation 为起点搜索实体的距离。 The distance to search for the entity from the blockLocation. Defaults to: 0 ##### isPresent? `boolean` 若为 true,此函数测试指定类型实体是否存在;若为 false,则测试指定类型实体不存在。 If true, this function tests whether an entity of the specified type is present. If false, tests that an entity of the specified type is not present. Defaults to: true #### Returns `void` #### Remarks 根据 isPresent 的取值,测试在某特定位置存在或不存在指定类型的实体。若条件未满足,则抛出异常。 Depending on the value of isPresent, tests for the presence or non-presence of entity of a specified type at a particular location. If the condition is not met, an exception is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertEntityPresentInArea() > **assertEntityPresentInArea**(`entityTypeIdentifier`, `isPresent?`): `void` **`Beta`** #### Parameters ##### entityTypeIdentifier `string` 待测试实体的类型(例如 'minecraft:skeleton')。若未指定实体命名空间,则默认为 'minecraft:'。 Type of entity to test for (e.g., 'minecraft:skeleton'). If an entity namespace is not specified, 'minecraft:' is assumed. ##### isPresent? `boolean` 若为 true,此函数测试指定类型实体是否存在于 GameTest 区域内;若为 false,则测试指定类型实体不存在于该区域。 If true, this function tests whether an entity of the specified type is present in the GameTest area. If false, tests that an entity of the specified type is not present. Defaults to: true #### Returns `void` #### Remarks 断言在 GameTest 区域内存在指定类型的实体。否则抛出异常。 Tests that an entity of a specified type is present within the GameTest area. If not, an exception is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) #### Examples **simpleMobTest.ts** ```typescript import * as gameTest from '@minecraft/server-gametest'; gameTest .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => { const attackerId = 'fox'; const victimId = 'chicken'; test.spawn(attackerId, { x: 5, y: 2, z: 5 }); test.spawn(victimId, { x: 2, y: 2, z: 2 }); test.assertEntityPresentInArea(victimId, true); test.succeedWhen(() => { test.assertEntityPresentInArea(victimId, false); }); }) .maxTicks(400) .structureName('gametests:mediumglass'); ``` **simpleMobGameTest.ts** ```typescript import { Test, register } from '@minecraft/server-gametest'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function simpleMobGameTest(test: Test) { const attackerId = MinecraftEntityTypes.Fox; const victimId = MinecraftEntityTypes.Chicken; test.spawn(attackerId, { x: 5, y: 2, z: 5 }); test.spawn(victimId, { x: 2, y: 2, z: 2 }); test.assertEntityPresentInArea(victimId, true); test.succeedWhen(() => { test.assertEntityPresentInArea(victimId, false); }); } register('StarterTests', 'simpleMobTest', simpleMobGameTest).maxTicks(400).structureName('gametests:mediumglass'); ``` *** ### assertEntityState() > **assertEntityState**(`blockLocation`, `entityTypeIdentifier`, `callback`): `void` **`Beta`** #### Parameters ##### blockLocation `Vector3` 要查找的实体位置。 Location of the entity to look for. ##### entityTypeIdentifier `string` 要查找的实体的标识符(例如 'minecraft:skeleton')。注意:若未指定命名空间,则默认为 'minecraft:'。 Identifier of the entity (e.g., 'minecraft:skeleton') to look for. Note if no namespace is specified, 'minecraft:' is assumed. ##### callback (`arg0`) => `boolean` 用于对所选实体的各项属性进行测试的回调函数。若该回调函数返回 false 或未找到指定标识符的实体,则抛出异常。 Callback function where facets of the selected entity can be tested for. If this callback function returns false or no entity with the specified identifier is found, an exception is thrown. #### Returns `void` #### Remarks 断言位于指定位置的实体(例如骷髅)具有特定数据。否则抛出错误。 Tests that an entity (e.g., a skeleton) at the specified location has a particular piece of data. If not, an error is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertEntityTouching() > **assertEntityTouching**(`entityTypeIdentifier`, `location`, `isTouching?`): `void` **`Beta`** #### Parameters ##### entityTypeIdentifier `string` 待测试实体的类型(例如 'minecraft:skeleton')。若未指定实体命名空间,则默认为 'minecraft:'。 Type of entity to test for (e.g., 'minecraft:skeleton'). If an entity namespace is not specified, 'minecraft:' is assumed. ##### location `Vector3` 待测试实体的位置。 Location of the entity to test for. ##### isTouching? `boolean` 若为 true,此函数测试实体是否接触指定位置;若为 false,则测试实体未接触指定位置。 If true, this function tests whether the entity is touching the specified location. If false, tests that an entity is not testing the specified location. Defaults to: true #### Returns `void` #### Remarks 根据 isTouching 的取值,断言指定类型的实体正在接触或连接另一实体。若条件未满足,则抛出异常。 Depending on the value of isTouching, tests that an entity of a specified type is touching or connected to another entity. If the condition is not met, an exception is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertIsWaterlogged() > **assertIsWaterlogged**(`blockLocation`, `isWaterlogged?`): `void` **`Beta`** #### Parameters ##### blockLocation `Vector3` 待测试方块的位置。 Location of the block to test for. ##### isWaterlogged? `boolean` 是否测试 _position_ 处方块期望处于含水状态。 Whether to test that the block at _position_ is expected to be waterlogged. Defaults to: true #### Returns `void` #### Remarks 根据 isWaterlogged 的取值,断言某位置的方块含水。若条件未满足,则抛出错误。纯水方块不视为含水方块。 Depending on the value of isWaterlogged, tests that a block at a location contains water. If the condition is not met, an error is thrown. Pure water blocks are not considered to be waterlogged. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertItemEntityCountIs() > **assertItemEntityCountIs**(`itemType`, `blockLocation`, `searchDistance`, `count`): `void` **`Beta`** #### Parameters ##### itemType `any` 要查找的物品类型。 Type of item to look for. ##### blockLocation `Vector3` 在该位置附近搜索指定物品集合。 Location to search around for the specified set of items. ##### searchDistance `number` 搜索半径(以方块为单位),用于在范围内累计物品数量。若为 0,则仅搜索 _position_ 处的特定方块。 Range, in blocks, to aggregate a count of items around. If 0, will only search the particular block at _position_. ##### count `number` 至少要查找并用于测试的物品数量。 Number of items, at minimum, to look and test for. #### Returns `void` #### Remarks 断言在某区域内存在指定类型和数量的物品。否则抛出错误。 Tests that items of a particular type and count are present within an area. If not, an error is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertItemEntityPresent() > **assertItemEntityPresent**(`itemType`, `blockLocation`, `searchDistance?`, `isPresent?`): `void` **`Beta`** #### Parameters ##### itemType `any` 待测试物品的类型。 Type of item to test for. ##### blockLocation `Vector3` 待测试物品实体的位置。 Location of the item entity to test for. ##### searchDistance? `number` 用于查找物品实体的半径(以方块为单位)。 Radius in blocks to look for the item entity. Defaults to: 0 ##### isPresent? `boolean` 若为 true,此函数测试指定类型的物品实体是否存在;若为 false,则测试指定类型的物品实体不存在。 If true, this function tests whether an item entity of the specified type is present. If false, tests that an item entity of the specified type is not present. Defaults to: true #### Returns `void` #### Remarks 根据 isPresent 的取值,断言某特定位置存在或不存在特定物品实体。若条件未满足,则抛出异常。 Depending on the value of isPresent, tests whether a particular item entity is present or not at a particular location. If the condition is not met, an exception is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### assertRedstonePower() > **assertRedstonePower**(`blockLocation`, `power`): `void` **`Beta`** #### Parameters ##### blockLocation `Vector3` 待测试的位置。 Location to test. ##### power `number` 期望的能量等级。 Expected power level. #### Returns `void` #### Remarks 断言某位置上的红石信号强度等级与特定值匹配。否则抛出异常。 Tests that Redstone power at a particular location matches a particular value. If not, an exception is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### destroyBlock() > **destroyBlock**(`blockLocation`, `dropResources?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 要销毁的方块的位置。 Location of the block to destroy. ##### dropResources? `boolean` 是否生成特定掉落所暴露的资源。 Whether to add resources exposed with a particular drop. Defaults to: false #### Returns `void` #### Remarks 销毁特定位置上的方块。 Destroys a block at a particular location. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### fail() > **fail**(`errorMessage`): `void` **`Beta`** #### Parameters ##### errorMessage `string` 概括失败原因的错误消息。 Error message summarizing the failure condition. #### Returns `void` #### Remarks 将当前测试标记为失败用例。 Marks the current test as a failure case. #### Throws This function can throw errors. *** ### failIf() > **failIf**(`callback`): `void` **`Beta`** #### Parameters ##### callback () => `void` 要运行的回调函数。若该函数正常执行完毕,则测试将被标记为失败。通常该函数体内会调用 .assertXyz 系列方法。 Callback function that runs. If the function runs successfully, the test is marked as a failure. Typically, this function will have .assertXyz method calls within it. #### Returns `void` #### Remarks 运行给定回调函数。若回调未抛出异常,则将该测试标记为失败。 Runs the given callback. If the callback does not throw an exception, the test is marked as a failure. #### Throws This function can throw errors. *** ### getBlock() > **getBlock**(`blockLocation`): `Block` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 要检索的方块的位置。 Location of the block to retrieve. #### Returns `Block` #### Remarks 获取指定方块位置处的方块。 Gets a block at the specified block location. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### getDimension() > **getDimension**(): `Dimension` **`Beta`** #### Returns `Dimension` #### Remarks 获取此测试所处的维度。 Gets the dimension of this test. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### getFenceConnectivity() > **getFenceConnectivity**(`blockLocation`): [`FenceConnectivity`](/server-gametest/classes/FenceConnectivity.md) **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 要检索的方块的位置。 Location of the block to retrieve. #### Returns [`FenceConnectivity`](/server-gametest/classes/FenceConnectivity.md) #### Remarks 若指定方块位置处的方块是栅栏,则返回一个包含栅栏连接详情的辅助对象。 If the block at the specified block location is a fence, this returns a helper object with details on how a fence is connected. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### getSculkSpreader() > **getSculkSpreader**(`blockLocation`): [`SculkSpreader`](/server-gametest/classes/SculkSpreader.md) | `undefined` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 要从中获取 sculk spreader 的方块的位置。 Location of the block to retrieve a sculk spreader from. #### Returns [`SculkSpreader`](/server-gametest/classes/SculkSpreader.md) | `undefined` 返回 SculkSpreader;若该方块上不存在 SculkSpreader 则返回 undefined。 Returns the SculkSpreader or undefined if no SculkSpreader is present on the block. #### Remarks 获取一个 sculk spreader 对象,可用于控制和管理 sculk 从某个方块的扩散方式。 Retrieves a sculk spreader object that can be used to control and manage how sculk grows from a block. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### getTestDirection() > **getTestDirection**(): `Direction` **`Beta`** #### Returns `Direction` #### Remarks 返回当前测试的方向 —— 有关可能取值(北、东、南、西,数值 2-5),请参阅 [minecraftserver.Direction](/server/enums/Direction.md) 枚举。 Returns the direction of the current test - see the [minecraftserver.Direction](/server/enums/Direction.md) enum for more information on potential values (north, east, south, west - values 2-5). #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) *** ### idle() > **idle**(`tickDelay`): `Promise`\<`void`> **`World Mutation`** **`Beta`** #### Parameters ##### tickDelay `number` 等待时长(以 tick 为单位)。 Amount of time to wait, in ticks. #### Returns `Promise`\<`void`> #### Remarks 此异步函数将等待指定的 tick 数后再继续执行。 This asynchronous function will wait for the specified time in ticks before continuing execution. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) *** ### isCleaningUp() > **isCleaningUp**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks 返回该测试当前是否处于运行后的 Clean Up(清理)阶段。 Returns whether or not the test is currently in the Clean Up step after running. *** ### isCompleted() > **isCompleted**(): `boolean` **`World Mutation`** **`Beta`** #### Returns `boolean` #### Remarks 返回该测试是否已经完成。 Returns whether or not the test has already completed *** ### killAllEntities() > **killAllEntities**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 杀死 GameTest 结构内的所有实体。 Kills all entities within the GameTest structure. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### onPlayerJump() > **onPlayerJump**(`mob`, `jumpAmount`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### mob `Entity` ##### jumpAmount `number` #### Returns `void` #### Remarks #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### pressButton() > **pressButton**(`blockLocation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 要按下按钮的位置。 Location to push the button at. #### Returns `void` #### Remarks 在某个方块位置按下按钮。 Presses a button at a block location. #### Throws Will throw an error if a button is not present at the specified position. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### print() > **print**(`text`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### text `string` 要显示的消息。 Message to display. #### Returns `void` #### Remarks 向所有玩家显示指定消息。 Displays the specified message to all players. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### pullLever() > **pullLever**(`blockLocation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 要扳动拉杆的位置。 Location to pull the lever at. #### Returns `void` #### Remarks 在某个方块位置扳动拉杆。 Pulls a lever at a block location. #### Throws Will throw an error if a lever is not present at the specified position. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### pulseRedstone() > **pulseRedstone**(`blockLocation`, `duration`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 发射红石脉冲的位置。 Location to pulse Redstone at. ##### duration `number` 脉冲持续的 tick 数。 Number of ticks to pulse Redstone. #### Returns `void` #### Remarks 通过创建一个临时红石方块在某特定位置发出红石脉冲。 Sends a Redstone pulse at a particular location by creating a temporary Redstone block. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### relativeBlockLocation() > **relativeBlockLocation**(`worldBlockLocation`): `Vector3` **`Beta`** #### Parameters ##### worldBlockLocation `Vector3` 世界上要转换为相对位置的绝对位置。 Absolute location in the world to convert to a relative location. #### Returns `Vector3` 一个相对于 GameTest 命令方块的位置。 A location relative to the GameTest command block. #### Remarks 从一个 BlockLocation 出发,返回一个坐标相对于当前 GameTest 结构方块的新 BlockLocation。例如,结构方块上方方块的相对坐标为 (0, 1, 0)。同时也会考虑 GameTest 结构的旋转。 From a BlockLocation, returns a new BlockLocation with coordinates relative to the current GameTest structure block. For example, the relative coordinates for the block above the structure block are (0, 1, 0). Rotation of the GameTest structure is also taken into account. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### relativeLocation() > **relativeLocation**(`worldLocation`): `Vector3` **`World Mutation`** **`Beta`** #### Parameters ##### worldLocation `Vector3` 世界上要转换为相对位置的绝对位置。 Absolute location in the world to convert to a relative location. #### Returns `Vector3` 一个相对于 GameTest 命令方块的位置。 A location relative to the GameTest command block. #### Remarks 从一个位置出发,返回一个坐标相对于当前 GameTest 结构方块的新位置。例如,结构方块上方方块的相对坐标为 (0, 1, 0)。同时也会考虑 GameTest 结构的旋转。 From a location, returns a new location with coordinates relative to the current GameTest structure block. For example, the relative coordinates for the block above the structure block are (0, 1, 0). Rotation of the GameTest structure is also taken into account. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### removeSimulatedPlayer() > **removeSimulatedPlayer**(`simulatedPlayer`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### simulatedPlayer [`SimulatedPlayer`](/server-gametest/classes/SimulatedPlayer.md) 要移除的模拟玩家。 Simulated player to remove. #### Returns `void` #### Remarks 从世界中移除一个模拟玩家。 Removes a simulated player from the world. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) *** ### rotateDirection() > **rotateDirection**(`direction`): `Direction` **`World Mutation`** **`Beta`** #### Parameters ##### direction `Direction` 要转换为 GameTest 朝向相对方向的方向。传入 Direction.south 将返回测试方向;传入 Direction.north 则返回测试方向的反方向,以此类推。 Direction to translate into a direction relative to the GameTest facing. Passing in Direction.south will return the test direction; Passing in Direction.north will return the opposite of the test direction, and so on. #### Returns `Direction` #### Remarks 根据当前测试的旋转方向返回某个方向的相对方向。传入 Direction.south 将返回测试方向;传入 Direction.north 则返回测试方向的反方向,以此类推。 Returns a relative direction given the current rotation of the current test. Passing in Direction.south will return the test direction; Passing in Direction.north will return the opposite of the test direction, and so on. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### rotateVector() > **rotateVector**(`vector`): `Vector3` **`World Mutation`** **`Beta`** #### Parameters ##### vector `Vector3` #### Returns `Vector3` #### Remarks #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### runAfterDelay() > **runAfterDelay**(`delayTicks`, `callback`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### delayTicks `number` 运行指定回调之前的延迟 tick 数。 Number of ticks to delay before running the specified callback. ##### callback () => `void` 要执行的回调函数。 Callback function to execute. #### Returns `void` #### Remarks 在指定的 tick 延迟后运行某个特定的回调函数。 Runs a specific callback after a specified delay of ticks #### Throws This function can throw errors. *** ### runAtTickTime() > **runAtTickTime**(`tick`, `callback`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### tick `number` 从 GameTest 开始的 tick 计数,到达该 tick 时运行回调。 Tick (after the start of the GameTest) to run the callback at. ##### callback () => `void` 要执行的回调函数。 Callback function to execute. #### Returns `void` #### Remarks 在 GameTest 开始的 _tick_ tick 之后运行给定的回调函数。 Runs the given callback after a delay of _tick_ ticks from the start of the GameTest. #### Throws This function can throw errors. *** ### runOnFinish() > **runOnFinish**(`callback`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### callback () => `void` 要执行的回调。 Callback to execute. #### Returns `void` #### Remarks 在 GameTest 完成后运行给定的回调函数,无论测试是通过、失败还是超时。 Runs the given callback after the GameTest has completed regardless if the test passed, failed, or timed out. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### setBlockPermutation() > **setBlockPermutation**(`blockData`, `blockLocation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockData `BlockPermutation` 包含方块配置数据的方块状态(Permutation)。 Permutation that contains the configuration data for a block. ##### blockLocation `Vector3` 要设置的方块的位置。 Location of the block to set. #### Returns `void` #### Remarks 在指定的方块位置将方块设为特定配置(即一个 BlockPermutation)。 Sets a block to a particular configuration (a BlockPermutation) at the specified block location. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### setBlockType() > **setBlockType**(`blockType`, `blockLocation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockType `any` 要设置的方块类型。 Type of block to set. ##### blockLocation `Vector3` 要设置的方块的位置。 Location of the block to set. #### Returns `void` #### Remarks 在指定的方块位置将方块设为特定类型。 Sets a block to a particular type at the specified block location. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) #### Example **minibiomes.ts** ```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); ``` *** ### setFluidContainer() > **setFluidContainer**(`location`, `type`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### location `Vector3` 盛液方块的位置。 Location of the fluid container block. ##### type `FluidType` 要设置的液体类型。可取值请参阅 [FluidType](/server/enums/FluidType.md)。 Type of fluid to set. See [FluidType](/server/enums/FluidType.md) for a list of values. #### Returns `void` #### Remarks 对于盛液体的方块(如炼药锅),可更改其中所盛液体的类型。 For blocks that are fluid containers - like a cauldron - changes the type of fluid within that container. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### setTntFuse() > **setTntFuse**(`entity`, `fuseLength`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### entity `Entity` 可爆炸的实体。 Entity that is explodable. ##### fuseLength `number` 实体爆炸之前的时长(以 tick 为单位)。 Length of time, in ticks, before the entity explodes. #### Returns `void` #### Remarks 设置可爆炸实体的引信时长。 Sets the fuse of an explodable entity. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### spawn() > **spawn**(`entityTypeIdentifier`, `blockLocation`): `Entity` **`World Mutation`** **`Beta`** #### Parameters ##### entityTypeIdentifier `string` 要创建的实体类型。若未指定命名空间,则默认为 'minecraft:'。注意可在尖括号之间指定一个可选的初始生成事件(例如 namespace:entityType\)。 Type of entity to create. If no namespace is provided, 'minecraft:' is assumed. Note that an optional initial spawn event can be specified between less than/greater than signs (e.g., namespace:entityType\). ##### blockLocation `Vector3` #### Returns `Entity` 已生成的实体。若无法生成该实体,则返回 undefined。 The spawned entity. If the entity cannot be spawned, returns undefined. #### Remarks 在某位置生成一个实体。 Spawns an entity at a location. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) #### Examples **simpleMobTest.ts** ```typescript import * as gameTest from '@minecraft/server-gametest'; gameTest .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => { const attackerId = 'fox'; const victimId = 'chicken'; test.spawn(attackerId, { x: 5, y: 2, z: 5 }); test.spawn(victimId, { x: 2, y: 2, z: 2 }); test.assertEntityPresentInArea(victimId, true); test.succeedWhen(() => { test.assertEntityPresentInArea(victimId, false); }); }) .maxTicks(400) .structureName('gametests:mediumglass'); ``` **simpleMobGameTest.ts** ```typescript import { Test, register } from '@minecraft/server-gametest'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function simpleMobGameTest(test: Test) { const attackerId = MinecraftEntityTypes.Fox; const victimId = MinecraftEntityTypes.Chicken; test.spawn(attackerId, { x: 5, y: 2, z: 5 }); test.spawn(victimId, { x: 2, y: 2, z: 2 }); test.assertEntityPresentInArea(victimId, true); test.succeedWhen(() => { test.assertEntityPresentInArea(victimId, false); }); } register('StarterTests', 'simpleMobTest', simpleMobGameTest).maxTicks(400).structureName('gametests:mediumglass'); ``` **phantomsShouldFlyFromCats.ts** ```typescript import { Test, register } from '@minecraft/server-gametest'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function phantomsShouldFlyFromCats(test: Test) { test.spawn(MinecraftEntityTypes.Cat, { x: 4, y: 3, z: 3 }); test.spawn(MinecraftEntityTypes.Phantom, { x: 4, y: 3, z: 3 }); test.succeedWhenEntityPresent(MinecraftEntityTypes.Phantom, { x: 4, y: 6, z: 3 }, true); } register('MobBehaviorTests', 'phantoms_should_fly_from_cats', phantomsShouldFlyFromCats).structureName( 'gametests:glass_cells' ); ``` **minibiomes.ts** ```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); ``` *** ### spawnAtLocation() > **spawnAtLocation**(`entityTypeIdentifier`, `location`): `Entity` **`World Mutation`** **`Beta`** #### Parameters ##### entityTypeIdentifier `string` 要创建的实体类型。若未指定命名空间,则默认为 'minecraft:'。注意可在尖括号之间指定一个可选的初始生成事件(例如 namespace:entityType\)。 Type of entity to create. If no namespace is provided, 'minecraft:' is assumed. Note that an optional initial spawn event can be specified between less than/greater than signs (e.g., namespace:entityType\). ##### location `Vector3` #### Returns `Entity` 已生成的实体。若无法生成该实体,则返回 undefined。 The spawned entity. If the entity cannot be spawned, returns undefined. #### Remarks 在某位置生成一个实体。 Spawns an entity at a location. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### spawnItem() > **spawnItem**(`itemStack`, `location`): `Entity` **`World Mutation`** **`Beta`** #### Parameters ##### itemStack `ItemStack` 用于描述要创建的物品实体的 ItemStack。 ItemStack that describes the item entity to create. ##### location `Vector3` 要在其上创建物品实体的位置。 Location to create the item entity at. #### Returns `Entity` #### Remarks 在指定位置生成一个物品实体。 Spawns an item entity at a specified location. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### spawnSimulatedPlayer() > **spawnSimulatedPlayer**(`blockLocation`, `name?`, `gameMode?`): [`SimulatedPlayer`](/server-gametest/classes/SimulatedPlayer.md) **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 模拟玩家生成的位置。 Location where to spawn the simulated player. ##### name? `string` 为新创建的模拟玩家指定的名称。 Name to give the new simulated player. Defaults to: "Simulated Player" ##### gameMode? `any` Defaults to: 0 #### Returns [`SimulatedPlayer`](/server-gametest/classes/SimulatedPlayer.md) #### Remarks 在世界中创建一个新的模拟玩家。 Creates a new simulated player within the world. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### spawnWithoutBehaviors() > **spawnWithoutBehaviors**(`entityTypeIdentifier`, `blockLocation`): `Entity` **`World Mutation`** **`Beta`** #### Parameters ##### entityTypeIdentifier `string` ##### blockLocation `Vector3` 实体应被生成到的位置。 Location where the entity should be spawned. #### Returns `Entity` #### Remarks 在某位置生成一个没有任何 AI 行为的实体。此方法经常与 .walkTo 等方法联用,以获得可预测的 mob 行为。 Spawns an entity at a location without any AI behaviors. This method is frequently used in conjunction with methods like .walkTo to create predictable mob actions. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### spawnWithoutBehaviorsAtLocation() > **spawnWithoutBehaviorsAtLocation**(`entityTypeIdentifier`, `location`): `Entity` **`World Mutation`** **`Beta`** #### Parameters ##### entityTypeIdentifier `string` ##### location `Vector3` 实体应被生成到的位置。 Location where the entity should be spawned. #### Returns `Entity` #### Remarks 在某位置生成一个没有任何 AI 行为的实体。此方法经常与 .walkTo 等方法联用,以获得可预测的 mob 行为。 Spawns an entity at a location without any AI behaviors. This method is frequently used in conjunction with methods like .walkTo to create predictable mob actions. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### spreadFromFaceTowardDirection() > **spreadFromFaceTowardDirection**(`blockLocation`, `fromFace`, `direction`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` 含有多面方块的 BlockLocation。 BlockLocation containing a multiface block. ##### fromFace `Direction` 用于扩散的起始面。该面必须已被设置。 Face to spread from. This face must already be set. ##### direction `Direction` 扩散方向。使用 Minecraft.Direction 枚举来指定方向。 Direction to spread. Use the Minecraft.Direction enum to specify a direction. #### Returns `void` #### Remarks 断言在某一特定位置存在特定的物品实体。否则抛出异常。 Tests that a particular item entity is present at a particular location. If not, an exception is thrown. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### startSequence() > **startSequence**(): [`GameTestSequence`](/server-gametest/classes/GameTestSequence.md) **`World Mutation`** **`Beta`** #### Returns [`GameTestSequence`](/server-gametest/classes/GameTestSequence.md) 一个新的 GameTestSequence,其链式方法便于创建一组步骤。 A new GameTestSequence with chaining methods that facilitate creating a set of steps. #### Remarks 创建一个新的 GameTestSequence —— 一组在 GameTest 中按顺序执行的步骤。 Creates a new GameTestSequence - A set of steps that play out sequentially within a GameTest. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) *** ### succeed() > **succeed**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将当前测试标记为成功用例。 Marks the current test as a success case. #### Throws This function can throw errors. *** ### succeedIf() > **succeedIf**(`callback`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### callback () => `void` 要运行的回调函数。若该函数正常执行完毕,则测试将被标记为成功。通常该函数体内会调用 .assertXyz 系列方法。 Callback function that runs. If the function runs successfully, the test is marked as a success. Typically, this function will have .assertXyz method calls within it. #### Returns `void` #### Remarks 运行给定的回调函数。若回调未抛出异常,则将该测试标记为成功。 Runs the given callback. If the callback does not throw an exception, the test is marked as a success. #### Throws This function can throw errors. *** ### succeedOnTick() > **succeedOnTick**(`tick`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### tick `number` 自 GameTest 开始后到达该 tick 时将测试标记为成功。 Tick after the start of the GameTest to mark the test as successful. #### Returns `void` #### Remarks 在指定的 tick 将测试标记为成功。 Marks the test as a success at the specified tick. #### Throws This function can throw errors. *** ### succeedOnTickWhen() > **succeedOnTickWhen**(`tick`, `callback`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### tick `number` 从 GameTest 开始后到达该 tick 时运行测试回调。 Tick after the start of the GameTest to run the testing callback at. ##### callback () => `void` 要运行的回调函数。若该函数正常执行完毕,则测试将被标记为成功。 Callback function that runs. If the function runs successfully, the test is marked as a success. #### Returns `void` #### Remarks 在测试开始 _tick_ 个 tick 后运行给定的回调函数。若回调未抛出异常,则将该测试标记为失败。 Runs the given callback at _tick_ ticks after the start of the test. If the callback does not throw an exception, the test is marked as a failure. #### Throws This function can throw errors. *** ### succeedWhen() > **succeedWhen**(`callback`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### callback () => `void` 要运行的测试回调函数。若该函数正常执行完毕,则测试将被标记为成功。 Testing callback function that runs. If the function runs successfully, the test is marked as a success. #### Returns `void` #### Remarks 每个 tick 运行一次给定的回调函数。当回调成功执行(即不抛出异常)时,测试被标记为成功。 Runs the given callback every tick. When the callback successfully executes, the test is marked as a success. Specifically, the test will succeed when the callback does not throw an exception. #### Throws This function can throw errors. #### Example **simpleMobGameTest.ts** ```typescript import { Test, register } from '@minecraft/server-gametest'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function simpleMobGameTest(test: Test) { const attackerId = MinecraftEntityTypes.Fox; const victimId = MinecraftEntityTypes.Chicken; test.spawn(attackerId, { x: 5, y: 2, z: 5 }); test.spawn(victimId, { x: 2, y: 2, z: 2 }); test.assertEntityPresentInArea(victimId, true); test.succeedWhen(() => { test.assertEntityPresentInArea(victimId, false); }); } register('StarterTests', 'simpleMobTest', simpleMobGameTest).maxTicks(400).structureName('gametests:mediumglass'); ``` *** ### succeedWhenBlockPresent() > **succeedWhenBlockPresent**(`blockType`, `blockLocation`, `isPresent?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockType `any` 待测试的方块类型。 Type of block to test for. ##### blockLocation `Vector3` 待测试的方块位置。 Location of the block to test at. ##### isPresent? `boolean` 若为 true,此函数测试是否存在指定类型的方块;若为 false,则测试指定类型的方块不存在。 If true, this function tests whether a block of the specified type is present. If false, tests that a block of the specified type is not present. Defaults to: true #### Returns `void` #### Remarks 根据 isPresent 的取值,每个 tick 测试是否存在某种类型的方块。当找到或未找到(取决于 isPresent)指定类型的方块时,测试即被标记为成功。 Depending on the condition of isPresent, tests for the presence of a block of a particular type on every tick. When the specified block of a type is found or not found (depending on isPresent), the test is marked as a success. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### succeedWhenEntityHasComponent() > **succeedWhenEntityHasComponent**(`entityTypeIdentifier`, `componentIdentifier`, `blockLocation`, `hasComponent`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### entityTypeIdentifier `string` 要查找的实体类型。若未指定命名空间,则默认为 'minecraft:'。 Type of entity to look for. If no namespace is specified, 'minecraft:' is assumed. ##### componentIdentifier `string` 用于测试其存在性的组件类型。若未指定命名空间,则默认为 'minecraft:'。 Type of component to test for the presence of. If no namespace is specified, 'minecraft:' is assumed. ##### blockLocation `Vector3` 待测试实体的方块位置。 Block location of the entity to test. ##### hasComponent `boolean` 若为 true,此函数测试组件是否存在;若为 false,则测试组件不存在。 If true, this function tests for the presence of a component. If false, this function tests for the lack of a component. #### Returns `void` #### Remarks 每个 tick 检查特定组件是否存在。根据 hasComponent 的取值,当找到指定组件时,测试即被标记为成功。 Tests for the presence of a component on every tick. Depending on the value of hasComponent, when the specified component is found, the test is marked as a success. #### Throws This function can throw errors. *** ### succeedWhenEntityPresent() > **succeedWhenEntityPresent**(`entityTypeIdentifier`, `blockLocation`, `isPresent?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### entityTypeIdentifier `string` 待测试的实体类型(例如 'minecraft:skeleton')。若未指定实体命名空间,则默认为 'minecraft:'。 Type of entity to test for (e.g., 'minecraft:skeleton'). If an entity namespace is not specified, 'minecraft:' is assumed. ##### blockLocation `Vector3` 待测试实体的位置。 Location of the entity to test for. ##### isPresent? `boolean` 若为 true,此函数测试指定类型实体是否存在;若为 false,则测试指定类型实体不存在。 If true, this function tests whether an entity of the specified type is present. If false, tests that an entity of the specified type is not present. Defaults to: true #### Returns `void` #### Remarks 根据 isPresent 的取值,每个 tick 测试实体的存在性。当找到或未找到(取决于 isPresent)指定类型的实体时,测试即被标记为成功。 Depending on the value of isPresent, tests for the presence of an entity on every tick. When an entity of the specified type is found or not found (depending on isPresent), the test is marked as a success. #### Throws This function can throw errors. #### Examples **phantomsShouldFlyFromCats.ts** ```typescript import { Test, register } from '@minecraft/server-gametest'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function phantomsShouldFlyFromCats(test: Test) { test.spawn(MinecraftEntityTypes.Cat, { x: 4, y: 3, z: 3 }); test.spawn(MinecraftEntityTypes.Phantom, { x: 4, y: 3, z: 3 }); test.succeedWhenEntityPresent(MinecraftEntityTypes.Phantom, { x: 4, y: 6, z: 3 }, true); } register('MobBehaviorTests', 'phantoms_should_fly_from_cats', phantomsShouldFlyFromCats).structureName( 'gametests:glass_cells' ); ``` **minibiomes.ts** ```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); ``` *** ### triggerInternalBlockEvent() > **triggerInternalBlockEvent**(`blockLocation`, `event`, `eventParameters?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blockLocation `Vector3` ##### event `string` 要触发的事件。有效值包括 minecraft:drip、minecraft:grow\_stalagtite、minecraft:grow\_stalagmite、minecraft:grow\_up、minecraft:grow\_down 以及 minecraft:grow\_sideways。 Event to trigger. Valid values include minecraft:drip, minecraft:grow\_stalagtite, minecraft:grow\_stalagmite, minecraft:grow\_up, minecraft:grow\_down and minecraft:grow\_sideways. ##### eventParameters? `number`\[] Defaults to: \[] #### Returns `void` #### Remarks 从固定列表中的方块事件触发一个方块事件。 Triggers a block event from a fixed list of available block events. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### until() > **until**(`callback`): `Promise`\<`void`> **`World Mutation`** **`Beta`** #### Parameters ##### callback () => `void` 包含要执行的代码的函数。 Function with code to evaluate. #### Returns `Promise`\<`void`> #### Remarks 此异步函数将等待指定回调成功执行完毕。until 可以与 .assert 系列方法配合,用于评估某个条件是否为真。 This asynchronous function will wait until the code in the specified callback successfully completes. until can be used in conjunction with .assert functions to evaluate that a condition is true. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) *** ### walkTo() > **walkTo**(`mob`, `blockLocation`, `speedModifier?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### mob `Entity` 要下达指令的生物实体。 Mob entity to give orders to. ##### blockLocation `Vector3` 实体应行走到的位置。 Location where the entity should be walk to. ##### speedModifier? `number` 实体行走速度的可调修正系数。 Adjustable modifier to the mob's walking speed. Defaults to: 1 #### Returns `void` #### Remarks 强制一个生物走到特定位置。通常与 .spawnWithoutBehaviors 等方法配合使用,以获得更可预测的生物行为。一旦与目标位置相交,生物即会停止寻路。 Forces a mob to walk to a particular location. Usually used in conjunction with methods like .spawnWithoutBehaviors to have more predictable mob behaviors. Mobs will stop navigation as soon as they intersect the target location. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### walkToLocation() > **walkToLocation**(`mob`, `location`, `speedModifier?`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### mob `Entity` 要下达指令的生物实体。 Mob entity to give orders to. ##### location `Vector3` 实体应行走到的位置。 Location where the entity should be walk to. ##### speedModifier? `number` 实体行走速度的可调修正系数。 Adjustable modifier to the mob's walking speed. Defaults to: 1 #### Returns `void` #### Remarks 强制一个生物走到特定位置。通常与 .spawnWithoutBehaviors 等方法配合使用,以获得更可预测的生物行为。一旦与目标位置相交,生物即会停止寻路。 Forces a mob to walk to a particular location. Usually used in conjunction with methods like .spawnWithoutBehaviors to have more predictable mob behaviors. Mobs will stop navigation as soon as they intersect the target location. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### worldBlockLocation() > **worldBlockLocation**(`relativeBlockLocation`): `Vector3` **`Beta`** #### Parameters ##### relativeBlockLocation `Vector3` 相对于 GameTest 命令方块的位置。 Location relative to the GameTest command block. #### Returns `Vector3` 一个相对于 GameTest 命令方块的绝对位置。 An absolute location relative to the GameTest command block. #### Remarks 从一个相对于 GameTest 结构方块的 BlockLocation 出发,返回一个坐标相对于世界的新 BlockLocation。同时也会考虑 GameTest 结构的旋转。 From a BlockLocation with coordinates relative to the GameTest structure block, returns a new BlockLocation with coordinates relative to world. Rotation of the GameTest structure is also taken into account. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) *** ### worldLocation() > **worldLocation**(`relativeLocation`): `Vector3` **`Beta`** #### Parameters ##### relativeLocation `Vector3` 相对于 GameTest 命令方块的位置。 Location relative to the GameTest command block. #### Returns `Vector3` 一个相对于 GameTest 命令方块的绝对位置。 An absolute location relative to the GameTest command block. #### Remarks 从一个相对于 GameTest 结构方块的位置出发,返回一个坐标相对于世界的新位置。同时也会考虑 GameTest 结构的旋转。 From a location with coordinates relative to the GameTest structure block, returns a new location with coordinates relative to world. Rotation of the GameTest structure is also taken into account. #### Throws This function can throw errors. [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) [GameTestError](/server-gametest/classes/GameTestError.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/enums/GameTestCompletedErrorReason.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/enums/GameTestCompletedErrorReason.md. # Enumeration: GameTestCompletedErrorReason error **`Beta`** ## Enumeration Members ### Cleanup > **Cleanup**: `"Cleanup"` **`Beta`** *** ### Done > **Done**: `"Done"` **`Beta`** ## 同领域相关 - [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) - [GameTestError](/server-gametest/classes/GameTestError.md) - [GameTestErrorContext](/server-gametest/interfaces/GameTestErrorContext.md) - [GameTestErrorType](/server-gametest/enums/GameTestErrorType.md) - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/enums/GameTestErrorType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/enums/GameTestErrorType.md. # Enumeration: GameTestErrorType error **`Beta`** ## Enumeration Members ### Assert > **Assert**: `"Assert"` **`Beta`** *** ### AssertAtPosition > **AssertAtPosition**: `"AssertAtPosition"` **`Beta`** *** ### ExecutionTimeout > **ExecutionTimeout**: `"ExecutionTimeout"` **`Beta`** *** ### ExhaustedAttempts > **ExhaustedAttempts**: `"ExhaustedAttempts"` **`Beta`** *** ### FailConditionsMet > **FailConditionsMet**: `"FailConditionsMet"` **`Beta`** *** ### LevelStateModificationFailed > **LevelStateModificationFailed**: `"LevelStateModificationFailed"` **`Beta`** *** ### MethodNotImplemented > **MethodNotImplemented**: `"MethodNotImplemented"` **`Beta`** *** ### SimulatedPlayerOutOfBounds > **SimulatedPlayerOutOfBounds**: `"SimulatedPlayerOutOfBounds"` **`Beta`** *** ### Unknown > **Unknown**: `"Unknown"` **`Beta`** *** ### Waiting > **Waiting**: `"Waiting"` **`Beta`** ## 同领域相关 - [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) - [GameTestCompletedErrorReason](/server-gametest/enums/GameTestCompletedErrorReason.md) - [GameTestError](/server-gametest/classes/GameTestError.md) - [GameTestErrorContext](/server-gametest/interfaces/GameTestErrorContext.md) - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/enums/LookDuration.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/enums/LookDuration.md. # Enumeration: LookDuration **`Beta`** ## Enumeration Members ### Continuous > **Continuous**: `"Continuous"` **`Beta`** *** ### Instant > **Instant**: `"Instant"` **`Beta`** *** ### UntilMove > **UntilMove**: `"UntilMove"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/enums/PersonaArmSize.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/enums/PersonaArmSize.md. # Enumeration: PersonaArmSize **`Beta`** ## Enumeration Members ### Slim > **Slim**: `"Slim"` **`Beta`** *** ### Wide > **Wide**: `"Wide"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/enums/PersonaPieceType.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/enums/PersonaPieceType.md. # Enumeration: PersonaPieceType **`Beta`** ## Enumeration Members ### Arms > **Arms**: `"Arms"` **`Beta`** *** ### Back > **Back**: `"Back"` **`Beta`** *** ### Body > **Body**: `"Body"` **`Beta`** *** ### Bottom > **Bottom**: `"Bottom"` **`Beta`** *** ### Capes > **Capes**: `"Capes"` **`Beta`** *** ### Dress > **Dress**: `"Dress"` **`Beta`** *** ### Eyes > **Eyes**: `"Eyes"` **`Beta`** *** ### FaceAccessory > **FaceAccessory**: `"FaceAccessory"` **`Beta`** *** ### FacialHair > **FacialHair**: `"FacialHair"` **`Beta`** *** ### Feet > **Feet**: `"Feet"` **`Beta`** *** ### Hair > **Hair**: `"Hair"` **`Beta`** *** ### Hands > **Hands**: `"Hands"` **`Beta`** *** ### Head > **Head**: `"Head"` **`Beta`** *** ### HighPants > **HighPants**: `"HighPants"` **`Beta`** *** ### Hood > **Hood**: `"Hood"` **`Beta`** *** ### LeftArm > **LeftArm**: `"LeftArm"` **`Beta`** *** ### LeftLeg > **LeftLeg**: `"LeftLeg"` **`Beta`** *** ### Legs > **Legs**: `"Legs"` **`Beta`** *** ### Mouth > **Mouth**: `"Mouth"` **`Beta`** *** ### Outerwear > **Outerwear**: `"Outerwear"` **`Beta`** *** ### RightArm > **RightArm**: `"RightArm"` **`Beta`** *** ### RightLeg > **RightLeg**: `"RightLeg"` **`Beta`** *** ### Skeleton > **Skeleton**: `"Skeleton"` **`Beta`** *** ### Skin > **Skin**: `"Skin"` **`Beta`** *** ### Top > **Top**: `"Top"` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/functions/getPlayerSkin.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/functions/getPlayerSkin.md. # Function: getPlayerSkin() player > **getPlayerSkin**(`player`): [`PlayerSkinData`](/server-gametest/interfaces/PlayerSkinData.md) **`World Mutation`** **`Beta`** ## Parameters ### player `Player` 要获取皮肤数据的玩家。 The player who's skin is returned. ## Returns [`PlayerSkinData`](/server-gametest/interfaces/PlayerSkinData.md) ## Remarks 返回玩家皮肤的相关数据。 Returns data about a player's skin. ## Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) [InvalidEntityError](/server/classes/InvalidEntityError.md) ## 同领域相关 - [PlayerPersonaPiece](/server-gametest/interfaces/PlayerPersonaPiece.md) - [PlayerSkinData](/server-gametest/interfaces/PlayerSkinData.md) - [SimulatedPlayer](/server-gametest/classes/SimulatedPlayer.md) - [spawnSimulatedPlayer](/server-gametest/functions/spawnSimulatedPlayer.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/functions/register.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/functions/register.md. # Function: register() > **register**(`testClassName`, `testName`, `testFunction`): [`RegistrationBuilder`](/server-gametest/classes/RegistrationBuilder.md) **`World Mutation`** **`Early Execution`** **`Beta`** ## Parameters ### testClassName `string` 此测试所属的测试类名称。 ### testName `string` 此具体测试的名称。 ### testFunction (`arg0`) => `void` 测试函数的实现。 ## Returns [`RegistrationBuilder`](/server-gametest/classes/RegistrationBuilder.md) 返回一个 [RegistrationBuilder](/server-gametest/classes/RegistrationBuilder.md) 对象, 可通过其构建器方法为此测试指定 其他选项。 ## Remarks 注册一个新的 GameTest 函数。该 GameTest 将可通过 `/gametest run [testClassName]:[testName]` 在 Minecraft 中运行。 ## Examples **simpleMobGameTest.ts** ```typescript import { Test, register } from '@minecraft/server-gametest'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function simpleMobGameTest(test: Test) { const attackerId = MinecraftEntityTypes.Fox; const victimId = MinecraftEntityTypes.Chicken; test.spawn(attackerId, { x: 5, y: 2, z: 5 }); test.spawn(victimId, { x: 2, y: 2, z: 2 }); test.assertEntityPresentInArea(victimId, true); test.succeedWhen(() => { test.assertEntityPresentInArea(victimId, false); }); } register('StarterTests', 'simpleMobTest', simpleMobGameTest).maxTicks(400).structureName('gametests:mediumglass'); ``` **simpleMobGameTest.ts** ```typescript import { Test, register } from '@minecraft/server-gametest'; import { MinecraftEntityTypes } from '@minecraft/vanilla-data'; function simpleMobGameTest(test: Test) { const attackerId = MinecraftEntityTypes.Fox; const victimId = MinecraftEntityTypes.Chicken; test.spawn(attackerId, { x: 5, y: 2, z: 5 }); test.spawn(victimId, { x: 2, y: 2, z: 2 }); test.assertEntityPresentInArea(victimId, true); test.succeedWhen(() => { test.assertEntityPresentInArea(victimId, false); }); } register('StarterTests', 'simpleMobTest', simpleMobGameTest).maxTicks(400).structureName('gametests:mediumglass'); ``` [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/functions/registerAsync.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/functions/registerAsync.md. # Function: registerAsync() > **registerAsync**(`testClassName`, `testName`, `testFunction`): [`RegistrationBuilder`](/server-gametest/classes/RegistrationBuilder.md) **`World Mutation`** **`Early Execution`** **`Beta`** ## Parameters ### testClassName `string` Name of the class of tests this test should be a part of. ### testName `string` Name of this specific test. ### testFunction (`arg0`) => `Promise`\<`void`> Implementation of the test function. ## Returns [`RegistrationBuilder`](/server-gametest/classes/RegistrationBuilder.md) Returns a [RegistrationBuilder](/server-gametest/classes/RegistrationBuilder.md) object where additional options for this test can be specified via builder methods. ## Remarks 注册一个为异步执行而设计的新 GameTest 函数。此 GameTest 将可以在 Minecraft 中通过 `/gametest run [testClassName]:[testName]` 使用。 Registers a new GameTest function that is designed for asynchronous execution. This GameTest will become available in Minecraft via `/gametest run [testClassName]:[testName]`. ## Example **simpleMobAsyncTest.ts** ```typescript import * as gameTest from '@minecraft/server-gametest'; gameTest .registerAsync('StarterTests', 'simpleMobTest', async (test: gameTest.Test) => { const attackerId = 'fox'; const victimId = 'chicken'; test.spawn(attackerId, { x: 5, y: 2, z: 5 }); test.spawn(victimId, { x: 2, y: 2, z: 2 }); test.assertEntityPresentInArea(victimId, true); test.succeedWhen(() => { test.assertEntityPresentInArea(victimId, false); }); }) .maxTicks(400) .structureName('gametests:mediumglass'); ``` [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/functions/setAfterBatchCallback.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/functions/setAfterBatchCallback.md. # Function: setAfterBatchCallback() > **setAfterBatchCallback**(`batchName`, `batchCallback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** ## Parameters ### batchName `string` 回调将在其之后运行的测试批次名称。 Name of the batch of tests the callback will run after. ### batchCallback () => `void` ## Returns `void` ## Remarks 设置一个在批次运行结束后被调用的回调函数。 这将覆盖先前为该批次设置的回调函数。 Sets a callback that is called after the batch gets called. This will overwrite previously set callbacks for this batch. ## Throws This function can throw errors. [GameTestError](/server-gametest/classes/GameTestError.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/functions/setBeforeBatchCallback.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/functions/setBeforeBatchCallback.md. # Function: setBeforeBatchCallback() > **setBeforeBatchCallback**(`batchName`, `batchCallback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** ## Parameters ### batchName `string` 测试回调将要在其之前运行的批次名称。 Name of the batch of tests the callback will run before. ### batchCallback () => `void` ## Returns `void` ## Remarks 设置一个在批次调用前调用的回调。 这将覆盖此前为此批次设置的回调。 Sets a callback that is called before the batch gets called. This will overwrite previously set callbacks for this batch. ## Throws 此函数可能会抛出错误。 This function can throw errors. [GameTestError](/server-gametest/classes/GameTestError.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/functions/spawnSimulatedPlayer.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/functions/spawnSimulatedPlayer.md. # Function: spawnSimulatedPlayer() player > **spawnSimulatedPlayer**(`location`, `name`, `gameMode`): [`SimulatedPlayer`](/server-gametest/classes/SimulatedPlayer.md) **`World Mutation`** **`Beta`** ## Parameters ### location `DimensionLocation` 生成玩家的位置。 The location in which to spawn the player. ### name `string` 玩家的名称。 The name for the player. ### gameMode `GameMode` 玩家的游戏模式。 The game mode for the player. ## Returns [`SimulatedPlayer`](/server-gametest/classes/SimulatedPlayer.md) ## Remarks 生成一个未与特定 [Test](/server-gametest/classes/Test.md) 关联的模拟玩家。 你可以使用 [SimulatedPlayer.remove](/debug-utilities/classes/DebugArrow.md#remove) 将玩家移出世界。 Spawns a simulated player that isn't associated to a specific [Test](/server-gametest/classes/Test.md). You can use [SimulatedPlayer.remove](/debug-utilities/classes/DebugArrow.md#remove) to remove the player from the world. ## Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) ## 同领域相关 - [getPlayerSkin](/server-gametest/functions/getPlayerSkin.md) - [PlayerPersonaPiece](/server-gametest/interfaces/PlayerPersonaPiece.md) - [PlayerSkinData](/server-gametest/interfaces/PlayerSkinData.md) - [SimulatedPlayer](/server-gametest/classes/SimulatedPlayer.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/index.md. # Module: server-gametest **`Beta`** `@minecraft/server-gametest` 为脚本API在脚手架与内容测试方面提供支持。 The @minecraft/server-gametest module provides scriptable APIs for scaffolding and testing content experiences in Minecraft. Manifest Details ```json { "module_name": "@minecraft/server-gametest", "version": "1.0.0-beta" } ``` ## Enumerations - [GameTestCompletedErrorReason](/server-gametest/enums/GameTestCompletedErrorReason.md) - [GameTestErrorType](/server-gametest/enums/GameTestErrorType.md) - [LookDuration](/server-gametest/enums/LookDuration.md) - [PersonaArmSize](/server-gametest/enums/PersonaArmSize.md) - [PersonaPieceType](/server-gametest/enums/PersonaPieceType.md) ## Classes - [FenceConnectivity](/server-gametest/classes/FenceConnectivity.md) - [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) - [GameTestError](/server-gametest/classes/GameTestError.md) - [GameTestSequence](/server-gametest/classes/GameTestSequence.md) - [NavigationResult](/server-gametest/classes/NavigationResult.md) - [RegistrationBuilder](/server-gametest/classes/RegistrationBuilder.md) - [SculkSpreader](/server-gametest/classes/SculkSpreader.md) - [SimulatedPlayer](/server-gametest/classes/SimulatedPlayer.md) - [Tags](/server-gametest/classes/Tags.md) - [Test](/server-gametest/classes/Test.md) ## Interfaces - [GameTestErrorContext](/server-gametest/interfaces/GameTestErrorContext.md) - [MoveToOptions](/server-gametest/interfaces/MoveToOptions.md) - [PlayerPersonaPiece](/server-gametest/interfaces/PlayerPersonaPiece.md) - [PlayerSkinData](/server-gametest/interfaces/PlayerSkinData.md) ## Functions - [getPlayerSkin](/server-gametest/functions/getPlayerSkin.md) - [register](/server-gametest/functions/register.md) - [registerAsync](/server-gametest/functions/registerAsync.md) - [setAfterBatchCallback](/server-gametest/functions/setAfterBatchCallback.md) - [setBeforeBatchCallback](/server-gametest/functions/setBeforeBatchCallback.md) - [spawnSimulatedPlayer](/server-gametest/functions/spawnSimulatedPlayer.md) --- url: /server-gametest/interfaces/GameTestErrorContext.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/interfaces/GameTestErrorContext.md. # Interface: GameTestErrorContext error **`Beta`** ## Properties ### absolutePosition > **absolutePosition**: `Vector3` **`Beta`** *** ### relativePosition > **relativePosition**: `Vector3` **`Beta`** *** ### tickCount > **tickCount**: `number` **`Beta`** ## 同领域相关 - [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError.md) - [GameTestCompletedErrorReason](/server-gametest/enums/GameTestCompletedErrorReason.md) - [GameTestError](/server-gametest/classes/GameTestError.md) - [GameTestErrorType](/server-gametest/enums/GameTestErrorType.md) - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError.md) - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/interfaces/MoveToOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/interfaces/MoveToOptions.md. # Interface: MoveToOptions **`Beta`** ## Properties ### faceTarget? > `optional` **faceTarget?**: `boolean` **`Beta`** *** ### speed? > `optional` **speed?**: `number` **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/interfaces/PlayerPersonaPiece.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/interfaces/PlayerPersonaPiece.md. # Interface: PlayerPersonaPiece player **`Beta`** 与特定玩家角色(Persona)部件相关的数据。 Data pertaining to a specific player Persona piece. ## Properties ### id > **id**: `string` **`Beta`** *** ### isDefaultPiece? > `optional` **isDefaultPiece?**: `boolean` **`Beta`** *** ### packId > **packId**: `string` **`Beta`** *** ### productId > **productId**: `string` **`Beta`** *** ### type > **type**: [`PersonaPieceType`](/server-gametest/enums/PersonaPieceType.md) **`Beta`** ## 同领域相关 - [getPlayerSkin](/server-gametest/functions/getPlayerSkin.md) - [PlayerSkinData](/server-gametest/interfaces/PlayerSkinData.md) - [SimulatedPlayer](/server-gametest/classes/SimulatedPlayer.md) - [spawnSimulatedPlayer](/server-gametest/functions/spawnSimulatedPlayer.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-gametest/interfaces/PlayerSkinData.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-gametest/interfaces/PlayerSkinData.md. # Interface: PlayerSkinData player **`Beta`** 与玩家已配置皮肤相关的数据。 Data pertaining to a player's configured skin. ## Properties ### armSize? > `optional` **armSize?**: [`PersonaArmSize`](/server-gametest/enums/PersonaArmSize.md) **`Beta`** *** ### personaPieces? > `optional` **personaPieces?**: [`PlayerPersonaPiece`](/server-gametest/interfaces/PlayerPersonaPiece.md)\[] **`Beta`** *** ### skinColor? > `optional` **skinColor?**: `any` **`Beta`** ## 同领域相关 - [getPlayerSkin](/server-gametest/functions/getPlayerSkin.md) - [PlayerPersonaPiece](/server-gametest/interfaces/PlayerPersonaPiece.md) - [SimulatedPlayer](/server-gametest/classes/SimulatedPlayer.md) - [spawnSimulatedPlayer](/server-gametest/functions/spawnSimulatedPlayer.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) [源码](https://www.npmjs.com/package/@minecraft/server-gametest) --- url: /server-graphics/classes/BiomeAtmospherics.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/classes/BiomeAtmospherics.md. # Class: BiomeAtmospherics biome **`Beta`** 用于在「灵动视效」(Vibrant Visuals) 中按生物群系影响大气散射。 Used to affect atmospheric scattering per biome for Vibrant Visuals ## Methods ### resetHorizonBlendMax() > **resetHorizonBlendMax**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将地平线混合上限重置为资源包所设置的值,或通过行为包中的 'setHorizonBlendMax' API 所设置的值。 Resets the horizon blend max to the value set by resource packs or via the 'setHorizonBlendMax' API in behavior packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetHorizonBlendMieStart() > **resetHorizonBlendMieStart**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将地平线混合 Mie 起始值重置为资源包所设置的值,或通过行为包中的 'setHorizonBlendMieStart' API 所设置的值。 Resets the horizon blend mie start to the value set by resource packs or via the 'setHorizonBlendMieStart' API in behavior packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetHorizonBlendMin() > **resetHorizonBlendMin**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将地平线混合下限重置为资源包所设置的值,或通过行为包中的 'setHorizonBlendMin' API 所设置的值。 Resets the horizon blend min to the value set by resource packs or via the 'setHorizonBlendMin' API in behavior packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetHorizonBlendStart() > **resetHorizonBlendStart**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将地平线混合起始值重置为资源包所设置的值,或通过行为包中的 'setHorizonBlendStart' API 所设置的值。 Resets the horizon blend start to the value set by resource packs or via the 'setHorizonBlendStart' API in behavior packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetMoonMieStrength() > **resetMoonMieStrength**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将月亮 Mie 强度重置为资源包所设置的值,或通过行为包中的 'setMoonMieStrength' API 所设置的值。 Resets the moon mie strength to the value set by resource packs or via the 'setMoonMieStrength' API in behavior packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetRayleighStrength() > **resetRayleighStrength**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将瑞利散射强度重置为资源包所设置的值,或通过行为包中的 'setRayleighStrength' API 所设置的值。 Resets the rayleigh strength to the value set by resource packs or via the 'setRayleighStrength' API in behavior packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetSkyHorizonColor() > **resetSkyHorizonColor**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将天空地平线颜色重置为资源包所设置的值,或通过行为包中的 'setSkyHorizonColor' API 所设置的值。 Resets the sky horizon color to the color set by resource packs or via the 'setSkyHorizonColor' API in behavior packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetSkyZenithColor() > **resetSkyZenithColor**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将天空天顶颜色重置为资源包所设置的值,或通过行为包中的 'setSkyZenithColor' API 所设置的值。 Resets the sky zenith color to the color set by resource packs or via the 'setSkyZenithColor' API in behavior packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetSunGlareShape() > **resetSunGlareShape**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将太阳眩光形状重置为资源包所设置的值,或通过行为包中的 'setSunGlareShape' API 所设置的值。 Resets the sun glare shape to the value set by resource packs or via the 'setSunGlareShape' API in behavior packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetSunMieStrength() > **resetSunMieStrength**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将太阳 Mie 强度重置为资源包所设置的值,或通过行为包中的 'setSunMieStrength' API 所设置的值。 Resets the sun mie strength to the value set by resource packs or via the 'setSunMieStrength' API in behavior packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### setHorizonBlendMax() > **setHorizonBlendMax**(`blendMax`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blendMax `number` | `Record`\<`number`, `number`> 一个数字(范围 \[0,1])或一组关键帧。关键帧由键值对组成。键是一个数字(范围 \[0,1])用于表示一天中的时间(0.0 和 1.0 表示正午,0.25 表示日落,0.5 表示午夜,0.75 表示日出)。值也是一个数字(范围 \[0,1]) #### Returns `void` #### Remarks 为「灵动视效」中的大气散射设置地平线混合上限。 Sets the horizon blend max for atmospheric scattering in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setHorizonBlendMieStart() > **setHorizonBlendMieStart**(`blendMieStart`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blendMieStart `number` | `Record`\<`number`, `number`> 一个数字(范围 \[0,1.2])或一组关键帧。关键帧由键值对组成。键是一个数字(范围 \[0,1])用于表示一天中的时间(0.0 和 1.0 表示正午,0.25 表示日落,0.5 表示午夜,0.75 表示日出)。值也是一个数字(范围 \[0,1.2]) #### Returns `void` #### Remarks 为「灵动视效」中的大气散射设置地平线混合 Mie 起始值。 Sets the horizon blend mie start for atmospheric scattering in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setHorizonBlendMin() > **setHorizonBlendMin**(`blendMin`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blendMin `number` | `Record`\<`number`, `number`> 一个数字(范围 \[0,1])或一组关键帧。关键帧由键值对组成。键是一个数字(范围 \[0,1])用于表示一天中的时间(0.0 和 1.0 表示正午,0.25 表示日落,0.5 表示午夜,0.75 表示日出)。值也是一个数字(范围 \[0,1]) #### Returns `void` #### Remarks 为「灵动视效」中的大气散射设置地平线混合下限。 Sets the horizon blend min for atmospheric scattering in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setHorizonBlendStart() > **setHorizonBlendStart**(`blendStart`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### blendStart `number` | `Record`\<`number`, `number`> 一个数字(范围 \[0,1])或一组关键帧。关键帧由键值对组成。键是一个数字(范围 \[0,1])用于表示一天中的时间(0.0 和 1.0 表示正午,0.25 表示日落,0.5 表示午夜,0.75 表示日出)。值也是一个数字(范围 \[0,1]) #### Returns `void` #### Remarks 为「灵动视效」中的大气散射设置地平线混合起始值。 Sets the horizon blend start for atmospheric scattering in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setMoonMieStrength() > **setMoonMieStrength**(`moonMieStrength`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### moonMieStrength `number` | `Record`\<`number`, `number`> 一个数字(范围 \[0,60])或一组关键帧。关键帧由键值对组成。键是一个数字(范围 \[0,1])用于表示一天中的时间(0.0 和 1.0 表示正午,0.25 表示日落,0.5 表示午夜,0.75 表示日出)。值也是一个数字(范围 \[0,60]) #### Returns `void` #### Remarks 为「灵动视效」中的大气散射设置月亮 Mie 强度。 Sets the moon mie strength for atmospheric scattering in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setRayleighStrength() > **setRayleighStrength**(`rayleighStrength`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### rayleighStrength `number` | `Record`\<`number`, `number`> 一个数字(范围 \[0,11])或一组关键帧。关键帧由键值对组成。键是一个数字(范围 \[0,1])用于表示一天中的时间(0.0 和 1.0 表示正午,0.25 表示日落,0.5 表示午夜,0.75 表示日出)。值也是一个数字(范围 \[0,11]) #### Returns `void` #### Remarks 为「灵动视效」中的大气散射设置瑞利散射强度。 Sets the rayleigh strength for atmospheric scattering in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setSkyHorizonColor() > **setSkyHorizonColor**(`color`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### color `any` 一个 RGB 三元组或一组关键帧。关键帧由键值对组成。键是一个数字(范围 \[0,1])用于表示一天中的时间(0.0 和 1.0 表示正午,0.25 表示日落,0.5 表示午夜,0.75 表示日出),值是一个 RGB 三元组 #### Returns `void` #### Remarks 为「灵动视效」中的大气散射设置天空地平线颜色。 Sets the sky horizon color for atmospheric scattering in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setSkyZenithColor() > **setSkyZenithColor**(`color`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### color `any` 一个 RGB 三元组或一组关键帧。关键帧由键值对组成。键是一个范围 0-1 的浮点数用于表示一天中的时间,值是一个 RGB 三元组 #### Returns `void` #### Remarks 为「灵动视效」中的大气散射设置天空天顶颜色。 Sets the sky zenith color for atmospheric scattering in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setSunGlareShape() > **setSunGlareShape**(`sunGlareShape`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### sunGlareShape `number` | `Record`\<`number`, `number`> 一个数字(范围 \[0,50])或一组关键帧。关键帧由键值对组成。键是一个数字(范围 \[0,1])用于表示一天中的时间(0.0 和 1.0 表示正午,0.25 表示日落,0.5 表示午夜,0.75 表示日出)。值也是一个数字(范围 \[0,50]) #### Returns `void` #### Remarks 为「灵动视效」中的大气散射设置太阳眩光形状。 Sets the sun glare shape for atmospheric scattering in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setSunMieStrength() > **setSunMieStrength**(`sunMieStrength`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### sunMieStrength `number` | `Record`\<`number`, `number`> 一个数字(范围 \[0,60])或一组关键帧。关键帧由键值对组成。键是一个数字(范围 \[0,1])用于表示一天中的时间(0.0 和 1.0 表示正午,0.25 表示日落,0.5 表示午夜,0.75 表示日出)。值也是一个数字(范围 \[0,60]) #### Returns `void` #### Remarks 为「灵动视效」中的大气散射设置太阳 Mie 强度。 Sets the sun mie strength for atmospheric scattering in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) ## 同领域相关 - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) - [BiomeWater](/server-graphics/classes/BiomeWater.md) - [getBiomeAtmospherics](/server-graphics/functions/getBiomeAtmospherics.md) - [getBiomeColorGrading](/server-graphics/functions/getBiomeColorGrading.md) - [getBiomeLighting](/server-graphics/functions/getBiomeLighting.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/classes/BiomeColorGrading.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/classes/BiomeColorGrading.md. # Class: BiomeColorGrading biome **`Beta`** 用于影响 Vibrant Visuals(灵动视效)的颜色分级。 Used to affect color grading for Vibrant Visuals ## Methods ### resetHighlightsContrast() > **resetHighlightsContrast**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将高光的对比度重置为资源包设定的值。 Resets the contrast of highlights to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetHighlightsGain() > **resetHighlightsGain**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将高光的增益重置为资源包设定的值。 Resets the gain of highlights to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetHighlightsGamma() > **resetHighlightsGamma**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将高光的伽马值重置为资源包设定的值。 Resets the gamma of highlights to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetHighlightsMin() > **resetHighlightsMin**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将高光下限重置为资源包设定的值。 Resets the highlights min to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetHighlightsOffset() > **resetHighlightsOffset**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将高光的偏移量重置为资源包设定的值。 Resets the offset of highlights to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetHighlightsSaturation() > **resetHighlightsSaturation**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将高光的饱和度重置为资源包设定的值。 Resets the saturation of highlights to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetMidtonesContrast() > **resetMidtonesContrast**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将中间调的对比度重置为资源包设定的值。 Resets the contrast of midtones to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetMidtonesGain() > **resetMidtonesGain**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将中间调的增益重置为资源包设定的值。 Resets the gain of midtones to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetMidtonesGamma() > **resetMidtonesGamma**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将中间调的伽马值重置为资源包设定的值。 Resets the gamma of midtones to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetMidtonesOffset() > **resetMidtonesOffset**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将中间调的偏移量重置为资源包设定的值。 Resets the offset of midtones to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetMidtonesSaturation() > **resetMidtonesSaturation**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将中间调的饱和度重置为资源包设定的值。 Resets the saturation of midtones to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetShadowsContrast() > **resetShadowsContrast**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将阴影的对比度重置为资源包设定的值。 Resets the contrast of shadows to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetShadowsGain() > **resetShadowsGain**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将阴影的增益重置为资源包设定的值。 Resets the gain of shadows to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetShadowsGamma() > **resetShadowsGamma**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将阴影的伽马值重置为资源包设定的值。 Resets the gamma of shadows to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetShadowsMax() > **resetShadowsMax**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将阴影上限重置为资源包设定的值。 Resets the shadows max to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetShadowsOffset() > **resetShadowsOffset**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将阴影的偏移量重置为资源包设定的值。 Resets the offset of shadows to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetShadowsSaturation() > **resetShadowsSaturation**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将阴影的饱和度重置为资源包设定的值。 Resets the saturation of shadows to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetTemperature() > **resetTemperature**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将色温重置为资源包设定的值。 Resets the temperature to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### setHighlightsContrast() > **setHighlightsContrast**(`highlightsContrast`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### highlightsContrast `Vector3` 一个 Vector3(取值范围 \[0.0f, 4.0f])。用于设置高光的对比度。 对比度描述色调范围,即图像中亮像素与暗像素之间的亮度差异。 高对比度的图像其像素亮度值分布范围很广,而低对比度的图像 其像素亮度值分布范围相对较窄。值为 1.0 时不改变原图像的对比度。 值为 0.0 时会得到一张完全褪色的灰色图像。大于 1.0 的值会在 最终图像中提高高光亮度并加深阴影。 A Vector3 (range \[0.0f, 4.0f]). Used to set the contrast of highlights. Describes the tonal range, the difference in luminance between the bright and dark pixels in an image. An image with high contrast will have pixels with a wide range of luminance values, whereas an image with low contrast will have pixels of a relatively small luminance range. A value of 1.0 results in no change in contrast to the original image. A value of 0.0 results in a completely washed-out, gray image. Values > 1.0 increase the brightness of highlights while darkening the shadows in the final image. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的高光对比度。 Sets the contrast of highlights for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setHighlightsGain() > **setHighlightsGain**(`highlightsGain`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### highlightsGain `Vector3` 一个 Vector3(取值范围 \[0.0f, 10.0f])。用于设置高光的增益。 增益是应用于各颜色通道的乘法因子,用于调整高光范围的整体亮度强度。 值为 1.0 时不改变原图像。值 \< 1.0 会使图像变暗,值 > 1.0 会使其变亮。 值为 0.0 时会完全抵消该颜色通道。增益是乘法性的,因此对较亮像素的 影响比对较暗像素更强。 A Vector3 (range \[0.0f, 10.0f]). Used to set the gain of highlights. A multiplication factor applied to each color channel to adjust the overall luminance intensity of the highlight range. A value of 1.0 results in no change to the original image. Values \< 1.0 darken the image while values > 1.0 brighten it. A value of 0.0 cancels out the color channel completely. Gain is multiplicative and therefore has a stronger effect on brighter pixels than darker pixels. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的高光增益。 Sets the gain of highlights for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setHighlightsGamma() > **setHighlightsGamma**(`highlightsGamma`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### highlightsGamma `Vector3` 一个 Vector3(取值范围 \[0.0f, 4.0f])。用于设置高光的伽马值。 伽马值是在颜色分级和色调映射之后应用于最终颜色的指数因子, 用于调整图像的整体亮度强度。伽马值的标准值为 2.2。较低的值会 加深最终图像,较高的值则会使其变亮。伽马值过高会使最终图像 显得褪色。 A Vector3 (range \[0.0f, 4.0f]). Used to set the gamma of highlights. An exponential factor applied to the final color after both color grading and tone mapping to adjust the overall luminance intensity of the image. The standard value for gamma is 2.2. Lower values darken the final image, whereas higher values brighten it. Too high a gamma will cause the final image to appear washed-out. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的高光伽马值。 Sets the gamma of highlights for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setHighlightsMin() > **setHighlightsMin**(`highlightsMin`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### highlightsMin `number` 一个数字(取值范围 \[1.0f, 20.0f])。用于设置高光下限。 该因子与场景的平均亮度相乘,用于确定哪些像素被视为高光。 亮度大于 HighlightsMin \* AverageLuminance 的像素将应用高光组的 颜色分级值。值为 1.0 表示高光占据平均亮度及以上的整个取值范围。 更高的值会提高像素被视为高光所需的最低亮度值。此值不应等于 ShadowsMax。 A number (range \[1.0f, 20.0f]). Used to set the highlights min. A factor multiplied by the average luminance of the scene to determine which pixels are considered highlights. Pixels with luminance greater than HighlightsMin \* AverageLuminance will have the highlights set of color grading values applied. A value of 1.0 indicates highlights occupy the entire range of values including and above the average luminance. Higher values will cause the minimum required luminance value for a pixel to be considered a highlight to rise. This value should not be equal to ShadowsMax. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的高光下限。 Sets the highlights min for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setHighlightsOffset() > **setHighlightsOffset**(`highlightsOffset`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### highlightsOffset `Vector3` 一个 Vector3(取值范围 \[-1.0f, 1.0f])。用于设置高光的偏移量。 偏移量是一个加法因子,它先与场景的平均亮度相乘,再加到指定的 颜色通道上,用于调整图像的整体亮度强度。值为 0.0 时不产生变化。 值 > 0.0 会使图像变亮,值 \< 0.0 会使其变暗。偏移量是加法性的, 因此对较暗像素的影响比对较亮像素更强。 A Vector3 (range \[-1.0f, 1.0f]). Used to set the offset of highlights. An additive factor that is multiplied by the average luminance of the scene and then added to a given color channel to adjust the overall luminance intensity of the image. A value of 0.0 results in no change. Values > 0.0 brighten the image, values \< 0.0 darken it. Offset is additive and therefore has a stronger effect on darker pixels than brighter pixels. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的高光偏移量。 Sets the offset of highlights for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setHighlightsSaturation() > **setHighlightsSaturation**(`highlightsSaturation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### highlightsSaturation `Vector3` 一个 Vector3(取值范围 \[0.0f, 10.0f])。用于设置高光的饱和度。 饱和度决定颜色的色相强度。值为 1.0 时不改变原图像的饱和度。 值为 0.0 时会得到一张灰度图像。值 > 1.0 会增强颜色的强度。 A Vector3 (range \[0.0f, 10.0f]). Used to set the saturation of highlights. Determines the hue intensity of colors. A value of 1.0 results in no change in saturation to the original image. A value of 0.0 results in a grayscale image. Values > 1.0 increase the intensity of colors. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的高光饱和度。 Sets the saturation of highlights for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setMidtonesContrast() > **setMidtonesContrast**(`midtonesContrast`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### midtonesContrast `Vector3` 一个 Vector3(取值范围 \[0.0f, 4.0f])。用于设置中间调的对比度。 对比度描述色调范围,即图像中亮像素与暗像素之间的亮度差异。 高对比度的图像其像素亮度值分布范围很广,而低对比度的图像 其像素亮度值分布范围相对较窄。值为 1.0 时不改变原图像的对比度。 值为 0.0 时会得到一张完全褪色的灰色图像。大于 1.0 的值会在 最终图像中提高高光亮度并加深阴影。 A Vector3 (range \[0.0f, 4.0f]). Used to set the contrast of midtones. Describes the tonal range, the difference in luminance between the bright and dark pixels in an image. An image with high contrast will have pixels with a wide range of luminance values, whereas an image with low contrast will have pixels of a relatively small luminance range. A value of 1.0 results in no change in contrast to the original image. A value of 0.0 results in a completely washed-out, gray image. Values > 1.0 increase the brightness of highlights while darkening the shadows in the final image. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的中间调对比度。 Sets the contrast of midtones for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setMidtonesGain() > **setMidtonesGain**(`midtonesGain`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### midtonesGain `Vector3` 一个 Vector3(取值范围 \[0.0f, 10.0f])。用于设置中间调的增益。 增益是应用于各颜色通道的乘法因子,用于调整中间调范围的整体亮度强度。 值为 1.0 时不改变原图像。值 \< 1.0 会使图像变暗,值 > 1.0 会使其变亮。 值为 0.0 时会完全抵消该颜色通道。增益是乘法性的,因此对较亮像素的 影响比对较暗像素更强。 A Vector3 (range \[0.0f, 10.0f]). Used to set the gain of midtones. A multiplication factor applied to each color channel to adjust the overall luminance intensity of the midtone range. A value of 1.0 results in no change to the original image. Values \< 1.0 darken the image while values > 1.0 brighten it. A value of 0.0 cancels out the color channel completely. Gain is multiplicative and therefore has a stronger effect on brighter pixels than darker pixels. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的中间调增益。 Sets the gain of midtones for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setMidtonesGamma() > **setMidtonesGamma**(`midtonesGamma`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### midtonesGamma `Vector3` 一个 Vector3(取值范围 \[0.0f, 4.0f])。用于设置中间调的伽马值。 伽马值是在颜色分级和色调映射之后应用于最终颜色的指数因子, 用于调整图像的整体亮度强度。伽马值的标准值为 2.2。较低的值会 加深最终图像,较高的值则会使其变亮。伽马值过高会使最终图像 显得褪色。 A Vector3 (range \[0.0f, 4.0f]). Used to set the gamma of midtones. An exponential factor applied to the final color after both color grading and tone mapping to adjust the overall luminance intensity of the image. The standard value for gamma is 2.2. Lower values darken the final image, whereas higher values brighten it. Too high a gamma will cause the final image to appear washed-out. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的中间调伽马值。 Sets the gamma of midtones for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setMidtonesOffset() > **setMidtonesOffset**(`midtonesOffset`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### midtonesOffset `Vector3` 一个 Vector3(取值范围 \[-1.0f, 1.0f])。用于设置中间调的偏移量。 偏移量是一个加法因子,它先与场景的平均亮度相乘,再加到指定的 颜色通道上,用于调整图像的整体亮度强度。值为 0.0 时不产生变化。 值 > 0.0 会使图像变亮,值 \< 0.0 会使其变暗。偏移量是加法性的, 因此对较暗像素的影响比对较亮像素更强。 A Vector3 (range \[-1.0f, 1.0f]). Used to set the offset of midtones. An additive factor that is multiplied by the average luminance of the scene and then added to a given color channel to adjust the overall luminance intensity of the image. A value of 0.0 results in no change. Values > 0.0 brighten the image, values \< 0.0 darken it. Offset is additive and therefore has a stronger effect on darker pixels than brighter pixels. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的中间调偏移量。 Sets the offset of midtones for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setMidtonesSaturation() > **setMidtonesSaturation**(`midtonesSaturation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### midtonesSaturation `Vector3` 一个 Vector3(取值范围 \[0.0f, 10.0f])。用于设置中间调的饱和度。 饱和度决定颜色的色相强度。值为 1.0 时不改变原图像的饱和度。 值为 0.0 时会得到一张灰度图像。值 > 1.0 会增强颜色的强度。 A Vector3 (range \[0.0f, 10.0f]). Used to set the saturation of midtones. Determines the hue intensity of colors. A value of 1.0 results in no change in saturation to the original image. A value of 0.0 results in a grayscale image. Values > 1.0 increase the intensity of colors. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的中间调饱和度。 Sets the saturation of midtones for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setShadowsContrast() > **setShadowsContrast**(`shadowsContrast`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### shadowsContrast `Vector3` 一个 Vector3(取值范围 \[0.0f, 4.0f])。用于设置阴影的对比度。 对比度描述色调范围,即图像中亮像素与暗像素之间的亮度差异。 高对比度的图像其像素亮度值分布范围很广,而低对比度的图像 其像素亮度值分布范围相对较窄。值为 1.0 时不改变原图像的对比度。 值为 0.0 时会得到一张完全褪色的灰色图像。大于 1.0 的值会在 最终图像中提高高光亮度并加深阴影。 A Vector3 (range \[0.0f, 4.0f]). Used to set the contrast of shadows. Describes the tonal range, the difference in luminance between the bright and dark pixels in an image. An image with high contrast will have pixels with a wide range of luminance values, whereas an image with low contrast will have pixels of a relatively small luminance range. A value of 1.0 results in no change in contrast to the original image. A value of 0.0 results in a completely washed-out, gray image. Values > 1.0 increase the brightness of highlights while darkening the shadows in the final image. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的阴影对比度。 Sets the contrast of shadows for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setShadowsGain() > **setShadowsGain**(`shadowsGain`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### shadowsGain `Vector3` 一个 Vector3(取值范围 \[0.0f, 10.0f])。用于设置阴影的增益。 增益是应用于各颜色通道的乘法因子,用于调整阴影范围的整体亮度强度。 值为 1.0 时不改变原图像。值 \< 1.0 会使图像变暗,值 > 1.0 会使其变亮。 值为 0.0 时会完全抵消该颜色通道。增益是乘法性的,因此对较亮像素的 影响比对较暗像素更强。 A Vector3 (range \[0.0f, 10.0f]). Used to set the gain of shadows. A multiplication factor applied to each color channel to adjust the overall luminance intensity of the shadow range. A value of 1.0 results in no change to the original image. Values \< 1.0 darken the image while values > 1.0 brighten it. A value of 0.0 cancels out the color channel completely. Gain is multiplicative and therefore has a stronger effect on brighter pixels than darker pixels. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的阴影增益。 Sets the gain of shadows for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setShadowsGamma() > **setShadowsGamma**(`shadowsGamma`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### shadowsGamma `Vector3` 一个 Vector3(取值范围 \[0.0f, 4.0f])。用于设置阴影的伽马值。 伽马值是在颜色分级和色调映射之后应用于最终颜色的指数因子, 用于调整图像的整体亮度强度。伽马值的标准值为 2.2。较低的值会 加深最终图像,较高的值则会使其变亮。伽马值过高会使最终图像 显得褪色。 A Vector3 (range \[0.0f, 4.0f]). Used to set the gamma of shadows. An exponential factor applied to the final color after both color grading and tone mapping to adjust the overall luminance intensity of the image. The standard value for gamma is 2.2. Lower values darken the final image, whereas higher values brighten it. Too high a gamma will cause the final image to appear washed-out. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的阴影伽马值。 Sets the gamma of shadows for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setShadowsMax() > **setShadowsMax**(`shadowsMax`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### shadowsMax `number` 一个数字(取值范围 \[0.0f, 1.0f])。用于设置阴影上限。 该因子与场景的平均亮度相乘,用于确定哪些像素被视为阴影。 亮度小于 ShadowsMax \* AverageLuminance 的像素将应用阴影组的 颜色分级值。值为 1.0 表示阴影占据平均亮度及以下的整个取值范围。 更低的值会降低像素被视为阴影所需的最高亮度值。此值不应等于 HighlightsMin。 A number (range \[0.0f, 1.0f]). Used to set the shadows max. A factor multiplied by the average luminance of the scene to determine which pixels are considered shadows. Pixels with luminance less than ShadowsMax \* AverageLuminance will have the shadows set of color grading values applied. A value of 1.0 indicates shadows occupy the entire range of values including and up to the average luminance. Lower values will cause the maximum required luminance value for a pixel to be considered a shadow to drop. This value should not be equal to HighlightsMin. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的阴影上限。 Sets the shadows max for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setShadowsOffset() > **setShadowsOffset**(`shadowsOffset`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### shadowsOffset `Vector3` 一个 Vector3(取值范围 \[-1.0f, 1.0f])。用于设置阴影的偏移量。 偏移量是一个加法因子,它先与场景的平均亮度相乘,再加到指定的 颜色通道上,用于调整图像的整体亮度强度。值为 0.0 时不产生变化。 值 > 0.0 会使图像变亮,值 \< 0.0 会使其变暗。偏移量是加法性的, 因此对较暗像素的影响比对较亮像素更强。 A Vector3 (range \[-1.0f, 1.0f]). Used to set the offset of shadows. An additive factor that is multiplied by the average luminance of the scene and then added to a given color channel to adjust the overall luminance intensity of the image. A value of 0.0 results in no change. Values > 0.0 brighten the image, values \< 0.0 darken it. Offset is additive and therefore has a stronger effect on darker pixels than brighter pixels. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的阴影偏移量。 Sets the offset of shadows for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setShadowsSaturation() > **setShadowsSaturation**(`shadowsSaturation`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### shadowsSaturation `Vector3` 一个 Vector3(取值范围 \[0.0f, 10.0f])。用于设置阴影的饱和度。 饱和度决定颜色的色相强度。值为 1.0 时不改变原图像的饱和度。 值为 0.0 时会得到一张灰度图像。值 > 1.0 会增强颜色的强度。 A Vector3 (range \[0.0f, 10.0f]). Used to set the saturation of shadows. Determines the hue intensity of colors. A value of 1.0 results in no change in saturation to the original image. A value of 0.0 results in a grayscale image. Values > 1.0 increase the intensity of colors. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的阴影饱和度。 Sets the saturation of shadows for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setTemperature() > **setTemperature**(`temperature`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### temperature `number` 一个数字(取值范围 \[1000.0f, 15000.0f])。用于设置色温。 即以开尔文(Kelvin)为单位测量的整体图像色温。默认值为 6500.0, 即标准的「日光」照明。 A number (range \[1000.0f, 15000.0f]). Used to set the temperature. The overall image temperature measured in Kelvin. The default value is 6500.0, the standard "daylight" illumination. #### Returns `void` #### Remarks 设置 Vibrant Visuals 中颜色分级的色温。 Sets the temperature for color grading in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) ## 同领域相关 - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) - [BiomeWater](/server-graphics/classes/BiomeWater.md) - [getBiomeAtmospherics](/server-graphics/functions/getBiomeAtmospherics.md) - [getBiomeColorGrading](/server-graphics/functions/getBiomeColorGrading.md) - [getBiomeLighting](/server-graphics/functions/getBiomeLighting.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/classes/BiomeLighting.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/classes/BiomeLighting.md. # Class: BiomeLighting biome **`Beta`** 用于在「灵动视效」(Vibrant Visuals) 中影响光照。 Used to affect lighting for Vibrant Visuals ## Methods ### resetAmbientColor() > **resetAmbientColor**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将环境光颜色重置为资源包所设置的值。 Resets the ambient color to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetAmbientIlluminance() > **resetAmbientIlluminance**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将环境光照度重置为资源包所设置的值。 Resets the ambient illuminance to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetEmissiveDesaturation() > **resetEmissiveDesaturation**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将自发光去饱和度重置为资源包所设置的值。 Resets the emissive desaturation to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetFlashColor() > **resetFlashColor**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将闪光颜色重置为资源包所设置的值。 Resets the flash color to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetFlashIlluminance() > **resetFlashIlluminance**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将闪光照度重置为资源包所设置的值。 Resets the flash illuminance to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetMoonColor() > **resetMoonColor**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将月亮颜色重置为资源包所设置的值。 Resets the moon color to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetMoonIlluminance() > **resetMoonIlluminance**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将月亮照度重置为资源包所设置的值。 Resets the moon illuminance to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetOrbitalOffsetDegrees() > **resetOrbitalOffsetDegrees**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将轨道偏移角度重置为资源包所设置的值。 Resets the orbital offset to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetSkyIntensity() > **resetSkyIntensity**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将天空强度重置为资源包所设置的值。 Resets the sky intensity to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetSunColor() > **resetSunColor**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将太阳颜色重置为资源包所设置的值。 Resets the sun color to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetSunIlluminance() > **resetSunIlluminance**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将太阳照度重置为资源包所设置的值。 Resets the sun illuminance to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### setAmbientColor() > **setAmbientColor**(`color`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### color `any` #### Returns `void` #### Remarks 为「灵动视效」中的光照设置环境光颜色。 Sets the ambient color for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setAmbientIlluminance() > **setAmbientIlluminance**(`illuminance`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### illuminance `number` | `Record`\<`number`, `number`> #### Returns `void` #### Remarks 为「灵动视效」中的光照设置环境光照度。 Sets the ambient illuminance for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setEmissiveDesaturation() > **setEmissiveDesaturation**(`value`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### value `number` #### Returns `void` #### Remarks 为「灵动视效」中的光照设置自发光去饱和度。 Sets the emissive desaturation for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setFlashColor() > **setFlashColor**(`color`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### color `any` #### Returns `void` #### Remarks 为「灵动视效」中的光照设置闪光颜色。 Sets the flash color for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setFlashIlluminance() > **setFlashIlluminance**(`illuminance`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### illuminance `number` | `Record`\<`number`, `number`> #### Returns `void` #### Remarks 为「灵动视效」中的光照设置闪光照度。 Sets the flash illuminance for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setMoonColor() > **setMoonColor**(`color`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### color `any` #### Returns `void` #### Remarks 为「灵动视效」中的光照设置月亮颜色。 Sets the moon color for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setMoonIlluminance() > **setMoonIlluminance**(`illuminance`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### illuminance `number` | `Record`\<`number`, `number`> #### Returns `void` #### Remarks 为「灵动视效」中的光照设置月亮照度。 Sets the moon illuminance for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setOrbitalOffsetDegrees() > **setOrbitalOffsetDegrees**(`degrees`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### degrees `number` | `Record`\<`number`, `number`> #### Returns `void` #### Remarks 为「灵动视效」中的光照设置轨道偏移。 Sets the orbital offset for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setSkyIntensity() > **setSkyIntensity**(`intensity`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### intensity `number` | `Record`\<`number`, `number`> #### Returns `void` #### Remarks 为「灵动视效」中的光照设置天空强度。 Sets the sky intensity for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setSunColor() > **setSunColor**(`color`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### color `any` #### Returns `void` #### Remarks 为「灵动视效」中的光照设置太阳颜色。 Sets the sun color for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setSunIlluminance() > **setSunIlluminance**(`illuminance`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### illuminance `number` | `Record`\<`number`, `number`> #### Returns `void` #### Remarks 为「灵动视效」中的光照设置太阳照度。 Sets the sun illuminance for lighting in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) ## 同领域相关 - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeWater](/server-graphics/classes/BiomeWater.md) - [getBiomeAtmospherics](/server-graphics/functions/getBiomeAtmospherics.md) - [getBiomeColorGrading](/server-graphics/functions/getBiomeColorGrading.md) - [getBiomeLighting](/server-graphics/functions/getBiomeLighting.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/classes/BiomeWater.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/classes/BiomeWater.md. # Class: BiomeWater biome **`Beta`** 用于在“鲜艳视觉”(Vibrant Visuals)中影响水的效果。 Used to affect water for Vibrant Visuals ## Methods ### resetCDOM() > **resetCDOM**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将 CDOM 重置为资源包所设置的值。 Resets the CDOM to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetChlorophyll() > **resetChlorophyll**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将叶绿素浓度重置为资源包所设置的值。 Resets the chlorophyll concentration to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetSuspendedSediment() > **resetSuspendedSediment**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将悬浮沉积物重置为资源包所设置的值。 Resets the suspended sediment to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetWavesDepth() > **resetWavesDepth**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将波浪深度重置为资源包所设置的值。 Resets the wave depth to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetWavesDirectionIncrement() > **resetWavesDirectionIncrement**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将波浪方向增量重置为资源包所设置的值。 Resets the wave direction increment to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetWavesFrequency() > **resetWavesFrequency**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将波浪频率重置为资源包所设置的值。 Resets the wave frequency to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetWavesFrequencyScaling() > **resetWavesFrequencyScaling**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将波浪频率缩放重置为资源包所设置的值。 Resets the wave frequency scaling to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetWavesMix() > **resetWavesMix**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将波浪混合重置为资源包所设置的值。 Resets the wave mix to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetWavesOctaves() > **resetWavesOctaves**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将波浪倍频层数重置为资源包所设置的值。 Resets the wave octaves to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetWavesPull() > **resetWavesPull**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将波浪拉力重置为资源包所设置的值。 Resets the wave pull to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetWavesShape() > **resetWavesShape**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将波浪形状重置为资源包所设置的值。 Resets the wave shape to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetWavesSpeed() > **resetWavesSpeed**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将波浪速度重置为资源包所设置的值。 Resets the wave speed to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### resetWavesSpeedScaling() > **resetWavesSpeedScaling**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 将波浪速度缩放重置为资源包所设置的值。 Resets the wave speed scaling to the value set by resource packs #### Throws This function can throw errors. [EngineError](/common/classes/EngineError.md) *** ### setCDOM() > **setCDOM**(`cdom`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### cdom `number` 范围为 `[0,15]` 的一个数字,用于设置 CDOM。CDOM 浓度越高,由于强烈吸收蓝色波长,水体会呈现黄色至黄褐色;开阔海域通常几乎没有 CDOM,因此保持蓝色;而河流等淡水来源往往具有较高的 CDOM 浓度。 A number (range \[0,15]). Used to set the CDOM. High concentrations produce yellow to yellow-brown colors, due to CDOM strongly absorbing blue wavelengths. Open oceans typically have little to no CDOM, and thus retain a blue appearance; fresh water sources, like rivers, tend to have higher concentrations. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的 CDOM。 Sets the CDOM for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setChlorophyll() > **setChlorophyll**(`chlorophyll`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### chlorophyll `number` 范围为 `[0,10]` 的一个数字,用于设置叶绿素浓度。浓度越高,由于叶绿素强烈吸收蓝色与红色波长,水体会呈现绿色。 A number (range \[0,10]). Used to set the chlorophyll concentration. High concentrations produce green colors, due to chlorophyll strongly absorbing blue and red wavelengths. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的叶绿素浓度。 Sets the chlorophyll concentration for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setSuspendedSediment() > **setSuspendedSediment**(`suspendedSediment`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### suspendedSediment `number` 范围为 `[0,300]` 的一个数字,用于设置悬浮沉积物。浓度越高,由于悬浮沉积物强烈吸收蓝色与绿色波长,水体会呈现红色至红褐色。黏土和淤泥等悬浮沉积物往往在河流中富集,可作为近期洪水或污染源的指示。 A number (range \[0,300]). Used to set the suspended sediment. High concentrations produce red to red-brown colors, due to suspended sediment strongly absorbing blue and green wavelengths. Suspended sediment, like clay and silt, tend to be concentrated in rivers and can indicate recent floods or sources of pollution. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的悬浮沉积物。 Sets the suspended sediment for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setWavesDepth() > **setWavesDepth**(`wavesDepth`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### wavesDepth `number` 范围为 `[0,10]` 的一个数字,用于设置波浪深度。值越大表示波浪越深,值越小则波浪越浅。 A number (range \[0,10]). Used to set the wave depth. Determines how much waves displace the water surface. Larger values will result in deeper waves, whereas smaller values will produce shallower waves. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的波浪深度。 Sets the wave depth for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setWavesDirectionIncrement() > **setWavesDirectionIncrement**(`wavesDirectionIncrement`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### wavesDirectionIncrement `number` 范围为 `[0.0f, 360.0f]` 的一个数字,用于设置波浪方向增量。该角度(以度为单位)控制每个倍频层之间方向变化的幅度。 A number (range \[0.0f, 360.0f]). Used to set the wave direction increment. An angle, in degrees, that controls how much the heading changes between each octave. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的波浪方向增量。 Sets the wave direction increment for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setWavesFrequency() > **setWavesFrequency**(`wavesFrequency`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### wavesFrequency `number` 范围为 `[0,10]` 的一个数字,用于设置波浪频率。决定每个水方块所具有的波浪数量,也可理解为波浪尺寸。值越大波浪排列越紧密,值越小则波浪越发分散。 A number (range \[0,10]). Used to set the wave frequency. Determines how many waves there are per water block. Can also be thought of as the size of the waves. Larger values will create more tightly packed waves, whereas smaller values will spread waves out over a wider area. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的波浪频率。 Sets the wave frequency for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setWavesFrequencyScaling() > **setWavesFrequencyScaling**(`wavesFrequencyScaling`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### wavesFrequencyScaling `number` 范围为 `[0,2]` 的一个数字,用于设置波浪频率缩放。指定倍频层之间波浪频率的变化幅度。值为 `1` 时倍频层之间频率不变;大于 `1` 时频率递增;小于 `1` 时频率递减。 A number (range \[0,2]). Used to set the wave frequency scaling. Specifies how much wave frequency changes between octaves. A value of 1 will result in no change between octaves. Values higher than 1 will cause frequencies to increase while values less than 1 will cause frequencies to decrease. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的波浪频率缩放。 Sets the wave frequency scaling for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setWavesMix() > **setWavesMix**(`wavesMix`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### wavesMix `number` 范围为 `[0.0, 1.0]` 的一个数字,用于设置波浪混合。控制每个倍频层与其相邻倍频层之间的混合程度。 A number (range \[0.0, 1.0]). Used to set the wave mix. Controls how much each octave is blended into the neighboring octave. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的波浪混合。 Sets the wave mix for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setWavesOctaves() > **setWavesOctaves**(`wavesOctaves`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### wavesOctaves `number` 范围为 `[1.0, 10]` 的一个数字,用于设置波浪倍频层数。决定要模拟的波浪层数;值越大,波浪越复杂。 A number (range \[1.0, 10]). Used to set the wave octaves. Determines how many layers of waves to simulate; high values result in more complex waves #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的波浪倍频层数。 Sets the wave octaves for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setWavesPull() > **setWavesPull**(`wavesPull`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### wavesPull `number` 范围为 `[-1.0f, 1.0f]` 的一个数字,用于设置波浪拉力。控制较小的波浪被吸入较大波浪的程度。值为 `0` 表示不进行拉拽;大于 `0` 时以标准的凹形方式进行拉拽;小于 `0` 时以凸形方式进行拉拽,从而产生更膨胀的波浪而非浪尖翻卷的波浪。 A number (range \[-1.0f, 1.0f]). Used to set the wave pull. Controls how much smaller waves are pulled into larger waves. A value of 0 results in no pull. Values larger than 0 will pull waves in a standard concave fashion, whereas values less than 0 will pull waves in a convex fashion, resulting in more pillowing waves as opposed to cresting waves. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的波浪拉力。 Sets the wave pull for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setWavesShape() > **setWavesShape**(`wavesShape`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### wavesShape `number` 范围为 `[1.0, 10]` 的一个数字,用于设置波浪形状。调节波浪的核心形状。值为 `1` 时为纯正弦波;大于 `1` 时波浪更尖锐。 A number (range \[1.0, 10]). Used to set the wave shape. Adjusts the core shape of waves. A value of 1 results in a pure sine wave, whereas values larger than 1 will produce sharper waves. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的波浪形状。 Sets the wave shape for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setWavesSpeed() > **setWavesSpeed**(`wavesSpeed`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### wavesSpeed `number` 范围为 `[0.01,10]` 的一个数字,用于设置波浪速度。决定第一层波浪的移动速度,并作为“速度缩放”参数的起始值。 A number (range \[0.01,10]). Used to set the wave speed. etermines the movement speed of the first wave and the starting value of the Speed Scaling parameter. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的波浪速度。 Sets the wave speed for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) *** ### setWavesSpeedScaling() > **setWavesSpeedScaling**(`wavesSpeedScaling`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### wavesSpeedScaling `number` 范围为 `[0.0,2]` 的一个数字,用于设置波浪速度缩放。控制后续每个倍频层的移动速度。值为 `1` 时倍频层之间速度不变;大于 `1` 时速度递增;小于 `1` 时速度递减。 A number (range \[0.0,2]). Used to set the wave speed scaling. Controls how much faster each subsequent octave moves. A value of 1 will result in no change between octaves. Values higher than 1 will cause speeds to increase while values less than 1 will cause speeds to decrease. #### Returns `void` #### Remarks 设置“鲜艳视觉”中水的波浪速度缩放。 Sets the wave speed scaling for water in Vibrant Visuals #### Throws This function can throw errors. [InvalidArgumentError](/common/classes/InvalidArgumentError.md) ## 同领域相关 - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) - [getBiomeAtmospherics](/server-graphics/functions/getBiomeAtmospherics.md) - [getBiomeColorGrading](/server-graphics/functions/getBiomeColorGrading.md) - [getBiomeLighting](/server-graphics/functions/getBiomeLighting.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/functions/getBiomeAtmospherics.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/functions/getBiomeAtmospherics.md. # Function: getBiomeAtmospherics() biome > **getBiomeAtmospherics**(`biome`): [`BiomeAtmospherics`](/server-graphics/classes/BiomeAtmospherics.md) **`World Mutation`** **`Beta`** ## Parameters ### biome `BiomeType` ## Returns [`BiomeAtmospherics`](/server-graphics/classes/BiomeAtmospherics.md) ## Remarks 获取 BiomeAtmospherics 组件,用于在「灵动视效」(Vibrant Visuals) 中控制大气散射效果。 Retrieves the BiomeAtmospherics component to control atmoshperic scattering for Vibrant Visuals. ## 同领域相关 - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) - [BiomeWater](/server-graphics/classes/BiomeWater.md) - [getBiomeColorGrading](/server-graphics/functions/getBiomeColorGrading.md) - [getBiomeLighting](/server-graphics/functions/getBiomeLighting.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/functions/getBiomeColorGrading.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/functions/getBiomeColorGrading.md. # Function: getBiomeColorGrading() biome > **getBiomeColorGrading**(`biome`): [`BiomeColorGrading`](/server-graphics/classes/BiomeColorGrading.md) **`World Mutation`** **`Beta`** ## Parameters ### biome `BiomeType` ## Returns [`BiomeColorGrading`](/server-graphics/classes/BiomeColorGrading.md) ## Remarks 获取 BiomeColorGrading 组件,用于在「灵动视效」中控制色彩分级。 Retrieves the BiomeColorGrading component to control color grading for Vibrant Visuals. ## 同领域相关 - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) - [BiomeWater](/server-graphics/classes/BiomeWater.md) - [getBiomeAtmospherics](/server-graphics/functions/getBiomeAtmospherics.md) - [getBiomeLighting](/server-graphics/functions/getBiomeLighting.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/functions/getBiomeLighting.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/functions/getBiomeLighting.md. # Function: getBiomeLighting() biome > **getBiomeLighting**(`biome`): [`BiomeLighting`](/server-graphics/classes/BiomeLighting.md) **`World Mutation`** **`Beta`** ## Parameters ### biome `BiomeType` ## Returns [`BiomeLighting`](/server-graphics/classes/BiomeLighting.md) ## Remarks 获取 BiomeLighting 组件,用于在「灵动视效」中控制光照。 Retrieves the BiomeLighting component to control lighting for Vibrant Visuals. ## 同领域相关 - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) - [BiomeWater](/server-graphics/classes/BiomeWater.md) - [getBiomeAtmospherics](/server-graphics/functions/getBiomeAtmospherics.md) - [getBiomeColorGrading](/server-graphics/functions/getBiomeColorGrading.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/functions/getBiomeWater.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/functions/getBiomeWater.md. # Function: getBiomeWater() biome > **getBiomeWater**(`biome`): [`BiomeWater`](/server-graphics/classes/BiomeWater.md) **`World Mutation`** **`Beta`** ## Parameters ### biome `BiomeType` ## Returns [`BiomeWater`](/server-graphics/classes/BiomeWater.md) ## Remarks 获取 BiomeWater 组件,用于在「灵动视效」中控制水的效果。 Retrieves the BiomeWater component to control water for Vibrant Visuals ## 同领域相关 - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) - [BiomeWater](/server-graphics/classes/BiomeWater.md) - [getBiomeAtmospherics](/server-graphics/functions/getBiomeAtmospherics.md) - [getBiomeColorGrading](/server-graphics/functions/getBiomeColorGrading.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/functions/getPlayerAtmospherics.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/functions/getPlayerAtmospherics.md. # Function: getPlayerAtmospherics() player > **getPlayerAtmospherics**(`biome`, `player`): [`BiomeAtmospherics`](/server-graphics/classes/BiomeAtmospherics.md) **`World Mutation`** **`Beta`** ## Parameters ### biome `BiomeType` ### player `Player` ## Returns [`BiomeAtmospherics`](/server-graphics/classes/BiomeAtmospherics.md) ## Remarks 获取 PlayerAtmospherics 组件,用于在「灵动视效」中控制特定玩家的大气散射效果。它提供与 BiomeAtmospherics 相同的控制选项,但 PlayerAtmospherics 的控制将始终优先于 BiomeAtmospherics。 Retrieves the PlayerAtmospherics component to control atmospheric scattering for a particular player in Vibrant Visuals. This offers the same controls as BiomeAtmospherics, but PlayerAtmospherics controls will always take precedence over BiomeAtmospherics. ## 同领域相关 - [getPlayerColorGrading](/server-graphics/functions/getPlayerColorGrading.md) - [getPlayerLighting](/server-graphics/functions/getPlayerLighting.md) - [getPlayerWater](/server-graphics/functions/getPlayerWater.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/functions/getPlayerColorGrading.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/functions/getPlayerColorGrading.md. # Function: getPlayerColorGrading() player > **getPlayerColorGrading**(`biome`, `player`): [`BiomeColorGrading`](/server-graphics/classes/BiomeColorGrading.md) **`World Mutation`** **`Beta`** ## Parameters ### biome `BiomeType` ### player `Player` ## Returns [`BiomeColorGrading`](/server-graphics/classes/BiomeColorGrading.md) ## Remarks 获取 PlayerColorGrading 组件,用于在「灵动视效」中控制特定玩家的色彩分级。它提供与 BiomeColorGrading 相同的控制选项,但 PlayerColorGrading 的控制将始终优先于 BiomeColorGrading。 Retrieves the PlayerColorGrading component to control color grading for a particular player in Vibrant Visuals. This offers the same controls as BiomeColorGrading, but PlayerColorGrading controls will always take precedence over BiomeColorGrading. ## 同领域相关 - [getPlayerAtmospherics](/server-graphics/functions/getPlayerAtmospherics.md) - [getPlayerLighting](/server-graphics/functions/getPlayerLighting.md) - [getPlayerWater](/server-graphics/functions/getPlayerWater.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/functions/getPlayerLighting.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/functions/getPlayerLighting.md. # Function: getPlayerLighting() player > **getPlayerLighting**(`biome`, `player`): [`BiomeLighting`](/server-graphics/classes/BiomeLighting.md) **`World Mutation`** **`Beta`** ## Parameters ### biome `BiomeType` ### player `Player` ## Returns [`BiomeLighting`](/server-graphics/classes/BiomeLighting.md) ## Remarks 获取 PlayerLighting 组件,用于在「灵动视效」中控制特定玩家的光照。它提供与 BiomeLighting 相同的控制选项,但 PlayerLighting 的控制将始终优先于 BiomeLighting。 Retrieves the PlayerLighting component to control lighting for a particular player in Vibrant Visuals. This offers the same controls as BiomeLighting, but PlayerLighting controls will always take precedence over BiomeLighting. ## 同领域相关 - [getPlayerAtmospherics](/server-graphics/functions/getPlayerAtmospherics.md) - [getPlayerColorGrading](/server-graphics/functions/getPlayerColorGrading.md) - [getPlayerWater](/server-graphics/functions/getPlayerWater.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/functions/getPlayerWater.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/functions/getPlayerWater.md. # Function: getPlayerWater() player > **getPlayerWater**(`biome`, `player`): [`BiomeWater`](/server-graphics/classes/BiomeWater.md) **`World Mutation`** **`Beta`** ## Parameters ### biome `BiomeType` ### player `Player` ## Returns [`BiomeWater`](/server-graphics/classes/BiomeWater.md) ## Remarks 获取 PlayerWater 组件,用于在「灵动视效」中控制特定玩家的水效果。它提供与 BiomeWater 相同的控制选项,但 PlayerWater 的控制将始终优先于 BiomeWater。 Retrieves the PlayerWater component to control water for a particular player in Vibrant Visuals. This offers the same controls as BiomeWater, but PlayerWater controls will always take precedence over BiomeWater. ## 同领域相关 - [getPlayerAtmospherics](/server-graphics/functions/getPlayerAtmospherics.md) - [getPlayerColorGrading](/server-graphics/functions/getPlayerColorGrading.md) - [getPlayerLighting](/server-graphics/functions/getPlayerLighting.md) - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent.md) - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal.md) - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-graphics) --- url: /server-graphics/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-graphics/index.md. # Module: server-graphics **`Beta`** `@minecraft/server-graphics` 模块包含用于更改图形和渲染设置的 API。 The `@minecraft/server-graphics` module contains APIs to change graphics and rendering settings. Manifest Details ```json { "module_name": "@minecraft/server-graphics", "version": "1.0.0-beta" } ``` ## Classes - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics.md) - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading.md) - [BiomeLighting](/server-graphics/classes/BiomeLighting.md) - [BiomeWater](/server-graphics/classes/BiomeWater.md) ## Functions - [getBiomeAtmospherics](/server-graphics/functions/getBiomeAtmospherics.md) - [getBiomeColorGrading](/server-graphics/functions/getBiomeColorGrading.md) - [getBiomeLighting](/server-graphics/functions/getBiomeLighting.md) - [getBiomeWater](/server-graphics/functions/getBiomeWater.md) - [getPlayerAtmospherics](/server-graphics/functions/getPlayerAtmospherics.md) - [getPlayerColorGrading](/server-graphics/functions/getPlayerColorGrading.md) - [getPlayerLighting](/server-graphics/functions/getPlayerLighting.md) - [getPlayerWater](/server-graphics/functions/getPlayerWater.md) --- url: /server-net/classes/CloseAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/CloseAfterEventSignal.md. # Class: CloseAfterEventSignal event **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [beforeEvents](/server-net/variables/beforeEvents.md) - [MessageAfterEventSignal](/server-net/classes/MessageAfterEventSignal.md) - [NetworkBeforeEvents](/server-net/classes/NetworkBeforeEvents.md) - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/HttpClient.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/HttpClient.md. # Class: HttpClient network **`Beta`** ## Example **simpleHttpRequest.ts** ```typescript import { HttpRequest, HttpHeader, HttpRequestMethod, http } from '@minecraft/server-net'; async function updateScore() { const req = new HttpRequest('http://localhost:3000/updateScore'); req.body = JSON.stringify({ score: 22, }); req.method = HttpRequestMethod.Post; req.headers = [new HttpHeader('Content-Type', 'application/json'), new HttpHeader('auth', 'my-auth-token')]; await http.request(req); } ``` ## Methods ### cancelAll() > **cancelAll**(`reason`): `void` **`Early Execution`** **`Beta`** #### Parameters ##### reason `string` 提供给请求对应的 Promise 的 reject 原因。 #### Returns `void` #### Remarks 取消所有尚未完成的请求。 Cancels all pending requests. *** ### get() > **get**(`uri`): `Promise`\<[`HttpResponse`](/server-net/classes/HttpResponse.md)> **`Early Execution`** **`Beta`** #### Parameters ##### uri `string` 请求的 URL。 URL to make an HTTP Request to. #### Returns `Promise`\<[`HttpResponse`](/server-net/classes/HttpResponse.md)> 解析到对应响应的 Promise。 An awaitable promise that contains the HTTP response. #### Remarks 发起一个 HTTP GET 请求。 Performs a simple HTTP get request. *** ### request() > **request**(`config`): `Promise`\<[`HttpResponse`](/server-net/classes/HttpResponse.md)> **`Early Execution`** **`Beta`** #### Parameters ##### config [`HttpRequest`](/server-net/classes/HttpRequest.md) 用于发起请求的配置对象。 Contains an HTTP Request object with configuration data on the HTTP request. #### Returns `Promise`\<[`HttpResponse`](/server-net/classes/HttpResponse.md)> 解析到对应响应的 Promise。 An awaitable promise that contains the HTTP response. #### Remarks 发起一个 HTTP 请求。 Performs an HTTP request. #### Example **simpleHttpRequest.ts** ```typescript import { HttpRequest, HttpHeader, HttpRequestMethod, http } from '@minecraft/server-net'; async function updateScore() { const req = new HttpRequest('http://localhost:3000/updateScore'); req.body = JSON.stringify({ score: 22, }); req.method = HttpRequestMethod.Post; req.headers = [new HttpHeader('Content-Type', 'application/json'), new HttpHeader('auth', 'my-auth-token')]; await http.request(req); } ``` ## 同领域相关 - [HttpHeader](/server-net/classes/HttpHeader.md) - [HttpRequest](/server-net/classes/HttpRequest.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpRequestMethod](/server-net/enums/HttpRequestMethod.md) - [HttpResponse](/server-net/classes/HttpResponse.md) - [HttpStatusCode](/server-net/enums/HttpStatusCode.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/HttpHeader.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/HttpHeader.md. # Class: HttpHeader network **`Beta`** 表示一个请求标头,即包含了请求元数据的键值对。 Represents an HTTP header - a key/value pair of meta-information about a request. ## Example **simpleHttpRequest.ts** ```typescript import { HttpRequest, HttpHeader, HttpRequestMethod, http } from '@minecraft/server-net'; async function updateScore() { const req = new HttpRequest('http://localhost:3000/updateScore'); req.body = JSON.stringify({ score: 22, }); req.method = HttpRequestMethod.Post; req.headers = [new HttpHeader('Content-Type', 'application/json'), new HttpHeader('auth', 'my-auth-token')]; await http.request(req); } ``` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new HttpHeader**(`key`, `value`): `HttpHeader` **`Beta`** #### Parameters ##### key `string` ##### value `any` #### Returns `HttpHeader` ## Properties ### key > **key**: `string` **`Early Execution`** **`Beta`** #### Remarks 请求标头的键。 Key of the HTTP header. *** ### value > **value**: `any` **`Early Execution`** **`Beta`** #### Remarks 请求标头的值。 Value of the HTTP header. ## 同领域相关 - [HttpClient](/server-net/classes/HttpClient.md) - [HttpRequest](/server-net/classes/HttpRequest.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpRequestMethod](/server-net/enums/HttpRequestMethod.md) - [HttpResponse](/server-net/classes/HttpResponse.md) - [HttpStatusCode](/server-net/enums/HttpStatusCode.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/HttpRequest.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/HttpRequest.md. # Class: HttpRequest network **`Beta`** 包含构成 HTTP 请求所需的参数。主要用于发起请求。 Main object for structuring a request. ## Example **simpleHttpRequest.ts** ```typescript import { HttpRequest, HttpHeader, HttpRequestMethod, http } from '@minecraft/server-net'; async function updateScore() { const req = new HttpRequest('http://localhost:3000/updateScore'); req.body = JSON.stringify({ score: 22, }); req.method = HttpRequestMethod.Post; req.headers = [new HttpHeader('Content-Type', 'application/json'), new HttpHeader('auth', 'my-auth-token')]; await http.request(req); } ``` ## Constructors \{#constructors} ### Constructor \{#constructor} > **new HttpRequest**(`uri`): `HttpRequest` **`Beta`** #### Parameters ##### uri `string` #### Returns `HttpRequest` ## Properties ### body > **body**: `any` **`Early Execution`** **`Beta`** #### Remarks 请求的携带的主体负载内容。 Content of the body of the HTTP request. *** ### headers > **headers**: [`HttpHeader`](/server-net/classes/HttpHeader.md)\[] **`Early Execution`** **`Beta`** #### Remarks 该请求的请求标头集合。 A collection of HTTP headers to add to the outbound request. *** ### method > **method**: [`HttpRequestMethod`](/server-net/enums/HttpRequestMethod.md) **`Early Execution`** **`Beta`** #### Remarks 该请求的请求方法(例如 GET、PUT 或 PATCH)。 HTTP method (e.g., GET or PUT or PATCH) to use for making the request. *** ### timeout > **timeout**: `number` **`Early Execution`** **`Beta`** #### Remarks 在请求被视为超时而取消前的最大时长,单位为秒。 Amount of time, in seconds, before the request times out and is abandoned. *** ### uri > **uri**: `string` **`Early Execution`** **`Beta`** #### Remarks 请求访问的资源 URI。 The HTTP resource to access. ## Methods ### addHeader() > **addHeader**(`key`, `value`): `HttpRequest` **`Early Execution`** **`Beta`** #### Parameters ##### key `string` ##### value `any` #### Returns `HttpRequest` #### Remarks 向当前请求中增加一个请求标头。 Adds an additional header to the overall list of headers used in the corresponding HTTP request. *** ### setBody() > **setBody**(`body`): `HttpRequest` **`Early Execution`** **`Beta`** #### Parameters ##### body `any` #### Returns `HttpRequest` #### Remarks 将请求的主体负载内容设定为指定内容。 Updates the content of the body of the HTTP request. *** ### setHeaders() > **setHeaders**(`headers`): `HttpRequest` **`Early Execution`** **`Beta`** #### Parameters ##### headers [`HttpHeader`](/server-net/classes/HttpHeader.md)\[] #### Returns `HttpRequest` #### Remarks 使用指定的请求标头集合增加或替换请求中指定的请求标头。 Replaces and applies a set of HTTP Headers for the request. *** ### setMethod() > **setMethod**(`method`): `HttpRequest` **`Early Execution`** **`Beta`** #### Parameters ##### method [`HttpRequestMethod`](/server-net/enums/HttpRequestMethod.md) #### Returns `HttpRequest` #### Remarks 设置该请求的请求方法(例如 GET、PUT 或 PATCH)。 Sets the desired HTTP method (e.g., GET or PUT or PATCH) to use for making the request. *** ### setTimeout() > **setTimeout**(`timeout`): `HttpRequest` **`Early Execution`** **`Beta`** #### Parameters ##### timeout `number` The timeout value, in seconds. #### Returns `HttpRequest` #### Remarks Sets the maximum amount of time, in seconds, before the request times out and is cancelled. 设置请求超时并被取消前的最大时间(以秒为单位)。 ## 同领域相关 - [HttpClient](/server-net/classes/HttpClient.md) - [HttpHeader](/server-net/classes/HttpHeader.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpRequestMethod](/server-net/enums/HttpRequestMethod.md) - [HttpResponse](/server-net/classes/HttpResponse.md) - [HttpStatusCode](/server-net/enums/HttpStatusCode.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/HttpRequestLimitExceededError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/HttpRequestLimitExceededError.md. # Class: HttpRequestLimitExceededError network error **`Beta`** 当并发的 HTTP 请求数达到上限时抛出的错误。 An error thrown when the maximum number of concurrent HTTP requests has been reached. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### inFlightRequests > `readonly` **inFlightRequests**: `number` **`Early Execution`** **`Beta`** #### Remarks 被拒绝时已经处于进行中的请求数。 Number of requests already in flight when rejected. *** ### maxConcurrentRequests > `readonly` **maxConcurrentRequests**: `number` **`Early Execution`** **`Beta`** #### Remarks 已配置的最大并发 HTTP 请求数。 Configured maximum concurrent HTTP requests. *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [WebSocketConnectionFailedError](/server-net/classes/WebSocketConnectionFailedError.md) - [WebSocketLimitExceededError](/server-net/classes/WebSocketLimitExceededError.md) - [WebSocketNotConnectedError](/server-net/classes/WebSocketNotConnectedError.md) - [HttpClient](/server-net/classes/HttpClient.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/HttpResponse.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/HttpResponse.md. # Class: HttpResponse network **`Beta`** 表示一个 HTTP 响应。包含了请求及对应响应的相关信息。 Main object that contains result information from a request. ## Properties ### body > `readonly` **body**: `string` **`Beta`** #### Remarks 响应的主体内容。 Body content of the HTTP response. *** ### headers > `readonly` **headers**: [`HttpHeader`](/server-net/classes/HttpHeader.md)\[] **`Beta`** #### Remarks 通过请求返回的响应标头集合。 A collection of HTTP response headers returned from the request. *** ### request > `readonly` **request**: [`HttpRequest`](/server-net/classes/HttpRequest.md) **`Beta`** #### Remarks 该响应对应的请求参数信息。 Information that was used to formulate the HTTP response that this object represents. *** ### status > `readonly` **status**: `number` **`Beta`** #### Remarks 请求响应的状态代码。例如,404 表示未找到资源,500 则表示服务器内部错误。 HTTP response code for the request. For example, 404 represents resource not found, and 500 represents an internal server error. ## Methods ### deserialize() > **deserialize**(`identifier`): `ISerializable` **`World Mutation`** **`Beta`** #### Parameters ##### identifier `string` #### Returns `ISerializable` #### Remarks #### Throws This function can throw errors. [SerializableParseError](/server-net/classes/SerializableParseError.md) ## 同领域相关 - [HttpClient](/server-net/classes/HttpClient.md) - [HttpHeader](/server-net/classes/HttpHeader.md) - [HttpRequest](/server-net/classes/HttpRequest.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpRequestMethod](/server-net/enums/HttpRequestMethod.md) - [HttpStatusCode](/server-net/enums/HttpStatusCode.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/InternalHttpRequestError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/InternalHttpRequestError.md. # Class: InternalHttpRequestError network error **`Beta`** 当发生平台级 HTTP 错误时抛出的错误。此类中提供的信息可能对诊断很有用,但因平台而异。 An error thrown when a platform-level HTTP error occurs. Information provided in this class may be useful for diagnostics purposes but will differ from platform to platform. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### errorCode > `readonly` **errorCode**: `number` **`Early Execution`** **`Beta`** #### Remarks *** ### errorMessage > `readonly` **errorMessage**: `string` **`Early Execution`** **`Beta`** #### Remarks *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [WebSocketConnectionFailedError](/server-net/classes/WebSocketConnectionFailedError.md) - [WebSocketLimitExceededError](/server-net/classes/WebSocketLimitExceededError.md) - [WebSocketNotConnectedError](/server-net/classes/WebSocketNotConnectedError.md) - [HttpClient](/server-net/classes/HttpClient.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/InternalWebSocketError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/InternalWebSocketError.md. # Class: InternalWebSocketError network error **`Beta`** 当发生平台级 WebSocket 错误时抛出的错误。此类中提供的信息可能对诊断很有用,但因平台而异。 An error thrown when a platform-level WebSocket error occurs. Information provided in this class may be useful for diagnostics purposes but will differ from platform to platform. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### errorCode > `readonly` **errorCode**: `number` **`Early Execution`** **`Beta`** #### Remarks *** ### errorMessage > `readonly` **errorMessage**: `string` **`Early Execution`** **`Beta`** #### Remarks *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [WebSocketConnectionFailedError](/server-net/classes/WebSocketConnectionFailedError.md) - [WebSocketLimitExceededError](/server-net/classes/WebSocketLimitExceededError.md) - [WebSocketNotConnectedError](/server-net/classes/WebSocketNotConnectedError.md) - [HttpClient](/server-net/classes/HttpClient.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/MalformedUriError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/MalformedUriError.md. # Class: MalformedUriError error **`Beta`** 当使用格式不正确的 URI 时抛出的错误。 An error thrown when a malformed URI is used. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [RequestBodyTooLargeError](/server-net/classes/RequestBodyTooLargeError.md) - [SerializableParseError](/server-net/classes/SerializableParseError.md) - [TLSOnlyError](/server-net/classes/TLSOnlyError.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/MessageAfterEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/MessageAfterEventSignal.md. # Class: MessageAfterEventSignal event **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` #### Returns `void` #### Remarks ## 同领域相关 - [beforeEvents](/server-net/variables/beforeEvents.md) - [CloseAfterEventSignal](/server-net/classes/CloseAfterEventSignal.md) - [NetworkBeforeEvents](/server-net/classes/NetworkBeforeEvents.md) - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/NetworkBeforeEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/NetworkBeforeEvents.md. # Class: NetworkBeforeEvents event **`Beta`** ## Properties ### packetReceive > `readonly` **packetReceive**: [`PacketReceiveBeforeEventSignal`](/server-net/classes/PacketReceiveBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### packetSend > `readonly` **packetSend**: [`PacketSendBeforeEventSignal`](/server-net/classes/PacketSendBeforeEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks ## 同领域相关 - [beforeEvents](/server-net/variables/beforeEvents.md) - [CloseAfterEventSignal](/server-net/classes/CloseAfterEventSignal.md) - [MessageAfterEventSignal](/server-net/classes/MessageAfterEventSignal.md) - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/PacketReceiveBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/PacketReceiveBeforeEventSignal.md. # Class: PacketReceiveBeforeEventSignal event network **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: ##### options? [`PacketEventOptions`](/server-net/interfaces/PacketEventOptions.md) #### Returns :::tip 以受限执行权限调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks ## 同领域相关 - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) - [PacketSendBeforeEvent](/server-net/classes/PacketSendBeforeEvent.md) - [PacketSendBeforeEventSignal](/server-net/classes/PacketSendBeforeEventSignal.md) - [WebSocketClientAfterEvents](/server-net/classes/WebSocketClientAfterEvents.md) - [WebSocketClientCloseAfterEvent](/server-net/classes/WebSocketClientCloseAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/PacketReceivedBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/PacketReceivedBeforeEvent.md. # Class: PacketReceivedBeforeEvent event network **`Beta`** 当服务器从客户端接收到网络数据包时发送。如果取消,服务器将不会解析该网络数据包, 并会静默忽略它。 Sent as the server receives a network packet from a client. If cancelled, the server will not parse the network packet and will silently ignore it. ## Properties ### cancel > **cancel**: `boolean` **`Beta`** *** ### packetId > `readonly` **packetId**: [`PacketId`](/server-net/enums/PacketId.md) **`Beta`** #### Remarks 网络数据包的类型。 The type of network packet. *** ### packetSize > `readonly` **packetSize**: `number` **`Beta`** #### Remarks 该网络数据包的字节大小。 The size of the network packet in bytes. *** ### sender? > `readonly` `optional` **sender?**: `any` **`Beta`** #### Remarks 将该网络数据包发送给游戏服务器的客户端。 Which client sent the network packet to the game server. ## 同领域相关 - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketSendBeforeEvent](/server-net/classes/PacketSendBeforeEvent.md) - [PacketSendBeforeEventSignal](/server-net/classes/PacketSendBeforeEventSignal.md) - [WebSocketClientAfterEvents](/server-net/classes/WebSocketClientAfterEvents.md) - [WebSocketClientCloseAfterEvent](/server-net/classes/WebSocketClientCloseAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/PacketSendBeforeEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/PacketSendBeforeEvent.md. # Class: PacketSendBeforeEvent event network **`Beta`** 在服务器向客户端发送网络数据包时触发的事件。如果取消,服务器将不会向接收客户端发送该网络数据包。 Sent as the server sends a network packet to clients. If cancelled, the server will not send the network packet to the receiving clients. ## Properties ### cancel > **cancel**: `boolean` **`Beta`** *** ### packetId > `readonly` **packetId**: [`PacketId`](/server-net/enums/PacketId.md) **`Beta`** #### Remarks 网络数据包的类型。 The type of network packet. *** ### recipients > `readonly` **recipients**: `any`\[] **`Beta`** #### Remarks 该网络数据包将发送到的目标客户端。 Which clients the network packet is being sent to. ## 同领域相关 - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) - [PacketSendBeforeEventSignal](/server-net/classes/PacketSendBeforeEventSignal.md) - [WebSocketClientAfterEvents](/server-net/classes/WebSocketClientAfterEvents.md) - [WebSocketClientCloseAfterEvent](/server-net/classes/WebSocketClientCloseAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/PacketSendBeforeEventSignal.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/PacketSendBeforeEventSignal.md. # Class: PacketSendBeforeEventSignal event network **`Beta`** ## Methods ### subscribe() > **subscribe**(`callback`, `options?`): (`arg0`) => `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: ##### options? [`PacketEventOptions`](/server-net/interfaces/PacketEventOptions.md) #### Returns :::tip 以受限执行权限调用的闭包。 ::: :::tip Closure that is called with restricted-execution privilege. ::: (`arg0`) => `void` #### Remarks *** ### unsubscribe() > **unsubscribe**(`callback`): `void` **`World Mutation`** **`Early Execution`** **`Beta`** #### Parameters ##### callback (`arg0`) => `void` :::tip 此闭包以受限执行权限调用。 ::: :::tip This closure is called with restricted-execution privilege. ::: #### Returns `void` #### Remarks ## 同领域相关 - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) - [PacketSendBeforeEvent](/server-net/classes/PacketSendBeforeEvent.md) - [WebSocketClientAfterEvents](/server-net/classes/WebSocketClientAfterEvents.md) - [WebSocketClientCloseAfterEvent](/server-net/classes/WebSocketClientCloseAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/RequestBodyTooLargeError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/RequestBodyTooLargeError.md. # Class: RequestBodyTooLargeError error **`Beta`** 当网络请求体超过配置的尺寸限制时抛出的错误。 An error thrown when an network request body exceeds the configured size limit. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### maxBytes > `readonly` **maxBytes**: `number` **`Early Execution`** **`Beta`** #### Remarks 已配置的最大请求体字节数。 Configured maximum body size in bytes. *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### providedBytes > `readonly` **providedBytes**: `number` **`Early Execution`** **`Beta`** #### Remarks 实际请求体的字节数。 Request body size in bytes. *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [MalformedUriError](/server-net/classes/MalformedUriError.md) - [SerializableParseError](/server-net/classes/SerializableParseError.md) - [TLSOnlyError](/server-net/classes/TLSOnlyError.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/SerializableParseError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/SerializableParseError.md. # Class: SerializableParseError error **`Beta`** ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [MalformedUriError](/server-net/classes/MalformedUriError.md) - [RequestBodyTooLargeError](/server-net/classes/RequestBodyTooLargeError.md) - [TLSOnlyError](/server-net/classes/TLSOnlyError.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/TLSOnlyError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/TLSOnlyError.md. # Class: TLSOnlyError error **`Beta`** 当需要使用安全 URI 协议但提供了非安全 URI 时抛出的错误。 An error thrown when secure URI scheme is required but a non-secure URI was provided. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### uri > `readonly` **uri**: `string` **`Early Execution`** **`Beta`** #### Remarks 因未使用安全协议而被拒绝的 URI。 URI that was rejected for not using secure scheme. *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [MalformedUriError](/server-net/classes/MalformedUriError.md) - [RequestBodyTooLargeError](/server-net/classes/RequestBodyTooLargeError.md) - [SerializableParseError](/server-net/classes/SerializableParseError.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/UriNotAllowedError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/UriNotAllowedError.md. # Class: UriNotAllowedError error **`Beta`** 当网络请求的目标 URI 不在已配置的允许列表中时抛出的错误。 An error thrown when a network request targets a URI that is not in the configured allow list. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### uri > `readonly` **uri**: `string` **`Early Execution`** **`Beta`** #### Remarks 因不被允许而被拒绝的 URI。 URI that was rejected because it is not allowed. *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [MalformedUriError](/server-net/classes/MalformedUriError.md) - [RequestBodyTooLargeError](/server-net/classes/RequestBodyTooLargeError.md) - [SerializableParseError](/server-net/classes/SerializableParseError.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/WebSocket.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/WebSocket.md. # Class: WebSocket network **`Beta`** 用于管理 WebSocket 连接。 Used to manage WebSocket connections. ## Methods ### connect() > **connect**(`uri`, `headers?`): `Promise`\<[`WebSocketClient`](/server-net/classes/WebSocketClient.md)> **`World Mutation`** **`Beta`** #### Parameters ##### uri `string` 要建立连接的 URL。 URL to make connection to. ##### headers? [`HttpHeader`](/server-net/classes/HttpHeader.md)\[] #### Returns `Promise`\<[`WebSocketClient`](/server-net/classes/WebSocketClient.md)> 一个可等待的 Promise,其结果为已连接的 WebSocket 客户端。 An awaitable promise that contains the WebSocket client that was connected. #### Remarks 尝试连接一个 WebSocket 客户端。 Attempts to connect a WebSocket client. ## 同领域相关 - [HttpClient](/server-net/classes/HttpClient.md) - [HttpHeader](/server-net/classes/HttpHeader.md) - [HttpRequest](/server-net/classes/HttpRequest.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpRequestMethod](/server-net/enums/HttpRequestMethod.md) - [HttpResponse](/server-net/classes/HttpResponse.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/WebSocketClient.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/WebSocketClient.md. # Class: WebSocketClient network **`Beta`** 一个活跃的 WebSocket 客户端。 An active WebSocket client. ## Properties ### afterEvents > `readonly` **afterEvents**: [`WebSocketClientAfterEvents`](/server-net/classes/WebSocketClientAfterEvents.md) **`Beta`** #### Remarks 包含与此 WebSocket 客户端相关的一组事件。 Contains a set of events related to this WebSocket client. *** ### isOpen > `readonly` **isOpen**: `boolean` **`Beta`** #### Remarks 如果当前已连接到服务器,则为 true。 Set to true if the socket is current connected to the server. ## Methods ### close() > **close**(): `void` **`World Mutation`** **`Beta`** #### Returns `void` #### Remarks 关闭与服务器的连接。 Closes the connection with the server. #### Throws This function can throw errors. [WebSocketNotConnectedError](/server-net/classes/WebSocketNotConnectedError.md) *** ### send() > **send**(`payload`): `void` **`World Mutation`** **`Beta`** #### Parameters ##### payload `string` 将被包含在网络数据包中的有效负载。 The payload that will be included in the network packet. #### Returns `void` #### Remarks 将提供的有效负载发送到服务器。 Sends the provided payload to the server. #### Throws This function can throw errors. [RequestBodyTooLargeError](/server-net/classes/RequestBodyTooLargeError.md) [WebSocketNotConnectedError](/server-net/classes/WebSocketNotConnectedError.md) ## 同领域相关 - [HttpClient](/server-net/classes/HttpClient.md) - [HttpHeader](/server-net/classes/HttpHeader.md) - [HttpRequest](/server-net/classes/HttpRequest.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpRequestMethod](/server-net/enums/HttpRequestMethod.md) - [HttpResponse](/server-net/classes/HttpResponse.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/WebSocketClientAfterEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/WebSocketClientAfterEvents.md. # Class: WebSocketClientAfterEvents event network **`Beta`** ## Properties ### close > `readonly` **close**: [`CloseAfterEventSignal`](/server-net/classes/CloseAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks *** ### message > `readonly` **message**: [`MessageAfterEventSignal`](/server-net/classes/MessageAfterEventSignal.md) **`Early Execution`** **`Beta`** #### Remarks ## 同领域相关 - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) - [PacketSendBeforeEvent](/server-net/classes/PacketSendBeforeEvent.md) - [PacketSendBeforeEventSignal](/server-net/classes/PacketSendBeforeEventSignal.md) - [WebSocketClientCloseAfterEvent](/server-net/classes/WebSocketClientCloseAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/WebSocketClientCloseAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/WebSocketClientCloseAfterEvent.md. # Class: WebSocketClientCloseAfterEvent event network **`Beta`** ## Properties ### reason > `readonly` **reason**: [`WebSocketClientCloseReasons`](/server-net/enums/WebSocketClientCloseReasons.md) **`Beta`** ## 同领域相关 - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) - [PacketSendBeforeEvent](/server-net/classes/PacketSendBeforeEvent.md) - [PacketSendBeforeEventSignal](/server-net/classes/PacketSendBeforeEventSignal.md) - [WebSocketClientAfterEvents](/server-net/classes/WebSocketClientAfterEvents.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/WebSocketClientReceiveAfterEvent.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/WebSocketClientReceiveAfterEvent.md. # Class: WebSocketClientReceiveAfterEvent event network **`Beta`** ## Properties ### message > `readonly` **message**: `string` **`Beta`** ## 同领域相关 - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) - [PacketSendBeforeEvent](/server-net/classes/PacketSendBeforeEvent.md) - [PacketSendBeforeEventSignal](/server-net/classes/PacketSendBeforeEventSignal.md) - [WebSocketClientAfterEvents](/server-net/classes/WebSocketClientAfterEvents.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/WebSocketConnectionFailedError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/WebSocketConnectionFailedError.md. # Class: WebSocketConnectionFailedError network error **`Beta`** 当与 WebSocket 服务器的连接失败时抛出的错误。 An error thrown when the connection with the WebSocket server has failed. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### errorCode > `readonly` **errorCode**: [`HttpStatusCode`](/server-net/enums/HttpStatusCode.md) **`Early Execution`** **`Beta`** #### Remarks 尝试与服务器建立连接时收到的错误代码。 The error code received when attempting to connect with the server. *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### uri > `readonly` **uri**: `string` **`Early Execution`** **`Beta`** #### Remarks 用于发起本次连接尝试但失败的 URI。 The URI provided to make this connection attempt that failed. *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [WebSocketLimitExceededError](/server-net/classes/WebSocketLimitExceededError.md) - [WebSocketNotConnectedError](/server-net/classes/WebSocketNotConnectedError.md) - [HttpClient](/server-net/classes/HttpClient.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/WebSocketLimitExceededError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/WebSocketLimitExceededError.md. # Class: WebSocketLimitExceededError network error **`Beta`** 当已连接的 WebSocket 数量达到上限时抛出的错误。 An error that is thrown when the maximum number of connected WebSockets is reached. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### connectedSockets > `readonly` **connectedSockets**: `number` **`Early Execution`** **`Beta`** #### Remarks 被拒绝时已处于活动状态的 WebSocket 连接数。 Number of WebSocket connections already active when rejected. *** ### maxConcurrentConnections > `readonly` **maxConcurrentConnections**: `number` **`Early Execution`** **`Beta`** #### Remarks 已配置的最大活动 WebSocket 连接数。 Configured maximum active WebSocket connections. *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [WebSocketConnectionFailedError](/server-net/classes/WebSocketConnectionFailedError.md) - [WebSocketNotConnectedError](/server-net/classes/WebSocketNotConnectedError.md) - [HttpClient](/server-net/classes/HttpClient.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/classes/WebSocketNotConnectedError.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/classes/WebSocketNotConnectedError.md. # Class: WebSocketNotConnectedError network error **`Beta`** 当 WebSocket 尚未连接到服务器时尝试使用 WebSocket 所抛出的错误。 An error thrown when attempting to use a WebSocket while the socket is not connected to a server. ## Extends - `Error` ## Properties ### cause? > `optional` **cause?**: `unknown` **`Beta`** #### Inherited from `Error.cause` *** ### message > **message**: `string` **`Beta`** #### Inherited from `Error.message` *** ### name > **name**: `string` **`Beta`** #### Inherited from `Error.name` *** ### stack? > `optional` **stack?**: `string` **`Beta`** #### Inherited from `Error.stack` *** ### stackTraceLimit > `static` **stackTraceLimit**: `number` **`Beta`** The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. #### Inherited from `Error.stackTraceLimit` ## Methods ### captureStackTrace() > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` **`Beta`** Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` #### Parameters ##### targetObject `object` ##### constructorOpt? `Function` #### Returns `void` #### Inherited from `Error.captureStackTrace` *** ### prepareStackTrace() > `static` **prepareStackTrace**(`err`, `stackTraces`): `any` **`Beta`** #### Parameters ##### err `Error` ##### stackTraces `CallSite`\[] #### Returns `any` #### See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces) #### Inherited from `Error.prepareStackTrace` ## 同领域相关 - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [WebSocketConnectionFailedError](/server-net/classes/WebSocketConnectionFailedError.md) - [WebSocketLimitExceededError](/server-net/classes/WebSocketLimitExceededError.md) - [HttpClient](/server-net/classes/HttpClient.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/enums/HttpRequestMethod.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/enums/HttpRequestMethod.md. # Enumeration: HttpRequestMethod network **`Beta`** ## Enumeration Members ### Delete 实验性 > **Delete**: `"Delete"` **`Beta`** #### Remarks 表示 HTTP DELETE 请求。 DELETE 通常用于描述删除指定的资源。 Represents the method for an HTTP DELETE request. DELETE requests are used to delete the specified resource from the server. *** ### Get 实验性 > **Get**: `"Get"` **`Beta`** #### Remarks 表示 HTTP GET 请求。 GET 请求通常用于获取指定资源的信息。 Represents the method for an HTTP GET request. GET requests are commonly used to retrieve data from the specified URI. *** ### Head 实验性 > **Head**: `"Head"` **`Beta`** #### Remarks 表示 HTTP HEAD 请求。 HEAD 请求类似于 GET 请求,但通常用于仅需要获取指定资源的 HTTP 响应标头,不需要获取响应主体的情况。 Represents the method for an HTTP HEAD request. HEAD requests are similar to a GET request, but are commonly used to retrieve just the HTTP response headers from the specified URI, and not the body contents. *** ### Patch 实验性 > **Patch**: `"Patch"` **`Beta`** #### Remarks 表示 HTTP PATCH 请求。PATCH 请求通常用于对资源进行部分修改。 Represents the method for an HTTP PATCH request. PATCH requests are commonly used to apply partial modifications to a resource. *** ### Post 实验性 > **Post**: `"Post"` **`Beta`** #### Remarks 表示 HTTP POST 请求。 POST 请求通常用于在指定 URI 下创建新资源。 Represents the method for an HTTP POST request. POST requests are commonly used to submit data to be processed to the specified URI. *** ### Put 实验性 > **Put**: `"Put"` **`Beta`** #### Remarks 表示 HTTP PUT 请求。 PUT 请求通常用于更新某个已存在于资源集合中的资源。 Represents the method for an HTTP PUT request. PUT requests are commonly used to update a single resource that already exists in a resource collection. ## 同领域相关 - [HttpClient](/server-net/classes/HttpClient.md) - [HttpHeader](/server-net/classes/HttpHeader.md) - [HttpRequest](/server-net/classes/HttpRequest.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpResponse](/server-net/classes/HttpResponse.md) - [HttpStatusCode](/server-net/enums/HttpStatusCode.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/enums/HttpStatusCode.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/enums/HttpStatusCode.md. # Enumeration: HttpStatusCode network **`Beta`** ## Enumeration Members ### Accepted > **Accepted**: `202` **`Beta`** *** ### AlreadyReported > **AlreadyReported**: `208` **`Beta`** *** ### BadGateway > **BadGateway**: `502` **`Beta`** *** ### BadRequest > **BadRequest**: `400` **`Beta`** *** ### ClientClosedRequest > **ClientClosedRequest**: `499` **`Beta`** *** ### ClientRequestTimeout > **ClientRequestTimeout**: `498` **`Beta`** *** ### Conflict > **Conflict**: `409` **`Beta`** *** ### ConnectionClosedWithoutResponse > **ConnectionClosedWithoutResponse**: `444` **`Beta`** *** ### Continue > **Continue**: `100` **`Beta`** *** ### Created > **Created**: `201` **`Beta`** *** ### ExpectationFailed > **ExpectationFailed**: `417` **`Beta`** *** ### FailedDependency > **FailedDependency**: `424` **`Beta`** *** ### Forbidden > **Forbidden**: `403` **`Beta`** *** ### Found > **Found**: `302` **`Beta`** *** ### GatewayTimeout > **GatewayTimeout**: `504` **`Beta`** *** ### Gone > **Gone**: `410` **`Beta`** *** ### HttpVersionNotSupported > **HttpVersionNotSupported**: `505` **`Beta`** *** ### IMUsed > **IMUsed**: `226` **`Beta`** *** ### InsufficientStorage > **InsufficientStorage**: `507` **`Beta`** *** ### InternalServerError > **InternalServerError**: `500` **`Beta`** *** ### LengthRequired > **LengthRequired**: `411` **`Beta`** *** ### Locked > **Locked**: `423` **`Beta`** *** ### LoopDetected > **LoopDetected**: `508` **`Beta`** *** ### MethodNotAllowed > **MethodNotAllowed**: `405` **`Beta`** *** ### MisdirectedRequest > **MisdirectedRequest**: `421` **`Beta`** *** ### MovedPermanently > **MovedPermanently**: `301` **`Beta`** *** ### MultipleChoices > **MultipleChoices**: `300` **`Beta`** *** ### MultiStatus > **MultiStatus**: `207` **`Beta`** *** ### NetworkAuthenticationRequired > **NetworkAuthenticationRequired**: `511` **`Beta`** *** ### NetworkConnectionTimeoutError > **NetworkConnectionTimeoutError**: `599` **`Beta`** *** ### NoContent > **NoContent**: `204` **`Beta`** *** ### NonAuthoritativeInformation > **NonAuthoritativeInformation**: `203` **`Beta`** *** ### NotAcceptable > **NotAcceptable**: `406` **`Beta`** *** ### NotExtended > **NotExtended**: `510` **`Beta`** *** ### NotFound > **NotFound**: `404` **`Beta`** *** ### NotImplemented > **NotImplemented**: `501` **`Beta`** *** ### NotModified > **NotModified**: `304` **`Beta`** *** ### OK > **OK**: `200` **`Beta`** *** ### PartialContent > **PartialContent**: `206` **`Beta`** *** ### PayloadTooLarge > **PayloadTooLarge**: `413` **`Beta`** *** ### PaymentRequired > **PaymentRequired**: `402` **`Beta`** *** ### PermanentRedirect > **PermanentRedirect**: `308` **`Beta`** *** ### PreconditionFailed > **PreconditionFailed**: `412` **`Beta`** *** ### PreconditionRequired > **PreconditionRequired**: `428` **`Beta`** *** ### Processing > **Processing**: `102` **`Beta`** *** ### ProxyAuthenticationRequired > **ProxyAuthenticationRequired**: `407` **`Beta`** *** ### RequestedRangeNotSatisfiable > **RequestedRangeNotSatisfiable**: `416` **`Beta`** *** ### RequestHeaderFieldsTooLarge > **RequestHeaderFieldsTooLarge**: `431` **`Beta`** *** ### RequestTimeout > **RequestTimeout**: `408` **`Beta`** *** ### RequestURITooLong > **RequestURITooLong**: `414` **`Beta`** *** ### ResetContent > **ResetContent**: `205` **`Beta`** *** ### SeeOther > **SeeOther**: `303` **`Beta`** *** ### ServiceUnavailable > **ServiceUnavailable**: `503` **`Beta`** *** ### SwitchingProtocols > **SwitchingProtocols**: `101` **`Beta`** *** ### TemporaryRedirect > **TemporaryRedirect**: `307` **`Beta`** *** ### TooEarly > **TooEarly**: `425` **`Beta`** *** ### TooManyRequests > **TooManyRequests**: `429` **`Beta`** *** ### Unauthorized > **Unauthorized**: `401` **`Beta`** *** ### UnavailableForLegalReasons > **UnavailableForLegalReasons**: `451` **`Beta`** *** ### UnprocessableEntity > **UnprocessableEntity**: `422` **`Beta`** *** ### UnsupportedMediaType > **UnsupportedMediaType**: `415` **`Beta`** *** ### UpgradeRequired > **UpgradeRequired**: `426` **`Beta`** *** ### UseProxy > **UseProxy**: `305` **`Beta`** *** ### VariantAlsoNegotiates > **VariantAlsoNegotiates**: `506` **`Beta`** ## 同领域相关 - [HttpClient](/server-net/classes/HttpClient.md) - [HttpHeader](/server-net/classes/HttpHeader.md) - [HttpRequest](/server-net/classes/HttpRequest.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpRequestMethod](/server-net/enums/HttpRequestMethod.md) - [HttpResponse](/server-net/classes/HttpResponse.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/enums/PacketId.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/enums/PacketId.md. # Enumeration: PacketId network **`Beta`** 表示网络数据包的唯一类型。 Represents the unique type of network packet. ## Enumeration Members ### ActorEventPacket > **ActorEventPacket**: `"ActorEventPacket"` **`Beta`** 各种实体状态变化(参见 Actor::handleEntityEvent)。 All kinds of actor state changes (see Actor::handleEntityEvent). *** ### ActorPickRequestPacket > **ActorPickRequestPacket**: `"ActorPickRequestPacket"` **`Beta`** 玩家点击世界中的某个实体,例如一只鸡。 Player clicks on an actor in the world, eg a chicken. *** ### AddActorPacket > **AddActorPacket**: `"AddActorPacket"` **`Beta`** 向客户端添加新实体(Actor)的数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/AddActorPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/AddActorPacket.html) *** ### AddBehaviorTreePacket > **AddBehaviorTreePacket**: `"AddBehaviorTreePacket"` **`Beta`** 添加行为树。 Add Behavior Tree *** ### AddItemActorPacket > **AddItemActorPacket**: `"AddItemActorPacket"` **`Beta`** 向客户端添加物品实体的数据包(用于掉落物)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/AddItemActorPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/AddItemActorPacket.html) *** ### AddPaintingPacket > **AddPaintingPacket**: `"AddPaintingPacket"` **`Beta`** 从服务端向客户端发送新的画作实体的信息。 Sends the information for a new painting actor from server to client. *** ### AddPlayerPacket > **AddPlayerPacket**: `"AddPlayerPacket"` **`Beta`** 向客户端添加玩家实体的数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/AddPlayerPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/AddPlayerPacket.html) *** ### AddVolumeEntityPacket > **AddVolumeEntityPacket**: `"AddVolumeEntityPacket"` **`Beta`** 从服务端向客户端发送体积实体的定义和组件。 Sends a volume entity's definition and components from server to client. *** ### AgentActionEventPacket > **AgentActionEventPacket**: `"AgentActionEventPacket"` **`Beta`** 包含机器人(Agent)动作类型数据的数据包。 packet containing data of Agent Action Type *** ### AgentAnimationPacket > **AgentAnimationPacket**: `"AgentAnimationPacket"` **`Beta`** 当机器人(Agent)执行动画时广播给其他玩家,以便正确同步。 Broadcasted to other players when an Agent performs an animation so it gets properly replicated. *** ### AnimateEntityPacket > **AnimateEntityPacket**: `"AnimateEntityPacket"` **`Beta`** AnimateEntityPacket 用于在其发送到的客户端上触发一次性动画。 The AnimateEntityPacket is used to trigger a one - off animation on the client it is sent to. *** ### AnimatePacket > **AnimatePacket**: `"AnimatePacket"` **`Beta`** 播放实体动画。 Animate Actor *** ### AnvilDamagePacket > **AnvilDamagePacket**: `"AnvilDamagePacket"` **`Beta`** 请求使铁砧受损。 Requests an anvil to be damaged. *** ### AutomationClientConnectPacket > **AutomationClientConnectPacket**: `"AutomationClientConnectPacket"` **`Beta`** 发起 websocket 连接。 Initiates websocket connection *** ### AvailableActorIdentifiersPacket > **AvailableActorIdentifiersPacket**: `"AvailableActorIdentifiersPacket"` **`Beta`** 在游戏开始时从服务端发送完整的实体标识符列表。 Sends the whole list of actor identifiers at game start from the server. *** ### AvailableCommandsPacket > **AvailableCommandsPacket**: `"AvailableCommandsPacket"` **`Beta`** 包含所有可用的命令。 Contains all the available commands. *** ### AwardAchievementPacket > **AwardAchievementPacket**: `"AwardAchievementPacket"` **`Beta`** 包含要授予的成就的 ID。 Contains the ID of the achievement to award *** ### BiomeDefinitionListPacket > **BiomeDefinitionListPacket**: `"BiomeDefinitionListPacket"` **`Beta`** 在世界开始时,向客户端发送所有可用生物群系的信息。 On world start, send clients the info for all available biomes. *** ### BlockActorDataPacket > **BlockActorDataPacket**: `"BlockActorDataPacket"` **`Beta`** 向客户端发送完整的用户数据复合标签以及方块坐标。 Sends the entire user data compound tag and the block position to the client. *** ### BlockEventPacket > **BlockEventPacket**: `"BlockEventPacket"` **`Beta`** 每当发生方块事件时,从服务端发送以同步客户端与服务端,b0 和 b1 中携带任意编码的信息。 Whenever a block event happens it is sent from the server to sync client and server, with arbitrarily encoded information in b0 and b1. *** ### BlockPickRequestPacket > **BlockPickRequestPacket**: `"BlockPickRequestPacket"` **`Beta`** 玩家在世界中拾取方块;由客户端发往服务端。 Player picks up a block in the world; client to server. *** ### BookEditPacket > **BookEditPacket**: `"BookEditPacket"` **`Beta`** 在使用过程中,从客户端向服务端发送成书与笔物品的更新状态。 Sends the updated state of the Book and Quill item from client to server during use. *** ### BossEventPacket > **BossEventPacket**: `"BossEventPacket"` **`Beta`** 当 Boss 更新时发送。 Sent when a boss gets updated *** ### CameraAimAssistActorPriorityPacket > **CameraAimAssistActorPriorityPacket**: `"CameraAimAssistActorPriorityPacket"` **`Beta`** 由服务端向客户端发送的摄像机瞄准辅助实体优先级数据。 Camera aim-assist actor priority data sent from the server to clients. *** ### CameraAimAssistPacket > **CameraAimAssistPacket**: `"CameraAimAssistPacket"` **`Beta`** 摄像机瞄准辅助。 CameraAimAssist *** ### CameraAimAssistPresetsPacket > **CameraAimAssistPresetsPacket**: `"CameraAimAssistPresetsPacket"` **`Beta`** 由服务端向客户端发送的摄像机瞄准辅助注册表预设/分类数据。 Camera aim-assist registry presets/categories data sent from the server to clients. *** ### CameraInstructionPacket > **CameraInstructionPacket**: `"CameraInstructionPacket"` **`Beta`** 用于从服务端向指定客户端发送摄像机指令(CameraInstruction)。 Used to send a CameraInstruction from the server to the specified clients. *** ### CameraPacket > **CameraPacket**: `"CameraPacket"` **`Beta`** 仅在教育版中通过三脚架相机物品或 TakePictureCommand 使用。从服务端发送相机实体 id 和目标玩家 id。 Used only in EDU through the tripod camera item or the TakePictureCommand. Sends the camera actor id and the target player id from the server. *** ### CameraPresetsPacket > **CameraPresetsPacket**: `"CameraPresetsPacket"` **`Beta`** 用于从服务端向客户端同步摄像机预设(CameraPresets)数据。 Used to sync CameraPresets data from server to clients. *** ### CameraShakePacket > **CameraShakePacket**: `"CameraShakePacket"` **`Beta`** 用于控制并触发客户端玩家摄像机的镜头晃动效果。 Used to control trigger camera shake movements on the client's player camera *** ### CameraSplinePacket > **CameraSplinePacket**: `"CameraSplinePacket"` **`Beta`** 由服务端向客户端发送的摄像机自定义样条数据。 Camera custom spline data sent from server to client. *** ### ChangeDimensionPacket > **ChangeDimensionPacket**: `"ChangeDimensionPacket"` **`Beta`** 服务端从世界发送此数据包以启动维度切换流程。 The server sends this packet from the level to kick off dimension changing process. *** ### ChangeMobPropertyPacket > **ChangeMobPropertyPacket**: `"ChangeMobPropertyPacket"` **`Beta`** 包含用于更改生物属性的数据的数据包。 packet containing data for changing mob property *** ### ChunkRadiusUpdatedPacket > **ChunkRadiusUpdatedPacket**: `"ChunkRadiusUpdatedPacket"` **`Beta`** 在世界加载时发送。我们不清楚为何会发送四次。用于定义刻距离(tick distance)。 Sent when the world is loading. We don't know why it is sent four times. Defines the tick distance. *** ### ClientboundAttributeLayerSyncPacket > **ClientboundAttributeLayerSyncPacket**: `"ClientboundAttributeLayerSyncPacket"` **`Beta`** 将属性层同步到客户端(当前已禁用)。 Syncs Attribute Layers to the Client (Currently disabled) *** ### ClientboundCloseFormPacket > **ClientboundCloseFormPacket**: `"ClientboundCloseFormPacket"` **`Beta`** 从服务端发送到客户端,用于强制关闭栈中所有服务端表单并返回 HUD 界面。 Sent from the server to client to force close all server forms on the stack and return to the HUD screen. *** ### ClientboundControlSchemeSetPacket > **ClientboundControlSchemeSetPacket**: `"ClientboundControlSchemeSetPacket"` **`Beta`** 设置玩家应使用的操作方案。 Set the control scheme that the player should use *** ### ClientboundDataDrivenUICloseScreenPacket > **ClientboundDataDrivenUICloseScreenPacket**: `"ClientboundDataDrivenUICloseScreenPacket"` **`Beta`** 允许服务端告知客户端关闭数据驱动 UI 界面。 Allows the server to tell the client to close Data Driven UI screens. *** ### ClientboundDataDrivenUIReloadPacket > **ClientboundDataDrivenUIReloadPacket**: `"ClientboundDataDrivenUIReloadPacket"` **`Beta`** 允许服务端告知客户端重新加载数据驱动 UI。 Allows the server to tell the client to reload the Data Driven UI. *** ### ClientboundDataDrivenUIShowScreenPacket > **ClientboundDataDrivenUIShowScreenPacket**: `"ClientboundDataDrivenUIShowScreenPacket"` **`Beta`** 允许服务端告知客户端显示数据驱动 UI 界面。 Allows the server to tell the client to show a Data Driven UI screen. *** ### ClientboundDataStorePacket > **ClientboundDataStorePacket**: `"ClientboundDataStorePacket"` **`Beta`** 从服务端向客户端发送一组数据存储属性。 Sends a list of data store properties from the server to the client. *** ### ClientboundDebugRendererPacket > **ClientboundDebugRendererPacket**: `"ClientboundDebugRendererPacket"` **`Beta`** 用于添加/移除调试渲染对象。 Used to add/remove debug rendering objects. *** ### ClientboundMapItemDataPacket > **ClientboundMapItemDataPacket**: `"ClientboundMapItemDataPacket"` **`Beta`** 服务端→客户端的地图物品数据包(MapItemDataPacket)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/ClientboundMapItemDataPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/ClientboundMapItemDataPacket.html) *** ### ClientboundTextureShiftPacket > **ClientboundTextureShiftPacket**: `"ClientboundTextureShiftPacket"` **`Beta`** 从服务端向客户端发送纹理偏移系统的一组更新属性。 Sends a set of update properties for the texture shift system from the server to the client. *** ### ClientboundUpdateSoundDataPacket > **ClientboundUpdateSoundDataPacket**: `"ClientboundUpdateSoundDataPacket"` **`Beta`** 用于更新声音数据。 Sent to update sound data. *** ### ClientCacheBlobStatusPacket > **ClientCacheBlobStatusPacket**: `"ClientCacheBlobStatusPacket"` **`Beta`** 客户端缓存 Blob 状态数据包。 Client Cache Blob Status Packet *** ### ClientCacheMissResponsePacket > **ClientCacheMissResponsePacket**: `"ClientCacheMissResponsePacket"` **`Beta`** 仅在真实的客户端-服务端场景中生效。此数据包只是从服务端发送到客户端的一组 \ 键值对列表。 Only active in a real client-server scenario. This packet is just a list of \ pairs sent from server to client. *** ### ClientCacheStatusPacket > **ClientCacheStatusPacket**: `"ClientCacheStatusPacket"` **`Beta`** 由客户端在登录时发送一次,用于告知是否支持缓存。 It is sent by the Client once, at login, to communicate if it supports the cache or not. *** ### ClientCameraAimAssistPacket > **ClientCameraAimAssistPacket**: `"ClientCameraAimAssistPacket"` **`Beta`** 客户端激活瞄准辅助。 Client-side activation of aim-assist *** ### ClientMovementPredictionSyncPacket > **ClientMovementPredictionSyncPacket**: `"ClientMovementPredictionSyncPacket"` **`Beta`** 向服务端发送客户端移动预测信息。 Sends client movement prediction information to the server *** ### ClientToServerHandshakePacket > **ClientToServerHandshakePacket**: `"ClientToServerHandshakePacket"` **`Beta`** 在教育版中,由客户端在世界启动时发送一次,用于建立加密并进行身份验证。 Sets up encryption and authenticates in educational version once at level startup from client. *** ### CodeBuilderPacket > **CodeBuilderPacket**: `"CodeBuilderPacket"` **`Beta`** Code Builder 数据包。 Code Builder Packet *** ### CodeBuilderSourcePacket > **CodeBuilderSourcePacket**: `"CodeBuilderSourcePacket"` **`Beta`** 这是教育版专用,用于 WebviewSystem 的 getInterface()。 This is EDU exclusive, used in getInterface() of WebviewSystem *** ### CommandBlockUpdatePacket > **CommandBlockUpdatePacket**: `"CommandBlockUpdatePacket"` **`Beta`** 命令方块更新。 Command Block Update *** ### CommandOutputPacket > **CommandOutputPacket**: `"CommandOutputPacket"` **`Beta`** “斜杠”命令的执行输出,由服务端发往客户端。 "slash" command execution output, server to client. *** ### CommandRequestPacket > **CommandRequestPacket**: `"CommandRequestPacket"` **`Beta`** “斜杠”命令的执行,由客户端发往服务端。 "slash" command execution, client to server. *** ### CompletedUsingItemPacket > **CompletedUsingItemPacket**: `"CompletedUsingItemPacket"` **`Beta`** 从服务端发往客户端,用于完成物品使用流程。例如当你喝完或吃完时。 Send server to client to complete the using item process. An example is when you finish drinking or eating. *** ### ContainerClosePacket > **ContainerClosePacket**: `"ContainerClosePacket"` **`Beta`** 当游戏在客户端删除容器管理器后,客户端会发送此数据包。 随后服务端删除其容器管理器,并向客户端发回一个关闭容器界面的数据包。 After the game deletes the container manager on the client, the client sends this packet. Then the server deletes its container manager, and sends a packet back to the client that closes the container screen. *** ### ContainerOpenPacket > **ContainerOpenPacket**: `"ContainerOpenPacket"` **`Beta`** 从服务端发送,以便客户端知道要打开容器界面并播放箱子打开动画。 Sent from the server so that the client knows to open the container screen and do the chest opening animation. *** ### ContainerRegistryCleanupPacket > **ContainerRegistryCleanupPacket**: `"ContainerRegistryCleanupPacket"` **`Beta`** 用于触发客户端对动态容器注册表的清理。 This is used to trigger a clientside cleanup of the dynamic container registry. *** ### ContainerSetDataPacket > **ContainerSetDataPacket**: `"ContainerSetDataPacket"` **`Beta`** 基本上,每当酿造台或熔炉的“烹饪”状态发生变化(即加载进度条)时,都会从服务端发送此数据包。 This is sent from the server basically any time that the "cooking" state of the brewing stand or the furnace changes (i.e. the loading bar) *** ### CorrectPlayerMovePredictionPacket > **CorrectPlayerMovePredictionPacket**: `"CorrectPlayerMovePredictionPacket"` **`Beta`** 当玩家的移动模拟与服务端偏差过大、服务端需要纠正客户端时,发送给该玩家。 Sent to a player when their simulation of movement mismatches enough from the server that it wants to correct the client. *** ### CraftingDataPacket > **CraftingDataPacket**: `"CraftingDataPacket"` **`Beta`** 客户端向服务端发送的合成数据包(含配方、容器类型等)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/CraftingDataPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/CraftingDataPacket.html) *** ### CreatePhotoPacket > **CreatePhotoPacket**: `"CreatePhotoPacket"` **`Beta`** 玩家现在可以将作品集中的照片导出为其物品栏中的照片物品。教育版。 Players now have the possibility to export photos from their portfolios into photo items in their inventory. EDU. *** ### CreativeContentPacket > **CreativeContentPacket**: `"CreativeContentPacket"` **`Beta`** 发送给客户端以同步创造模式物品栏内容的数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/CreativeContentPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/CreativeContentPacket.html) *** ### CurrentStructureFeaturePacket > **CurrentStructureFeaturePacket**: `"CurrentStructureFeaturePacket"` **`Beta`** 告知客户端玩家当前所处的结构特征(Structure Feature)。 Informs the client of which Structure Feature they are currently occupying. *** ### DeathInfoPacket > **DeathInfoPacket**: `"DeathInfoPacket"` **`Beta`** 当玩家死亡时从服务端发送到客户端(Level::onPlayerDeath)。 Sent from the server to client when player dies (Level::onPlayerDeath). *** ### DebugInfoPacket > **DebugInfoPacket**: `"DebugInfoPacket"` **`Beta`** 系统通过一个通用网络数据包发送调试信息。这使得任何服务端信息都能在客户端上(例如在 ImGui 中)渲染。 The system sends debug information via a generic network packet. This enables rendering of any server information on the client in for instance ImGui. *** ### DimensionDataPacket > **DimensionDataPacket**: `"DimensionDataPacket"` **`Beta`** 用于同步世界维度(Dimension)数据的数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/DimensionDataPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/DimensionDataPacket.html) *** ### DisconnectPacket > **DisconnectPacket**: `"DisconnectPacket"` **`Beta`** 从服务端发送到客户端以触发断开连接。 Sent from the server to a client to trigger a disconnection. *** ### EditorNetworkPacket > **EditorNetworkPacket**: `"EditorNetworkPacket"` **`Beta`** 通用的编辑器专用数据包——携带由各个 IEditorNetworkPayload 生成的任意序列化数据作为载荷。 General use Editor specific packet - carries a payload of whatever serialized data that the individual IEditorNetworkPayload generates. #### See [https://mojang.github.io/bedrock-protocol-docs/html/EditorNetworkPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/EditorNetworkPacket.html) *** ### EducationSettingsPacket > **EducationSettingsPacket**: `"EducationSettingsPacket"` **`Beta`** 向所有客户端传输 EducationLevelSettings。 Transmits EducationLevelSettings to all clients. *** ### EduUriResourcePacket > **EduUriResourcePacket**: `"EduUriResourcePacket"` **`Beta`** 向所有客户端传输教育版共享 URI 资源设置。 Transmits Edu Shared Uri Resource settings to all clients. *** ### EmoteListPacket > **EmoteListPacket**: `"EmoteListPacket"` **`Beta`** 允许客户端下载其他客户端已装备的表情动作。 Allows clients to download emotes that other clients have equipped. *** ### EmotePacket > **EmotePacket**: `"EmotePacket"` **`Beta`** 客户端将此发送给服务端,以将表情动作通知其他客户端。 A client sends this to the server to notify other clients about the emote. *** ### FeatureRegistryPacket > **FeatureRegistryPacket**: `"FeatureRegistryPacket"` **`Beta`** 此数据包用于跟踪来自服务端的激活特征注册表数据,以便客户端能够自行放置这些特征。 This is the packet that tracks the active feature registry data from the server so that client can place the features themselves. *** ### GameRulesChangedPacket > **GameRulesChangedPacket**: `"GameRulesChangedPacket"` **`Beta`** 更新游戏规则。 Updates game rules. *** ### GameTestRequestPacket > **GameTestRequestPacket**: `"GameTestRequestPacket"` **`Beta`** 内部文本数据包。 Internal Text Packet *** ### GameTestResultsPacket > **GameTestResultsPacket**: `"GameTestResultsPacket"` **`Beta`** 游戏测试结果数据包。 Game Test Results Packet *** ### GraphicsOverrideParameterPacket > **GraphicsOverrideParameterPacket**: `"GraphicsOverrideParameterPacket"` **`Beta`** 当服务端脚本更改渲染设置时,从服务端发送到客户端。 Sent from the server to the client when a server script changes the rendering settings *** ### GuiDataPickItemPacket > **GuiDataPickItemPacket**: `"GuiDataPickItemPacket"` **`Beta`** 服务端告知客户端在快捷栏中悬停于哪个物品槽。 The server telling the client what item slot to hover over in the hotbar. *** ### HurtArmorPacket > **HurtArmorPacket**: `"HurtArmorPacket"` **`Beta`** 护甲受损。 Hurt Armor *** ### InteractPacket > **InteractPacket**: `"InteractPacket"` **`Beta`** 交互。 Interact *** ### InventoryContentPacket > **InventoryContentPacket**: `"InventoryContentPacket"` **`Beta`** 用于更新整个容器。示例用途包括:玩家重生、replace 物品命令、第三方内容调用 sendInventory()、方块拾取。 This is used for updating an entire container. Example uses include: player respawned, replace items command, 3rd party content calls sendInventory(), block picking. *** ### InventorySlotPacket > **InventorySlotPacket**: `"InventorySlotPacket"` **`Beta`** 更新容器中的单个槽位,而不是整个容器。例如动物物品栏(马、驴等)和箱子。也包括快捷栏、副手以及部分玩家物品栏的变化。 Updates one slot in an inventory rather than the whole thing. So like animal inventory (horses, donkeys, etc) and chests. Hotbar, offhand, and some player inventory changes. *** ### InventoryTransactionPacket > **InventoryTransactionPacket**: `"InventoryTransactionPacket"` **`Beta`** 物品栏事务。根据是否启用 ItemStackNetManager,在物品交互 UI 时发送,以及在玩家于游戏中使用物品时发送。更多细节参见 ComplexInventoryTransaction::Type。 Inventory Transaction. Sent for item interaction UI depending on if ItemStackNetManager is enabled as well as when the player uses items in gameplay. See ComplexInventoryTransaction::Type for more details. *** ### ItemRegistryPacket > **ItemRegistryPacket**: `"ItemRegistryPacket"` **`Beta`** 来自服务端的物品数据。包含组件信息。 Item data from the server. Contains component information. *** ### ItemStackRequestPacket > **ItemStackRequestPacket**: `"ItemStackRequestPacket"` **`Beta`** 客户端→服务端:物品栈请求数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/ItemStackRequestPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/ItemStackRequestPacket.html) *** ### ItemStackResponsePacket > **ItemStackResponsePacket**: `"ItemStackResponsePacket"` **`Beta`** 服务端→客户端:物品栈响应数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/ItemStackResponsePacket.html](https://mojang.github.io/bedrock-protocol-docs/html/ItemStackResponsePacket.html) *** ### JigsawStructureDataPacket > **JigsawStructureDataPacket**: `"JigsawStructureDataPacket"` **`Beta`** 供客户端拼图结构世界生成使用的拼图结构数据。此数据包包含行为包拼图结构规则的一份副本。 Jigsaw Structure data used by client jigsaw structure worldgen. This packet contains a copy of the behavior pack jigsaw structure rules. *** ### LabTablePacket > **LabTablePacket**: `"LabTablePacket"` **`Beta`** 用于教育版化学实验台方块实体。 For the EDU Chemistry Lab Table block actor. *** ### LecternUpdatePacket > **LecternUpdatePacket**: `"LecternUpdatePacket"` **`Beta`** 用于讲台方块实体。 This is used for the Lectern Block Actor. *** ### LegacyTelemetryEventPacket > **LegacyTelemetryEventPacket**: `"LegacyTelemetryEventPacket"` **`Beta`** 向客户端发送遥测事件,以便客户端将其转发到事件系统。 Sends telemetry events to the client so the client can then send that on to the eventing system *** ### LessonProgressPacket > **LessonProgressPacket**: `"LessonProgressPacket"` **`Beta`** 课程进度。 Lesson Progress *** ### LevelChunkPacket > **LevelChunkPacket**: `"LevelChunkPacket"` **`Beta`** 用于向客户端发送世界区块数据的数据包(LevelChunkPacket)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/LevelChunkPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/LevelChunkPacket.html) *** ### LevelEventGenericPacket > **LevelEventGenericPacket**: `"LevelEventGenericPacket"` **`Beta`** 通用世界事件数据包(LevelEventGenericPacket)。 LevelEventGenericPacket *** ### LevelEventPacket > **LevelEventPacket**: `"LevelEventPacket"` **`Beta`** 喷溅药水、天气事件、全局暂停、simlock 命令,应有尽有! Splash Potions, weather events, global pause, simlock commands, oh my! *** ### LevelSoundEventPacket > **LevelSoundEventPacket**: `"LevelSoundEventPacket"` **`Beta`** 世界声音事件。 Level Sound Event *** ### LocatorBarPacket > **LocatorBarPacket**: `"LocatorBarPacket"` **`Beta`** 将服务端上的定位栏(LocatorBar)变化同步到客户端。 Syncs LocatorBar changes on the server with the client. *** ### LoginPacket > **LoginPacket**: `"LoginPacket"` **`Beta`** 在登录时由客户端向服务端发送一次。大约 100k。 Sent once from client to server at login. About 100k. *** ### MapCreateLockedCopyPacket > **MapCreateLockedCopyPacket**: `"MapCreateLockedCopyPacket"` **`Beta`** 当用户在游戏中使用制图台锁定地图物品时触发。 This is fired when the user locks a map item utilizing the Cartography Table in game. *** ### MapInfoRequestPacket > **MapInfoRequestPacket**: `"MapInfoRequestPacket"` **`Beta`** 当客户端无法找到某地图物品的地图数据时,它会向服务端发送该地图的 uuid。 In the case of the client being unable to find map data for a map item it sends a uuid for a map to the server. *** ### MobArmorEquipmentPacket > **MobArmorEquipmentPacket**: `"MobArmorEquipmentPacket"` **`Beta`** 生物护甲装备。 Mob Armor Equipment *** ### MobEffectPacket > **MobEffectPacket**: `"MobEffectPacket"` **`Beta`** 生物效果。 Mob Effect *** ### MobEquipmentPacket > **MobEquipmentPacket**: `"MobEquipmentPacket"` **`Beta`** 生物装备。任何生物的手持/副手物品变化都会通过此数据包从服务端发往客户端。当客户端的手持槽位或其内容变化时,也会将此发送给服务端。 Mob Equipment. Changes to any mob's held/offhand item are fired from server to client with this packet. Clients also send this to the server when their held slot or its contents change. *** ### ModalFormRequestPacket > **ModalFormRequestPacket**: `"ModalFormRequestPacket"` **`Beta`** 模态表单请求。 Modal Form Request *** ### ModalFormResponsePacket > **ModalFormResponsePacket**: `"ModalFormResponsePacket"` **`Beta`** 响应第三方服务端请求以显示自定义 UI 界面时触发。 Fired in response to third party server request to show the custom UI screen. *** ### MotionPredictionHintsPacket > **MotionPredictionHintsPacket**: `"MotionPredictionHintsPacket"` **`Beta`** 它本质上是一个 SetActionMotionPacket,附带一个布尔值,指示在数据包发送时实体是否在地面上。 It is essentially a SetActionMotionPacket with a bool indicating if the actor was on the ground at the time the packet is sent or not. *** ### MoveActorAbsolutePacket > **MoveActorAbsolutePacket**: `"MoveActorAbsolutePacket"` **`Beta`** 主要用于从服务端向客户端更新所有实体的运动。 This is used primarily for motion updates of all actors from server to client. *** ### MoveActorDeltaPacket > **MoveActorDeltaPacket**: `"MoveActorDeltaPacket"` **`Beta`** 向客户端发送实体增量移动信息的数据包(MoveActorDeltaPacket)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/MoveActorDeltaPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/MoveActorDeltaPacket.html) *** ### MovementEffectPacket > **MovementEffectPacket**: `"MovementEffectPacket"` **`Beta`** 这些数据包发送到客户端,用于更新特定的移动效果(MovementEffects)。 These packets are sent to the client to update specific MovementEffects *** ### MovePlayerPacket > **MovePlayerPacket**: `"MovePlayerPacket"` **`Beta`** 向客户端发送玩家移动信息的数据包(MovePlayerPacket)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/MovePlayerPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/MovePlayerPacket.html) *** ### MultiplayerSettingsPacket > **MultiplayerSettingsPacket**: `"MultiplayerSettingsPacket"` **`Beta`** 同步多人游戏设置。 Syncs multiplayer settings *** ### NetworkChunkPublisherUpdatePacket > **NetworkChunkPublisherUpdatePacket**: `"NetworkChunkPublisherUpdatePacket"` **`Beta`** 告知客户端为本地玩家更新区块视野。 Tells clients to update the chunk view for the local player. *** ### NetworkSettingsPacket > **NetworkSettingsPacket**: `"NetworkSettingsPacket"` **`Beta`** 从主机向客户端发送可调选项(压缩阈值和算法)。 Sends tunable options from host to client (compression threshold and algorithm) *** ### NetworkStackLatencyPacket > **NetworkStackLatencyPacket**: `"NetworkStackLatencyPacket"` **`Beta`** Ping 数据包。 Ping Packet *** ### NpcDialoguePacket > **NpcDialoguePacket**: `"NpcDialoguePacket"` **`Beta`** 当为客户端远程触发 NPC 对话窗口时,从服务端发送到客户端。 Sent from the server to client when remote firing an NPC dialogue window for a client *** ### NpcRequestPacket > **NpcRequestPacket**: `"NpcRequestPacket"` **`Beta`** 用于与 NPC 组件的多种交互。 Used for a number of interactions with the NPC Component *** ### OnScreenTextureAnimationPacket > **OnScreenTextureAnimationPacket**: `"OnScreenTextureAnimationPacket"` **`Beta`** 屏幕纹理动画。 On-Screen Texture Animation *** ### OpenSignPacket > **OpenSignPacket**: `"OpenSignPacket"` **`Beta`** 从服务端发送,以便客户端知道要打开告示牌界面。 Sent from the server so that the client knows to open the sign screen. *** ### PacketViolationWarningPacket > **PacketViolationWarningPacket**: `"PacketViolationWarningPacket"` **`Beta`** 当客户端检测到格式错误的数据包时发送。 This is sent when the client detects a malformed packet *** ### PartyChangedPacket > **PartyChangedPacket**: `"PartyChangedPacket"` **`Beta`** 由客户端发送,以提供额外的客户端元数据。 Sent by the client to provide additional client metadata. *** ### PartyDestinationCookieResponsePacket > **PartyDestinationCookieResponsePacket**: `"PartyDestinationCookieResponsePacket"` **`Beta`** 由客户端发送到服务端,携带队伍目的地 cookie 响应。 Sent by the client to the server with a party destination cookie response. *** ### PhotoTransferPacket > **PhotoTransferPacket**: `"PhotoTransferPacket"` **`Beta`** 教育版中有一个相机物品,玩家可以用它截图并添加到剪贴簿中。 There is a camera item in EDU and they can use it to take screenshots and add them to a scrapbook. *** ### PlayerActionPacket > **PlayerActionPacket**: `"PlayerActionPacket"` **`Beta`** 每当玩家执行动作(冲刺、停止冲刺、使用物品、挖掘/攻击、使用方块等)时,从客户端发送。 Sent from the client whenever the player performs an action (dashing, un-dashing, use an item, mine/hit, use a block, etc). *** ### PlayerArmorDamagePacket > **PlayerArmorDamagePacket**: `"PlayerArmorDamagePacket"` **`Beta`** 每当玩家的护甲受到伤害时,从服务端发送。 Sent from server whenever the player's armor takes damage. *** ### PlayerAuthInputPacket > **PlayerAuthInputPacket**: `"PlayerAuthInputPacket"` **`Beta`** 客户端→服务端:玩家权威输入数据包(PlayerAuthInputPacket)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/PlayerAuthInputPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/PlayerAuthInputPacket.html) *** ### PlayerEnchantOptionsPacket > **PlayerEnchantOptionsPacket**: `"PlayerEnchantOptionsPacket"` **`Beta`** 当玩家右键点击附魔台时,从服务端发送新的附魔选项。 Sends the of new Enchanting options from the server when a player right clicks the enchantment table. *** ### PlayerFogPacket > **PlayerFogPacket**: `"PlayerFogPacket"` **`Beta`** 玩家迷雾数据包。 Player Fog Packet *** ### PlayerHotbarPacket > **PlayerHotbarPacket**: `"PlayerHotbarPacket"` **`Beta`** 当玩家对实体或方块使用选取方块时,以及玩家使用 clear、give 或 replace 物品命令,或服务端玩家使用 \_sendAdditionalLevelData() 时,从服务端发送。 Sent from the server when the player uses pick block on actors or blocks, in addition to the player uses the clear, give, or replace item command or if the serverplayer uses \_sendAdditionalLevelData(). *** ### PlayerListPacket > **PlayerListPacket**: `"PlayerListPacket"` **`Beta`** 用于同步玩家在线列表的数据包(PlayerListPacket)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/PlayerListPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/PlayerListPacket.html) *** ### PlayerLocationPacket > **PlayerLocationPacket**: `"PlayerLocationPacket"` **`Beta`** 用于上报玩家位置的数据包(PlayerLocationPacket)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/PlayerLocationPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/PlayerLocationPacket.html) *** ### PlayerSkinPacket > **PlayerSkinPacket**: `"PlayerSkinPacket"` **`Beta`** 当玩家更换皮肤时使用。 Used when the player changes their skin #### See [https://mojang.github.io/bedrock-protocol-docs/html/PlayerSkinPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/PlayerSkinPacket.html) *** ### PlayerStartItemCooldownPacket > **PlayerStartItemCooldownPacket**: `"PlayerStartItemCooldownPacket"` **`Beta`** 玩家开始物品冷却。 Player Start Item Cooldown *** ### PlayerToggleCrafterSlotRequestPacket > **PlayerToggleCrafterSlotRequestPacket**: `"PlayerToggleCrafterSlotRequestPacket"` **`Beta`** 玩家切换合成器槽位请求数据包(PlayerToggleCrafterSlotRequestPacket)。 PlayerToggleCrafterSlotRequestPacket *** ### PlayerUpdateEntityOverridesPacket > **PlayerUpdateEntityOverridesPacket**: `"PlayerUpdateEntityOverridesPacket"` **`Beta`** 用于更新实体覆盖(overrides)的玩家相关数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/PlayerUpdateEntityOverridesPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/PlayerUpdateEntityOverridesPacket.html) *** ### PlaySoundPacket > **PlaySoundPacket**: `"PlaySoundPacket"` **`Beta`** 此数据包仅通过命令或脚本事件使用。用于第三方内容。 This packet is only used via command or script event. This is for 3rd party content. *** ### PlayStatusPacket > **PlayStatusPacket**: `"PlayStatusPacket"` **`Beta`** 描述玩家的登录状态。 Describes the login status of the player *** ### PositionTrackingDBClientRequestPacket > **PositionTrackingDBClientRequestPacket**: `"PositionTrackingDBClientRequestPacket"` **`Beta`** 位置跟踪数据库客户端请求。 Position Tracking DB Client Request *** ### PositionTrackingDBServerBroadcastPacket > **PositionTrackingDBServerBroadcastPacket**: `"PositionTrackingDBServerBroadcastPacket"` **`Beta`** 用于服务端权威运行时数据库(带持久化 LevelStorage 备份)的服务端到客户端数据包,主要用于跟踪磁石相关内容。参见 bedrock-docs 中的 Position Tracking DB Notes.md。 Server to client packet for server authoratative runtime database (with persistent LevelStorage backup) designed primarily to track lodestone stuff. See Position Tracking DB Notes.md in bedrock-docs. *** ### PrimitiveShapesPacket > **PrimitiveShapesPacket**: `"PrimitiveShapesPacket"` **`Beta`** 将基本绘制形状信息(来自脚本)发送到客户端进行渲染。 Send primitive drawing shape info (from scripting) to the client for rendering *** ### PurchaseReceiptPacket > **PurchaseReceiptPacket**: `"PurchaseReceiptPacket"` **`Beta`** 从客户端发送到服务端。 Sent from client to server *** ### RefreshEntitlementsPacket > **RefreshEntitlementsPacket**: `"RefreshEntitlementsPacket"` **`Beta`** 刷新权益。 Refresh Entitlements *** ### RemoveActorPacket > **RemoveActorPacket**: `"RemoveActorPacket"` **`Beta`** 偶尔,在服务端玩家刻处理期间会花一些时间将附近的实体从世界中移除。 Occasionally, during the server player tick some time is taken to remove nearby actors from the world. *** ### RemoveObjectivePacket > **RemoveObjectivePacket**: `"RemoveObjectivePacket"` **`Beta`** 用户可以使用 scoreboard 命令移除计分板上跟踪的记分项。 Using the scoreboard command, users can remove objectives that are tracked on the scoreboard. *** ### RemoveVolumeEntityPacket > **RemoveVolumeEntityPacket**: `"RemoveVolumeEntityPacket"` **`Beta`** 从服务端向客户端发送要移除的体积实体。 Sends a volume entity to be removed from server to client. *** ### RequestAbilityPacket > **RequestAbilityPacket**: `"RequestAbilityPacket"` **`Beta`** 从客户端发送到服务端。用于请求更改能力。 Sent from client to server. Used to request an ability change. *** ### RequestChunkRadiusPacket > **RequestChunkRadiusPacket**: `"RequestChunkRadiusPacket"` **`Beta`** 客户端不能在未经服务端批准的情况下直接更改视野半径,否则未渲染区域可能会出现空洞。 The client can't just change the view radius without the server's approval, otherwise there could be holes on unrendered area. *** ### RequestNetworkSettingsPacket > **RequestNetworkSettingsPacket**: `"RequestNetworkSettingsPacket"` **`Beta`** 从主机向客户端请求可调选项(压缩阈值和算法)。 Requests tunable options from host to client (compression threshold and algorithm). *** ### RequestPermissionsPacket > **RequestPermissionsPacket**: `"RequestPermissionsPacket"` **`Beta`** 从客户端发送到服务端。用于请求新的权限等级。 Sent from client to server. Used to request a new Permissions Levels. *** ### ResourcePackChunkDataPacket > **ResourcePackChunkDataPacket**: `"ResourcePackChunkDataPacket"` **`Beta`** 资源包分块数据。 Resource Pack Chunk Data *** ### ResourcePackChunkRequestPacket > **ResourcePackChunkRequestPacket**: `"ResourcePackChunkRequestPacket"` **`Beta`** 资源包分块请求。 Resource Pack Chunk Request *** ### ResourcePackClientResponsePacket > **ResourcePackClientResponsePacket**: `"ResourcePackClientResponsePacket"` **`Beta`** 客户端→服务端:资源包响应数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/ResourcePackClientResponsePacket.html](https://mojang.github.io/bedrock-protocol-docs/html/ResourcePackClientResponsePacket.html) *** ### ResourcePackDataInfoPacket > **ResourcePackDataInfoPacket**: `"ResourcePackDataInfoPacket"` **`Beta`** 资源包数据信息。 Resource Pack Data Info *** ### ResourcePacksInfoPacket > **ResourcePacksInfoPacket**: `"ResourcePacksInfoPacket"` **`Beta`** 用于向客户端发送资源包清单信息的数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/ResourcePacksInfoPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/ResourcePacksInfoPacket.html) *** ### ResourcePacksReadyForValidationPacket > **ResourcePacksReadyForValidationPacket**: `"ResourcePacksReadyForValidationPacket"` **`Beta`** 用于通知服务端客户端已完成加载所有资源包。 Used to inform the server that the client has finished loading all resource packs. *** ### ResourcePackStackPacket > **ResourcePackStackPacket**: `"ResourcePackStackPacket"` **`Beta`** 资源包栈。 Resource Pack Stack *** ### RespawnPacket > **RespawnPacket**: `"RespawnPacket"` **`Beta`** 作为客户端与服务端之间的握手发送,用于使玩家重生。 Sent as a handshake between the client and server to respawn the player. *** ### ScriptMessagePacket > **ScriptMessagePacket**: `"ScriptMessagePacket"` **`Beta`** 用于在客户端与服务端之间发送自定义消息。 Used to send custom messages between client and server. *** ### SendPartyDestinationCookiePacket > **SendPartyDestinationCookiePacket**: `"SendPartyDestinationCookiePacket"` **`Beta`** 由服务端发送到客户端,携带队伍目的地 cookie。 Sent by the server to a client with a party destination cookie. *** ### ServerboundDataDrivenScreenClosedPacket > **ServerboundDataDrivenScreenClosedPacket**: `"ServerboundDataDrivenScreenClosedPacket"` **`Beta`** 当数据驱动界面关闭时,从客户端发送到服务端。 Sent from the client to the server when a data driven screen is closed. *** ### ServerboundDataStorePacket > **ServerboundDataStorePacket**: `"ServerboundDataStorePacket"` **`Beta`** 从客户端向服务端数据存储应用一次更新。 Applies a single update to the server data store from the client. *** ### ServerboundDiagnosticsPacket > **ServerboundDiagnosticsPacket**: `"ServerboundDiagnosticsPacket"` **`Beta`** 当 ProfilerLite 启用、且创作者开启了额外客户端遥测开关、且有新的遥测数据就绪(每 500 毫秒)时,从客户端发送到服务端。 Sent from the client to the server IF ProfilerLite is enabled AND the creator toggle for additional client telemetry is enabled AND new telemetry data is ready (every 500 ms). *** ### ServerboundLoadingScreenPacket > **ServerboundLoadingScreenPacket**: `"ServerboundLoadingScreenPacket"` **`Beta`** 从客户端发送到服务端,用于向服务端告知加载界面的状态。 Sent from the client to the server to message to the server about the state of the loading screen. *** ### ServerboundPackSettingChangePacket > **ServerboundPackSettingChangePacket**: `"ServerboundPackSettingChangePacket"` **`Beta`** 当玩家更改包设置(包 UI)时,从客户端发送到服务端。 Sent from the client to the server when players change Pack Settings (pack UI). *** ### ServerPlayerPostMovePositionPacket > **ServerPlayerPostMovePositionPacket**: `"ServerPlayerPostMovePositionPacket"` **`Beta`** 用于在移动结束时将玩家的服务端位置发送到对应客户端。 Used to send a player's server position to the respective client at the end of movement. *** ### ServerPresenceInfoPacket > **ServerPresenceInfoPacket**: `"ServerPresenceInfoPacket"` **`Beta`** 由服务端发送,以向客户端提供 PresenceConfiguration。 Sent by the server to provide PresenceConfiguration to the client. *** ### ServerSettingsRequestPacket > **ServerSettingsRequestPacket**: `"ServerSettingsRequestPacket"` **`Beta`** 在客户端初始化世界设置期间发送。 Sent during the initialization of world settings on the client. *** ### ServerSettingsResponsePacket > **ServerSettingsResponsePacket**: `"ServerSettingsResponsePacket"` **`Beta`** 服务端设置响应。 Server Settings Response *** ### ServerStatsPacket > **ServerStatsPacket**: `"ServerStatsPacket"` **`Beta`** 用于将性能及其他有价值的统计数据发回客户端。 Used to send performance and other valuable stats back to the client *** ### ServerStoreInfoPacket > **ServerStoreInfoPacket**: `"ServerStoreInfoPacket"` **`Beta`** 由服务端发送,以向客户端提供 ClientStoreEntryPointConfiguration。 Sent by the server to provide ClientStoreEntryPointConfiguration to the client. *** ### ServerToClientHandshakePacket > **ServerToClientHandshakePacket**: `"ServerToClientHandshakePacket"` **`Beta`** 服务端→客户端握手。 Server->Client Handshake *** ### SetActorDataPacket > **SetActorDataPacket**: `"SetActorDataPacket"` **`Beta`** 用于设置实体数据(SetActorData)的服务端→客户端数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/SetActorDataPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/SetActorDataPacket.html) *** ### SetActorLinkPacket > **SetActorLinkPacket**: `"SetActorLinkPacket"` **`Beta`** 由客户端和服务端双方发送,仅由 LegacyClientHandler 接收。 Sent by both client and server, only received by LegacyClientHandler. *** ### SetActorMotionPacket > **SetActorMotionPacket**: `"SetActorMotionPacket"` **`Beta`** 用于服务端设置客户端实体的速度。 This is used for the server to set the velocity of a client actor. *** ### SetCommandsEnabledPacket > **SetCommandsEnabledPacket**: `"SetCommandsEnabledPacket"` **`Beta`** 世界设置界面、作弊、面向教师的教育版构建以及其他各种地方使用它来启用作弊/命令。 This is used by the world settings screen, cheats, EDU builds for teachers, and various other places to enable cheats/commands *** ### SetDefaultGameTypePacket > **SetDefaultGameTypePacket**: `"SetDefaultGameTypePacket"` **`Beta`** 与 SetPlayerGameTypePacket 和 UpdatePlayerGameTypePacket 相同,唯一区别是它会更改所有客户端的默认设置。 Same as SetPlayerGameTypePacket & UpdatePlayerGameTypePacket, the only difference is that this changes the default for all clients. *** ### SetDifficultyPacket > **SetDifficultyPacket**: `"SetDifficultyPacket"` **`Beta`** 设置难度。 Set Difficulty *** ### SetDisplayObjectivePacket > **SetDisplayObjectivePacket**: `"SetDisplayObjectivePacket"` **`Beta`** 从服务端发送,供第三方内容显示当前记分项和状态。 Sent from the server for 3rd party content to display current objectives and status *** ### SetHealthPacket > **SetHealthPacket**: `"SetHealthPacket"` **`Beta`** 当玩家生成以及重生时,此数据包会发送到客户端。 This packet is sent to the client when the player is spawned in and when they respawn. *** ### SetHudPacket > **SetHudPacket**: `"SetHudPacket"` **`Beta`** 此数据包仅通过 set hud 命令使用。用于第三方内容。 This packet is only used via the set hud command. This is for 3rd party content. *** ### SetLastHurtByPacket > **SetLastHurtByPacket**: `"SetLastHurtByPacket"` **`Beta`** 每当玩家被击中时,最后攻击他们的生物的 id 会被发送到客户端。 Any time a player is hit, the id of the last mob that attacked them is sent to the client *** ### SetLocalPlayerAsInitializedPacket > **SetLocalPlayerAsInitializedPacket**: `"SetLocalPlayerAsInitializedPacket"` **`Beta`** 将本地玩家设为已初始化。 Set Local Player As Initialized *** ### SetPlayerGameTypePacket > **SetPlayerGameTypePacket**: `"SetPlayerGameTypePacket"` **`Beta`** 设置玩家游戏模式。 Set Player Game Type *** ### SetPlayerInventoryOptionsPacket > **SetPlayerInventoryOptionsPacket**: `"SetPlayerInventoryOptionsPacket"` **`Beta`** 设置玩家物品栏选项数据包(SetPlayerInventoryOptionsPacket)。 SetPlayerInventoryOptionsPacket *** ### SetScoreboardIdentityPacket > **SetScoreboardIdentityPacket**: `"SetScoreboardIdentityPacket"` **`Beta`** 用于设置计分板上身份信息的数据包(SetScoreboardIdentityPacket)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/SetScoreboardIdentityPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/SetScoreboardIdentityPacket.html) *** ### SetScorePacket > **SetScorePacket**: `"SetScorePacket"` **`Beta`** 用于设置计分板分数的数据包(SetScorePacket)。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/SetScorePacket.html](https://mojang.github.io/bedrock-protocol-docs/html/SetScorePacket.html) *** ### SetSpawnPositionPacket > **SetSpawnPositionPacket**: `"SetSpawnPositionPacket"` **`Beta`** 当玩家登录或使用 SetWorldSpawnCommand 时,从服务端发送到客户端。使用床时不会改变,那是一个单独的数据包(RespawnPacket)。 When a player logs in or the SetWorldSpawnCommand is used this is sent from the server to the client. Does not change when using a bed, that is a separate packet (RespawnPacket) *** ### SetTimePacket > **SetTimePacket**: `"SetTimePacket"` **`Beta`** 设置时间。 Set Time *** ### SettingsCommandPacket > **SettingsCommandPacket**: `"SettingsCommandPacket"` **`Beta`** 请求通过命令更改某项设置。 Requests a setting to be changed through commands. *** ### SetTitlePacket > **SetTitlePacket**: `"SetTitlePacket"` **`Beta`** 供第三方内容用于显示 UI 横幅。 Used by 3rd party content for the purpose of showing ui banners *** ### ShowCreditsPacket > **ShowCreditsPacket**: `"ShowCreditsPacket"` **`Beta`** 当应弹出制作人员名单界面时,由服务端启动。 Starts on server when the credits screen should pop up. *** ### ShowProfilePacket > **ShowProfilePacket**: `"ShowProfilePacket"` **`Beta`** 显示个人资料。 Show Profile *** ### ShowStoreOfferPacket > **ShowStoreOfferPacket**: `"ShowStoreOfferPacket"` **`Beta`** 用于将用户重定向到正确的商品项。 Used for redirecting a user to the right offer. *** ### SimpleEventPacket > **SimpleEventPacket**: `"SimpleEventPacket"` **`Beta`** 此数据包用于启用/禁用命令以及解锁世界模板设置(既解锁客户端上的 UI 按钮,也解锁服务端上的实际设置)。 This packet is used for enabling/disabling commands and for unlocking world template settings (both unlocking UI buttons on client and the actual setting on the server). *** ### SimulationTypePacket > **SimulationTypePacket**: `"SimulationTypePacket"` **`Beta`** 在为工具箱模式设置模拟类型时,从服务端发送到客户端。(尚未支持) Sent from the server to the client when setting the simulation type for toolbox mode. (Not yet suported) *** ### SpawnExperienceOrbPacket > **SpawnExperienceOrbPacket**: `"SpawnExperienceOrbPacket"` **`Beta`** 生成经验球。 Spawn Experience Orb *** ### SpawnParticleEffectPacket > **SpawnParticleEffectPacket**: `"SpawnParticleEffectPacket"` **`Beta`** 告知客户端生成一个粒子效果。 Tell client to spawn a particle effect. *** ### StartGamePacket > **StartGamePacket**: `"StartGamePacket"` **`Beta`** 游戏开始时服务端→客户端的世界初始化数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/StartGamePacket.html](https://mojang.github.io/bedrock-protocol-docs/html/StartGamePacket.html) *** ### StopSoundPacket > **StopSoundPacket**: `"StopSoundPacket"` **`Beta`** 允许你在所有客户端上停止某个声音或所有声音,仅在 /command 中使用。 Allows you to stop a sound or all sounds on all clients, only used in a /command *** ### StructureBlockUpdatePacket > **StructureBlockUpdatePacket**: `"StructureBlockUpdatePacket"` **`Beta`** 用于同步结构方块(Structure Block)更新的数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/StructureBlockUpdatePacket.html](https://mojang.github.io/bedrock-protocol-docs/html/StructureBlockUpdatePacket.html) *** ### StructureTemplateDataRequestPacket > **StructureTemplateDataRequestPacket**: `"StructureTemplateDataRequestPacket"` **`Beta`** 用于从服务端请求结构信息。 Used to request structure information from a server. *** ### StructureTemplateDataResponsePacket > **StructureTemplateDataResponsePacket**: `"StructureTemplateDataResponsePacket"` **`Beta`** 用于从加载导出、从存档导出,以及从结构方块查询已保存的结构。 This is used in exporting from load, exporting from save, and querying saved structures from structure blocks. *** ### SubChunkPacket > **SubChunkPacket**: `"SubChunkPacket"` **`Beta`** 服务端→客户端:子区块数据传输数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/SubChunkPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/SubChunkPacket.html) *** ### SubChunkRequestPacket > **SubChunkRequestPacket**: `"SubChunkRequestPacket"` **`Beta`** 从客户端发送到服务端,表示客户端向服务端请求的一批子区块。 Sent from the client to the server representing a batch of subchunks that the client requests from the server *** ### SubClientLoginPacket > **SubClientLoginPacket**: `"SubClientLoginPacket"` **`Beta`** 子客户端(split-screen)登录数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/SubClientLoginPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/SubClientLoginPacket.html) *** ### SyncActorPropertyPacket > **SyncActorPropertyPacket**: `"SyncActorPropertyPacket"` **`Beta`** 允许我们跨网络同步实体属性。 Allows us to synchronize Actor properties across the network. *** ### SyncWorldClocksPacket > **SyncWorldClocksPacket**: `"SyncWorldClocksPacket"` **`Beta`** 从服务端向客户端初始化并同步世界时钟。(当前已禁用) Initializes and syncs world clocks from the server to clients. (Currently disabled) *** ### TakeItemActorPacket > **TakeItemActorPacket**: `"TakeItemActorPacket"` **`Beta`** 当处理在世界地面上拾取物品时,发送到服务端的数据包。 A packet sent to the server when deal with picking up an item off the ground in the world. *** ### TextPacket > **TextPacket**: `"TextPacket"` **`Beta`** 表示需要在游戏内显示的文本消息。 Represents a text message that needs to be displayed in-game *** ### TickingAreasLoadStatusPacket > **TickingAreasLoadStatusPacket**: `"TickingAreasLoadStatusPacket"` **`Beta`** 用于通知客户端服务端正在等待常加载区域完成预加载。 Used to inform the client that the server is waiting for ticking areas to finish preloading. *** ### ToastRequestPacket > **ToastRequestPacket**: `"ToastRequestPacket"` **`Beta`** 推送一条 UI toast 消息供客户端显示。 Pushes a UI toast message to be displayed by the client *** ### TransferPacket > **TransferPacket**: `"TransferPacket"` **`Beta`** 用于启动将客户端在在线游戏之间转移,也可用于使玩家退出世界并重新加入。 Used to kick off transferring the client between online games, or it can be used to cause players to quit the world and rejoin. *** ### TrimDataPacket > **TrimDataPacket**: `"TrimDataPacket"` **`Beta`** 盔甲纹饰(Trim)数据包。 #### See [https://mojang.github.io/bedrock-protocol-docs/html/TrimDataPacket.html](https://mojang.github.io/bedrock-protocol-docs/html/TrimDataPacket.html) *** ### UnlockedRecipesPacket > **UnlockedRecipesPacket**: `"UnlockedRecipesPacket"` **`Beta`** 从服务端发送到客户端,用于加载时所有先前已解锁的配方,以及游戏过程中任何新解锁的配方。 Sent from server to client, for all previously unlocked recipes on load and for any newly unlocked recipes during gameplay. *** ### UpdateAbilitiesPacket > **UpdateAbilitiesPacket**: `"UpdateAbilitiesPacket"` **`Beta`** 由服务端发送,用于更新玩家能力的状态。 Sent by the server to update the state of a player's Abilities. *** ### UpdateAdventureSettingsPacket > **UpdateAdventureSettingsPacket**: `"UpdateAdventureSettingsPacket"` **`Beta`** 更新冒险模式设置数据包(UpdateAdventureSettingsPacket)。 UpdateAdventureSettingsPacket *** ### UpdateAttributesPacket > **UpdateAttributesPacket**: `"UpdateAttributesPacket"` **`Beta`** 更新属性。 Update Attributes *** ### UpdateBlockPacket > **UpdateBlockPacket**: `"UpdateBlockPacket"` **`Beta`** 当方块更新或被刻处理时,服务端偶尔发送的数据包。(例如挖掘时。) Occasional packets sent from server when blocks update or are ticked. (For example, when digging.) *** ### UpdateBlockSyncedPacket > **UpdateBlockSyncedPacket**: `"UpdateBlockSyncedPacket"` **`Beta`** 用于与客户端同步移动的方块,使其正确渲染。 Used to sync moving blocks with clients so they render correctly *** ### UpdateClientInputLocksPacket > **UpdateClientInputLocksPacket**: `"UpdateClientInputLocksPacket"` **`Beta`** 更新客户端输入锁数据包(UpdateClientInputLocksPacket)。 UpdateClientInputLocksPacket *** ### UpdateClientOptionsPacket > **UpdateClientOptionsPacket**: `"UpdateClientOptionsPacket"` **`Beta`** 将玩家的选项(主要是设置)同步到服务端。 Sync the player's options (mostly settings) to the server. *** ### UpdateEquipPacket > **UpdateEquipPacket**: `"UpdateEquipPacket"` **`Beta`** 似乎仅用于马的物品栏……更具体地说,是当玩家打开马的物品栏时。 Seemingly only used for the Horse Inventory... More specifically when the player opens the horse inventory. *** ### UpdatePlayerGameTypePacket > **UpdatePlayerGameTypePacket**: `"UpdatePlayerGameTypePacket"` **`Beta`** 服务端在收到 SetPlayerGameTypePacket 后,会将其发回所有客户端,以便所有客户端上 mLevel 中缓存的游戏模式和权限标志保持最新。 The server will send this back to all clients on receipt of the SetPlayerGameTypePacket so that cached game type and permissions flags in mLevel on all clients is kept up to date. *** ### UpdateSoftEnumPacket > **UpdateSoftEnumPacket**: `"UpdateSoftEnumPacket"` **`Beta`** 用于计分板和标签系统(绝大多数由第三方内容使用)。 This is used for the scoreboard and tag systems (overwhelmingly used by 3rd party content) *** ### UpdateSubChunkBlocksPacket > **UpdateSubChunkBlocksPacket**: `"UpdateSubChunkBlocksPacket"` **`Beta`** 每刻针对子区块中每组变化的方块发送的数据包。 Packet sent for every set of blocks changed in a sub chunk every tick. *** ### UpdateTradePacket > **UpdateTradePacket**: `"UpdateTradePacket"` **`Beta`** 当玩家与 NPC 交易时使用。它会在一个大数据包中发送所有更新后的交易信息。 This is used when the player trades with an npc. This sends all of the updated trade info in one big ol' packet. *** ### VoxelShapesPacket > **VoxelShapesPacket**: `"VoxelShapesPacket"` **`Beta`** 在加入世界时,将客户端与服务端的体素形状数据同步。此数据包包含所有行为包体素形状数据的一份副本,并被 StartGamePacket 使用。 Syncs client with server voxel shape data on world join. This packet contains a copy of all behavior pack voxel shapes data and is used by StartGamePacket. ## 同领域相关 - [HttpClient](/server-net/classes/HttpClient.md) - [HttpHeader](/server-net/classes/HttpHeader.md) - [HttpRequest](/server-net/classes/HttpRequest.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpRequestMethod](/server-net/enums/HttpRequestMethod.md) - [HttpResponse](/server-net/classes/HttpResponse.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/enums/WebSocketClientCloseReasons.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/enums/WebSocketClientCloseReasons.md. # Enumeration: WebSocketClientCloseReasons network **`Beta`** ## Enumeration Members ### ClosedByClient > **ClosedByClient**: `1` **`Beta`** #### Remarks 客户端已关闭该 Socket。 The client has closed the socket. *** ### ClosedByServer > **ClosedByServer**: `0` **`Beta`** #### Remarks 服务器已关闭该 Socket。 The server has closed the socket. *** ### IncomingPayloadsTooLarge > **IncomingPayloadsTooLarge**: `2` **`Beta`** #### Remarks 客户端接收到的负载体积超过了每个 Tick 配置的最大允许值,因此客户端关闭了 Socket。 The client has received payloads whose body exceeds the configured maximum size allowed per tick so the client has closed the socket. ## 同领域相关 - [HttpClient](/server-net/classes/HttpClient.md) - [HttpHeader](/server-net/classes/HttpHeader.md) - [HttpRequest](/server-net/classes/HttpRequest.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpRequestMethod](/server-net/enums/HttpRequestMethod.md) - [HttpResponse](/server-net/classes/HttpResponse.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/index.md. # Module: server-net **`Beta`** `@minecraft/server-net` 模块包含了用于发起基于 HTTP 的请求的类型。 此模块仅可用于基岩版专用服务器。 The `@minecraft/server-net` module contains types for executing HTTP-based requests. This module can only be used on Bedrock Dedicated Server. These APIs do not function within the Minecraft game client or within Minecraft Realms. Manifest Details ```json { "module_name": "@minecraft/server-net", "version": "1.0.0-beta" } ``` ## Enumerations - [HttpRequestMethod](/server-net/enums/HttpRequestMethod.md) - [HttpStatusCode](/server-net/enums/HttpStatusCode.md) - [PacketId](/server-net/enums/PacketId.md) - [WebSocketClientCloseReasons](/server-net/enums/WebSocketClientCloseReasons.md) ## Classes - [CloseAfterEventSignal](/server-net/classes/CloseAfterEventSignal.md) - [HttpClient](/server-net/classes/HttpClient.md) - [HttpHeader](/server-net/classes/HttpHeader.md) - [HttpRequest](/server-net/classes/HttpRequest.md) - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError.md) - [HttpResponse](/server-net/classes/HttpResponse.md) - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError.md) - [InternalWebSocketError](/server-net/classes/InternalWebSocketError.md) - [MalformedUriError](/server-net/classes/MalformedUriError.md) - [MessageAfterEventSignal](/server-net/classes/MessageAfterEventSignal.md) - [NetworkBeforeEvents](/server-net/classes/NetworkBeforeEvents.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) - [PacketSendBeforeEvent](/server-net/classes/PacketSendBeforeEvent.md) - [PacketSendBeforeEventSignal](/server-net/classes/PacketSendBeforeEventSignal.md) - [RequestBodyTooLargeError](/server-net/classes/RequestBodyTooLargeError.md) - [SerializableParseError](/server-net/classes/SerializableParseError.md) - [TLSOnlyError](/server-net/classes/TLSOnlyError.md) - [UriNotAllowedError](/server-net/classes/UriNotAllowedError.md) - [WebSocket](/server-net/classes/WebSocket.md) - [WebSocketClient](/server-net/classes/WebSocketClient.md) - [WebSocketClientAfterEvents](/server-net/classes/WebSocketClientAfterEvents.md) - [WebSocketClientCloseAfterEvent](/server-net/classes/WebSocketClientCloseAfterEvent.md) - [WebSocketClientReceiveAfterEvent](/server-net/classes/WebSocketClientReceiveAfterEvent.md) - [WebSocketConnectionFailedError](/server-net/classes/WebSocketConnectionFailedError.md) - [WebSocketLimitExceededError](/server-net/classes/WebSocketLimitExceededError.md) - [WebSocketNotConnectedError](/server-net/classes/WebSocketNotConnectedError.md) ## Interfaces - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) ## Variables - [beforeEvents](/server-net/variables/beforeEvents.md) - [http](/server-net/variables/http.md) - [websocket](/server-net/variables/websocket.md) --- url: /server-net/interfaces/PacketEventOptions.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/interfaces/PacketEventOptions.md. # Interface: PacketEventOptions event network **`Beta`** 用于网络数据包触发事件的选项。 Options for events triggered by network packets. ## Properties ### ignoredPacketIds? > `optional` **ignoredPacketIds?**: [`PacketId`](/server-net/enums/PacketId.md)\[] **`Beta`** #### Remarks 如果提供该列表,则其中列出的数据包 ID 不会触发事件订阅。 If provided, packet IDs in this list will not trigger the event subscriptions. *** ### monitoredPacketIds? > `optional` **monitoredPacketIds?**: [`PacketId`](/server-net/enums/PacketId.md)\[] **`Beta`** #### Remarks 如果提供该列表,则只有其中列出的数据包 ID 会触发事件订阅。 If provided only packet IDs in this list will trigger the event subscriptions. ## 同领域相关 - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) - [PacketSendBeforeEvent](/server-net/classes/PacketSendBeforeEvent.md) - [PacketSendBeforeEventSignal](/server-net/classes/PacketSendBeforeEventSignal.md) - [WebSocketClientAfterEvents](/server-net/classes/WebSocketClientAfterEvents.md) - [WebSocketClientCloseAfterEvent](/server-net/classes/WebSocketClientCloseAfterEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/variables/beforeEvents.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/variables/beforeEvents.md. # Variable: beforeEvents event > `const` **beforeEvents**: [`NetworkBeforeEvents`](/server-net/classes/NetworkBeforeEvents.md) **`Beta`** ## 同领域相关 - [CloseAfterEventSignal](/server-net/classes/CloseAfterEventSignal.md) - [MessageAfterEventSignal](/server-net/classes/MessageAfterEventSignal.md) - [NetworkBeforeEvents](/server-net/classes/NetworkBeforeEvents.md) - [PacketEventOptions](/server-net/interfaces/PacketEventOptions.md) - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal.md) - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent.md) [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/variables/http.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/variables/http.md. # Variable: http > `const` **http**: [`HttpClient`](/server-net/classes/HttpClient.md) **`Beta`** [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /server-net/variables/websocket.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server-net/variables/websocket.md. # Variable: websocket > `const` **websocket**: [`WebSocket`](/server-net/classes/WebSocket.md) **`Beta`** ## Remarks 用于管理 WebSocket 连接。 Used to manage WebSocket connections. [源码](https://www.npmjs.com/package/@minecraft/server-net) --- url: /tags/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /tags/index.md. # 标签索引 按领域标签、模块与类型筛选 Script API 符号。图例与条目由构建时扫描增强后的成员页生成。 领域标签说明 | 标签 | 含义 | | --- | --- | | event | 事件信号/回调类(BeforeEvent / AfterEvent / EventSignal 等) | | player | 玩家相关 | | entity | 实体相关 | | item | 物品 / 物品堆相关 | | block | 方块 / 方块排列相关 | | world | 世界相关 | | dimension | 维度相关 | | biome | 生物群系相关 | | damage | 伤害 / 生命值相关 | | inventory | 物品栏 / 容器相关 | | scoreboard | 计分板相关 | | chat | 原始消息 / 聊天相关 | | permission | 权限 / OP 等级相关 | | tick | 时序 / Tick 相关 | | animation | 动画相关 | | sound | 声音 / 音乐相关 | | effect | 状态效果相关 | | debug | 调试绘制相关 | | network | HTTP / WebSocket / 数据包相关 | | data | 动态属性 / 持久存储相关 | | error | 错误异常类 | | component | 实体 / 物品 / 方块组件相关 | 领域全部animationbiomeblockchatcomponentdamagedatadebugdimensioneffectentityerroreventinventoryitemnetworkpermissionplayerscoreboardsoundtickworld模块全部commondebug-utilitiesdiagnosticsmathserverserver-adminserver-editorserver-gametestserver-graphicsserver-netserver-ui类型全部类枚举函数接口类型别名变量 共 1323 项 - [ArgumentOutOfBoundsError](/common/classes/ArgumentOutOfBoundsError)common · 类error - [ContainerSizeOutOfBoundsError](/common/classes/ContainerSizeOutOfBoundsError)common · 类inventoryerror - [EngineError](/common/classes/EngineError)common · 类error - [InvalidArgumentError](/common/classes/InvalidArgumentError)common · 类error - [PropertyOutOfBoundsError](/common/classes/PropertyOutOfBoundsError)common · 类error - [RuntimeConditionError](/common/classes/RuntimeConditionError)common · 类error - [UnsupportedFunctionalityError](/common/classes/UnsupportedFunctionalityError)common · 类error - [InvalidArgumentErrorType](/common/enums/InvalidArgumentErrorType)common · 枚举error - [NumberRange](/common/interfaces/NumberRange)common · 接口 - [DebugArrow](/debug-utilities/classes/DebugArrow)debug-utilities · 类debug - [DebugBox](/debug-utilities/classes/DebugBox)debug-utilities · 类debug - [DebugCircle](/debug-utilities/classes/DebugCircle)debug-utilities · 类debug - [DebugCone](/debug-utilities/classes/DebugCone)debug-utilities · 类debug - [DebugCylinder](/debug-utilities/classes/DebugCylinder)debug-utilities · 类debug - [DebugDrawer](/debug-utilities/classes/DebugDrawer)debug-utilities · 类debug - [DebugEllipsoid](/debug-utilities/classes/DebugEllipsoid)debug-utilities · 类debug - [DebugLine](/debug-utilities/classes/DebugLine)debug-utilities · 类debug - [DebugPyramid](/debug-utilities/classes/DebugPyramid)debug-utilities · 类debug - [DebugShape](/debug-utilities/classes/DebugShape)debug-utilities · 类debug - [DebugSphere](/debug-utilities/classes/DebugSphere)debug-utilities · 类debug - [DebugText](/debug-utilities/classes/DebugText)debug-utilities · 类debug - [collectPluginStats](/debug-utilities/functions/collectPluginStats)debug-utilities · 函数 - [collectRuntimeStats](/debug-utilities/functions/collectRuntimeStats)debug-utilities · 函数 - [disableWatchdogTimingWarnings](/debug-utilities/functions/disableWatchdogTimingWarnings)debug-utilities · 函数 - [HandleCounts](/debug-utilities/interfaces/HandleCounts)debug-utilities · 接口 - [PluginStats](/debug-utilities/interfaces/PluginStats)debug-utilities · 接口 - [RuntimeStats](/debug-utilities/interfaces/RuntimeStats)debug-utilities · 接口 - [debugDrawer](/debug-utilities/variables/debugDrawer)debug-utilities · 变量 - [Sentry](/diagnostics/classes/Sentry)diagnostics · 类 - [SentryAlreadyInitializedError](/diagnostics/classes/SentryAlreadyInitializedError)diagnostics · 类error - [SentryUninitializedError](/diagnostics/classes/SentryUninitializedError)diagnostics · 类error - [SentryEventLevel](/diagnostics/enums/SentryEventLevel)diagnostics · 枚举event - [SentryCaptureContext](/diagnostics/interfaces/SentryCaptureContext)diagnostics · 接口 - [SentryOptions](/diagnostics/interfaces/SentryOptions)diagnostics · 接口 - [sentry](/diagnostics/variables/sentry)diagnostics · 变量 - [AABBInvalidExtentError](/math/classes/AABBInvalidExtentError)math · 类error - [AABBUtils](/math/classes/AABBUtils)math · 类 - [Vector2Builder](/math/classes/Vector2Builder)math · 类 - [Vector2Utils](/math/classes/Vector2Utils)math · 类 - [Vector3Builder](/math/classes/Vector3Builder)math · 类 - [Vector3Utils](/math/classes/Vector3Utils)math · 类 - [VectorXZBuilder](/math/classes/VectorXZBuilder)math · 类 - [VectorXZUtils](/math/classes/VectorXZUtils)math · 类 - [clampNumber](/math/functions/clampNumber)math · 函数 - [Colors](/math/variables/Colors)math · 变量 - [VECTOR2_ZERO](/math/variables/VECTOR2_ZERO)math · 变量 - [VECTOR3_BACK](/math/variables/VECTOR3_BACK)math · 变量 - [VECTOR3_DOWN](/math/variables/VECTOR3_DOWN)math · 变量 - [VECTOR3_EAST](/math/variables/VECTOR3_EAST)math · 变量 - [VECTOR3_FORWARD](/math/variables/VECTOR3_FORWARD)math · 变量 - [VECTOR3_HALF](/math/variables/VECTOR3_HALF)math · 变量 - [VECTOR3_LEFT](/math/variables/VECTOR3_LEFT)math · 变量 - [VECTOR3_NEGATIVE_ONE](/math/variables/VECTOR3_NEGATIVE_ONE)math · 变量 - [VECTOR3_NORTH](/math/variables/VECTOR3_NORTH)math · 变量 - [VECTOR3_ONE](/math/variables/VECTOR3_ONE)math · 变量 - [VECTOR3_RIGHT](/math/variables/VECTOR3_RIGHT)math · 变量 - [VECTOR3_SOUTH](/math/variables/VECTOR3_SOUTH)math · 变量 - [VECTOR3_UP](/math/variables/VECTOR3_UP)math · 变量 - [VECTOR3_WEST](/math/variables/VECTOR3_WEST)math · 变量 - [VECTOR3_ZERO](/math/variables/VECTOR3_ZERO)math · 变量 - [VECTORXZ_ZERO](/math/variables/VECTORXZ_ZERO)math · 变量 - [AimAssistCategory](/server/classes/AimAssistCategory)server · 类 - [AimAssistCategorySettings](/server/classes/AimAssistCategorySettings)server · 类 - [AimAssistPreset](/server/classes/AimAssistPreset)server · 类 - [AimAssistPresetSettings](/server/classes/AimAssistPresetSettings)server · 类 - [AimAssistRegistry](/server/classes/AimAssistRegistry)server · 类 - [BannerPattern](/server/classes/BannerPattern)server · 类 - [BiomeType](/server/classes/BiomeType)server · 类biome - [BiomeTypes](/server/classes/BiomeTypes)server · 类biome - [Block](/server/classes/Block)server · 类block - [BlockBoundingBoxUtils](/server/classes/BlockBoundingBoxUtils)server · 类block - [BlockComponent](/server/classes/BlockComponent)server · 类blockcomponent - [BlockComponentBlockBreakEvent](/server/classes/BlockComponentBlockBreakEvent)server · 类eventblockcomponent - [BlockComponentBlockStateChangeEvent](/server/classes/BlockComponentBlockStateChangeEvent)server · 类eventblockcomponent - [BlockComponentEntityEvent](/server/classes/BlockComponentEntityEvent)server · 类evententityblockcomponent - [BlockComponentEntityFallOnEvent](/server/classes/BlockComponentEntityFallOnEvent)server · 类evententityblockcomponent - [BlockComponentOnPlaceEvent](/server/classes/BlockComponentOnPlaceEvent)server · 类eventblockcomponent - [BlockComponentPlayerBreakEvent](/server/classes/BlockComponentPlayerBreakEvent)server · 类eventplayerblockcomponent - [BlockComponentPlayerInteractEvent](/server/classes/BlockComponentPlayerInteractEvent)server · 类eventplayerblockcomponent - [BlockComponentPlayerPlaceBeforeEvent](/server/classes/BlockComponentPlayerPlaceBeforeEvent)server · 类eventplayerblockcomponent - [BlockComponentRandomTickEvent](/server/classes/BlockComponentRandomTickEvent)server · 类eventblocktickcomponent - [BlockComponentRedstoneUpdateEvent](/server/classes/BlockComponentRedstoneUpdateEvent)server · 类eventblockcomponent - [BlockComponentRegistry](/server/classes/BlockComponentRegistry)server · 类blockcomponent - [BlockComponentStepOffEvent](/server/classes/BlockComponentStepOffEvent)server · 类eventblockcomponent - [BlockComponentStepOnEvent](/server/classes/BlockComponentStepOnEvent)server · 类eventblockcomponent - [BlockComponentTickEvent](/server/classes/BlockComponentTickEvent)server · 类eventblocktickcomponent - [BlockContainerClosedAfterEvent](/server/classes/BlockContainerClosedAfterEvent)server · 类eventblockinventory - [BlockContainerClosedAfterEventSignal](/server/classes/BlockContainerClosedAfterEventSignal)server · 类eventblockinventory - [BlockContainerOpenedAfterEvent](/server/classes/BlockContainerOpenedAfterEvent)server · 类eventblockinventory - [BlockContainerOpenedAfterEventSignal](/server/classes/BlockContainerOpenedAfterEventSignal)server · 类eventblockinventory - [BlockCustomComponentAlreadyRegisteredError](/server/classes/BlockCustomComponentAlreadyRegisteredError)server · 类blockerrorcomponent - [BlockCustomComponentInstance](/server/classes/BlockCustomComponentInstance)server · 类blockcomponent - [BlockCustomComponentReloadNewComponentError](/server/classes/BlockCustomComponentReloadNewComponentError)server · 类blockerrorcomponent - [BlockCustomComponentReloadNewEventError](/server/classes/BlockCustomComponentReloadNewEventError)server · 类eventblockerrorcomponent - [BlockCustomComponentReloadVersionError](/server/classes/BlockCustomComponentReloadVersionError)server · 类blockerrorcomponent - [BlockDynamicPropertiesComponent](/server/classes/BlockDynamicPropertiesComponent)server · 类blockcomponent - [BlockEvent](/server/classes/BlockEvent)server · 类eventblock - [BlockExplodeAfterEvent](/server/classes/BlockExplodeAfterEvent)server · 类eventblock - [BlockExplodeAfterEventSignal](/server/classes/BlockExplodeAfterEventSignal)server · 类eventblock - [BlockFluidContainerComponent](/server/classes/BlockFluidContainerComponent)server · 类blockinventorycomponent - [BlockInstrumentComponent](/server/classes/BlockInstrumentComponent)server · 类blockcomponent - [BlockInventoryComponent](/server/classes/BlockInventoryComponent)server · 类blockinventorycomponent - [BlockLocationIterator](/server/classes/BlockLocationIterator)server · 类block - [BlockMapColorComponent](/server/classes/BlockMapColorComponent)server · 类blockcomponent - [BlockMovableComponent](/server/classes/BlockMovableComponent)server · 类blockcomponent - [BlockPermutation](/server/classes/BlockPermutation)server · 类block - [BlockPistonComponent](/server/classes/BlockPistonComponent)server · 类blockcomponent - [BlockPrecipitationInteractionsComponent](/server/classes/BlockPrecipitationInteractionsComponent)server · 类blockcomponent - [BlockRecordPlayerComponent](/server/classes/BlockRecordPlayerComponent)server · 类playerblockcomponent - [BlockRedstoneProducerComponent](/server/classes/BlockRedstoneProducerComponent)server · 类blockcomponent - [BlockSignComponent](/server/classes/BlockSignComponent)server · 类blockcomponent - [BlockStates](/server/classes/BlockStates)server · 类block - [BlockStateType](/server/classes/BlockStateType)server · 类block - [BlockType](/server/classes/BlockType)server · 类block - [BlockTypes](/server/classes/BlockTypes)server · 类block - [BlockVolume](/server/classes/BlockVolume)server · 类block - [BlockVolumeBase](/server/classes/BlockVolumeBase)server · 类block - [BookError](/server/classes/BookError)server · 类error - [BookPageContentError](/server/classes/BookPageContentError)server · 类error - [ButtonPushAfterEvent](/server/classes/ButtonPushAfterEvent)server · 类event - [ButtonPushAfterEventSignal](/server/classes/ButtonPushAfterEventSignal)server · 类event - [Camera](/server/classes/Camera)server · 类 - [CarryOverBlockEntityDataFunction](/server/classes/CarryOverBlockEntityDataFunction)server · 类entityblock - [CatmullRomSpline](/server/classes/CatmullRomSpline)server · 类 - [ChatSendAfterEvent](/server/classes/ChatSendAfterEvent)server · 类event - [ChatSendAfterEventSignal](/server/classes/ChatSendAfterEventSignal)server · 类event - [ChatSendBeforeEvent](/server/classes/ChatSendBeforeEvent)server · 类event - [ChatSendBeforeEventSignal](/server/classes/ChatSendBeforeEventSignal)server · 类event - [ClientSystemInfo](/server/classes/ClientSystemInfo)server · 类 - [CommandError](/server/classes/CommandError)server · 类error - [CommandResult](/server/classes/CommandResult)server · 类 - [Component](/server/classes/Component)server · 类component - [Container](/server/classes/Container)server · 类inventory - [ContainerRulesError](/server/classes/ContainerRulesError)server · 类inventoryerror - [ContainerSlot](/server/classes/ContainerSlot)server · 类inventory - [CustomCommandError](/server/classes/CustomCommandError)server · 类error - [CustomCommandOrigin](/server/classes/CustomCommandOrigin)server · 类 - [CustomCommandRegistry](/server/classes/CustomCommandRegistry)server · 类 - [CustomComponentInvalidRegistryError](/server/classes/CustomComponentInvalidRegistryError)server · 类errorcomponent - [CustomComponentNameError](/server/classes/CustomComponentNameError)server · 类errorcomponent - [CustomComponentParameters](/server/classes/CustomComponentParameters)server · 类component - [CustomDimensionAlreadyRegisteredError](/server/classes/CustomDimensionAlreadyRegisteredError)server · 类dimensionerror - [CustomDimensionInvalidRegistryError](/server/classes/CustomDimensionInvalidRegistryError)server · 类dimensionerror - [CustomDimensionNameError](/server/classes/CustomDimensionNameError)server · 类dimensionerror - [CustomDimensionReloadNewDimensionError](/server/classes/CustomDimensionReloadNewDimensionError)server · 类dimensionerror - [DamagedByEntityCondition](/server/classes/DamagedByEntityCondition)server · 类entity - [DataDrivenEntityTriggerAfterEvent](/server/classes/DataDrivenEntityTriggerAfterEvent)server · 类evententity - [DataDrivenEntityTriggerAfterEventSignal](/server/classes/DataDrivenEntityTriggerAfterEventSignal)server · 类evententity - [Dimension](/server/classes/Dimension)server · 类dimension - [DimensionRegistry](/server/classes/DimensionRegistry)server · 类dimension - [DimensionType](/server/classes/DimensionType)server · 类dimension - [DimensionTypes](/server/classes/DimensionTypes)server · 类dimension - [Effect](/server/classes/Effect)server · 类effect - [EffectAddAfterEvent](/server/classes/EffectAddAfterEvent)server · 类eventeffect - [EffectAddAfterEventSignal](/server/classes/EffectAddAfterEventSignal)server · 类eventeffect - [EffectAddBeforeEvent](/server/classes/EffectAddBeforeEvent)server · 类eventeffect - [EffectAddBeforeEventSignal](/server/classes/EffectAddBeforeEventSignal)server · 类eventeffect - [EffectType](/server/classes/EffectType)server · 类effect - [EffectTypes](/server/classes/EffectTypes)server · 类effect - [EmptyLootItem](/server/classes/EmptyLootItem)server · 类 - [EnchantInfo](/server/classes/EnchantInfo)server · 类 - [EnchantmentLevelOutOfBoundsError](/server/classes/EnchantmentLevelOutOfBoundsError)server · 类error - [EnchantmentType](/server/classes/EnchantmentType)server · 类 - [EnchantmentTypeNotCompatibleError](/server/classes/EnchantmentTypeNotCompatibleError)server · 类error - [EnchantmentTypes](/server/classes/EnchantmentTypes)server · 类 - [EnchantmentTypeUnknownIdError](/server/classes/EnchantmentTypeUnknownIdError)server · 类error - [EnchantRandomEquipmentFunction](/server/classes/EnchantRandomEquipmentFunction)server · 类 - [EnchantRandomlyFunction](/server/classes/EnchantRandomlyFunction)server · 类 - [EnchantWithLevelsFunction](/server/classes/EnchantWithLevelsFunction)server · 类 - [Entity](/server/classes/Entity)server · 类entity - [EntityAddRiderComponent](/server/classes/EntityAddRiderComponent)server · 类entitycomponent - [EntityAgeableComponent](/server/classes/EntityAgeableComponent)server · 类entitycomponent - [EntityAttributeComponent](/server/classes/EntityAttributeComponent)server · 类entitycomponent - [EntityBaseMovementComponent](/server/classes/EntityBaseMovementComponent)server · 类entitycomponent - [EntityBreathableComponent](/server/classes/EntityBreathableComponent)server · 类entitycomponent - [EntityCanClimbComponent](/server/classes/EntityCanClimbComponent)server · 类entitycomponent - [EntityCanFlyComponent](/server/classes/EntityCanFlyComponent)server · 类entitycomponent - [EntityCanPowerJumpComponent](/server/classes/EntityCanPowerJumpComponent)server · 类entitycomponent - [EntityColor2Component](/server/classes/EntityColor2Component)server · 类entity - [EntityColorComponent](/server/classes/EntityColorComponent)server · 类entitycomponent - [EntityComponent](/server/classes/EntityComponent)server · 类entitycomponent - [EntityContainerClosedAfterEvent](/server/classes/EntityContainerClosedAfterEvent)server · 类evententityinventory - [EntityContainerClosedAfterEventSignal](/server/classes/EntityContainerClosedAfterEventSignal)server · 类evententityinventory - [EntityContainerOpenedAfterEvent](/server/classes/EntityContainerOpenedAfterEvent)server · 类evententityinventory - [EntityContainerOpenedAfterEventSignal](/server/classes/EntityContainerOpenedAfterEventSignal)server · 类evententityinventory - [EntityDefinitionFeedItem](/server/classes/EntityDefinitionFeedItem)server · 类entity - [EntityDieAfterEvent](/server/classes/EntityDieAfterEvent)server · 类evententity - [EntityDieAfterEventSignal](/server/classes/EntityDieAfterEventSignal)server · 类evententity - [EntityEnderInventoryComponent](/server/classes/EntityEnderInventoryComponent)server · 类entityinventorycomponent - [EntityEquippableComponent](/server/classes/EntityEquippableComponent)server · 类entitycomponent - [EntityExhaustionComponent](/server/classes/EntityExhaustionComponent)server · 类entitycomponent - [EntityFireImmuneComponent](/server/classes/EntityFireImmuneComponent)server · 类entitycomponent - [EntityFloatsInLiquidComponent](/server/classes/EntityFloatsInLiquidComponent)server · 类entitycomponent - [EntityFlyingSpeedComponent](/server/classes/EntityFlyingSpeedComponent)server · 类entitycomponent - [EntityFrictionModifierComponent](/server/classes/EntityFrictionModifierComponent)server · 类entitycomponent - [EntityHasMarkVariantCondition](/server/classes/EntityHasMarkVariantCondition)server · 类entity - [EntityHasVariantCondition](/server/classes/EntityHasVariantCondition)server · 类entity - [EntityHealableComponent](/server/classes/EntityHealableComponent)server · 类entitycomponent - [EntityHealAfterEvent](/server/classes/EntityHealAfterEvent)server · 类evententity - [EntityHealAfterEventSignal](/server/classes/EntityHealAfterEventSignal)server · 类evententity - [EntityHealBeforeEvent](/server/classes/EntityHealBeforeEvent)server · 类evententity - [EntityHealBeforeEventSignal](/server/classes/EntityHealBeforeEventSignal)server · 类evententity - [EntityHealSource](/server/classes/EntityHealSource)server · 类entity - [EntityHealthChangedAfterEvent](/server/classes/EntityHealthChangedAfterEvent)server · 类evententitydamage - [EntityHealthChangedAfterEventSignal](/server/classes/EntityHealthChangedAfterEventSignal)server · 类evententitydamage - [EntityHealthComponent](/server/classes/EntityHealthComponent)server · 类entitydamagecomponent - [EntityHitBlockAfterEvent](/server/classes/EntityHitBlockAfterEvent)server · 类evententityblock - [EntityHitBlockAfterEventSignal](/server/classes/EntityHitBlockAfterEventSignal)server · 类evententityblock - [EntityHitEntityAfterEvent](/server/classes/EntityHitEntityAfterEvent)server · 类evententity - [EntityHitEntityAfterEventSignal](/server/classes/EntityHitEntityAfterEventSignal)server · 类evententity - [EntityHungerComponent](/server/classes/EntityHungerComponent)server · 类entitycomponent - [EntityHurtAfterEvent](/server/classes/EntityHurtAfterEvent)server · 类evententity - [EntityHurtAfterEventSignal](/server/classes/EntityHurtAfterEventSignal)server · 类evententity - [EntityHurtBeforeEvent](/server/classes/EntityHurtBeforeEvent)server · 类evententity - [EntityHurtBeforeEventSignal](/server/classes/EntityHurtBeforeEventSignal)server · 类evententity - [EntityInventoryComponent](/server/classes/EntityInventoryComponent)server · 类entityinventorycomponent - [EntityIsBabyComponent](/server/classes/EntityIsBabyComponent)server · 类entitycomponent - [EntityIsChargedComponent](/server/classes/EntityIsChargedComponent)server · 类entitycomponent - [EntityIsChestedComponent](/server/classes/EntityIsChestedComponent)server · 类entitycomponent - [EntityIsDyeableComponent](/server/classes/EntityIsDyeableComponent)server · 类entitycomponent - [EntityIsHiddenWhenInvisibleComponent](/server/classes/EntityIsHiddenWhenInvisibleComponent)server · 类entitycomponent - [EntityIsIgnitedComponent](/server/classes/EntityIsIgnitedComponent)server · 类entitycomponent - [EntityIsIllagerCaptainComponent](/server/classes/EntityIsIllagerCaptainComponent)server · 类entitycomponent - [EntityIsSaddledComponent](/server/classes/EntityIsSaddledComponent)server · 类entitycomponent - [EntityIsShakingComponent](/server/classes/EntityIsShakingComponent)server · 类entitycomponent - [EntityIsShearedComponent](/server/classes/EntityIsShearedComponent)server · 类entitycomponent - [EntityIsStackableComponent](/server/classes/EntityIsStackableComponent)server · 类entitycomponent - [EntityIsStunnedComponent](/server/classes/EntityIsStunnedComponent)server · 类entitycomponent - [EntityIsTamedComponent](/server/classes/EntityIsTamedComponent)server · 类entitycomponent - [EntityItemComponent](/server/classes/EntityItemComponent)server · 类entitycomponent - [EntityItemDropAfterEvent](/server/classes/EntityItemDropAfterEvent)server · 类evententity - [EntityItemDropAfterEventSignal](/server/classes/EntityItemDropAfterEventSignal)server · 类evententity - [EntityItemPickupAfterEvent](/server/classes/EntityItemPickupAfterEvent)server · 类evententity - [EntityItemPickupAfterEventSignal](/server/classes/EntityItemPickupAfterEventSignal)server · 类evententity - [EntityItemPickupBeforeEvent](/server/classes/EntityItemPickupBeforeEvent)server · 类evententity - [EntityItemPickupBeforeEventSignal](/server/classes/EntityItemPickupBeforeEventSignal)server · 类evententity - [EntityKilledCondition](/server/classes/EntityKilledCondition)server · 类entity - [EntityLavaMovementComponent](/server/classes/EntityLavaMovementComponent)server · 类entitycomponent - [EntityLeashableComponent](/server/classes/EntityLeashableComponent)server · 类entitycomponent - [EntityLoadAfterEvent](/server/classes/EntityLoadAfterEvent)server · 类evententity - [EntityLoadAfterEventSignal](/server/classes/EntityLoadAfterEventSignal)server · 类evententity - [EntityMarkVariantComponent](/server/classes/EntityMarkVariantComponent)server · 类entitycomponent - [EntityMovementAmphibiousComponent](/server/classes/EntityMovementAmphibiousComponent)server · 类entitycomponent - [EntityMovementBasicComponent](/server/classes/EntityMovementBasicComponent)server · 类entitycomponent - [EntityMovementComponent](/server/classes/EntityMovementComponent)server · 类entitycomponent - [EntityMovementFlyComponent](/server/classes/EntityMovementFlyComponent)server · 类entitycomponent - [EntityMovementGenericComponent](/server/classes/EntityMovementGenericComponent)server · 类entitycomponent - [EntityMovementGlideComponent](/server/classes/EntityMovementGlideComponent)server · 类entitycomponent - [EntityMovementHoverComponent](/server/classes/EntityMovementHoverComponent)server · 类entitycomponent - [EntityMovementJumpComponent](/server/classes/EntityMovementJumpComponent)server · 类entitycomponent - [EntityMovementSkipComponent](/server/classes/EntityMovementSkipComponent)server · 类entitycomponent - [EntityMovementSwayComponent](/server/classes/EntityMovementSwayComponent)server · 类entitycomponent - [EntityNavigationClimbComponent](/server/classes/EntityNavigationClimbComponent)server · 类entitycomponent - [EntityNavigationComponent](/server/classes/EntityNavigationComponent)server · 类entitycomponent - [EntityNavigationFloatComponent](/server/classes/EntityNavigationFloatComponent)server · 类entitycomponent - [EntityNavigationFlyComponent](/server/classes/EntityNavigationFlyComponent)server · 类entitycomponent - [EntityNavigationGenericComponent](/server/classes/EntityNavigationGenericComponent)server · 类entitycomponent - [EntityNavigationHoverComponent](/server/classes/EntityNavigationHoverComponent)server · 类entitycomponent - [EntityNavigationWalkComponent](/server/classes/EntityNavigationWalkComponent)server · 类entitycomponent - [EntityNpcComponent](/server/classes/EntityNpcComponent)server · 类entitycomponent - [EntityOnFireComponent](/server/classes/EntityOnFireComponent)server · 类entitycomponent - [EntityProjectileComponent](/server/classes/EntityProjectileComponent)server · 类entitycomponent - [EntityPushThroughComponent](/server/classes/EntityPushThroughComponent)server · 类entitycomponent - [EntityRemoveAfterEvent](/server/classes/EntityRemoveAfterEvent)server · 类evententity - [EntityRemoveAfterEventSignal](/server/classes/EntityRemoveAfterEventSignal)server · 类evententity - [EntityRemoveBeforeEvent](/server/classes/EntityRemoveBeforeEvent)server · 类evententity - [EntityRemoveBeforeEventSignal](/server/classes/EntityRemoveBeforeEventSignal)server · 类evententity - [EntityRideableComponent](/server/classes/EntityRideableComponent)server · 类entitycomponent - [EntityRidingComponent](/server/classes/EntityRidingComponent)server · 类entitycomponent - [EntitySaturationComponent](/server/classes/EntitySaturationComponent)server · 类entitycomponent - [EntityScaleComponent](/server/classes/EntityScaleComponent)server · 类entitycomponent - [EntitySkinIdComponent](/server/classes/EntitySkinIdComponent)server · 类entitycomponent - [EntitySpawnAfterEvent](/server/classes/EntitySpawnAfterEvent)server · 类evententity - [EntitySpawnAfterEventSignal](/server/classes/EntitySpawnAfterEventSignal)server · 类evententity - [EntitySpawnError](/server/classes/EntitySpawnError)server · 类entityerror - [EntityStartSneakingAfterEvent](/server/classes/EntityStartSneakingAfterEvent)server · 类evententity - [EntityStartSneakingAfterEventSignal](/server/classes/EntityStartSneakingAfterEventSignal)server · 类evententity - [EntityStopSneakingAfterEvent](/server/classes/EntityStopSneakingAfterEvent)server · 类evententity - [EntityStopSneakingAfterEventSignal](/server/classes/EntityStopSneakingAfterEventSignal)server · 类evententity - [EntityStrengthComponent](/server/classes/EntityStrengthComponent)server · 类entitycomponent - [EntityTameableComponent](/server/classes/EntityTameableComponent)server · 类entitycomponent - [EntityTamedAfterEvent](/server/classes/EntityTamedAfterEvent)server · 类evententity - [EntityTamedAfterEventSignal](/server/classes/EntityTamedAfterEventSignal)server · 类evententity - [EntityTamedBeforeEvent](/server/classes/EntityTamedBeforeEvent)server · 类evententity - [EntityTamedBeforeEventSignal](/server/classes/EntityTamedBeforeEventSignal)server · 类evententity - [EntityTameMountComponent](/server/classes/EntityTameMountComponent)server · 类entitycomponent - [EntityType](/server/classes/EntityType)server · 类entity - [EntityTypeFamilyComponent](/server/classes/EntityTypeFamilyComponent)server · 类entitycomponent - [EntityTypes](/server/classes/EntityTypes)server · 类entity - [EntityUnderwaterMovementComponent](/server/classes/EntityUnderwaterMovementComponent)server · 类entitycomponent - [EntityUpgradeAfterEvent](/server/classes/EntityUpgradeAfterEvent)server · 类evententity - [EntityUpgradeAfterEventSignal](/server/classes/EntityUpgradeAfterEventSignal)server · 类evententity - [EntityVariantComponent](/server/classes/EntityVariantComponent)server · 类entitycomponent - [EntityWantsJockeyComponent](/server/classes/EntityWantsJockeyComponent)server · 类entitycomponent - [EntityWaypoint](/server/classes/EntityWaypoint)server · 类entity - [ExplorationMapFunction](/server/classes/ExplorationMapFunction)server · 类 - [ExplosionAfterEvent](/server/classes/ExplosionAfterEvent)server · 类event - [ExplosionAfterEventSignal](/server/classes/ExplosionAfterEventSignal)server · 类event - [ExplosionBeforeEvent](/server/classes/ExplosionBeforeEvent)server · 类event - [ExplosionBeforeEventSignal](/server/classes/ExplosionBeforeEventSignal)server · 类event - [ExplosionDecayFunction](/server/classes/ExplosionDecayFunction)server · 类 - [FeedItem](/server/classes/FeedItem)server · 类 - [FeedItemEffect](/server/classes/FeedItemEffect)server · 类effect - [FillContainerFunction](/server/classes/FillContainerFunction)server · 类inventory - [FluidContainer](/server/classes/FluidContainer)server · 类inventory - [FogSettings](/server/classes/FogSettings)server · 类 - [FogSettingsError](/server/classes/FogSettingsError)server · 类error - [GameRuleChangeAfterEvent](/server/classes/GameRuleChangeAfterEvent)server · 类event - [GameRuleChangeAfterEventSignal](/server/classes/GameRuleChangeAfterEventSignal)server · 类event - [GameRules](/server/classes/GameRules)server · 类 - [InputInfo](/server/classes/InputInfo)server · 类 - [InvalidBlockComponentError](/server/classes/InvalidBlockComponentError)server · 类blockerrorcomponent - [InvalidContainerError](/server/classes/InvalidContainerError)server · 类inventoryerror - [InvalidContainerSlotError](/server/classes/InvalidContainerSlotError)server · 类inventoryerror - [InvalidEntityComponentError](/server/classes/InvalidEntityComponentError)server · 类entityerrorcomponent - [InvalidEntityError](/server/classes/InvalidEntityError)server · 类entityerror - [InvalidItemStackError](/server/classes/InvalidItemStackError)server · 类itemerror - [InvalidIteratorError](/server/classes/InvalidIteratorError)server · 类error - [InvalidPotionDeliveryTypeError](/server/classes/InvalidPotionDeliveryTypeError)server · 类error - [InvalidPotionEffectTypeError](/server/classes/InvalidPotionEffectTypeError)server · 类effecterror - [InvalidStructureError](/server/classes/InvalidStructureError)server · 类error - [InvalidWaypointError](/server/classes/InvalidWaypointError)server · 类error - [InvalidWaypointTextureSelectorError](/server/classes/InvalidWaypointTextureSelectorError)server · 类error - [IsBabyCondition](/server/classes/IsBabyCondition)server · 类 - [ISerializable](/server/classes/ISerializable)server · 类 - [ItemBlockDynamicPropertiesComponent](/server/classes/ItemBlockDynamicPropertiesComponent)server · 类blockcomponent - [ItemBookComponent](/server/classes/ItemBookComponent)server · 类component - [ItemCompleteUseAfterEvent](/server/classes/ItemCompleteUseAfterEvent)server · 类event - [ItemCompleteUseAfterEventSignal](/server/classes/ItemCompleteUseAfterEventSignal)server · 类event - [ItemCompleteUseEvent](/server/classes/ItemCompleteUseEvent)server · 类event - [ItemComponent](/server/classes/ItemComponent)server · 类component - [ItemComponentBeforeDurabilityDamageEvent](/server/classes/ItemComponentBeforeDurabilityDamageEvent)server · 类eventdamagecomponent - [ItemComponentCompleteUseEvent](/server/classes/ItemComponentCompleteUseEvent)server · 类eventcomponent - [ItemComponentConsumeEvent](/server/classes/ItemComponentConsumeEvent)server · 类eventcomponent - [ItemComponentHitEntityEvent](/server/classes/ItemComponentHitEntityEvent)server · 类evententitycomponent - [ItemComponentMineBlockEvent](/server/classes/ItemComponentMineBlockEvent)server · 类eventblockcomponent - [ItemComponentRegistry](/server/classes/ItemComponentRegistry)server · 类component - [ItemComponentUseEvent](/server/classes/ItemComponentUseEvent)server · 类eventcomponent - [ItemComponentUseOnEvent](/server/classes/ItemComponentUseOnEvent)server · 类eventcomponent - [ItemCompostableComponent](/server/classes/ItemCompostableComponent)server · 类component - [ItemCooldownComponent](/server/classes/ItemCooldownComponent)server · 类component - [ItemCustomComponentAlreadyRegisteredError](/server/classes/ItemCustomComponentAlreadyRegisteredError)server · 类errorcomponent - [ItemCustomComponentInstance](/server/classes/ItemCustomComponentInstance)server · 类component - [ItemCustomComponentReloadNewComponentError](/server/classes/ItemCustomComponentReloadNewComponentError)server · 类errorcomponent - [ItemCustomComponentReloadNewEventError](/server/classes/ItemCustomComponentReloadNewEventError)server · 类eventerrorcomponent - [ItemCustomComponentReloadVersionError](/server/classes/ItemCustomComponentReloadVersionError)server · 类errorcomponent - [ItemDurabilityComponent](/server/classes/ItemDurabilityComponent)server · 类component - [ItemDyeableComponent](/server/classes/ItemDyeableComponent)server · 类component - [ItemEnchantableComponent](/server/classes/ItemEnchantableComponent)server · 类component - [ItemFoodComponent](/server/classes/ItemFoodComponent)server · 类component - [ItemInventoryComponent](/server/classes/ItemInventoryComponent)server · 类inventorycomponent - [ItemPotionComponent](/server/classes/ItemPotionComponent)server · 类component - [ItemReleaseUseAfterEvent](/server/classes/ItemReleaseUseAfterEvent)server · 类event - [ItemReleaseUseAfterEventSignal](/server/classes/ItemReleaseUseAfterEventSignal)server · 类event - [ItemStack](/server/classes/ItemStack)server · 类item - [ItemStartUseAfterEvent](/server/classes/ItemStartUseAfterEvent)server · 类event - [ItemStartUseAfterEventSignal](/server/classes/ItemStartUseAfterEventSignal)server · 类event - [ItemStartUseOnAfterEvent](/server/classes/ItemStartUseOnAfterEvent)server · 类event - [ItemStartUseOnAfterEventSignal](/server/classes/ItemStartUseOnAfterEventSignal)server · 类event - [ItemStopUseAfterEvent](/server/classes/ItemStopUseAfterEvent)server · 类event - [ItemStopUseAfterEventSignal](/server/classes/ItemStopUseAfterEventSignal)server · 类event - [ItemStopUseOnAfterEvent](/server/classes/ItemStopUseOnAfterEvent)server · 类event - [ItemStopUseOnAfterEventSignal](/server/classes/ItemStopUseOnAfterEventSignal)server · 类event - [ItemType](/server/classes/ItemType)server · 类item - [ItemTypes](/server/classes/ItemTypes)server · 类 - [ItemUseAfterEvent](/server/classes/ItemUseAfterEvent)server · 类event - [ItemUseAfterEventSignal](/server/classes/ItemUseAfterEventSignal)server · 类event - [ItemUseBeforeEvent](/server/classes/ItemUseBeforeEvent)server · 类event - [ItemUseBeforeEventSignal](/server/classes/ItemUseBeforeEventSignal)server · 类event - [ItemUseOnEvent](/server/classes/ItemUseOnEvent)server · 类event - [KilledByEntityCondition](/server/classes/KilledByEntityCondition)server · 类entity - [KilledByPlayerCondition](/server/classes/KilledByPlayerCondition)server · 类player - [KilledByPlayerOrPetsCondition](/server/classes/KilledByPlayerOrPetsCondition)server · 类player - [LeverActionAfterEvent](/server/classes/LeverActionAfterEvent)server · 类event - [LeverActionAfterEventSignal](/server/classes/LeverActionAfterEventSignal)server · 类event - [LinearSpline](/server/classes/LinearSpline)server · 类 - [ListBlockVolume](/server/classes/ListBlockVolume)server · 类block - [LocationInUnloadedChunkError](/server/classes/LocationInUnloadedChunkError)server · 类error - [LocationOutOfWorldBoundariesError](/server/classes/LocationOutOfWorldBoundariesError)server · 类worlderror - [LocationWaypoint](/server/classes/LocationWaypoint)server · 类 - [LocatorBar](/server/classes/LocatorBar)server · 类 - [LocatorBarError](/server/classes/LocatorBarError)server · 类error - [LootingEnchantFunction](/server/classes/LootingEnchantFunction)server · 类 - [LootItem](/server/classes/LootItem)server · 类 - [LootItemCondition](/server/classes/LootItemCondition)server · 类 - [LootItemFunction](/server/classes/LootItemFunction)server · 类 - [LootPool](/server/classes/LootPool)server · 类 - [LootPoolEntry](/server/classes/LootPoolEntry)server · 类 - [LootPoolTiers](/server/classes/LootPoolTiers)server · 类 - [LootTable](/server/classes/LootTable)server · 类 - [LootTableEntry](/server/classes/LootTableEntry)server · 类 - [LootTableManager](/server/classes/LootTableManager)server · 类 - [LootTableReference](/server/classes/LootTableReference)server · 类 - [MatchToolCondition](/server/classes/MatchToolCondition)server · 类 - [MessageReceiveAfterEvent](/server/classes/MessageReceiveAfterEvent)server · 类event - [MolangVariableMap](/server/classes/MolangVariableMap)server · 类 - [NamespaceNameError](/server/classes/NamespaceNameError)server · 类error - [PackSettingChangeAfterEvent](/server/classes/PackSettingChangeAfterEvent)server · 类event - [PackSettingChangeAfterEventSignal](/server/classes/PackSettingChangeAfterEventSignal)server · 类event - [PassengerOfEntityCondition](/server/classes/PassengerOfEntityCondition)server · 类entity - [PistonActivateAfterEvent](/server/classes/PistonActivateAfterEvent)server · 类event - [PistonActivateAfterEventSignal](/server/classes/PistonActivateAfterEventSignal)server · 类event - [PlaceJigsawError](/server/classes/PlaceJigsawError)server · 类error - [Player](/server/classes/Player)server · 类player - [PlayerAimAssist](/server/classes/PlayerAimAssist)server · 类player - [PlayerBreakBlockAfterEvent](/server/classes/PlayerBreakBlockAfterEvent)server · 类eventplayerblock - [PlayerBreakBlockAfterEventSignal](/server/classes/PlayerBreakBlockAfterEventSignal)server · 类eventplayerblock - [PlayerBreakBlockBeforeEvent](/server/classes/PlayerBreakBlockBeforeEvent)server · 类eventplayerblock - [PlayerBreakBlockBeforeEventSignal](/server/classes/PlayerBreakBlockBeforeEventSignal)server · 类eventplayerblock - [PlayerButtonInputAfterEvent](/server/classes/PlayerButtonInputAfterEvent)server · 类eventplayer - [PlayerButtonInputAfterEventSignal](/server/classes/PlayerButtonInputAfterEventSignal)server · 类eventplayer - [PlayerCancelBreakingBlockAfterEvent](/server/classes/PlayerCancelBreakingBlockAfterEvent)server · 类eventplayerblock - [PlayerCancelBreakingBlockAfterEventSignal](/server/classes/PlayerCancelBreakingBlockAfterEventSignal)server · 类eventplayerblock - [PlayerCursorInventoryComponent](/server/classes/PlayerCursorInventoryComponent)server · 类playerinventorycomponent - [PlayerDimensionChangeAfterEvent](/server/classes/PlayerDimensionChangeAfterEvent)server · 类eventplayerdimension - [PlayerDimensionChangeAfterEventSignal](/server/classes/PlayerDimensionChangeAfterEventSignal)server · 类eventplayerdimension - [PlayerEmoteAfterEvent](/server/classes/PlayerEmoteAfterEvent)server · 类eventplayer - [PlayerEmoteAfterEventSignal](/server/classes/PlayerEmoteAfterEventSignal)server · 类eventplayer - [PlayerGameModeChangeAfterEvent](/server/classes/PlayerGameModeChangeAfterEvent)server · 类eventplayer - [PlayerGameModeChangeAfterEventSignal](/server/classes/PlayerGameModeChangeAfterEventSignal)server · 类eventplayer - [PlayerGameModeChangeBeforeEvent](/server/classes/PlayerGameModeChangeBeforeEvent)server · 类eventplayer - [PlayerGameModeChangeBeforeEventSignal](/server/classes/PlayerGameModeChangeBeforeEventSignal)server · 类eventplayer - [PlayerHotbarSelectedSlotChangeAfterEvent](/server/classes/PlayerHotbarSelectedSlotChangeAfterEvent)server · 类eventplayer - [PlayerHotbarSelectedSlotChangeAfterEventSignal](/server/classes/PlayerHotbarSelectedSlotChangeAfterEventSignal)server · 类eventplayer - [PlayerInputModeChangeAfterEvent](/server/classes/PlayerInputModeChangeAfterEvent)server · 类eventplayer - [PlayerInputModeChangeAfterEventSignal](/server/classes/PlayerInputModeChangeAfterEventSignal)server · 类eventplayer - [PlayerInputPermissionCategoryChangeAfterEvent](/server/classes/PlayerInputPermissionCategoryChangeAfterEvent)server · 类eventplayerpermission - [PlayerInputPermissionCategoryChangeAfterEventSignal](/server/classes/PlayerInputPermissionCategoryChangeAfterEventSignal)server · 类eventplayerpermission - [PlayerInputPermissions](/server/classes/PlayerInputPermissions)server · 类player - [PlayerInteractWithBlockAfterEvent](/server/classes/PlayerInteractWithBlockAfterEvent)server · 类eventplayerblock - [PlayerInteractWithBlockAfterEventSignal](/server/classes/PlayerInteractWithBlockAfterEventSignal)server · 类eventplayerblock - [PlayerInteractWithBlockBeforeEvent](/server/classes/PlayerInteractWithBlockBeforeEvent)server · 类eventplayerblock - [PlayerInteractWithBlockBeforeEventSignal](/server/classes/PlayerInteractWithBlockBeforeEventSignal)server · 类eventplayerblock - [PlayerInteractWithEntityAfterEvent](/server/classes/PlayerInteractWithEntityAfterEvent)server · 类eventplayerentity - [PlayerInteractWithEntityAfterEventSignal](/server/classes/PlayerInteractWithEntityAfterEventSignal)server · 类eventplayerentity - [PlayerInteractWithEntityBeforeEvent](/server/classes/PlayerInteractWithEntityBeforeEvent)server · 类eventplayerentity - [PlayerInteractWithEntityBeforeEventSignal](/server/classes/PlayerInteractWithEntityBeforeEventSignal)server · 类eventplayerentity - [PlayerInventoryItemChangeAfterEvent](/server/classes/PlayerInventoryItemChangeAfterEvent)server · 类eventplayerinventory - [PlayerInventoryItemChangeAfterEventSignal](/server/classes/PlayerInventoryItemChangeAfterEventSignal)server · 类eventplayerinventory - [PlayerJoinAfterEvent](/server/classes/PlayerJoinAfterEvent)server · 类eventplayer - [PlayerJoinAfterEventSignal](/server/classes/PlayerJoinAfterEventSignal)server · 类eventplayer - [PlayerLeaveAfterEvent](/server/classes/PlayerLeaveAfterEvent)server · 类eventplayer - [PlayerLeaveAfterEventSignal](/server/classes/PlayerLeaveAfterEventSignal)server · 类eventplayer - [PlayerLeaveBeforeEvent](/server/classes/PlayerLeaveBeforeEvent)server · 类eventplayer - [PlayerLeaveBeforeEventSignal](/server/classes/PlayerLeaveBeforeEventSignal)server · 类eventplayer - [PlayerPlaceBlockAfterEvent](/server/classes/PlayerPlaceBlockAfterEvent)server · 类eventplayerblock - [PlayerPlaceBlockAfterEventSignal](/server/classes/PlayerPlaceBlockAfterEventSignal)server · 类eventplayerblock - [PlayerPlaceBlockBeforeEvent](/server/classes/PlayerPlaceBlockBeforeEvent)server · 类eventplayerblock - [PlayerPlaceBlockBeforeEventSignal](/server/classes/PlayerPlaceBlockBeforeEventSignal)server · 类eventplayerblock - [PlayerSpawnAfterEvent](/server/classes/PlayerSpawnAfterEvent)server · 类eventplayer - [PlayerSpawnAfterEventSignal](/server/classes/PlayerSpawnAfterEventSignal)server · 类eventplayer - [PlayerStartBreakingBlockAfterEvent](/server/classes/PlayerStartBreakingBlockAfterEvent)server · 类eventplayerblock - [PlayerStartBreakingBlockAfterEventSignal](/server/classes/PlayerStartBreakingBlockAfterEventSignal)server · 类eventplayerblock - [PlayerSwingStartAfterEvent](/server/classes/PlayerSwingStartAfterEvent)server · 类eventplayer - [PlayerSwingStartAfterEventSignal](/server/classes/PlayerSwingStartAfterEventSignal)server · 类eventplayer - [PlayerUseNameTagAfterEvent](/server/classes/PlayerUseNameTagAfterEvent)server · 类eventplayer - [PlayerUseNameTagAfterEventSignal](/server/classes/PlayerUseNameTagAfterEventSignal)server · 类eventplayer - [PlayerWaypoint](/server/classes/PlayerWaypoint)server · 类player - [PotionDeliveryType](/server/classes/PotionDeliveryType)server · 类 - [PotionEffectType](/server/classes/PotionEffectType)server · 类effect - [Potions](/server/classes/Potions)server · 类 - [PressurePlatePopAfterEvent](/server/classes/PressurePlatePopAfterEvent)server · 类event - [PressurePlatePopAfterEventSignal](/server/classes/PressurePlatePopAfterEventSignal)server · 类event - [PressurePlatePushAfterEvent](/server/classes/PressurePlatePushAfterEvent)server · 类event - [PressurePlatePushAfterEventSignal](/server/classes/PressurePlatePushAfterEventSignal)server · 类event - [PrimitiveShape](/server/classes/PrimitiveShape)server · 类 - [PrimitiveShapeError](/server/classes/PrimitiveShapeError)server · 类error - [PrimitiveShapesManager](/server/classes/PrimitiveShapesManager)server · 类 - [ProjectileHitBlockAfterEvent](/server/classes/ProjectileHitBlockAfterEvent)server · 类eventblock - [ProjectileHitBlockAfterEventSignal](/server/classes/ProjectileHitBlockAfterEventSignal)server · 类eventblock - [ProjectileHitEntityAfterEvent](/server/classes/ProjectileHitEntityAfterEvent)server · 类evententity - [ProjectileHitEntityAfterEventSignal](/server/classes/ProjectileHitEntityAfterEventSignal)server · 类evententity - [RandomAuxValueFunction](/server/classes/RandomAuxValueFunction)server · 类 - [RandomBlockStateFunction](/server/classes/RandomBlockStateFunction)server · 类block - [RandomChanceCondition](/server/classes/RandomChanceCondition)server · 类 - [RandomChanceWithLootingCondition](/server/classes/RandomChanceWithLootingCondition)server · 类 - [RandomDifficultyChanceCondition](/server/classes/RandomDifficultyChanceCondition)server · 类 - [RandomDyeFunction](/server/classes/RandomDyeFunction)server · 类 - [RandomRegionalDifficultyChanceCondition](/server/classes/RandomRegionalDifficultyChanceCondition)server · 类 - [RawMessageError](/server/classes/RawMessageError)server · 类chaterror - [Scoreboard](/server/classes/Scoreboard)server · 类scoreboard - [ScoreboardIdentity](/server/classes/ScoreboardIdentity)server · 类scoreboard - [ScoreboardObjective](/server/classes/ScoreboardObjective)server · 类scoreboard - [ScoreboardScoreInfo](/server/classes/ScoreboardScoreInfo)server · 类scoreboard - [ScreenDisplay](/server/classes/ScreenDisplay)server · 类 - [ScriptEventCommandMessageAfterEvent](/server/classes/ScriptEventCommandMessageAfterEvent)server · 类event - [ScriptEventCommandMessageAfterEventSignal](/server/classes/ScriptEventCommandMessageAfterEventSignal)server · 类event - [Seat](/server/classes/Seat)server · 类 - [ServerMessageAfterEventSignal](/server/classes/ServerMessageAfterEventSignal)server · 类event - [SetArmorTrimFunction](/server/classes/SetArmorTrimFunction)server · 类 - [SetBannerDetailsFunction](/server/classes/SetBannerDetailsFunction)server · 类 - [SetBookContentsFunction](/server/classes/SetBookContentsFunction)server · 类 - [SetDataFromColorIndexFunction](/server/classes/SetDataFromColorIndexFunction)server · 类 - [SetItemCountFunction](/server/classes/SetItemCountFunction)server · 类 - [SetItemDamageFunction](/server/classes/SetItemDamageFunction)server · 类damage - [SetItemDataFunction](/server/classes/SetItemDataFunction)server · 类 - [SetItemLoreFunction](/server/classes/SetItemLoreFunction)server · 类 - [SetItemNameFunction](/server/classes/SetItemNameFunction)server · 类 - [SetOminousBottleFunction](/server/classes/SetOminousBottleFunction)server · 类 - [SetPotionFunction](/server/classes/SetPotionFunction)server · 类 - [SetSpawnEggFunction](/server/classes/SetSpawnEggFunction)server · 类 - [SetStewEffectFunction](/server/classes/SetStewEffectFunction)server · 类effect - [ShutdownBeforeEventSignal](/server/classes/ShutdownBeforeEventSignal)server · 类event - [ShutdownEvent](/server/classes/ShutdownEvent)server · 类event - [SmeltItemFunction](/server/classes/SmeltItemFunction)server · 类 - [SoundCompletedAfterEvent](/server/classes/SoundCompletedAfterEvent)server · 类eventsound - [SoundCompletedAfterEventSignal](/server/classes/SoundCompletedAfterEventSignal)server · 类eventsound - [SoundDefinition](/server/classes/SoundDefinition)server · 类sound - [SoundDefinitionRegistry](/server/classes/SoundDefinitionRegistry)server · 类sound - [SoundDurationInfo](/server/classes/SoundDurationInfo)server · 类sound - [SoundInstance](/server/classes/SoundInstance)server · 类sound - [SpecificEnchantFunction](/server/classes/SpecificEnchantFunction)server · 类 - [StartupBeforeEventSignal](/server/classes/StartupBeforeEventSignal)server · 类event - [StartupEvent](/server/classes/StartupEvent)server · 类event - [Structure](/server/classes/Structure)server · 类 - [StructureManager](/server/classes/StructureManager)server · 类 - [System](/server/classes/System)server · 类 - [SystemAfterEvents](/server/classes/SystemAfterEvents)server · 类event - [SystemBeforeEvents](/server/classes/SystemBeforeEvents)server · 类event - [SystemInfo](/server/classes/SystemInfo)server · 类 - [TargetBlockHitAfterEvent](/server/classes/TargetBlockHitAfterEvent)server · 类eventblock - [TargetBlockHitAfterEventSignal](/server/classes/TargetBlockHitAfterEventSignal)server · 类eventblock - [TextPrimitive](/server/classes/TextPrimitive)server · 类 - [TickingAreaError](/server/classes/TickingAreaError)server · 类error - [TickingAreaManager](/server/classes/TickingAreaManager)server · 类 - [Trigger](/server/classes/Trigger)server · 类 - [TripWireTripAfterEvent](/server/classes/TripWireTripAfterEvent)server · 类event - [TripWireTripAfterEventSignal](/server/classes/TripWireTripAfterEventSignal)server · 类event - [UnloadedChunksError](/server/classes/UnloadedChunksError)server · 类error - [WatchdogTerminateBeforeEvent](/server/classes/WatchdogTerminateBeforeEvent)server · 类event - [WatchdogTerminateBeforeEventSignal](/server/classes/WatchdogTerminateBeforeEventSignal)server · 类event - [Waypoint](/server/classes/Waypoint)server · 类 - [WeatherChangeAfterEvent](/server/classes/WeatherChangeAfterEvent)server · 类event - [WeatherChangeAfterEventSignal](/server/classes/WeatherChangeAfterEventSignal)server · 类event - [WeatherChangeBeforeEvent](/server/classes/WeatherChangeBeforeEvent)server · 类event - [WeatherChangeBeforeEventSignal](/server/classes/WeatherChangeBeforeEventSignal)server · 类event - [World](/server/classes/World)server · 类world - [WorldAfterEvents](/server/classes/WorldAfterEvents)server · 类eventworld - [WorldBeforeEvents](/server/classes/WorldBeforeEvents)server · 类eventworld - [WorldLoadAfterEvent](/server/classes/WorldLoadAfterEvent)server · 类eventworld - [WorldLoadAfterEventSignal](/server/classes/WorldLoadAfterEventSignal)server · 类eventworld - [AimAssistTargetMode](/server/enums/AimAssistTargetMode)server · 枚举 - [BlockComponentTypes](/server/enums/BlockComponentTypes)server · 枚举blockcomponent - [BlockPistonState](/server/enums/BlockPistonState)server · 枚举block - [BlockVolumeIntersection](/server/enums/BlockVolumeIntersection)server · 枚举block - [BookErrorReason](/server/enums/BookErrorReason)server · 枚举error - [ButtonState](/server/enums/ButtonState)server · 枚举 - [CameraShakeType](/server/enums/CameraShakeType)server · 枚举 - [CloneMode](/server/enums/CloneMode)server · 枚举 - [CommandPermissionLevel](/server/enums/CommandPermissionLevel)server · 枚举permission - [ContainerRulesErrorReason](/server/enums/ContainerRulesErrorReason)server · 枚举inventoryerror - [ControlScheme](/server/enums/ControlScheme)server · 枚举 - [CustomCommandErrorReason](/server/enums/CustomCommandErrorReason)server · 枚举error - [CustomCommandParamType](/server/enums/CustomCommandParamType)server · 枚举 - [CustomCommandSource](/server/enums/CustomCommandSource)server · 枚举 - [CustomCommandStatus](/server/enums/CustomCommandStatus)server · 枚举 - [CustomComponentNameErrorReason](/server/enums/CustomComponentNameErrorReason)server · 枚举errorcomponent - [Difficulty](/server/enums/Difficulty)server · 枚举 - [Direction](/server/enums/Direction)server · 枚举 - [DisplaySlotId](/server/enums/DisplaySlotId)server · 枚举 - [DyeColor](/server/enums/DyeColor)server · 枚举 - [EasingType](/server/enums/EasingType)server · 枚举 - [EnchantmentSlot](/server/enums/EnchantmentSlot)server · 枚举 - [EntityAttachPoint](/server/enums/EntityAttachPoint)server · 枚举entity - [EntityComponentTypes](/server/enums/EntityComponentTypes)server · 枚举entitycomponent - [EntityDamageCause](/server/enums/EntityDamageCause)server · 枚举entitydamage - [EntityHealCause](/server/enums/EntityHealCause)server · 枚举entity - [EntityInitializationCause](/server/enums/EntityInitializationCause)server · 枚举entity - [EntitySwingSource](/server/enums/EntitySwingSource)server · 枚举entity - [EquipmentSlot](/server/enums/EquipmentSlot)server · 枚举 - [FluidType](/server/enums/FluidType)server · 枚举 - [GameMode](/server/enums/GameMode)server · 枚举 - [GameRule](/server/enums/GameRule)server · 枚举 - [GraphicsMode](/server/enums/GraphicsMode)server · 枚举 - [HeldItemOption](/server/enums/HeldItemOption)server · 枚举 - [HudElement](/server/enums/HudElement)server · 枚举 - [HudVisibility](/server/enums/HudVisibility)server · 枚举 - [InputButton](/server/enums/InputButton)server · 枚举 - [InputMode](/server/enums/InputMode)server · 枚举 - [InputPermissionCategory](/server/enums/InputPermissionCategory)server · 枚举permission - [ItemComponentTypes](/server/enums/ItemComponentTypes)server · 枚举component - [ItemLockMode](/server/enums/ItemLockMode)server · 枚举item - [LiquidSettings](/server/enums/LiquidSettings)server · 枚举 - [LiquidType](/server/enums/LiquidType)server · 枚举 - [LocatorBarErrorReason](/server/enums/LocatorBarErrorReason)server · 枚举error - [MemoryTier](/server/enums/MemoryTier)server · 枚举 - [MoonPhase](/server/enums/MoonPhase)server · 枚举 - [MovementType](/server/enums/MovementType)server · 枚举 - [NamespaceNameErrorReason](/server/enums/NamespaceNameErrorReason)server · 枚举error - [ObjectiveSortOrder](/server/enums/ObjectiveSortOrder)server · 枚举 - [PaletteColor](/server/enums/PaletteColor)server · 枚举 - [PlatformType](/server/enums/PlatformType)server · 枚举 - [PlayerInventoryType](/server/enums/PlayerInventoryType)server · 枚举playerinventory - [PlayerPermissionLevel](/server/enums/PlayerPermissionLevel)server · 枚举playerpermission - [PlayerSplitScreenSlot](/server/enums/PlayerSplitScreenSlot)server · 枚举player - [PlayerWaypointsMode](/server/enums/PlayerWaypointsMode)server · 枚举player - [ScoreboardIdentityType](/server/enums/ScoreboardIdentityType)server · 枚举scoreboard - [ScriptEventSource](/server/enums/ScriptEventSource)server · 枚举event - [SignSide](/server/enums/SignSide)server · 枚举 - [StickyType](/server/enums/StickyType)server · 枚举 - [StructureAnimationMode](/server/enums/StructureAnimationMode)server · 枚举animation - [StructureMirrorAxis](/server/enums/StructureMirrorAxis)server · 枚举 - [StructureRotation](/server/enums/StructureRotation)server · 枚举 - [StructureSaveMode](/server/enums/StructureSaveMode)server · 枚举 - [TickingAreaErrorReason](/server/enums/TickingAreaErrorReason)server · 枚举error - [TimeOfDay](/server/enums/TimeOfDay)server · 枚举 - [TintMethod](/server/enums/TintMethod)server · 枚举 - [WatchdogTerminateReason](/server/enums/WatchdogTerminateReason)server · 枚举 - [WaypointTexture](/server/enums/WaypointTexture)server · 枚举 - [WeatherType](/server/enums/WeatherType)server · 枚举 - [AABB](/server/interfaces/AABB)server · 接口 - [AnimationOptions](/server/interfaces/AnimationOptions)server · 接口animation - [BiomeFilter](/server/interfaces/BiomeFilter)server · 接口biome - [BiomeSearchOptions](/server/interfaces/BiomeSearchOptions)server · 接口biome - [BlockBoundingBox](/server/interfaces/BlockBoundingBox)server · 接口block - [BlockContainerAccessEventOptions](/server/interfaces/BlockContainerAccessEventOptions)server · 接口eventblockinventory - [BlockCustomComponent](/server/interfaces/BlockCustomComponent)server · 接口blockcomponent - [BlockEventOptions](/server/interfaces/BlockEventOptions)server · 接口eventblock - [BlockFillOptions](/server/interfaces/BlockFillOptions)server · 接口block - [BlockFilter](/server/interfaces/BlockFilter)server · 接口block - [BlockHitInformation](/server/interfaces/BlockHitInformation)server · 接口block - [BlockQueryOptions](/server/interfaces/BlockQueryOptions)server · 接口block - [BlockRaycastHit](/server/interfaces/BlockRaycastHit)server · 接口block - [BlockRaycastOptions](/server/interfaces/BlockRaycastOptions)server · 接口block - [CameraAttachOptions](/server/interfaces/CameraAttachOptions)server · 接口 - [CameraFadeOptions](/server/interfaces/CameraFadeOptions)server · 接口 - [CameraFadeTimeOptions](/server/interfaces/CameraFadeTimeOptions)server · 接口 - [CameraFixedBoomOptions](/server/interfaces/CameraFixedBoomOptions)server · 接口 - [CameraFovOptions](/server/interfaces/CameraFovOptions)server · 接口 - [CameraSetFacingOptions](/server/interfaces/CameraSetFacingOptions)server · 接口 - [CameraSetLocationOptions](/server/interfaces/CameraSetLocationOptions)server · 接口 - [CameraSetPosOptions](/server/interfaces/CameraSetPosOptions)server · 接口 - [CameraSetRotOptions](/server/interfaces/CameraSetRotOptions)server · 接口 - [CameraShakeOptions](/server/interfaces/CameraShakeOptions)server · 接口 - [CameraTargetOptions](/server/interfaces/CameraTargetOptions)server · 接口 - [ContainerAccessSource](/server/interfaces/ContainerAccessSource)server · 接口inventory - [ContainerAccessSourceFilter](/server/interfaces/ContainerAccessSourceFilter)server · 接口inventory - [ContainerRules](/server/interfaces/ContainerRules)server · 接口inventory - [CustomCommand](/server/interfaces/CustomCommand)server · 接口 - [CustomCommandParameter](/server/interfaces/CustomCommandParameter)server · 接口 - [CustomCommandResult](/server/interfaces/CustomCommandResult)server · 接口 - [CustomTexture](/server/interfaces/CustomTexture)server · 接口 - [DefinitionModifier](/server/interfaces/DefinitionModifier)server · 接口 - [DimensionLocation](/server/interfaces/DimensionLocation)server · 接口dimension - [EaseOptions](/server/interfaces/EaseOptions)server · 接口 - [Enchantment](/server/interfaces/Enchantment)server · 接口 - [EntityApplyDamageByProjectileOptions](/server/interfaces/EntityApplyDamageByProjectileOptions)server · 接口entitydamage - [EntityApplyDamageOptions](/server/interfaces/EntityApplyDamageOptions)server · 接口entitydamage - [EntityContainerAccessEventOptions](/server/interfaces/EntityContainerAccessEventOptions)server · 接口evententityinventory - [EntityDamageSource](/server/interfaces/EntityDamageSource)server · 接口entitydamage - [EntityDataDrivenTriggerEventOptions](/server/interfaces/EntityDataDrivenTriggerEventOptions)server · 接口evententity - [EntityEffectOptions](/server/interfaces/EntityEffectOptions)server · 接口entityeffect - [EntityEventOptions](/server/interfaces/EntityEventOptions)server · 接口evententity - [EntityFilter](/server/interfaces/EntityFilter)server · 接口entity - [EntityHealEventOptions](/server/interfaces/EntityHealEventOptions)server · 接口evententity - [EntityHitInformation](/server/interfaces/EntityHitInformation)server · 接口entity - [EntityHurtAfterEventOptions](/server/interfaces/EntityHurtAfterEventOptions)server · 接口evententity - [EntityHurtBeforeEventOptions](/server/interfaces/EntityHurtBeforeEventOptions)server · 接口evententity - [EntityItemDropEventOptions](/server/interfaces/EntityItemDropEventOptions)server · 接口evententity - [EntityItemPickupEventOptions](/server/interfaces/EntityItemPickupEventOptions)server · 接口evententity - [EntityQueryOptions](/server/interfaces/EntityQueryOptions)server · 接口entity - [EntityQueryPropertyOptions](/server/interfaces/EntityQueryPropertyOptions)server · 接口entity - [EntityQueryScoreOptions](/server/interfaces/EntityQueryScoreOptions)server · 接口entity - [EntityRaycastHit](/server/interfaces/EntityRaycastHit)server · 接口entity - [EntityRaycastOptions](/server/interfaces/EntityRaycastOptions)server · 接口entity - [EntitySneakingChangedEventOptions](/server/interfaces/EntitySneakingChangedEventOptions)server · 接口evententity - [EntityTamedEventOptions](/server/interfaces/EntityTamedEventOptions)server · 接口evententity - [EntityVisibilityRules](/server/interfaces/EntityVisibilityRules)server · 接口entity - [EqualsComparison](/server/interfaces/EqualsComparison)server · 接口 - [ExplosionOptions](/server/interfaces/ExplosionOptions)server · 接口 - [GetBlocksStandingOnOptions](/server/interfaces/GetBlocksStandingOnOptions)server · 接口 - [GreaterThanComparison](/server/interfaces/GreaterThanComparison)server · 接口 - [GreaterThanOrEqualsComparison](/server/interfaces/GreaterThanOrEqualsComparison)server · 接口 - [HotbarEventOptions](/server/interfaces/HotbarEventOptions)server · 接口event - [InputEventOptions](/server/interfaces/InputEventOptions)server · 接口event - [InventoryItemEventOptions](/server/interfaces/InventoryItemEventOptions)server · 接口eventinventory - [ItemCustomComponent](/server/interfaces/ItemCustomComponent)server · 接口component - [ItemFilter](/server/interfaces/ItemFilter)server · 接口 - [JigsawPlaceOptions](/server/interfaces/JigsawPlaceOptions)server · 接口 - [JigsawStructurePlaceOptions](/server/interfaces/JigsawStructurePlaceOptions)server · 接口 - [LessThanComparison](/server/interfaces/LessThanComparison)server · 接口 - [LessThanOrEqualsComparison](/server/interfaces/LessThanOrEqualsComparison)server · 接口 - [MusicOptions](/server/interfaces/MusicOptions)server · 接口 - [NotEqualsComparison](/server/interfaces/NotEqualsComparison)server · 接口 - [PlayAnimationOptions](/server/interfaces/PlayAnimationOptions)server · 接口animation - [PlayerAimAssistSettings](/server/interfaces/PlayerAimAssistSettings)server · 接口player - [PlayerBreakingBlockEventOptions](/server/interfaces/PlayerBreakingBlockEventOptions)server · 接口eventplayerblock - [PlayerSoundOptions](/server/interfaces/PlayerSoundOptions)server · 接口playersound - [PlayerSwingEventOptions](/server/interfaces/PlayerSwingEventOptions)server · 接口eventplayer - [PlayerVisibilityRules](/server/interfaces/PlayerVisibilityRules)server · 接口player - [PrimitiveShapeQueryOptions](/server/interfaces/PrimitiveShapeQueryOptions)server · 接口 - [ProgressKeyFrame](/server/interfaces/ProgressKeyFrame)server · 接口 - [ProjectileShootOptions](/server/interfaces/ProjectileShootOptions)server · 接口 - [RangeComparison](/server/interfaces/RangeComparison)server · 接口 - [RawMessage](/server/interfaces/RawMessage)server · 接口chat - [RawMessageScore](/server/interfaces/RawMessageScore)server · 接口chat - [RawText](/server/interfaces/RawText)server · 接口chat - [RGB](/server/interfaces/RGB)server · 接口 - [RGBA](/server/interfaces/RGBA)server · 接口 - [RotationKeyFrame](/server/interfaces/RotationKeyFrame)server · 接口 - [ScoreboardObjectiveDisplayOptions](/server/interfaces/ScoreboardObjectiveDisplayOptions)server · 接口scoreboard - [ScriptEventMessageFilterOptions](/server/interfaces/ScriptEventMessageFilterOptions)server · 接口event - [SoundDefinitionDurationInfo](/server/interfaces/SoundDefinitionDurationInfo)server · 接口sound - [SoundDefinitionFilter](/server/interfaces/SoundDefinitionFilter)server · 接口sound - [SoundDefinitionMusicInfo](/server/interfaces/SoundDefinitionMusicInfo)server · 接口sound - [SpawnEntityOptions](/server/interfaces/SpawnEntityOptions)server · 接口entity - [SplineAnimation](/server/interfaces/SplineAnimation)server · 接口animation - [StructureCreateOptions](/server/interfaces/StructureCreateOptions)server · 接口 - [StructurePlaceOptions](/server/interfaces/StructurePlaceOptions)server · 接口 - [TeleportOptions](/server/interfaces/TeleportOptions)server · 接口 - [TickingArea](/server/interfaces/TickingArea)server · 接口 - [TickingAreaOptions](/server/interfaces/TickingAreaOptions)server · 接口 - [TitleDisplayOptions](/server/interfaces/TitleDisplayOptions)server · 接口 - [Vector2](/server/interfaces/Vector2)server · 接口 - [Vector3](/server/interfaces/Vector3)server · 接口 - [VectorXZ](/server/interfaces/VectorXZ)server · 接口 - [WaypointTextureBounds](/server/interfaces/WaypointTextureBounds)server · 接口 - [WaypointTextureSelector](/server/interfaces/WaypointTextureSelector)server · 接口 - [WorldSoundOptions](/server/interfaces/WorldSoundOptions)server · 接口worldsound - [BlockComponentReturnType](/server/types/BlockComponentReturnType)server · 类型别名blockcomponent - [BlockComponentTypeMap](/server/types/BlockComponentTypeMap)server · 类型别名blockcomponent - [BlockStateArg](/server/types/BlockStateArg)server · 类型别名block - [EntityComponentReturnType](/server/types/EntityComponentReturnType)server · 类型别名entitycomponent - [EntityComponentTypeMap](/server/types/EntityComponentTypeMap)server · 类型别名entitycomponent - [EntityIdentifierType](/server/types/EntityIdentifierType)server · 类型别名entity - [ItemComponentReturnType](/server/types/ItemComponentReturnType)server · 类型别名component - [ItemComponentTypeMap](/server/types/ItemComponentTypeMap)server · 类型别名component - [VanillaEntityIdentifier](/server/types/VanillaEntityIdentifier)server · 类型别名entity - [HudElementsCount](/server/variables/HudElementsCount)server · 变量 - [HudVisibilityCount](/server/variables/HudVisibilityCount)server · 变量 - [MoonPhaseCount](/server/variables/MoonPhaseCount)server · 变量 - [system](/server/variables/system)server · 变量 - [TicksPerDay](/server/variables/TicksPerDay)server · 变量 - [TicksPerSecond](/server/variables/TicksPerSecond)server · 变量 - [world](/server/variables/world)server · 变量 - [AdminBeforeEvents](/server-admin/classes/AdminBeforeEvents)server-admin · 类event - [AllowList](/server-admin/classes/AllowList)server-admin · 类 - [AllowListFileReloadError](/server-admin/classes/AllowListFileReloadError)server-admin · 类error - [AllowListModificationError](/server-admin/classes/AllowListModificationError)server-admin · 类error - [AsyncPlayerJoinBeforeEvent](/server-admin/classes/AsyncPlayerJoinBeforeEvent)server-admin · 类eventplayer - [AsyncPlayerJoinBeforeEventSignal](/server-admin/classes/AsyncPlayerJoinBeforeEventSignal)server-admin · 类eventplayer - [CannotDeopPlayerError](/server-admin/classes/CannotDeopPlayerError)server-admin · 类playererror - [CannotKickPlayerError](/server-admin/classes/CannotKickPlayerError)server-admin · 类playererror - [DedicatedServerUtils](/server-admin/classes/DedicatedServerUtils)server-admin · 类 - [DisconnectedError](/server-admin/classes/DisconnectedError)server-admin · 类error - [LevelStorage](/server-admin/classes/LevelStorage)server-admin · 类data - [LevelStorageQuerySnapshotFile](/server-admin/classes/LevelStorageQuerySnapshotFile)server-admin · 类data - [LevelStorageSaveStateChangeError](/server-admin/classes/LevelStorageSaveStateChangeError)server-admin · 类dataerror - [PlayerAlreadyOpError](/server-admin/classes/PlayerAlreadyOpError)server-admin · 类playererror - [SecretString](/server-admin/classes/SecretString)server-admin · 类 - [ServerSecrets](/server-admin/classes/ServerSecrets)server-admin · 类 - [ServerVariables](/server-admin/classes/ServerVariables)server-admin · 类 - [deopPlayer](/server-admin/functions/deopPlayer)server-admin · 函数player - [kickPlayer](/server-admin/functions/kickPlayer)server-admin · 函数player - [opPlayer](/server-admin/functions/opPlayer)server-admin · 函数player - [transferPlayer](/server-admin/functions/transferPlayer)server-admin · 函数player - [AllowListEntry](/server-admin/interfaces/AllowListEntry)server-admin · 接口 - [TransferPlayerIpPortOptions](/server-admin/interfaces/TransferPlayerIpPortOptions)server-admin · 接口player - [TransferPlayerNetherNetOptions](/server-admin/interfaces/TransferPlayerNetherNetOptions)server-admin · 接口player - [beforeEvents](/server-admin/variables/beforeEvents)server-admin · 变量event - [dedicatedServer](/server-admin/variables/dedicatedServer)server-admin · 变量 - [secrets](/server-admin/variables/secrets)server-admin · 变量 - [variables](/server-admin/variables/variables)server-admin · 变量 - [AudioSettings](/server-editor/classes/AudioSettings)server-editor · 类 - [BedrockEventSubscriptionCache](/server-editor/classes/BedrockEventSubscriptionCache)server-editor · 类event - [BlockIdentifierListObservableValidator](/server-editor/classes/BlockIdentifierListObservableValidator)server-editor · 类block - [BlockIdentifierObservableValidator](/server-editor/classes/BlockIdentifierObservableValidator)server-editor · 类block - [BlockPalette](/server-editor/classes/BlockPalette)server-editor · 类block - [BlockPaletteManager](/server-editor/classes/BlockPaletteManager)server-editor · 类block - [BlockPaletteSelectedItemChangeAfterEvent](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEvent)server-editor · 类eventblock - [BlockPaletteSelectedItemChangeAfterEventSignal](/server-editor/classes/BlockPaletteSelectedItemChangeAfterEventSignal)server-editor · 类eventblock - [BlockUtilities](/server-editor/classes/BlockUtilities)server-editor · 类block - [BlockUtilityTasks](/server-editor/classes/BlockUtilityTasks)server-editor · 类block - [BrushShape](/server-editor/classes/BrushShape)server-editor · 类 - [BrushShapeManager](/server-editor/classes/BrushShapeManager)server-editor · 类 - [ClipboardChangeAfterEvent](/server-editor/classes/ClipboardChangeAfterEvent)server-editor · 类event - [ClipboardChangeAfterEventSignal](/server-editor/classes/ClipboardChangeAfterEventSignal)server-editor · 类event - [ClipboardItem](/server-editor/classes/ClipboardItem)server-editor · 类 - [ClipboardManager](/server-editor/classes/ClipboardManager)server-editor · 类 - [ConeBrushShape](/server-editor/classes/ConeBrushShape)server-editor · 类 - [CuboidBrushShape](/server-editor/classes/CuboidBrushShape)server-editor · 类 - [CurrentThemeChangeAfterEvent](/server-editor/classes/CurrentThemeChangeAfterEvent)server-editor · 类event - [CurrentThemeChangeAfterEventSignal](/server-editor/classes/CurrentThemeChangeAfterEventSignal)server-editor · 类event - [CurrentThemeColorChangeAfterEvent](/server-editor/classes/CurrentThemeColorChangeAfterEvent)server-editor · 类event - [CurrentThemeColorChangeAfterEventSignal](/server-editor/classes/CurrentThemeColorChangeAfterEventSignal)server-editor · 类event - [Cursor](/server-editor/classes/Cursor)server-editor · 类 - [CursorPropertiesChangeAfterEvent](/server-editor/classes/CursorPropertiesChangeAfterEvent)server-editor · 类event - [CursorPropertyChangeAfterEventSignal](/server-editor/classes/CursorPropertyChangeAfterEventSignal)server-editor · 类event - [CylinderBrushShape](/server-editor/classes/CylinderBrushShape)server-editor · 类 - [EditorConstants](/server-editor/classes/EditorConstants)server-editor · 类 - [EditorStructure](/server-editor/classes/EditorStructure)server-editor · 类 - [EditorStructureManager](/server-editor/classes/EditorStructureManager)server-editor · 类 - [EllipsoidBrushShape](/server-editor/classes/EllipsoidBrushShape)server-editor · 类 - [EntityIdentifierObservableValidator](/server-editor/classes/EntityIdentifierObservableValidator)server-editor · 类entity - [ExportManager](/server-editor/classes/ExportManager)server-editor · 类 - [Extension](/server-editor/classes/Extension)server-editor · 类 - [ExtensionContext](/server-editor/classes/ExtensionContext)server-editor · 类 - [ExtensionContextAfterEvents](/server-editor/classes/ExtensionContextAfterEvents)server-editor · 类event - [GraphicsSettings](/server-editor/classes/GraphicsSettings)server-editor · 类 - [GuidePlaneManager](/server-editor/classes/GuidePlaneManager)server-editor · 类 - [IBlockPaletteItem](/server-editor/classes/IBlockPaletteItem)server-editor · 类 - [InvalidWidgetComponentError](/server-editor/classes/InvalidWidgetComponentError)server-editor · 类errorcomponent - [InvalidWidgetError](/server-editor/classes/InvalidWidgetError)server-editor · 类error - [InvalidWidgetGroupError](/server-editor/classes/InvalidWidgetGroupError)server-editor · 类error - [Logger](/server-editor/classes/Logger)server-editor · 类 - [MinecraftEditor](/server-editor/classes/MinecraftEditor)server-editor · 类 - [MinimapItem](/server-editor/classes/MinimapItem)server-editor · 类 - [MinimapManager](/server-editor/classes/MinimapManager)server-editor · 类 - [ModeChangeAfterEvent](/server-editor/classes/ModeChangeAfterEvent)server-editor · 类event - [ModeChangeAfterEventSignal](/server-editor/classes/ModeChangeAfterEventSignal)server-editor · 类event - [NumberLimitObservableValidator](/server-editor/classes/NumberLimitObservableValidator)server-editor · 类 - [ObservableValidator](/server-editor/classes/ObservableValidator)server-editor · 类 - [PendingTransaction](/server-editor/classes/PendingTransaction)server-editor · 类 - [PlaytestManager](/server-editor/classes/PlaytestManager)server-editor · 类 - [ProbabilityBlockPaletteItem](/server-editor/classes/ProbabilityBlockPaletteItem)server-editor · 类block - [ProjectAfterEvents](/server-editor/classes/ProjectAfterEvents)server-editor · 类event - [PyramidBrushShape](/server-editor/classes/PyramidBrushShape)server-editor · 类 - [RelativeVolumeListBlockVolume](/server-editor/classes/RelativeVolumeListBlockVolume)server-editor · 类block - [SelectionChangeAfterEventSignal](/server-editor/classes/SelectionChangeAfterEventSignal)server-editor · 类event - [SelectionContainerBase](/server-editor/classes/SelectionContainerBase)server-editor · 类inventory - [SelectionContainerEntity](/server-editor/classes/SelectionContainerEntity)server-editor · 类entityinventory - [SelectionContainerVolume](/server-editor/classes/SelectionContainerVolume)server-editor · 类inventory - [SelectionContainerVolumeEvent](/server-editor/classes/SelectionContainerVolumeEvent)server-editor · 类eventinventory - [SelectionEventAfterEvent](/server-editor/classes/SelectionEventAfterEvent)server-editor · 类event - [SelectionManager](/server-editor/classes/SelectionManager)server-editor · 类 - [SettingsManager](/server-editor/classes/SettingsManager)server-editor · 类 - [SimpleBlockPaletteItem](/server-editor/classes/SimpleBlockPaletteItem)server-editor · 类block - [SimulationState](/server-editor/classes/SimulationState)server-editor · 类 - [SimulationStateAfterEvent](/server-editor/classes/SimulationStateAfterEvent)server-editor · 类event - [SimulationStateChangeAfterEventSignal](/server-editor/classes/SimulationStateChangeAfterEventSignal)server-editor · 类event - [SingleBlockBrushShape](/server-editor/classes/SingleBlockBrushShape)server-editor · 类block - [SpeedSettings](/server-editor/classes/SpeedSettings)server-editor · 类 - [ThemeSettings](/server-editor/classes/ThemeSettings)server-editor · 类 - [TransactionEvent](/server-editor/classes/TransactionEvent)server-editor · 类event - [TransactionHandler](/server-editor/classes/TransactionHandler)server-editor · 类 - [TransactionManager](/server-editor/classes/TransactionManager)server-editor · 类 - [TransactionManagerNoChangesError](/server-editor/classes/TransactionManagerNoChangesError)server-editor · 类error - [TransactionOperationHandler](/server-editor/classes/TransactionOperationHandler)server-editor · 类 - [UserDefinedTransactionHandle](/server-editor/classes/UserDefinedTransactionHandle)server-editor · 类 - [UserDefinedTransactionOperationHandler](/server-editor/classes/UserDefinedTransactionOperationHandler)server-editor · 类 - [Vector2LimitObservableValidator](/server-editor/classes/Vector2LimitObservableValidator)server-editor · 类 - [Vector3LimitObservableValidator](/server-editor/classes/Vector3LimitObservableValidator)server-editor · 类 - [VolumeListTransactionOperationHandler](/server-editor/classes/VolumeListTransactionOperationHandler)server-editor · 类 - [Widget](/server-editor/classes/Widget)server-editor · 类 - [WidgetComponentBase](/server-editor/classes/WidgetComponentBase)server-editor · 类component - [WidgetComponentBoundingBox](/server-editor/classes/WidgetComponentBoundingBox)server-editor · 类component - [WidgetComponentBoundingBoxStateChangeEventParameters](/server-editor/classes/WidgetComponentBoundingBoxStateChangeEventParameters)server-editor · 类eventcomponent - [WidgetComponentClipboard](/server-editor/classes/WidgetComponentClipboard)server-editor · 类component - [WidgetComponentEntity](/server-editor/classes/WidgetComponentEntity)server-editor · 类entitycomponent - [WidgetComponentGizmo](/server-editor/classes/WidgetComponentGizmo)server-editor · 类component - [WidgetComponentGizmoStateChangeEventParameters](/server-editor/classes/WidgetComponentGizmoStateChangeEventParameters)server-editor · 类eventcomponent - [WidgetComponentGrid](/server-editor/classes/WidgetComponentGrid)server-editor · 类component - [WidgetComponentGuide](/server-editor/classes/WidgetComponentGuide)server-editor · 类component - [WidgetComponentRenderPlane](/server-editor/classes/WidgetComponentRenderPlane)server-editor · 类component - [WidgetComponentRenderPrimitive](/server-editor/classes/WidgetComponentRenderPrimitive)server-editor · 类component - [WidgetComponentRenderPrimitiveTypeAxialSphere](/server-editor/classes/WidgetComponentRenderPrimitiveTypeAxialSphere)server-editor · 类component - [WidgetComponentRenderPrimitiveTypeBase](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBase)server-editor · 类component - [WidgetComponentRenderPrimitiveTypeBox](/server-editor/classes/WidgetComponentRenderPrimitiveTypeBox)server-editor · 类component - [WidgetComponentRenderPrimitiveTypeCone](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCone)server-editor · 类component - [WidgetComponentRenderPrimitiveTypeCuboid](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCuboid)server-editor · 类component - [WidgetComponentRenderPrimitiveTypeCylinder](/server-editor/classes/WidgetComponentRenderPrimitiveTypeCylinder)server-editor · 类component - [WidgetComponentRenderPrimitiveTypeDisc](/server-editor/classes/WidgetComponentRenderPrimitiveTypeDisc)server-editor · 类component - [WidgetComponentRenderPrimitiveTypeEllipsoid](/server-editor/classes/WidgetComponentRenderPrimitiveTypeEllipsoid)server-editor · 类component - [WidgetComponentRenderPrimitiveTypeLine](/server-editor/classes/WidgetComponentRenderPrimitiveTypeLine)server-editor · 类component - [WidgetComponentRenderPrimitiveTypePyramid](/server-editor/classes/WidgetComponentRenderPrimitiveTypePyramid)server-editor · 类component - [WidgetComponentRenderPrimitiveTypeWireframeMesh](/server-editor/classes/WidgetComponentRenderPrimitiveTypeWireframeMesh)server-editor · 类component - [WidgetComponentSpline](/server-editor/classes/WidgetComponentSpline)server-editor · 类component - [WidgetComponentText](/server-editor/classes/WidgetComponentText)server-editor · 类component - [WidgetComponentVolumeOutline](/server-editor/classes/WidgetComponentVolumeOutline)server-editor · 类component - [WidgetGroup](/server-editor/classes/WidgetGroup)server-editor · 类 - [WidgetManager](/server-editor/classes/WidgetManager)server-editor · 类 - [WidgetMouseButtonEventData](/server-editor/classes/WidgetMouseButtonEventData)server-editor · 类event - [WidgetStateChangeEventData](/server-editor/classes/WidgetStateChangeEventData)server-editor · 类event - [ActionTypes](/server-editor/enums/ActionTypes)server-editor · 枚举 - [AudioSettingsProperty](/server-editor/enums/AudioSettingsProperty)server-editor · 枚举 - [Axis](/server-editor/enums/Axis)server-editor · 枚举 - [BlockMaskListType](/server-editor/enums/BlockMaskListType)server-editor · 枚举block - [BlockPaletteItemType](/server-editor/enums/BlockPaletteItemType)server-editor · 枚举itemblock - [BlockTableOperationType](/server-editor/enums/BlockTableOperationType)server-editor · 枚举block - [BlockUtilityExtrudeDirection](/server-editor/enums/BlockUtilityExtrudeDirection)server-editor · 枚举block - [BlockUtilityFloodMatchCriteria](/server-editor/enums/BlockUtilityFloodMatchCriteria)server-editor · 枚举block - [BoolPropertyItemVariant](/server-editor/enums/BoolPropertyItemVariant)server-editor · 枚举 - [BrushDirectionalPlacementMode](/server-editor/enums/BrushDirectionalPlacementMode)server-editor · 枚举 - [BrushElevationMode](/server-editor/enums/BrushElevationMode)server-editor · 枚举 - [ButtonVariant](/server-editor/enums/ButtonVariant)server-editor · 枚举 - [CollectionTreeEntryItemType](/server-editor/enums/CollectionTreeEntryItemType)server-editor · 枚举item - [CollectionTreeSortType](/server-editor/enums/CollectionTreeSortType)server-editor · 枚举 - [ColorPickerPropertyItemVariant](/server-editor/enums/ColorPickerPropertyItemVariant)server-editor · 枚举 - [ComboBoxPropertyItemDataType](/server-editor/enums/ComboBoxPropertyItemDataType)server-editor · 枚举 - [ContiguousSelectionType](/server-editor/enums/ContiguousSelectionType)server-editor · 枚举 - [ContinuousActionState](/server-editor/enums/ContinuousActionState)server-editor · 枚举 - [CoreActionBarItemType](/server-editor/enums/CoreActionBarItemType)server-editor · 枚举item - [CoreBrushShapeType](/server-editor/enums/CoreBrushShapeType)server-editor · 枚举 - [CoreInputBindingCategory](/server-editor/enums/CoreInputBindingCategory)server-editor · 枚举 - [CoreMenuType](/server-editor/enums/CoreMenuType)server-editor · 枚举 - [CoreModalDialogType](/server-editor/enums/CoreModalDialogType)server-editor · 枚举 - [CursorControlMode](/server-editor/enums/CursorControlMode)server-editor · 枚举 - [CursorTargetMode](/server-editor/enums/CursorTargetMode)server-editor · 枚举 - [DataPickerModalDialogVariant](/server-editor/enums/DataPickerModalDialogVariant)server-editor · 枚举 - [DaylightCycle](/server-editor/enums/DaylightCycle)server-editor · 枚举 - [EditorInputContext](/server-editor/enums/EditorInputContext)server-editor · 枚举 - [EditorMode](/server-editor/enums/EditorMode)server-editor · 枚举 - [EntityOperationType](/server-editor/enums/EntityOperationType)server-editor · 枚举entity - [ExportResult](/server-editor/enums/ExportResult)server-editor · 枚举 - [FlattenMode](/server-editor/enums/FlattenMode)server-editor · 枚举 - [GamePublishSetting](/server-editor/enums/GamePublishSetting)server-editor · 枚举 - [GraphicsSettingsProperty](/server-editor/enums/GraphicsSettingsProperty)server-editor · 枚举 - [ImageResourceType](/server-editor/enums/ImageResourceType)server-editor · 枚举 - [InputModifier](/server-editor/enums/InputModifier)server-editor · 枚举 - [KeyboardKey](/server-editor/enums/KeyboardKey)server-editor · 枚举 - [KeyProcessingState](/server-editor/enums/KeyProcessingState)server-editor · 枚举 - [LayoutAlignment](/server-editor/enums/LayoutAlignment)server-editor · 枚举 - [LayoutFlex](/server-editor/enums/LayoutFlex)server-editor · 枚举 - [LayoutSizeType](/server-editor/enums/LayoutSizeType)server-editor · 枚举 - [ListPaneEntryType](/server-editor/enums/ListPaneEntryType)server-editor · 枚举 - [ListPaneSlotVariant](/server-editor/enums/ListPaneSlotVariant)server-editor · 枚举 - [ListPaneViewSortType](/server-editor/enums/ListPaneViewSortType)server-editor · 枚举 - [ListViewControlFilterFlags](/server-editor/enums/ListViewControlFilterFlags)server-editor · 枚举 - [LogChannel](/server-editor/enums/LogChannel)server-editor · 枚举 - [MinimapMarkerType](/server-editor/enums/MinimapMarkerType)server-editor · 枚举 - [MinimapTrackingMode](/server-editor/enums/MinimapTrackingMode)server-editor · 枚举 - [MinimapViewType](/server-editor/enums/MinimapViewType)server-editor · 枚举 - [ModalDialogResponseType](/server-editor/enums/ModalDialogResponseType)server-editor · 枚举 - [ModalDialogType](/server-editor/enums/ModalDialogType)server-editor · 枚举 - [MouseActionCategory](/server-editor/enums/MouseActionCategory)server-editor · 枚举 - [MouseActionType](/server-editor/enums/MouseActionType)server-editor · 枚举 - [MouseCursorIconType](/server-editor/enums/MouseCursorIconType)server-editor · 枚举 - [MouseInputType](/server-editor/enums/MouseInputType)server-editor · 枚举 - [NumberPropertyItemVariant](/server-editor/enums/NumberPropertyItemVariant)server-editor · 枚举 - [PaintCompletionState](/server-editor/enums/PaintCompletionState)server-editor · 枚举 - [PaintMode](/server-editor/enums/PaintMode)server-editor · 枚举 - [PaneLayoutType](/server-editor/enums/PaneLayoutType)server-editor · 枚举 - [Plane](/server-editor/enums/Plane)server-editor · 枚举 - [PlaytestSessionResult](/server-editor/enums/PlaytestSessionResult)server-editor · 枚举 - [PrimitiveType](/server-editor/enums/PrimitiveType)server-editor · 枚举 - [ProgressIndicatorPropertyItemVariant](/server-editor/enums/ProgressIndicatorPropertyItemVariant)server-editor · 枚举 - [ProjectExportType](/server-editor/enums/ProjectExportType)server-editor · 枚举 - [PropertyItemType](/server-editor/enums/PropertyItemType)server-editor · 枚举item - [RenderPlaneGridResolution](/server-editor/enums/RenderPlaneGridResolution)server-editor · 枚举 - [RootPaneLocation](/server-editor/enums/RootPaneLocation)server-editor · 枚举 - [SelectionVolumeEventType](/server-editor/enums/SelectionVolumeEventType)server-editor · 枚举event - [SpeedSettingsProperty](/server-editor/enums/SpeedSettingsProperty)server-editor · 枚举 - [SplineType](/server-editor/enums/SplineType)server-editor · 枚举 - [StatusBarAlignment](/server-editor/enums/StatusBarAlignment)server-editor · 枚举 - [StructureSource](/server-editor/enums/StructureSource)server-editor · 枚举 - [TagContainerVariant](/server-editor/enums/TagContainerVariant)server-editor · 枚举inventory - [ThemeSettingsColorKey](/server-editor/enums/ThemeSettingsColorKey)server-editor · 枚举 - [TimelinePlayerPlaybackState](/server-editor/enums/TimelinePlayerPlaybackState)server-editor · 枚举player - [TransactionProcessState](/server-editor/enums/TransactionProcessState)server-editor · 枚举 - [WidgetCollisionType](/server-editor/enums/WidgetCollisionType)server-editor · 枚举 - [WidgetComponentType](/server-editor/enums/WidgetComponentType)server-editor · 枚举component - [WidgetGizmoEventType](/server-editor/enums/WidgetGizmoEventType)server-editor · 枚举event - [WidgetGizmoScaleMode](/server-editor/enums/WidgetGizmoScaleMode)server-editor · 枚举 - [WidgetGroupSelectionMode](/server-editor/enums/WidgetGroupSelectionMode)server-editor · 枚举 - [WidgetMouseButtonActionType](/server-editor/enums/WidgetMouseButtonActionType)server-editor · 枚举 - [WorldGeneratorType](/server-editor/enums/WorldGeneratorType)server-editor · 枚举world - [deserialize](/server-editor/functions/deserialize)server-editor · 函数 - [executeLargeOperation](/server-editor/functions/executeLargeOperation)server-editor · 函数 - [executeLargeOperationFromIterator](/server-editor/functions/executeLargeOperationFromIterator)server-editor · 函数 - [getDefaultAllowBlockList](/server-editor/functions/getDefaultAllowBlockList)server-editor · 函数block - [getDefaultBrushShapes](/server-editor/functions/getDefaultBrushShapes)server-editor · 函数 - [makeObservable](/server-editor/functions/makeObservable)server-editor · 函数 - [registerEditorExtension](/server-editor/functions/registerEditorExtension)server-editor · 函数 - [registerSerializationForType](/server-editor/functions/registerSerializationForType)server-editor · 函数 - [registerUserDefinedTransactionHandler](/server-editor/functions/registerUserDefinedTransactionHandler)server-editor · 函数 - [serialize](/server-editor/functions/serialize)server-editor · 函数 - [stringFromException](/server-editor/functions/stringFromException)server-editor · 函数 - [ActionManager](/server-editor/interfaces/ActionManager)server-editor · 接口 - [BlockMaskList](/server-editor/interfaces/BlockMaskList)server-editor · 接口block - [BlockUtilityManifest](/server-editor/interfaces/BlockUtilityManifest)server-editor · 接口block - [BlockUtilityManifestEntry](/server-editor/interfaces/BlockUtilityManifestEntry)server-editor · 接口block - [BuiltInUIManager](/server-editor/interfaces/BuiltInUIManager)server-editor · 接口 - [ClipboardWriteOptions](/server-editor/interfaces/ClipboardWriteOptions)server-editor · 接口 - [ConeBrushShapeSettings](/server-editor/interfaces/ConeBrushShapeSettings)server-editor · 接口 - [ContiguousSelectionProperties](/server-editor/interfaces/ContiguousSelectionProperties)server-editor · 接口 - [CuboidBrushShapeSettings](/server-editor/interfaces/CuboidBrushShapeSettings)server-editor · 接口 - [CursorPosition](/server-editor/interfaces/CursorPosition)server-editor · 接口 - [CursorProperties](/server-editor/interfaces/CursorProperties)server-editor · 接口 - [CursorRay](/server-editor/interfaces/CursorRay)server-editor · 接口 - [CylinderBrushShapeSettings](/server-editor/interfaces/CylinderBrushShapeSettings)server-editor · 接口 - [EditorStructureSearchOptions](/server-editor/interfaces/EditorStructureSearchOptions)server-editor · 接口 - [EllipsoidBrushShapeSettings](/server-editor/interfaces/EllipsoidBrushShapeSettings)server-editor · 接口 - [EventSink](/server-editor/interfaces/EventSink)server-editor · 接口event - [ExtensionOptionalParameters](/server-editor/interfaces/ExtensionOptionalParameters)server-editor · 接口 - [GameOptions](/server-editor/interfaces/GameOptions)server-editor · 接口 - [GuidePlane](/server-editor/interfaces/GuidePlane)server-editor · 接口 - [IActionBar](/server-editor/interfaces/IActionBar)server-editor · 接口 - [IActionBarItem](/server-editor/interfaces/IActionBarItem)server-editor · 接口 - [IActionBarItemCreationParams](/server-editor/interfaces/IActionBarItemCreationParams)server-editor · 接口 - [IBlockListPropertyItem](/server-editor/interfaces/IBlockListPropertyItem)server-editor · 接口 - [IBlockListPropertyItemOptions](/server-editor/interfaces/IBlockListPropertyItemOptions)server-editor · 接口 - [IBlockTableEntryInfo](/server-editor/interfaces/IBlockTableEntryInfo)server-editor · 接口 - [IBlockTablePropertyItem](/server-editor/interfaces/IBlockTablePropertyItem)server-editor · 接口 - [IBlockTablePropertyItemOptions](/server-editor/interfaces/IBlockTablePropertyItemOptions)server-editor · 接口 - [IBoolPropertyItem](/server-editor/interfaces/IBoolPropertyItem)server-editor · 接口 - [IBoolPropertyItemOptions](/server-editor/interfaces/IBoolPropertyItemOptions)server-editor · 接口 - [IButtonPanePropertyItem](/server-editor/interfaces/IButtonPanePropertyItem)server-editor · 接口 - [IButtonPanePropertyItemOptions](/server-editor/interfaces/IButtonPanePropertyItemOptions)server-editor · 接口 - [IButtonPropertyItem](/server-editor/interfaces/IButtonPropertyItem)server-editor · 接口 - [IButtonPropertyItemOptions](/server-editor/interfaces/IButtonPropertyItemOptions)server-editor · 接口 - [ICollectionTreeEntry](/server-editor/interfaces/ICollectionTreeEntry)server-editor · 接口 - [ICollectionTreeEntryDropdownItem](/server-editor/interfaces/ICollectionTreeEntryDropdownItem)server-editor · 接口 - [ICollectionTreeEntryItem](/server-editor/interfaces/ICollectionTreeEntryItem)server-editor · 接口 - [ICollectionTreeEntryNumberItem](/server-editor/interfaces/ICollectionTreeEntryNumberItem)server-editor · 接口 - [ICollectionTreeEntryStringItem](/server-editor/interfaces/ICollectionTreeEntryStringItem)server-editor · 接口 - [ICollectionTreeFolder](/server-editor/interfaces/ICollectionTreeFolder)server-editor · 接口 - [ICollectionTreePropertyItem](/server-editor/interfaces/ICollectionTreePropertyItem)server-editor · 接口 - [ICollectionTreePropertyItemOptions](/server-editor/interfaces/ICollectionTreePropertyItemOptions)server-editor · 接口 - [ICollectionTreeViewControlPaneOptions](/server-editor/interfaces/ICollectionTreeViewControlPaneOptions)server-editor · 接口 - [IColorPickerPropertyItem](/server-editor/interfaces/IColorPickerPropertyItem)server-editor · 接口 - [IColorPickerPropertyItemOptions](/server-editor/interfaces/IColorPickerPropertyItemOptions)server-editor · 接口 - [IColorTimelinePropertyItem](/server-editor/interfaces/IColorTimelinePropertyItem)server-editor · 接口 - [IColorTimelinePropertyItemEntry](/server-editor/interfaces/IColorTimelinePropertyItemEntry)server-editor · 接口 - [IColorTimelinePropertyItemOptions](/server-editor/interfaces/IColorTimelinePropertyItemOptions)server-editor · 接口 - [IComboBoxPropertyItem](/server-editor/interfaces/IComboBoxPropertyItem)server-editor · 接口 - [IComboBoxPropertyItemEntry](/server-editor/interfaces/IComboBoxPropertyItemEntry)server-editor · 接口 - [IComboBoxPropertyItemOptions](/server-editor/interfaces/IComboBoxPropertyItemOptions)server-editor · 接口 - [IContentBadgeManager](/server-editor/interfaces/IContentBadgeManager)server-editor · 接口 - [IDataTablePropertyItem](/server-editor/interfaces/IDataTablePropertyItem)server-editor · 接口 - [IDataTablePropertyItemEntry](/server-editor/interfaces/IDataTablePropertyItemEntry)server-editor · 接口 - [IDataTablePropertyItemOptions](/server-editor/interfaces/IDataTablePropertyItemOptions)server-editor · 接口 - [IDisposable](/server-editor/interfaces/IDisposable)server-editor · 接口 - [IDividerPropertyItemOptions](/server-editor/interfaces/IDividerPropertyItemOptions)server-editor · 接口 - [IDropdownPropertyItem](/server-editor/interfaces/IDropdownPropertyItem)server-editor · 接口 - [IDropdownPropertyItemEntry](/server-editor/interfaces/IDropdownPropertyItemEntry)server-editor · 接口 - [IDropdownPropertyItemOptions](/server-editor/interfaces/IDropdownPropertyItemOptions)server-editor · 接口 - [IEventToken](/server-editor/interfaces/IEventToken)server-editor · 接口 - [IGlobalInputManager](/server-editor/interfaces/IGlobalInputManager)server-editor · 接口 - [IImagePropertyItem](/server-editor/interfaces/IImagePropertyItem)server-editor · 接口 - [IImagePropertyItemOptions](/server-editor/interfaces/IImagePropertyItemOptions)server-editor · 接口 - [IIntroductionPane](/server-editor/interfaces/IIntroductionPane)server-editor · 接口 - [IIntroductionPaneOptions](/server-editor/interfaces/IIntroductionPaneOptions)server-editor · 接口 - [ILinkPropertyItem](/server-editor/interfaces/ILinkPropertyItem)server-editor · 接口 - [ILinkPropertyItemOptions](/server-editor/interfaces/ILinkPropertyItemOptions)server-editor · 接口 - [IListPaneBoolEntry](/server-editor/interfaces/IListPaneBoolEntry)server-editor · 接口 - [IListPaneButtonEntry](/server-editor/interfaces/IListPaneButtonEntry)server-editor · 接口 - [IListPaneEntry](/server-editor/interfaces/IListPaneEntry)server-editor · 接口 - [IListPaneImageEntry](/server-editor/interfaces/IListPaneImageEntry)server-editor · 接口 - [IListPanePropertyItem](/server-editor/interfaces/IListPanePropertyItem)server-editor · 接口 - [IListPanePropertyItemOptions](/server-editor/interfaces/IListPanePropertyItemOptions)server-editor · 接口 - [IListPaneSlot](/server-editor/interfaces/IListPaneSlot)server-editor · 接口 - [IListPaneSlotOptions](/server-editor/interfaces/IListPaneSlotOptions)server-editor · 接口 - [IListPaneTextEntry](/server-editor/interfaces/IListPaneTextEntry)server-editor · 接口 - [IListPaneViewControlPaneOptions](/server-editor/interfaces/IListPaneViewControlPaneOptions)server-editor · 接口 - [IListViewControlPane](/server-editor/interfaces/IListViewControlPane)server-editor · 接口 - [IListViewControlPaneOptions](/server-editor/interfaces/IListViewControlPaneOptions)server-editor · 接口 - [IMenu](/server-editor/interfaces/IMenu)server-editor · 接口 - [IMenuContainer](/server-editor/interfaces/IMenuContainer)server-editor · 接口inventory - [IMenuCreationParams](/server-editor/interfaces/IMenuCreationParams)server-editor · 接口 - [IMenuPropertyItem](/server-editor/interfaces/IMenuPropertyItem)server-editor · 接口 - [IMenuPropertyItemOptions](/server-editor/interfaces/IMenuPropertyItemOptions)server-editor · 接口 - [IMinimapPropertyItem](/server-editor/interfaces/IMinimapPropertyItem)server-editor · 接口 - [IMinimapPropertyItemOptions](/server-editor/interfaces/IMinimapPropertyItemOptions)server-editor · 接口 - [IModalControlPane](/server-editor/interfaces/IModalControlPane)server-editor · 接口 - [IModalDialog](/server-editor/interfaces/IModalDialog)server-editor · 接口 - [IModalDialogActivationRequest](/server-editor/interfaces/IModalDialogActivationRequest)server-editor · 接口 - [IModalDialogManager](/server-editor/interfaces/IModalDialogManager)server-editor · 接口 - [IModalOverlayPane](/server-editor/interfaces/IModalOverlayPane)server-editor · 接口 - [IModalOverlayPaneOptions](/server-editor/interfaces/IModalOverlayPaneOptions)server-editor · 接口 - [IModalTool](/server-editor/interfaces/IModalTool)server-editor · 接口 - [IModalToolContainer](/server-editor/interfaces/IModalToolContainer)server-editor · 接口inventory - [IntroductionPaneTabProps](/server-editor/interfaces/IntroductionPaneTabProps)server-editor · 接口 - [INumberPropertyItem](/server-editor/interfaces/INumberPropertyItem)server-editor · 接口 - [INumberPropertyItemOptions](/server-editor/interfaces/INumberPropertyItemOptions)server-editor · 接口 - [INumberTimelinePropertyItem](/server-editor/interfaces/INumberTimelinePropertyItem)server-editor · 接口 - [INumberTimelinePropertyItemEntry](/server-editor/interfaces/INumberTimelinePropertyItemEntry)server-editor · 接口 - [INumberTimelinePropertyItemOptions](/server-editor/interfaces/INumberTimelinePropertyItemOptions)server-editor · 接口 - [IObservable](/server-editor/interfaces/IObservable)server-editor · 接口 - [IPane](/server-editor/interfaces/IPane)server-editor · 接口 - [IPaneManager](/server-editor/interfaces/IPaneManager)server-editor · 接口 - [IPlayerLogger](/server-editor/interfaces/IPlayerLogger)server-editor · 接口 - [IPlayerLoggerProperties](/server-editor/interfaces/IPlayerLoggerProperties)server-editor · 接口 - [IProgressIndicatorPropertyItem](/server-editor/interfaces/IProgressIndicatorPropertyItem)server-editor · 接口 - [IProgressIndicatorPropertyItemOptions](/server-editor/interfaces/IProgressIndicatorPropertyItemOptions)server-editor · 接口 - [IPropertyItemBase](/server-editor/interfaces/IPropertyItemBase)server-editor · 接口 - [IPropertyItemOptionsBase](/server-editor/interfaces/IPropertyItemOptionsBase)server-editor · 接口 - [IPropertyPane](/server-editor/interfaces/IPropertyPane)server-editor · 接口 - [IPropertyPaneOptions](/server-editor/interfaces/IPropertyPaneOptions)server-editor · 接口 - [IRegisteredKeyBinding](/server-editor/interfaces/IRegisteredKeyBinding)server-editor · 接口 - [IRegisterExtensionOptionalParameters](/server-editor/interfaces/IRegisterExtensionOptionalParameters)server-editor · 接口 - [IRootPropertyPane](/server-editor/interfaces/IRootPropertyPane)server-editor · 接口 - [IRootPropertyPaneHeaderAction](/server-editor/interfaces/IRootPropertyPaneHeaderAction)server-editor · 接口 - [IRootPropertyPaneOptions](/server-editor/interfaces/IRootPropertyPaneOptions)server-editor · 接口 - [IStatusBar](/server-editor/interfaces/IStatusBar)server-editor · 接口 - [IStatusBarItem](/server-editor/interfaces/IStatusBarItem)server-editor · 接口 - [IStatusBarItemCreationParams](/server-editor/interfaces/IStatusBarItemCreationParams)server-editor · 接口 - [IStringPropertyItem](/server-editor/interfaces/IStringPropertyItem)server-editor · 接口 - [IStringPropertyItemOptions](/server-editor/interfaces/IStringPropertyItemOptions)server-editor · 接口 - [ISubPanePropertyItem](/server-editor/interfaces/ISubPanePropertyItem)server-editor · 接口 - [ISubPanePropertyItemOptions](/server-editor/interfaces/ISubPanePropertyItemOptions)server-editor · 接口 - [ITagContainerPropertyItem](/server-editor/interfaces/ITagContainerPropertyItem)server-editor · 接口inventory - [ITagContainerPropertyItemOptions](/server-editor/interfaces/ITagContainerPropertyItemOptions)server-editor · 接口inventory - [ITextPropertyItem](/server-editor/interfaces/ITextPropertyItem)server-editor · 接口 - [ITextPropertyItemOptions](/server-editor/interfaces/ITextPropertyItemOptions)server-editor · 接口 - [ITimelinePlayer](/server-editor/interfaces/ITimelinePlayer)server-editor · 接口player - [ITimelinePlayerEntry](/server-editor/interfaces/ITimelinePlayerEntry)server-editor · 接口player - [ITimelinePlayerGroup](/server-editor/interfaces/ITimelinePlayerGroup)server-editor · 接口player - [ITimelinePlayerOptions](/server-editor/interfaces/ITimelinePlayerOptions)server-editor · 接口player - [IToggleGroupPropertyItem](/server-editor/interfaces/IToggleGroupPropertyItem)server-editor · 接口 - [IToggleGroupPropertyItemEntry](/server-editor/interfaces/IToggleGroupPropertyItemEntry)server-editor · 接口 - [IToggleGroupPropertyItemOptions](/server-editor/interfaces/IToggleGroupPropertyItemOptions)server-editor · 接口 - [IVector2PropertyItem](/server-editor/interfaces/IVector2PropertyItem)server-editor · 接口 - [IVector2PropertyItemOptions](/server-editor/interfaces/IVector2PropertyItemOptions)server-editor · 接口 - [IVector3Keyframe](/server-editor/interfaces/IVector3Keyframe)server-editor · 接口 - [IVector3PropertyItem](/server-editor/interfaces/IVector3PropertyItem)server-editor · 接口 - [IVector3PropertyItemOptions](/server-editor/interfaces/IVector3PropertyItemOptions)server-editor · 接口 - [IVector3TimelinePlayerEntry](/server-editor/interfaces/IVector3TimelinePlayerEntry)server-editor · 接口player - [IVector3TimelinePlayerEntryOptions](/server-editor/interfaces/IVector3TimelinePlayerEntryOptions)server-editor · 接口player - [IVector3TimelinePropertyItem](/server-editor/interfaces/IVector3TimelinePropertyItem)server-editor · 接口 - [IVector3TimelinePropertyItemEntry](/server-editor/interfaces/IVector3TimelinePropertyItemEntry)server-editor · 接口 - [IVector3TimelinePropertyItemOptions](/server-editor/interfaces/IVector3TimelinePropertyItemOptions)server-editor · 接口 - [LocalizationEntry](/server-editor/interfaces/LocalizationEntry)server-editor · 接口 - [LogProperties](/server-editor/interfaces/LogProperties)server-editor · 接口 - [MinimapCreateOptions](/server-editor/interfaces/MinimapCreateOptions)server-editor · 接口 - [MinimapMarkerData](/server-editor/interfaces/MinimapMarkerData)server-editor · 接口 - [ModalDialogCreationParams](/server-editor/interfaces/ModalDialogCreationParams)server-editor · 接口 - [ModalToolCreationParameters](/server-editor/interfaces/ModalToolCreationParameters)server-editor · 接口 - [ProjectExportOptions](/server-editor/interfaces/ProjectExportOptions)server-editor · 接口 - [PyramidBrushShapeSettings](/server-editor/interfaces/PyramidBrushShapeSettings)server-editor · 接口 - [QuickExtrudeProperties](/server-editor/interfaces/QuickExtrudeProperties)server-editor · 接口 - [SelectionManifestData](/server-editor/interfaces/SelectionManifestData)server-editor · 接口 - [SelectionManifestEntry](/server-editor/interfaces/SelectionManifestEntry)server-editor · 接口 - [WeightedBlock](/server-editor/interfaces/WeightedBlock)server-editor · 接口block - [WidgetComponentBaseOptions](/server-editor/interfaces/WidgetComponentBaseOptions)server-editor · 接口component - [WidgetComponentBoundingBoxLimit](/server-editor/interfaces/WidgetComponentBoundingBoxLimit)server-editor · 接口component - [WidgetComponentBoundingBoxOptions](/server-editor/interfaces/WidgetComponentBoundingBoxOptions)server-editor · 接口component - [WidgetComponentClipboardOptions](/server-editor/interfaces/WidgetComponentClipboardOptions)server-editor · 接口component - [WidgetComponentEntityOptions](/server-editor/interfaces/WidgetComponentEntityOptions)server-editor · 接口entitycomponent - [WidgetComponentGizmoOptions](/server-editor/interfaces/WidgetComponentGizmoOptions)server-editor · 接口component - [WidgetComponentGridOptions](/server-editor/interfaces/WidgetComponentGridOptions)server-editor · 接口component - [WidgetComponentGuideOptions](/server-editor/interfaces/WidgetComponentGuideOptions)server-editor · 接口component - [WidgetComponentRenderPlaneOptions](/server-editor/interfaces/WidgetComponentRenderPlaneOptions)server-editor · 接口component - [WidgetComponentRenderPrimitiveOptions](/server-editor/interfaces/WidgetComponentRenderPrimitiveOptions)server-editor · 接口component - [WidgetComponentSplineOptions](/server-editor/interfaces/WidgetComponentSplineOptions)server-editor · 接口component - [WidgetComponentTextOptions](/server-editor/interfaces/WidgetComponentTextOptions)server-editor · 接口component - [WidgetComponentVolumeOutlineOptions](/server-editor/interfaces/WidgetComponentVolumeOutlineOptions)server-editor · 接口component - [WidgetCreateOptions](/server-editor/interfaces/WidgetCreateOptions)server-editor · 接口 - [WidgetGroupCreateOptions](/server-editor/interfaces/WidgetGroupCreateOptions)server-editor · 接口 - [WireframeMeshOptions](/server-editor/interfaces/WireframeMeshOptions)server-editor · 接口 - [Action](/server-editor/types/Action)server-editor · 类型别名 - [ActionID](/server-editor/types/ActionID)server-editor · 类型别名 - [ActivationFunctionType](/server-editor/types/ActivationFunctionType)server-editor · 类型别名 - [AudioSettingsPropertyTypeMap](/server-editor/types/AudioSettingsPropertyTypeMap)server-editor · 类型别名 - [BasicTooltipContent](/server-editor/types/BasicTooltipContent)server-editor · 类型别名 - [BrushShapeSettings](/server-editor/types/BrushShapeSettings)server-editor · 类型别名 - [ButtonPropertyItemSupportedActionTypes](/server-editor/types/ButtonPropertyItemSupportedActionTypes)server-editor · 类型别名 - [ContinuousAction](/server-editor/types/ContinuousAction)server-editor · 类型别名 - [EventHandler](/server-editor/types/EventHandler)server-editor · 类型别名event - [GraphicsSettingsPropertyTypeMap](/server-editor/types/GraphicsSettingsPropertyTypeMap)server-editor · 类型别名 - [ICollectionTreeEntryDropdownItemMenuOption](/server-editor/types/ICollectionTreeEntryDropdownItemMenuOption)server-editor · 类型别名 - [ICollectionTreeEntryDropdownItemParams](/server-editor/types/ICollectionTreeEntryDropdownItemParams)server-editor · 类型别名 - [ICollectionTreeEntryNumberItemParams](/server-editor/types/ICollectionTreeEntryNumberItemParams)server-editor · 类型别名 - [ICollectionTreeEntryOptions](/server-editor/types/ICollectionTreeEntryOptions)server-editor · 类型别名 - [ICollectionTreeEntryStringItemParams](/server-editor/types/ICollectionTreeEntryStringItemParams)server-editor · 类型别名 - [ICollectionTreeFolderHeaderActionParams](/server-editor/types/ICollectionTreeFolderHeaderActionParams)server-editor · 类型别名 - [ICollectionTreeFolderOptions](/server-editor/types/ICollectionTreeFolderOptions)server-editor · 类型别名 - [ImageAnimationData](/server-editor/types/ImageAnimationData)server-editor · 类型别名animation - [ImageResourceData](/server-editor/types/ImageResourceData)server-editor · 类型别名 - [IObservableProp](/server-editor/types/IObservableProp)server-editor · 类型别名 - [IPlayerUISession](/server-editor/types/IPlayerUISession)server-editor · 类型别名 - [KeyBinding](/server-editor/types/KeyBinding)server-editor · 类型别名 - [KeyBindingInfo](/server-editor/types/KeyBindingInfo)server-editor · 类型别名 - [LayoutSize](/server-editor/types/LayoutSize)server-editor · 类型别名 - [ListPaneBoolEntryParams](/server-editor/types/ListPaneBoolEntryParams)server-editor · 类型别名 - [ListPaneButtonEntryParams](/server-editor/types/ListPaneButtonEntryParams)server-editor · 类型别名 - [ListPaneEntryMap](/server-editor/types/ListPaneEntryMap)server-editor · 类型别名 - [ListPaneEntryParams](/server-editor/types/ListPaneEntryParams)server-editor · 类型别名 - [ListPaneImageEntryParams](/server-editor/types/ListPaneImageEntryParams)server-editor · 类型别名 - [ListPaneSlotConfiguration](/server-editor/types/ListPaneSlotConfiguration)server-editor · 类型别名 - [ListPaneSlotCreationProps](/server-editor/types/ListPaneSlotCreationProps)server-editor · 类型别名 - [ListPaneSlotLayoutEntry](/server-editor/types/ListPaneSlotLayoutEntry)server-editor · 类型别名 - [ListPaneSlotLayoutSections](/server-editor/types/ListPaneSlotLayoutSections)server-editor · 类型别名 - [ListPaneTextEntryParams](/server-editor/types/ListPaneTextEntryParams)server-editor · 类型别名 - [ListPaneViewFilter](/server-editor/types/ListPaneViewFilter)server-editor · 类型别名 - [ListViewControlAction](/server-editor/types/ListViewControlAction)server-editor · 类型别名 - [ListViewControlActionState](/server-editor/types/ListViewControlActionState)server-editor · 类型别名 - [LocalizedString](/server-editor/types/LocalizedString)server-editor · 类型别名 - [ModalDialogActivationParams](/server-editor/types/ModalDialogActivationParams)server-editor · 类型别名 - [ModalDialogCoreResponseType](/server-editor/types/ModalDialogCoreResponseType)server-editor · 类型别名 - [ModalDialogCustomResponse](/server-editor/types/ModalDialogCustomResponse)server-editor · 类型别名 - [ModalDialogDataPickerResponse](/server-editor/types/ModalDialogDataPickerResponse)server-editor · 类型别名 - [ModalDialogDismissResponse](/server-editor/types/ModalDialogDismissResponse)server-editor · 类型别名 - [ModalDialogRequestData](/server-editor/types/ModalDialogRequestData)server-editor · 类型别名 - [ModalToolLifecycleEventPayload](/server-editor/types/ModalToolLifecycleEventPayload)server-editor · 类型别名event - [MouseModifiers](/server-editor/types/MouseModifiers)server-editor · 类型别名 - [MouseProps](/server-editor/types/MouseProps)server-editor · 类型别名 - [MouseRayCastAction](/server-editor/types/MouseRayCastAction)server-editor · 类型别名 - [NoArgsAction](/server-editor/types/NoArgsAction)server-editor · 类型别名 - [PaneItemStyle](/server-editor/types/PaneItemStyle)server-editor · 类型别名 - [PropertyBag](/server-editor/types/PropertyBag)server-editor · 类型别名 - [PropertyPaneVisibilityUpdate](/server-editor/types/PropertyPaneVisibilityUpdate)server-editor · 类型别名 - [Ray](/server-editor/types/Ray)server-editor · 类型别名 - [RegisteredAction](/server-editor/types/RegisteredAction)server-editor · 类型别名 - [SelectedModalToolChangedEventPayload](/server-editor/types/SelectedModalToolChangedEventPayload)server-editor · 类型别名event - [ShutdownFunctionType](/server-editor/types/ShutdownFunctionType)server-editor · 类型别名 - [SpeedSettingsPropertyTypeMap](/server-editor/types/SpeedSettingsPropertyTypeMap)server-editor · 类型别名 - [StatefulAction](/server-editor/types/StatefulAction)server-editor · 类型别名 - [SupportedKeyboardActionTypes](/server-editor/types/SupportedKeyboardActionTypes)server-editor · 类型别名 - [SupportedMouseActionTypes](/server-editor/types/SupportedMouseActionTypes)server-editor · 类型别名 - [TooltipButton](/server-editor/types/TooltipButton)server-editor · 类型别名 - [TooltipContent](/server-editor/types/TooltipContent)server-editor · 类型别名 - [TooltipInteractiveContent](/server-editor/types/TooltipInteractiveContent)server-editor · 类型别名 - [TooltipInteractiveContentDescriptionItem](/server-editor/types/TooltipInteractiveContentDescriptionItem)server-editor · 类型别名 - [TooltipLink](/server-editor/types/TooltipLink)server-editor · 类型别名 - [UnregisterInputBindingCallback](/server-editor/types/UnregisterInputBindingCallback)server-editor · 类型别名 - [editor](/server-editor/variables/editor)server-editor · 变量 - [FenceConnectivity](/server-gametest/classes/FenceConnectivity)server-gametest · 类 - [GameTestCompletedError](/server-gametest/classes/GameTestCompletedError)server-gametest · 类error - [GameTestError](/server-gametest/classes/GameTestError)server-gametest · 类error - [GameTestSequence](/server-gametest/classes/GameTestSequence)server-gametest · 类 - [NavigationResult](/server-gametest/classes/NavigationResult)server-gametest · 类 - [RegistrationBuilder](/server-gametest/classes/RegistrationBuilder)server-gametest · 类 - [SculkSpreader](/server-gametest/classes/SculkSpreader)server-gametest · 类 - [SimulatedPlayer](/server-gametest/classes/SimulatedPlayer)server-gametest · 类player - [Tags](/server-gametest/classes/Tags)server-gametest · 类 - [Test](/server-gametest/classes/Test)server-gametest · 类 - [GameTestCompletedErrorReason](/server-gametest/enums/GameTestCompletedErrorReason)server-gametest · 枚举error - [GameTestErrorType](/server-gametest/enums/GameTestErrorType)server-gametest · 枚举error - [LookDuration](/server-gametest/enums/LookDuration)server-gametest · 枚举 - [PersonaArmSize](/server-gametest/enums/PersonaArmSize)server-gametest · 枚举 - [PersonaPieceType](/server-gametest/enums/PersonaPieceType)server-gametest · 枚举 - [getPlayerSkin](/server-gametest/functions/getPlayerSkin)server-gametest · 函数player - [register](/server-gametest/functions/register)server-gametest · 函数 - [registerAsync](/server-gametest/functions/registerAsync)server-gametest · 函数 - [setAfterBatchCallback](/server-gametest/functions/setAfterBatchCallback)server-gametest · 函数 - [setBeforeBatchCallback](/server-gametest/functions/setBeforeBatchCallback)server-gametest · 函数 - [spawnSimulatedPlayer](/server-gametest/functions/spawnSimulatedPlayer)server-gametest · 函数player - [GameTestErrorContext](/server-gametest/interfaces/GameTestErrorContext)server-gametest · 接口error - [MoveToOptions](/server-gametest/interfaces/MoveToOptions)server-gametest · 接口 - [PlayerPersonaPiece](/server-gametest/interfaces/PlayerPersonaPiece)server-gametest · 接口player - [PlayerSkinData](/server-gametest/interfaces/PlayerSkinData)server-gametest · 接口player - [BiomeAtmospherics](/server-graphics/classes/BiomeAtmospherics)server-graphics · 类biome - [BiomeColorGrading](/server-graphics/classes/BiomeColorGrading)server-graphics · 类biome - [BiomeLighting](/server-graphics/classes/BiomeLighting)server-graphics · 类biome - [BiomeWater](/server-graphics/classes/BiomeWater)server-graphics · 类biome - [getBiomeAtmospherics](/server-graphics/functions/getBiomeAtmospherics)server-graphics · 函数biome - [getBiomeColorGrading](/server-graphics/functions/getBiomeColorGrading)server-graphics · 函数biome - [getBiomeLighting](/server-graphics/functions/getBiomeLighting)server-graphics · 函数biome - [getBiomeWater](/server-graphics/functions/getBiomeWater)server-graphics · 函数biome - [getPlayerAtmospherics](/server-graphics/functions/getPlayerAtmospherics)server-graphics · 函数player - [getPlayerColorGrading](/server-graphics/functions/getPlayerColorGrading)server-graphics · 函数player - [getPlayerLighting](/server-graphics/functions/getPlayerLighting)server-graphics · 函数player - [getPlayerWater](/server-graphics/functions/getPlayerWater)server-graphics · 函数player - [CloseAfterEventSignal](/server-net/classes/CloseAfterEventSignal)server-net · 类event - [HttpClient](/server-net/classes/HttpClient)server-net · 类network - [HttpHeader](/server-net/classes/HttpHeader)server-net · 类network - [HttpRequest](/server-net/classes/HttpRequest)server-net · 类network - [HttpRequestLimitExceededError](/server-net/classes/HttpRequestLimitExceededError)server-net · 类networkerror - [HttpResponse](/server-net/classes/HttpResponse)server-net · 类network - [InternalHttpRequestError](/server-net/classes/InternalHttpRequestError)server-net · 类networkerror - [InternalWebSocketError](/server-net/classes/InternalWebSocketError)server-net · 类networkerror - [MalformedUriError](/server-net/classes/MalformedUriError)server-net · 类error - [MessageAfterEventSignal](/server-net/classes/MessageAfterEventSignal)server-net · 类event - [NetworkBeforeEvents](/server-net/classes/NetworkBeforeEvents)server-net · 类event - [PacketReceiveBeforeEventSignal](/server-net/classes/PacketReceiveBeforeEventSignal)server-net · 类eventnetwork - [PacketReceivedBeforeEvent](/server-net/classes/PacketReceivedBeforeEvent)server-net · 类eventnetwork - [PacketSendBeforeEvent](/server-net/classes/PacketSendBeforeEvent)server-net · 类eventnetwork - [PacketSendBeforeEventSignal](/server-net/classes/PacketSendBeforeEventSignal)server-net · 类eventnetwork - [RequestBodyTooLargeError](/server-net/classes/RequestBodyTooLargeError)server-net · 类error - [SerializableParseError](/server-net/classes/SerializableParseError)server-net · 类error - [TLSOnlyError](/server-net/classes/TLSOnlyError)server-net · 类error - [UriNotAllowedError](/server-net/classes/UriNotAllowedError)server-net · 类error - [WebSocket](/server-net/classes/WebSocket)server-net · 类network - [WebSocketClient](/server-net/classes/WebSocketClient)server-net · 类network - [WebSocketClientAfterEvents](/server-net/classes/WebSocketClientAfterEvents)server-net · 类eventnetwork - [WebSocketClientCloseAfterEvent](/server-net/classes/WebSocketClientCloseAfterEvent)server-net · 类eventnetwork - [WebSocketClientReceiveAfterEvent](/server-net/classes/WebSocketClientReceiveAfterEvent)server-net · 类eventnetwork - [WebSocketConnectionFailedError](/server-net/classes/WebSocketConnectionFailedError)server-net · 类networkerror - [WebSocketLimitExceededError](/server-net/classes/WebSocketLimitExceededError)server-net · 类networkerror - [WebSocketNotConnectedError](/server-net/classes/WebSocketNotConnectedError)server-net · 类networkerror - [HttpRequestMethod](/server-net/enums/HttpRequestMethod)server-net · 枚举network - [HttpStatusCode](/server-net/enums/HttpStatusCode)server-net · 枚举network - [PacketId](/server-net/enums/PacketId)server-net · 枚举network - [WebSocketClientCloseReasons](/server-net/enums/WebSocketClientCloseReasons)server-net · 枚举network - [PacketEventOptions](/server-net/interfaces/PacketEventOptions)server-net · 接口eventnetwork - [beforeEvents](/server-net/variables/beforeEvents)server-net · 变量event - [http](/server-net/variables/http)server-net · 变量 - [websocket](/server-net/variables/websocket)server-net · 变量 - [ActionFormData](/server-ui/classes/ActionFormData)server-ui · 类 - [ActionFormResponse](/server-ui/classes/ActionFormResponse)server-ui · 类 - [CustomForm](/server-ui/classes/CustomForm)server-ui · 类 - [FormRejectError](/server-ui/classes/FormRejectError)server-ui · 类error - [FormResponse](/server-ui/classes/FormResponse)server-ui · 类 - [FormVisibilityError](/server-ui/classes/FormVisibilityError)server-ui · 类error - [InvalidFormError](/server-ui/classes/InvalidFormError)server-ui · 类error - [InvalidFormModificationError](/server-ui/classes/InvalidFormModificationError)server-ui · 类error - [InvalidObservableError](/server-ui/classes/InvalidObservableError)server-ui · 类error - [MessageBox](/server-ui/classes/MessageBox)server-ui · 类 - [MessageFormData](/server-ui/classes/MessageFormData)server-ui · 类 - [MessageFormResponse](/server-ui/classes/MessageFormResponse)server-ui · 类 - [ModalFormData](/server-ui/classes/ModalFormData)server-ui · 类 - [ModalFormResponse](/server-ui/classes/ModalFormResponse)server-ui · 类 - [ObservableBoolean](/server-ui/classes/ObservableBoolean)server-ui · 类 - [ObservableNumber](/server-ui/classes/ObservableNumber)server-ui · 类 - [ObservableString](/server-ui/classes/ObservableString)server-ui · 类 - [ObservableUIRawMessage](/server-ui/classes/ObservableUIRawMessage)server-ui · 类 - [PlayerLeftError](/server-ui/classes/PlayerLeftError)server-ui · 类playererror - [UIManager](/server-ui/classes/UIManager)server-ui · 类 - [DataDrivenScreenClosedReason](/server-ui/enums/DataDrivenScreenClosedReason)server-ui · 枚举 - [FormCancelationReason](/server-ui/enums/FormCancelationReason)server-ui · 枚举 - [FormRejectReason](/server-ui/enums/FormRejectReason)server-ui · 枚举 - [FormVisibilityErrorReason](/server-ui/enums/FormVisibilityErrorReason)server-ui · 枚举error - [TextFilteringError](/server-ui/enums/TextFilteringError)server-ui · 枚举error - [ButtonOptions](/server-ui/interfaces/ButtonOptions)server-ui · 接口 - [DividerOptions](/server-ui/interfaces/DividerOptions)server-ui · 接口 - [DropdownItemData](/server-ui/interfaces/DropdownItemData)server-ui · 接口 - [DropdownOptions](/server-ui/interfaces/DropdownOptions)server-ui · 接口 - [ImageDetails](/server-ui/interfaces/ImageDetails)server-ui · 接口 - [ImageOptions](/server-ui/interfaces/ImageOptions)server-ui · 接口 - [MessageBoxButtonOptions](/server-ui/interfaces/MessageBoxButtonOptions)server-ui · 接口 - [MessageBoxResult](/server-ui/interfaces/MessageBoxResult)server-ui · 接口 - [ModalFormDataDropdownOptions](/server-ui/interfaces/ModalFormDataDropdownOptions)server-ui · 接口 - [ModalFormDataSliderOptions](/server-ui/interfaces/ModalFormDataSliderOptions)server-ui · 接口 - [ModalFormDataTextFieldOptions](/server-ui/interfaces/ModalFormDataTextFieldOptions)server-ui · 接口 - [ModalFormDataToggleOptions](/server-ui/interfaces/ModalFormDataToggleOptions)server-ui · 接口 - [ObservableOptions](/server-ui/interfaces/ObservableOptions)server-ui · 接口 - [SliderOptions](/server-ui/interfaces/SliderOptions)server-ui · 接口 - [SpacingOptions](/server-ui/interfaces/SpacingOptions)server-ui · 接口 - [TextFieldOptions](/server-ui/interfaces/TextFieldOptions)server-ui · 接口 - [TextOptions](/server-ui/interfaces/TextOptions)server-ui · 接口 - [ToggleOptions](/server-ui/interfaces/ToggleOptions)server-ui · 接口 - [UIRawMessage](/server-ui/interfaces/UIRawMessage)server-ui · 接口 - [uiManager](/server-ui/variables/uiManager)server-ui · 变量 --- url: /vanilla-data/index.md --- > For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /vanilla-data/index.md. # @minecraft/vanilla-data :::tip 精简索引 本页仅列出导出名称,不生成每枚举成员页,以避免页数爆炸。 ::: ## M - `MinecraftBiomeTypes` - `MinecraftBlockTypes` - `MinecraftCameraPresetsTypes` - `MinecraftCooldownCategoryTypes` - `MinecraftDimensionTypes` - `MinecraftEffectTypes` - `MinecraftEnchantmentTypes` - `MinecraftEntityTypes` - `MinecraftFeatureTypes` - `MinecraftItemTypes` - `MinecraftPotionDeliveryTypes` - `MinecraftPotionEffectTypes`