具体效果上面gif一目了然,当然我并不是完全按照他还原:
OOC:
- /summon falling_block ~ ~1.5 ~ {Time:1,Block:minecraft:redstone_block,Motion:[0d,-1d,0d],Passengers:[{id:falling_block,Time:1,Block:minecraft:activator_rail,Passengers:[{id:commandblock_minecart,Command:blockdata ~ ~-2 ~ {auto:0b,Command:""}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~14 chain_command_block 3 replace {Command:"/kill @e[tag=rsd]",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~13 chain_command_block 3 replace {Command:"/execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 fill ~ ~-1 ~ ~ ~ ~-1 air 0 replace red_sandstone 0",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~12 chain_command_block 3 replace {Command:"/execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 fill ~ ~-1 ~ ~ ~ ~1 air 0 replace red_sandstone 0",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~11 chain_command_block 3 replace {Command:"/execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 fill ~-1 ~ ~ ~1 ~ ~ air 0 replace red_sandstone 0",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~10 chain_command_block 3 replace {Command:"/execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 fill ~1 ~ ~ ~1 ~ ~ air 0 replace red_sandstone 0",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~9 chain_command_block 3 replace {Command:"/execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 scoreboard players tag @e[r=0,tag=rsss] add rsd",auto:1b}},{id:commandblock_minecart,Command:"setblock ~2 ~-2 ~8 chain_command_block 3 replace {Command:"/execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 summon minecraft:falling_block ~ ~-1 ~ {Block:\\"minecraft:red_sandstone\\",Time:1}",auto:1b}"},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~7 chain_command_block 3 replace {Command:"/execute @e[tag=rsss] ~ ~ ~ /kill @e[tag=rss,r=0]",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~6 chain_command_block 3 replace {Command:"/execute @e[tag=rsss] ~ ~ ~ tp @e[tag=rss,r=0] ~ -100 ~",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~5 chain_command_block 3 replace {Command:"/entitydata @e[tag=rsss] {Duration:21000000,Time:1s}",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~4 chain_command_block 3 replace {Command:"/execute @e[tag=rss] ~ ~ ~ summon area_effect_cloud ~ ~ ~ {Duration:210000000,Tags:[rsss]}",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~3 chain_command_block 3 replace {Command:"/execute @e[tag=rss] ~ ~ ~ setblock ~ ~ ~ minecraft:red_sandstone",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~2 chain_command_block 3 replace {Command:"/execute @e[tag=rs] ~ ~ ~ detect ~ ~ ~ minecraft:water 0 /execute @e[tag=rs] ~ ~ ~ detect ~ ~1 ~ minecraft:air 0 /kill @e[tag=rs,c=1]",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~1 chain_command_block 3 replace {Command:"/execute @e[tag=rs] ~ ~ ~ detect ~ ~ ~ minecraft:water 0 /execute @e[tag=rs] ~ ~ ~ detect ~ ~1 ~ minecraft:air 0 summon shulker ~ ~ ~ {NoAI:1b,Tags:[rss],Invulnerable:1,ActiveEffects:[{Id:14,Duration:9999999,Amplifier:50,Ambient:1}]}",auto:1b}},{id:commandblock_minecart,Command:"setblock ~2 ~-2 ~0 repeating_command_block 3 replace {Command:"/scoreboard players tag @e[type=falling_block] add rs {Block:\\"minecraft:sand\\",Data:1b}",auto:1b}"},{id:commandblock_minecart,Command:setblock ~ ~1 ~ command_block 0 replace {auto:1b,Command:fill ~ ~ ~ ~ ~-2 ~ air}},{id:commandblock_minecart,Command:kill @e[type=commandblock_minecart,r=1]}]}]}
尽管整体效果差不多,但是我这里你可以直接使用命令生成固态/液态混凝土:
- /give @p minecraft:spawn_egg 1 0 {EntityTag:{id:minecraft:shulker,Tags:[rss]},display:{Name:"生成固态混凝土"}}
- /summon minecraft:falling_block ~ ~ ~ {Block:"minecraft:sand",Data:1,Time:1}
分析命令:
- rcb:/scoreboard players tag @e[type=falling_block] add rs {Block:"minecraft:sand",Data:1b}
- *给液态混凝土加标签
- /execute @e[tag=rs] ~ ~ ~ detect ~ ~ ~ minecraft:water 0 /execute @e[tag=rs] ~ ~ ~ detect ~ ~1 ~ minecraft:air 0 summon shulker ~ ~ ~ {NoAI:1b,Tags:[rss],Invulnerable:1,ActiveEffects:[{Id:14,Duration:9999999,Amplifier:50,Ambient:1}]}
- /execute @e[tag=rs] ~ ~ ~ detect ~ ~ ~ minecraft:water 0 /execute @e[tag=rs] ~ ~ ~ detect ~ ~1 ~ minecraft:air 0 /kill @e[tag=rs,c=1]
- /execute @e[tag=rss] ~ ~ ~ setblock ~ ~ ~ minecraft:red_sandstone
- *如果落入水中,使用潜隐贝修正为整型坐标,并放置固态混凝土
- /execute @e[tag=rss] ~ ~ ~ summon area_effect_cloud ~ ~ ~ {Duration:210000000,Tags:[rsss]}
- /entitydata @e[tag=rsss] {Duration:21000000,Time:1s}
- *生成AEC作为实体标记
- /execute @e[tag=rsss] ~ ~ ~ tp @e[tag=rss,r=0] ~ -100 ~
- /execute @e[tag=rsss] ~ ~ ~ /kill @e[tag=rss,r=0]
- *销毁潜隐贝
- //破坏
- /execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 summon minecraft:falling_block ~ ~-1 ~ {Block:"minecraft:red_sandstone",Time:1}
- /execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 scoreboard players tag @e[r=0,tag=rsss] add rsd
- *检测到固态混凝土被破坏,给实体标记添加'待销毁'标签
- /execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 fill ~1 ~ ~ ~1 ~ ~ air 0 replace red_sandstone 0
- /execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 fill ~-1 ~ ~ ~1 ~ ~ air 0 replace red_sandstone 0
- /execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 fill ~ ~-1 ~ ~ ~ ~1 air 0 replace red_sandstone 0
- /execute @e[tag=rsss] ~ ~ ~ detect ~ ~ ~ air 0 fill ~ ~-1 ~ ~ ~ ~-1 air 0 replace red_sandstone 0
- *连锁反应
- /kill @e[tag=rsd]
- *销毁实体标记(完全销毁混凝土方块)
命令还蛮简单,有几个地方还是要说一说
1.连锁反应并不像gif所表现的,如果是20gt高频,则是非常迅速的连锁反应;想要看到gif中的连锁反应可以选择频率较低的高频驱动模块。
2.比起gif,你也可以破坏水面上的固态混凝土,结果是液态混凝土沉入水中(形成红沙)
3.用潜隐贝来正位是为了防止当实体进入水中运动速率改变后检测坐标上轻微的位移,只是为了保险起见(这种情况在帧数较低下比较明显)[groupid=546]Command Block Logic[/groupid]