Misaka。
本帖最后由 Misaka。 于 2020-10-25 10:49 编辑

我想检测一个方块的id,然后右键该种方块的时候,执行某效果
我使用创世神插件的/info功能检测的方块id  (因为我是1.12.2的mod服,方块放置出来后,id会改变)
但是却说无法检测到这个id,提示没有这种材料
mod的方块都会出现这种问题,原版的方块就没问题
#这里35是羊毛方块的ID,写35或者wool,都可以正常检测到,脚本正常运行
on right click on 35:
  if player is sneaking:
    stop
    cancel event
    execute console command "/tell %player% hi"
#这里1351是mod方块的ID,写数字id或英文名都不行,提示没有该材料
on right click on 1351:
  if player is sneaking:
    stop
    cancel event
    execute console command "/tell %player% hi"

sk版本是:2.2dev37c
服务端核心:cat1.12.2

(我在1.7版本使用该方法,可以正常运行脚本,但是升级到1.12就不行了,换低版本1.7的sk,结果会无法加载sk插件)

研究好半天了,还是没办法,是高版本不支持了吗或者是需要什么附属支持?


已找到解决办法:
on right click:
  if "%id of event-block%" is "623":
    send "a"




592764254
你可能需要一个变量的替换,比如
on script load:
    set {石头} to "stone" parsed as item

on right click:
    if tool is {石头}:
        message "666!"

把mod物品转换一次试试

下一页 最后一页