-
Notifications
You must be signed in to change notification settings - Fork 2
GameManager API command
IGameManager
/battleroyale api gameManager [...]
IGameInfoGetter
/battleroyale api gameManager getGameTime
-
返回值:当前游戏时间,单位 tick
/battleroyale api gameManager isInGame
-
返回值:当前是否在游戏中
/battleroyale api gameManager getGlobalCenterOffset [resourceLocation] [storagePath]
将全局偏移存入指定命令存储
- resourceLocation:标识符
- storagePath:NBT路径
-
返回值:1
/battleroyale api gameManager getMaxGameTime
-
返回值:最大游戏时长
/battleroyale api gameManager getWinnerTeamTotal
-
返回值:获胜队伍总数
_/battleroyale api gameManager _
-
返回值:开始大逃杀游戏需要的队伍数量
/battleroyale api gameManager hasWinner
-
返回值:当前状态是否有队伍获胜
/battleroyale api gameManager getRemainRestartTime
-
返回值:当前剩余的自动重开游戏次数
IGameFunc
/battleroyale api gameManager sendGameSpectateMessage [player]
- player:玩家选择器
- 向玩家发送观战消息,自动填入onlyGamePlayerSpectate
-
返回值:1
/battleroyale api gameManager finishGame [hasWinner]
强制结算并停止游戏:
- hasWinner:是否按获胜条件添加获胜玩家及获胜队伍
-
返回值:1
/battleroyale api gameManager addGameTimeAndTick
强制增加 1 tick 游戏时间并处理
-
返回值:1
IGameStatusSetter
/battleroyale api gameManager addFinishCheckAfterDeathEvent
若当前正在游戏玩家死亡事件(IGameMangaer::onPlayerDeath)中,则在事件结束后添加游戏胜利条件检查:
-
返回值:是否成功添加检查
/battleroyale api gameManager setHasWinner [hasWinner]
-
返回值:是否成功设置
/battleroyale api gameManager clearWinnerGamePlayers
-
返回值:是否成功清空
/battleroyale api gameManager clearWinnerGameTeams
-
返回值:是否成功清空
/battleroyale api gameManager addWinnerGamePlayer byPlayer [player] [withMembers] [withTeam]
/battleroyale api gameManager addWinnerGamePlayer byId [id] [withMembers] [withTeam]
- player:用实体选择器选中并获取游戏玩家
- id:用游戏玩家ID选中游戏玩家
- 若不存在对应的游戏玩家,
返回值为 0 - withMembers:是否将游戏玩家队伍成员一并加入获胜游戏玩家
- withTeam:是否将游戏玩家所在游戏队伍加入获胜游戏队伍
-
返回值:成功添加的游戏玩家数量
/battleroyale api gameManager addWinnerGameTeam byPlayer [player] [withMembers]
/battleroyale api gameManager addWinnerGameTeam byId [id] [withMembers]
- player:用实体选择器选中并获取游戏玩家
- id:用游戏队伍ID选中游戏队伍
- 若不存在对应的游戏玩家或游戏队伍,
返回值为0 - withMembers:是否将游戏队伍成员一并加入获胜游戏玩家
-
返回值:成功添加的游戏队伍数量和游戏玩家数量
/battleroyale api gameManager setRemainRestartTime [time]
- time:设置当前自动重开游戏次数
-
返回值:是否成功设置
IGameConfigGetter
/battleroyale api gameManager getGameruleConfigId
-
返回值:当前选中的游戏规则配置id
/battleroyale api gameManager getSpawnConfigId
-
返回值:当前选中的出生配置id
/battleroyale api gameManager getStatsConfigId
-
返回值:当前选中的统计数据配置id
/battleroyale api gameManager getBotConfigId
-
返回值:当前选中的人机配置id
IGameSaveTeleporter
/battleroyale api gameManager safeTeleport [player] [xyz]
- player:用实体选择器选中实体
- 若不为生物,
返回值为 0 - xyz:传送坐标
-
返回值:1
/battleroyale api gameManager safeTeleport [player] [xyz] [rotation]
- player:用实体选择器选中实体
- 若不为生物,
返回值为 0 - xyz:传送坐标
- rotation:传送朝向(水平朝向和垂直朝向)
- 若无法获取游戏维度,
返回值为 -1 -
返回值:1
IGameManager
/battleroyale api gameManager [...]
IGameInfoGetter
/battleroyale api gameManager getGameTime
-
return value: current game time in ticks
/battleroyale api gameManager isInGame
-
return value: whether the game is currently in progress
/battleroyale api gameManager getGlobalCenterOffset [resourceLocation] [storagePath]
Saves the Global offset to the specified command storage:
- resourceLocation: identifier
- storagePath: NBT path
-
return value: 1
/battleroyale api gameManager getMaxGameTime
-
return value: maximum BattleRoyale game time
/battleroyale api gameManager getWinnerTeamTotal
-
return value: total number of winner teams
_/battleroyale api gameManager _
-
return value: the number of teams required to start BattleRoyale
/battleroyale api gameManager hasWinner
-
return value: whether there is currently any winning team
/battleroyale api gameManager getRemainRestartTime
-
return value: current remaining automatic game restarts
IGameFunc
/battleroyale api gameManager sendGameSpectateMessage [player]
- player: player selector
- Send spectate message to the player, automatically filling in onlyGamePlayerSpectate
-
return value: 1
/battleroyale api gameManager finishGame [hasWinner]
Forcefully finishes and stops the game:
- hasWinner: whether to add winning players and teams based on winning conditions
-
return value: 1
/battleroyale api gameManager addGameTimeAndTick
Forcefully increases game time by 1 tick and processes it:
-
return value: 1
IGameStatusSetter
/battleroyale api gameManager addFinishCheckAfterDeathEvent
If currently within a game player death event (IGameMangaer::onPlayerDeath), adds a victory condition check after the event ends:
-
return value: whether the check was successfully added
/battleroyale api gameManager setHasWinner [hasWinner]
-
return value: whether the status was successfully set
/battleroyale api gameManager clearWinnerGamePlayers
-
return value: whether the set was successfully cleared
/battleroyale api gameManager clearWinnerGameTeams
-
return value: whether the set was successfully cleared
/battleroyale api gameManager addWinnerGamePlayer byPlayer [player] [withMembers] [withTeam]
/battleroyale api gameManager addWinnerGamePlayer byId [id] [withMembers] [withTeam]
- player: selects game player using an entity selector
- id: selects game player using a game player ID
- If the game player does not exist, the
return valueis 0. - withMembers: whether to add game player's all team members to the winner game players
- withTeam: whether to add the player's game team to the winner game teams
-
return value: number of successfully added game players
/battleroyale api gameManager addWinnerGameTeam byPlayer [player] [withMembers]
/battleroyale api gameManager addWinnerGameTeam byId [id] [withMembers]
- player: selects game player using an entity selector
- id: selects game team using a game team ID
- If the game player or team does not exist, the
return valueis 0. - withMembers: whether to add all game team members to the winner game players
-
return value: number of successfully added game teams and players
/battleroyale api gameManager setRemainRestartTime [time]
- time: sets the current number of automatic game restarts
-
return value: whether the value was successfully set
IGameConfigGetter
/battleroyale api gameManager getGameruleConfigId
-
return value: currently selected Gamerule config id
/battleroyale api gameManager getSpawnConfigId
-
return value: currently selected Spawn config id
/battleroyale api gameManager getStatsConfigId
-
return value: currently selected Stats config id
/battleroyale api gameManager getBotConfigId
-
return value: currently selected Bot config id
IGameSaveTeleporter
/battleroyale api gameManager safeTeleport [player] [xyz]
- player: selects entity using an entity selector
- If the enitty is not a living entity, the
return valueis 0. - xyz: teleport coordinate
-
return value: 1
/battleroyale api gameManager safeTeleport [player] [xyz] [rotation]
- player: selects entity using an entity selector
- If the enitty is not a living entity, the
return valueis 0. - xyz: teleport coordinate
- rotation: teleport rotation (yaw and pitch)
- If the game dimension cannot be retrieved, the
return valueis -1. -
return value: 1
🌐 Language / 语言
-
- Configuration Introduction
- Command Introcuction
- Game type introduction
- About
- Mod development tutorial