Skip to content
orange233 edited this page Dec 8, 2022 · 10 revisions

文档持续改进中

Type 类型

COResult

数组数据,使用循环 loop-index

Expression 表达式

[co] perform lookup

[co] perform lookup " +
                        "[in %-timespan%] " +
                        "[with restrict user[s] %-strings%] " +
                        "[with exclude user[s] %-strings%] " +
                        "[with restrict block[s] %-objects%] " +
                        "[with exclude block[s] %-objects%] " +
                        "[with action[s] %-integers%] " +
                        "in %integer% " +
                        "of %location%"

co block lookup 检查方块记录


示例:

set {_log::*} to co block lookup in 1 day of command sender's target block # 必须有数组变量来接收结果

提醒:此方法获取的结果不存在world name


写入聊天日志

[co] log %player%('[s] chat| chat[ted]) %string%

例子:

set {_r} to co log player's chat r8r8r8 # 必须有数组变量来接收结果

返回值:boolean

写入放置日志

[co] log %string%('[s] placement| place[d]) %material% with %blockdata% (of|at) %location%")

例子:

set {_r} to co log

解析结果

从lookpup中获得的数组不能直接被读取,需要通过下面的表达式获得结果

action id 动作ID

[the] action[ ]id of %coresult%"

结果:1 结果:0

action string 动作名称

[the] action[ ]string of %coresult%

结果:place 结果:break

block data 获取方块数据(NBT)

[the] block[ ]data of %coresult%

示例

if block data of {_log::%loop-index%} exist: #不能使用is set <-这是一个错误,已在新版本中修复
                set {_blockdata} to block data of {_log::%loop-index%}
            else:
                set {_blockdata} to "null"