大家好。今天就发一个短贴,来讲解一下1.9的单指令执行多条指令的新方法。由于1.9的Riding被删了,有一些单指令系统已被损坏。今天本人花了10分钟研制出了一个新的单指令方法。(版本最好在15w41a+)
-------------正题--------------
首先给大家看下格式:
- /summon FallingSand ~-2 ~ ~
- {Time:1,Block:"minecraft:redstone_block",Passengers:[{id:"FallingSand",Time:1,Block:"minecraft:activator_rail",Passengers:[{id:"MinecartCommandBlock",Command:"/say 1",CustomName:"First"},{id:"MinecartCommandBlock",Command:"/say 2",CustomName:"Second"},{id:"MinecartCommandBlock",Command:"/say 3",CustomName:"Third"},{id:"MinecartCommandBlock",Command:"/say 4",CustomName:"Fourth"},{id:"MinecartCommandBlock",Command:"/say 5",CustomName:"Fifth"},{id:"MinecartCommandBlock",Command:"/say 6",CustomName:"Sixth"},{id:"MinecartCommandBlock",Command:"/say 7",CustomName:"Seventh"},{id:"MinecartCommandBlock",Command:"/say 8",CustomName:"Eighth"},{id:"MinecartCommandBlock",Command:"/say 9",CustomName:"Nineth"},{id:"MinecartCommandBlock",Command:"/say 10",CustomName:"Tenth"},{id:"MinecartCommandBlock",Command:"/setblock ~ ~-1 ~ minecraft:lava 7 replace"},{id:"MinecartCommandBlock",Command:"/fill ~ ~ ~ ~ ~-1 ~ minecraft:air 0 replace"}]}]}
因为用了Passengers,这条指令的运行速度将会比以前旧版的快很多,来减少卡顿(原理还是指令方块矿车)。指令方块矿车的激活一般是瞬间的,然后瞬间清场。但是在这瞬间的过程中,指令方块矿车并不会打乱激活顺序,所以这点可以放心。
-------------指令分拆------------
第一部分:
- /summon FallingSand ~-2 ~ ~
- {Time:1,Block:"minecraft:redstone_block",Passengers:[{id:"FallingSand",Time:1,Block:"minecraft:activator_rail",Passengers:
第二部分(多指令部分):
- [{id:"MinecartCommandBlock",Command:"/say 1",CustomName:"First"},{id:"MinecartCommandBlock",Command:"/say 2",CustomName:"Second"},{id:"MinecartCommandBlock",Command:"/say 3",CustomName:"Third"},{id:"MinecartCommandBlock",Command:"/say 4",CustomName:"Fourth"},{id:"MinecartCommandBlock",Command:"/say 5",CustomName:"Fifth"},{id:"MinecartCommandBlock",Command:"/say 6",CustomName:"Sixth"},{id:"MinecartCommandBlock",Command:"/say 7",CustomName:"Seventh"},{id:"MinecartCommandBlock",Command:"/say 8",CustomName:"Eighth"},{id:"MinecartCommandBlock",Command:"/say 9",CustomName:"Nineth"},{id:"MinecartCommandBlock",Command:"/say 10",CustomName:"Tenth"},
第三部分(清场):
- {id:"MinecartCommandBlock",Command:"/setblock ~ ~-1 ~ minecraft:lava 7 replace"},{id:"MinecartCommandBlock",Command:"/fill ~ ~ ~ ~ ~-1 ~ minecraft:air 0 replace"}]}]}
到这里结束了吧。感谢PCA带来的Passengers的测试。
========END=======
(其实本人现在在写这种指令格式的生成器,内测中)