跳转至

@minecraft/server

文档版本:1.21.0.24

@minecraft/server模块的1.10.0版本,UUID为b26a4d4c-afdf-4690-88f8-931846312678。该模块是服务端的基础模块。

依赖

该模块依赖于以下模块:

  • @minecraft/common|1.1.0|77ec12b4-1b2b-4c98-8d34-d1cd63f849d5

常量

MoonPhaseCount
static read-only MoonPhaseCount = 8;
TicksPerSecond
static read-only TicksPerSecond = 20;

对象

system
static read-only system: System;
world
static read-only world: World;

描述
Block
BlockComponent
BlockEvent
BlockInventoryComponent
BlockPermutation
BlockPistonComponent
BlockSignComponent
BlockStates
BlockStateType
BlockType
ButtonPushAfterEvent
ButtonPushAfterEventSignal
Camera
CommandResult
Component
Container
ContainerSlot
DataDrivenEntityTriggerAfterEvent
DataDrivenEntityTriggerAfterEventSignal
Dimension
DimensionType
DimensionTypes
Effect
EffectAddAfterEvent
EffectAddAfterEventSignal
EffectAddBeforeEvent
EffectAddBeforeEventSignal
EffectType
EffectTypes
Entity
EntityAttributeComponent
EntityBaseMovementComponent
EntityCanClimbComponent
EntityCanFlyComponent
EntityCanPowerJumpComponent
EntityColorComponent
EntityComponent
EntityDieAfterEvent
EntityDieAfterEventSignal
EntityEquippableComponent
EntityFireImmuneComponent
EntityFloatsInLiquidComponent
EntityFlyingSpeedComponent
EntityFrictionModifierComponent
EntityGroundOffsetComponent
EntityHealableComponent
EntityHealthChangedAfterEvent
EntityHealthChangedAfterEventSignal
EntityHealthComponent
EntityHitBlockAfterEvent
EntityHitBlockAfterEventSignal
EntityHitEntityAfterEvent
EntityHitEntityAfterEventSignal
EntityHurtAfterEvent
EntityHurtAfterEventSignal
EntityInventoryComponent
EntityIsBabyComponent
EntityIsChargedComponent
EntityIsChestedComponent
EntityIsDyeableComponent
EntityIsHiddenWhenInvisibleComponent
EntityIsIgnitedComponent
EntityIsIllagerCaptainComponent
EntityIsSaddledComponent
EntityIsShakingComponent
EntityIsShearedComponent
EntityIsStackableComponent
EntityIsStunnedComponent
EntityIsTamedComponent
EntityItemComponent
EntityLoadAfterEvent
EntityLoadAfterEventSignal
EntityMarkVariantComponent
EntityMovementAmphibiousComponent
EntityMovementBasicComponent
EntityMovementFlyComponent
EntityMovementGenericComponent
EntityMovementHoverComponent
EntityMovementJumpComponent
EntityMovementSkipComponent
EntityOnFireComponent
EntityProjectileComponent
EntityPushThroughComponent
EntityRemoveAfterEvent
EntityRemoveAfterEventSignal
EntityRemoveBeforeEvent
EntityRemoveBeforeEventSignal
EntityScaleComponent
EntitySkinIdComponent
EntitySpawnAfterEvent
EntitySpawnAfterEventSignal
EntityType
EntityTypeFamilyComponent
EntityTypes
EntityVariantComponent
EntityWantsJockeyComponent
ExplosionAfterEvent
ExplosionAfterEventSignal
ExplosionBeforeEvent
ExplosionBeforeEventSignal
FeedItem
FeedItemEffect
IButtonPushAfterEventSignal
ILeverActionAfterEventSignal
IPlayerJoinAfterEventSignal
IPlayerLeaveAfterEventSignal
IPlayerSpawnAfterEventSignal
ItemCompleteUseAfterEvent
ItemCompleteUseAfterEventSignal
ItemComponent
ItemCooldownComponent
ItemDurabilityComponent
ItemFoodComponent
ItemReleaseUseAfterEvent
ItemReleaseUseAfterEventSignal
ItemStack
ItemStartUseAfterEvent
ItemStartUseAfterEventSignal
ItemStartUseOnAfterEvent
ItemStartUseOnAfterEventSignal
ItemStopUseAfterEvent
ItemStopUseAfterEventSignal
ItemStopUseOnAfterEvent
ItemStopUseOnAfterEventSignal
ItemType
ItemUseAfterEvent
ItemUseAfterEventSignal
ItemUseBeforeEvent
ItemUseBeforeEventSignal
ItemUseOnAfterEvent
ItemUseOnAfterEventSignal
ItemUseOnBeforeEvent
ItemUseOnBeforeEventSignal
LeverActionAfterEvent
LeverActionAfterEventSignal
MinecraftDimensionTypes
MolangVariableMap
PistonActivateAfterEvent
PistonActivateAfterEventSignal
Player
PlayerBreakBlockAfterEvent
PlayerBreakBlockAfterEventSignal
PlayerBreakBlockBeforeEvent
PlayerBreakBlockBeforeEventSignal
PlayerDimensionChangeAfterEvent
PlayerDimensionChangeAfterEventSignal
PlayerInteractWithBlockAfterEvent
PlayerInteractWithBlockAfterEventSignal
PlayerInteractWithBlockBeforeEvent
PlayerInteractWithBlockBeforeEventSignal
PlayerInteractWithEntityAfterEvent
PlayerInteractWithEntityAfterEventSignal
PlayerInteractWithEntityBeforeEvent
PlayerInteractWithEntityBeforeEventSignal
PlayerJoinAfterEvent
PlayerJoinAfterEventSignal
PlayerLeaveAfterEvent
PlayerLeaveAfterEventSignal
PlayerLeaveBeforeEvent
PlayerLeaveBeforeEventSignal
PlayerPlaceBlockAfterEvent
PlayerPlaceBlockAfterEventSignal
PlayerSpawnAfterEvent
PlayerSpawnAfterEventSignal
PressurePlatePopAfterEvent
PressurePlatePopAfterEventSignal
PressurePlatePushAfterEvent
PressurePlatePushAfterEventSignal
ProjectileHitBlockAfterEvent
ProjectileHitBlockAfterEventSignal
ProjectileHitEntityAfterEvent
ProjectileHitEntityAfterEventSignal
Scoreboard
ScoreboardIdentity
ScoreboardObjective
ScoreboardScoreInfo
ScreenDisplay
ScriptEventCommandMessageAfterEvent
ScriptEventCommandMessageAfterEventSignal
Structure
StructureManager
System
SystemAfterEvents
TargetBlockHitAfterEvent
TargetBlockHitAfterEventSignal
TripWireTripAfterEvent
TripWireTripAfterEventSignal
WeatherChangeAfterEvent
WeatherChangeAfterEventSignal
World
WorldAfterEvents
WorldBeforeEvents
WorldInitializeAfterEvent
WorldInitializeAfterEventSignal

