当前位置: 我的世界 > 游戏攻略 > 正文

教你用命令方块模拟苦力怕爆炸

小编:铅笔时间:2017-12-09 14:54回到游戏园首页

  下面小编为大家带来我的世界模拟苦力怕爆炸教程,教大家利用命令方块制作苦力怕爆炸,希望大家喜欢!

  整体思路:

  关于数据值ExplosionPower:的说明,是火球等一般实体的爆炸威力,若将其改为负数,则不会破坏地形以及造成伤害,固在这里起到了关键作用。

  根据之前的想法,我是想通过当爬行者开始爆炸时,便给其gboom加分,到一定值时,在爬行者位置生成一个爆炸威力为负数的火球,并播放爆炸粒子效果后将爬行者tp出世界(也可以看做kill爬行者)。但令我无奈的是,无法根据NBT获取到爬行者开始爆炸时间!!!(冷漠脸.png),固在此我直接模拟了原版中玩家(生存和冒险模式下)靠近爬行者即爆炸的机制。

  代码:

  创建变量:

  /scoreboard objectives add gboom dummy

  使生存和冒险模式被检测:[高频循环]

  /scoreboard players tag @a[tag=sa,m=1] remove sa

  /scoreboard players tag @a[tag=sa,m=3] remove sa

  /scoreboard players tag @a[tag=!sa,m=0] add sa

  /scoreboard players tag @a[tag=!sa,m=2] add sa

  PS: 使生存与冒险模式具有tag"sa",创造与旁观无,则选择生存与冒险的玩家用@a[tag=sa]即可。

  标记被检测玩家附近爬行者:[高频循环]

  /execute @a[tag=sa] ~ ~ ~ scoreboard players tag @e[type=Creeper,tag=sboom] remove sboom

  /execute @a[tag=sa] ~ ~ ~ scoreboard players tag @e[type=Creeper,r=5] add sboom

  PS: 使靠近生存和冒险模式玩家的苦力怕具有tag"sboom",即视为将爆炸的苦力怕。远离玩家5格以外的苦力怕不具有此标签

  被标记爬行者开始爆炸反之则否:[高频循环]

  /execute @e[type=Creeper,tag=!sboom,score_gboom_min=1,score_gboom=27] ~ ~ ~ summon Creeper ~ ~ ~

  /tp @e[type=Creeper,tag=!sboom,score_gboom_min=1,score_gboom=27] ~ ~-1000 ~

  /scoreboard players add @e[type=Creeper,tag=sboom] gboom 1

  /entitydata @e[type=Creeper,score_gboom_min=5,score_gboom=5] {ignited:1}

  /execute @e[type=Creeper,score_gboom_min=28,score_gboom=28] ~ ~ ~ summon Fireball ~ ~1 ~ {power:[0.0d,-55.0d,0.0d],direction:[0.0d,-55.0d,0.0d],ExplosionPower:-3}

  /execute @e[type=Creeper,score_gboom_min=28,score_gboom=28] ~ ~ ~ /particle hugeexplosion ~ ~ ~ 0 0 0 0.3 1 force

  /tp @e[type=Creeper,score_gboom_min=29,score_gboom=29] ~ ~-1000 ~

  此系统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 ~11 ~0 chain_command_block 1 replace {Command:"/tp @e[type=Creeper,score_gboom_min=29,score_gboom=29] ~ ~-1000 ~",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~10 ~0 chain_command_block 1 replace {Command:"/execute @e[type=Creeper,score_gboom_min=28,score_gboom=28] ~ ~ ~ /particle hugeexplosion ~ ~ ~ 0 0 0 0.3 1 force",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~9 ~0 chain_command_block 1 replace {Command:"/execute @e[type=Creeper,score_gboom_min=28,score_gboom=28] ~ ~ ~ summon Fireball ~ ~1 ~ {power:[0.0d,-55.0d,0.0d],direction:[0.0d,-55.0d,0.0d],ExplosionPower:-4}",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~8 ~0 chain_command_block 1 replace {Command:"/entitydata @e[type=Creeper,score_gboom_min=5,score_gboom=5] {ignited:1}",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~7 ~0 chain_command_block 1 replace {Command:"/scoreboard players add @e[type=Creeper,tag=sboom] gboom 1",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~6 ~0 chain_command_block 1 replace {Command:"/tp @e[type=Creeper,tag=!sboom,score_gboom_min=1,score_gboom=27] ~ ~-1000 ~",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~5 ~0 chain_command_block 1 replace {Command:"/execute @e[type=Creeper,tag=!sboom,score_gboom_min=1,score_gboom=27] ~ ~ ~ summon Creeper ~ ~ ~",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~4 ~0 chain_command_block 1 replace {Command:"/execute @a[tag=sa] ~ ~ ~ scoreboard players tag @e[type=Creeper,r=5] add sboom",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~3 ~0 chain_command_block 1 replace {Command:"/execute @a[tag=sa] ~ ~ ~ scoreboard players tag @e[type=Creeper,tag=sboom] remove sboom",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~2 ~0 chain_command_block 1 replace {Command:"/scoreboard players tag @a[tag=!sa,m=2] add sa",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~1 ~0 chain_command_block 1 replace {Command:"/scoreboard players tag @a[tag=!sa,m=0] add sa",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~0 ~0 chain_command_block 1 replace {Command:"/scoreboard players tag @a[tag=sa,m=3] remove sa",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-1 ~0 chain_command_block 1 replace {Command:"/scoreboard players tag @a[tag=sa,m=1] remove sa",auto:1b}},{id:commandblock_minecart,Command:setblock ~2 ~-2 ~0 repeating_command_block 1 replace {Command:/scoreboard objectives add gboom dummy,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]}]}]}

分享到:更多

游戏信息

我的世界
我的世界类型:休闲娱乐平台:PC,iOS,安卓电脑版下载
  • 游戏大礼包
  • 手游开测表