手冊:@minecraft/server

出自Minecraft基岩版开发Wiki
@minecraft/server
腳本API模組
適用語言
型別
API模組
b26a4d4c-afdf-4690-88f8-931846312678
NPM
  • 授權協議:MIT
  • 大小:189 KB
  • 檔案總數:6
  • 安裝指令npm i @minecraft/server
  • 最新版本

可用模組版本
1.7.0、1.6.0、1.5.0、1.4.0、1.3.0、1.2.0、1.1.0、0.1.0
  • 實驗性版本
1.8.0-beta
最新內部版本
1.8.0-internal.1.20.50-preview.21
依賴模組
加入版本
?
搶鮮版API

@minecraft/server包含了與原版世界遊戲機制有關的介面。

匯入[編輯]

清單檔案模組資訊:

{
  "module_name": "@minecraft/server",
  "version": "1.7.0"
}

JavaScript檔案匯入:

import * as MinecraftServer from "@minecraft/server";

常數[編輯]

一般常數[編輯]

名稱 型別 可用性 實驗性玩法 走出實驗模組版本
描述
MoonPhaseCount Number 8 可用 N/A N/A 包含了月相種類的個數。

物件[編輯]

名稱 型別 可用性 實驗性玩法 走出實驗模組版本
描述
world World 可用 N/A N/A 封裝了遊戲世界維度中各種屬性的類。
system System 可用 N/A N/A 包含了提供遊戲系統層級事件的類。

列舉[編輯]

名稱 可用性 實驗性玩法 走出實驗模組版本
描述
Direction 可用 搶鮮版API 三維空間中6個朝向的列舉。
DisplaySlotId 可用 搶鮮版API 計分板顯示欄位的列舉。
EasingType 可用 搶鮮版API 相機緩動型別的列舉。
EntityDamageCause 可用 搶鮮版API 實體傷害型別的列舉。
EntityInitializationCause 可用 搶鮮版API 實體初始化型別的列舉。
EquipmentSlot 可用 搶鮮版API 裝備欄位的列舉。
GameMode 可用 搶鮮版API 遊戲模式的列舉。
ItemLockMode 可用 搶鮮版API 物品鎖定模式的列舉。
MoonPhase 可用 搶鮮版API 月相的列舉。
ObjectiveSortOrder 可用 搶鮮版API 計分板排序方式的列舉。
ScoreboardIdentityType 可用 搶鮮版API 計分板記分專案標型別的列舉。
ScriptEventSource 可用 搶鮮版API 腳本事件發起來源的列舉。
TimeOfDay 可用 搶鮮版API 遊戲一天中特定時間點的列舉。
WeatherType 可用 搶鮮版API 天氣型別的列舉。

類別[編輯]

一般類別[編輯]