接口

接口 描述
BlockEventOptions
BlockFilter
BlockHitInformation
BlockRaycastHit
BlockRaycastOptions
CameraDefaultOptions
CameraEaseOptions
CameraFadeOptions
CameraFadeTimeOptions
CameraSetFacingOptions
CameraSetLocationOptions
CameraSetPosOptions
CameraSetRotOptions
DefinitionModifier
DimensionLocation
EntityApplyDamageByProjectileOptions
EntityApplyDamageOptions
EntityDamageSource
EntityDataDrivenTriggerEventOptions
EntityEffectOptions
EntityEventOptions
EntityFilter
EntityHitInformation
EntityQueryOptions
EntityQueryScoreOptions
EntityRaycastHit
EntityRaycastOptions
ExplosionOptions
MusicOptions
PlayAnimationOptions
PlayerSoundOptions
ProjectileShootOptions
RawMessage
RawMessageScore
RawText
RGB
RGBA
ScoreboardObjectiveDisplayOptions
ScriptEventMessageFilterOptions
StructureCreateOptions
StructurePlaceOptions
TeleportOptions
TitleDisplayOptions
Vector2
Vector3
WorldSoundOptions

枚举

枚举 描述
BlockComponentTypes
BlockPistonState
Direction
DisplaySlotId
DyeColor
EasingType
EntityComponentTypes
EntityDamageCause
EntityInitializationCause
EquipmentSlot
FluidType
GameMode
ItemComponentTypes
ItemLockMode
MoonPhase
ObjectiveSortOrder
ScoreboardIdentityType
ScriptEventSource
SignSide
StructureAnimationMode
StructureMirrorAxis
StructureRotation
StructureSaveMode
TimeOfDay
WeatherType

错误

错误 描述
CommandError
InvalidContainerSlotError
InvalidStructureError
LocationInUnloadedChunkError
LocationOutOfWorldBoundariesError