当前角色命令

命令 示例 介绍
c_spawn("代码",数量) c_spawn("rabbit",1) 生成指定数量的实体(动物、物体)
c_give("代码",数量) c_give("wood",1) 获取指定数量的物品
c_sethea​lth(小数) c_sethea​lth(0.9) 用百分比设置你的生命值
c_setsanit​y(小数) c_setsanit​y(0.9) 用百分比设置你的理智值
c_sethunger(小数) c_sethunger(0.9) 用百分比设置你的饥饿值
c_setmoisture(小数) c_setmoisture(0.9) 用百分比设置你的湿度
c_settemperature(数字) c_settemperature(36) 设置你的温度(范围:-20到85℃)
c_godmode() c_godmode(false) 半无敌模式;false开启,true关闭
c_supergodmode() c_supergodmode(false) 无敌模式;false开启,true关闭
c_speedmult(数字) c_speedmult(1.5) 设置移动速度

这里还有个指令

ThePlayer.components.builder:GiveAllRecipes()

创造模式,你可以合成任何东西。
true打开创造模式,false关闭创造模式(可以为空,为空时默认为切换另一状态)
具体效果不知道,毕竟我也没用过。

其他玩家命令

命令 示例 介绍
c_listallplayers() c_listallplayers(true) 列出所有玩家的用户名和编号
AllPlayers[玩家编号]
UserToPlayer('玩家名')
AllPlayers[1]
UserToPlayer('XXX')
取一个玩家
两命令效果相同
c_move(玩家) c_move(AllPlayers[1]) 移动玩家到鼠标所指的位置
玩家:PushEvent('death') AllPlayers[1]:PushEvent('death') 杀死指定玩家
玩家:PushEvent('respawnfromghost') AllPlayers[1]:PushEvent('respawnfromghost') 复活指定玩家
c_goto(玩家) c_goto(AllPlayers[1]) 传送到指定玩家
玩家.components.inventory:DropEverything() AllPlayers[1].components.inventory:DropEverything() 指定玩家丢弃所有物品
c_despawn(玩家) c_despawn(AllPlayers[1]) 指定玩家重选角色

如果要对所有玩家使用同一命令请使用以下指令:

for k,v in pairs(AllPlayers) do command end

只修改command,用其他命令代替command,使用 "v" 代替命令中的 AllPlayers。例如, "for k,v in pairs(AllPlayers) do c_move(v) end" 将会把所有玩家都移动到鼠标所指的位置。(命令太长单独介绍)

世界命令

命令 介绍
TheWorld:PushEvent("ms_setseason", "summer") 进入夏季
TheWorld:PushEvent("ms_setseason", "winter") 进入冬季
TheWorld:PushEvent("ms_forceprecipitation") 开始下雨
TheWorld:PushEvent("ms_forceprecipitation", false) 停止下雨
TheWorld:PushEvent("ms_sendlightningstrike", ConsoleWorldPosition()) 生成闪电
c_spawn("shadowmeteor", 1) 陨星撞击在鼠标的位置

服务器命令

命令 示例 介绍
TheNet:BanForTime(玩家或玩家名, 时间) TheNet:BanForTime("Player", 120) 封禁指定玩家指定时间
c_reset() c_reset() 重启服务器
c_regenerateworld() c_regenerateworld() 重置世界
c_regenerateshard() c_regenerateshard() 重新生成世界碎片
c_save() c_save() 保存当前世界
c_shutdown() c_shutdown(true) 关闭服务器;true 保存游戏,false 不保存游戏
c_rollback(次数) c_rollback(3) 回档一定次数
TheNet:SetAllowIncomingConnections() TheNet:SetAllowIncomingConnections(true) 默认为true;true允许新玩家,false禁止新玩家
c_announce("内容") c_announce("重启服务器") 发布公告

总结:

本文章仅仅整理并简化了参考文档,并非自创。

命令的分享到此为止

希望你能在评论区留言