名稱
可用性 實驗性玩法 走出實驗模組版本
描述
Block 可用 搶鮮版API 代表維度中某一座標下的方塊。
BlockComponent 可用 搶鮮版API 包含了方塊的各種基礎元件。
BlockEvent 可用 搶鮮版API 包含了方塊的各種事件。
BlockInventoryComponent 可用 搶鮮版API 方塊容器元件。
BlockPermutation 可用 搶鮮版API 代表某一方塊置換。
ButtonPushAfterEvent 可用 搶鮮版API 按鈕觸發前事件。
ButtonPushAfterEventSignal 可用 搶鮮版API 按鈕觸發前事件訊號,用於管理按鈕觸發前事件。
Camera 可用 搶鮮版API 代表某一玩家的活躍狀態相機。
CommandResult 可用 搶鮮版API 包含了指令傳回結果的資料。
Component 可用 搶鮮版API 各種元件類的基類。
Container 可用 搶鮮版API 代表某一容器。
Dimension 可用 搶鮮版API 代表世界中某一維度
Effect 可用 搶鮮版API 代表加入在實體上的某一狀態效果
EffectType 可用 搶鮮版API 代表某一狀態效果。
Entity 可用 搶鮮版API
EntityAttributeComponent 可用 搶鮮版API
EntityBaseMovementComponent 可用 搶鮮版API
EntityCanClimbComponent 可用 搶鮮版API
EntityCanFlyComponent 可用 搶鮮版API
EntityCanPowerJumpComponent 可用 搶鮮版API
EntityColorComponent 可用 搶鮮版API
EntityComponent 可用 搶鮮版API
EntityDieAfterEvent 可用 搶鮮版API
EntityDieAfterEventSignal 可用 搶鮮版API
EntityEquippableComponent 可用 搶鮮版API
EntityFireImmuneComponent 可用 搶鮮版API
EntityFloatsInLiquidComponent 可用 搶鮮版API
EntityFlyingSpeedComponent 可用 搶鮮版API
EntityFrictionModifierComponent 可用 搶鮮版API
EntityGroundOffsetComponent 可用 搶鮮版API
EntityHealableComponent 可用 搶鮮版API
EntityHealthChangedAfterEvent 可用 搶鮮版API
EntityHealthChangedAfterEventSignal 可用 搶鮮版API
EntityHealthComponent 可用 搶鮮版API
EntityHitBlockAfterEvent 可用 搶鮮版API
EntityHitBlockAfterEventSignal 可用 搶鮮版API
EntityHitEntityAfterEvent 可用 搶鮮版API
EntityHitEntityAfterEventSignal 可用 搶鮮版API
EntityHurtAfterEvent 可用 搶鮮版API
EntityHurtAfterEventSignal 可用 搶鮮版API
EntityInventoryComponent 可用 搶鮮版API
EntityIsBabyComponent 可用 搶鮮版API
EntityIsChargedComponent 可用 搶鮮版API
EntityIsChestedComponent 可用 搶鮮版API
EntityIsDyeableComponent 可用 搶鮮版API
EntityIsHiddenWhenInvisibleComponent 可用 搶鮮版API
EntityIsIgnitedComponent 可用 搶鮮版API
EntityIsIllagerCaptainComponent 可用 搶鮮版API
EntityIsSaddledComponent 可用 搶鮮版API
EntityIsShakingComponent 可用 搶鮮版API
EntityIsShearedComponent 可用 搶鮮版API
EntityIsStackableComponent 可用 搶鮮版API
EntityIsStunnedComponent 可用 搶鮮版API
EntityIsTamedComponent 可用 搶鮮版API
EntityItemComponent 可用 搶鮮版API
EntityLoadAfterEvent 可用 搶鮮版API
EntityLoadAfterEventSignal 可用 搶鮮版API
EntityMarkVariantComponent 可用 搶鮮版API
EntityMovementAmphibiousComponent 可用 搶鮮版API
EntityMovementBasicComponent 可用 搶鮮版API
EntityMovementFlyComponent 可用 搶鮮版API
EntityMovementGenericComponent 可用 搶鮮版API
EntityMovementHoverComponent 可用 搶鮮版API
EntityMovementJumpComponent 可用 搶鮮版API
EntityMovementSkipComponent 可用 搶鮮版API
EntityPushThroughComponent 可用 搶鮮版API
EntityRemoveAfterEvent 可用 搶鮮版API
EntityRemoveAfterEventSignal 可用 搶鮮版API
EntityRemoveBeforeEvent 可用 搶鮮版API
EntityRemoveBeforeEventSignal 可用 搶鮮版API
EntityScaleComponent 可用 搶鮮版API
EntitySkinIdComponent 可用 搶鮮版API
EntitySpawnAfterEvent 可用 搶鮮版API
EntitySpawnAfterEventSignal 可用 搶鮮版API
EntityVariantComponent 可用 搶鮮版API
EntityWantsJockeyComponent 可用 搶鮮版API
FeedItem 可用 搶鮮版API
FeedItemEffect 可用 搶鮮版API
IButtonPushAfterEventSignal 可用 搶鮮版API
ILeverActionAfterEventSignal 可用 搶鮮版API
IPlayerJoinAfterEventSignal 可用 搶鮮版API
IPlayerLeaveAfterEventSignal 可用 搶鮮版API
IPlayerSpawnAfterEventSignal 可用 搶鮮版API
ItemCompleteUseAfterEvent 可用 搶鮮版API
ItemCompleteUseAfterEventSignal 可用 搶鮮版API
ItemComponent 可用 搶鮮版API
ItemReleaseUseAfterEvent 可用 搶鮮版API
ItemReleaseUseAfterEventSignal 可用 搶鮮版API
ItemStack 可用 搶鮮版API
ItemStartUseAfterEvent 可用 搶鮮版API
ItemStartUseAfterEventSignal 可用 搶鮮版API
ItemStartUseOnAfterEvent 可用 搶鮮版API
ItemStartUseOnAfterEventSignal 可用 搶鮮版API
ItemStopUseAfterEvent 可用 搶鮮版API
ItemStopUseAfterEventSignal 可用 搶鮮版API
ItemStopUseOnAfterEvent 可用 搶鮮版API
ItemStopUseOnAfterEventSignal 可用 搶鮮版API
ItemType 可用 搶鮮版API
ItemUseAfterEvent 可用 搶鮮版API
ItemUseAfterEventSignal 可用 搶鮮版API
ItemUseBeforeEvent 可用 搶鮮版API
ItemUseBeforeEventSignal 可用 搶鮮版API
ItemUseOnAfterEvent 可用 搶鮮版API
ItemUseOnAfterEventSignal 可用 搶鮮版API
ItemUseOnBeforeEvent 可用 搶鮮版API
ItemUseOnBeforeEventSignal 可用 搶鮮版API
LeverActionAfterEvent 可用 搶鮮版API
LeverActionAfterEventSignal 可用 搶鮮版API
MinecraftDimensionTypes 可用 搶鮮版API
MolangVariableMap 可用 搶鮮版API
Player 可用 搶鮮版API
PlayerBreakBlockAfterEvent 可用 搶鮮版API
PlayerBreakBlockAfterEventSignal 可用 搶鮮版API
PlayerBreakBlockBeforeEvent 可用 搶鮮版API
PlayerBreakBlockBeforeEventSignal 可用 搶鮮版API
PlayerDimensionChangeAfterEvent 可用 搶鮮版API
PlayerDimensionChangeAfterEventSignal 可用 搶鮮版API
PlayerJoinAfterEvent 可用 搶鮮版API
PlayerJoinAfterEventSignal 可用 搶鮮版API
PlayerLeaveAfterEvent 可用 搶鮮版API
PlayerLeaveAfterEventSignal 可用 搶鮮版API
PlayerPlaceBlockAfterEvent 可用 搶鮮版API
PlayerPlaceBlockAfterEventSignal 可用 搶鮮版API
PlayerSpawnAfterEvent 可用 搶鮮版API
PlayerSpawnAfterEventSignal 可用 搶鮮版API
PressurePlatePopAfterEvent 可用 搶鮮版API
PressurePlatePopAfterEventSignal 可用 搶鮮版API
PressurePlatePushAfterEvent 可用 搶鮮版API
PressurePlatePushAfterEventSignal 可用 搶鮮版API
ProjectileHitBlockAfterEvent 可用 搶鮮版API
ProjectileHitBlockAfterEventSignal 可用 搶鮮版API
ProjectileHitEntityAfterEvent 可用 搶鮮版API
ProjectileHitEntityAfterEventSignal 可用 搶鮮版API
Scoreboard 可用 搶鮮版API
ScoreboardIdentity 可用 搶鮮版API
ScoreboardObjective 可用 搶鮮版API
ScoreboardScoreInfo 可用 搶鮮版API
ScreenDisplay 可用 搶鮮版API
ScriptEventCommandMessageAfterEvent 可用 搶鮮版API
ScriptEventCommandMessageAfterEventSignal 可用 搶鮮版API
System 可用 搶鮮版API
SystemAfterEvents 可用 搶鮮版API
TargetBlockHitAfterEvent 可用 搶鮮版API
TargetBlockHitAfterEventSignal 可用 搶鮮版API
TripWireTripAfterEvent 可用 搶鮮版API
TripWireTripAfterEventSignal 可用 搶鮮版API
World 可用 搶鮮版API
WorldAfterEvents 可用 搶鮮版API
WorldBeforeEvents 可用 搶鮮版API

錯誤[編輯]

名稱
可用性 實驗性玩法 走出實驗模組版本
描述
CommandError 可用 N/A N/A
LocationInUnloadedChunkError 可用 N/A N/A
LocationOutOfWorldBoundariesError 可用 N/A N/A

介面[編輯]

型別別名[編輯]

名稱
描述
BlockComponentTypeMap 包含了各方塊元件型別的別名映射。
EntityComponentTypeMap 包含了各實體元件型別的別名映射。
ItemComponentTypeMap 包含了各物品元件型別的別名映射。

歷史[編輯]

基岩版
?加入了mojang-minecraft
1.19.401.19.40.23將該模組重新命名為@minecraft/server

參見[編輯]