我的世界命令方块指令怎么创造经验瓶炸弹

我的世界命令方块功能十分强大,今天小编为大家带来的是我的世界命令方块创造经验炸弹指令分享,喜欢的小伙伴不妨看看怎么使用命令方块制作经验瓶炸弹吧,希望大家喜欢。

下面是OOC:

/summon FallingSand ~ ~1 ~2 {Time:1,Block:"minecraft:redstone_block",Passengers:[{id:"FallingSand",Time:1,Block:"minecraft:activator_rail",Passengers:[{id:"MinecartCommandBlock",Command:"/gamerule commandBlockOutput false"},{id:"MinecartCommandBlock",Command:"/scoreboard objectives add timer dummy"},{id:"MinecartCommandBlock",Command:"/scoreboard objectives add xptimer dummy"},{id:"MinecartCommandBlock",Command:"/title @a title [{"text":"经验瓶手榴弹安装成功","color":"red"}]"}, {id:"MinecartCommandBlock",Command:"/title @a subtitle [{"text":"码蚁工作室_天际制作 Minecraftid:Freerr","color":"aqua"}]"},{id:"MinecartCommandBlock",Command:"/setblock ~ ~-1 ~-2 minecraft:air"},{id:"MinecartCommandBlock",Command:"/replaceitem entity @a slot.hotbar.4 minecraft:experience_bottle 64 0 {display:{Name:"手榴弹"}}"},{id:"MinecartCommandBlock",Command:"setblock ~0 ~2 ~0 repeating_command_block 5 replace {auto:1b,Command:"/testfor @e[type=ThrownExpBottle,tag=true]"}"},{id:"MinecartCommandBlock",Command:"setblock ~1 ~2 ~0 repeating_command_block 13 replace {auto:1b,Command:"/scoreboard players add @a timer 1"}"},{id:"MinecartCommandBlock",Command:"setblock ~2 ~2 ~0 repeating_command_block 5 replace {auto:1b,Command:"/scoreboard players test @a timer 3"}"},{id:"MinecartCommandBlock",Command:"setblock ~3 ~2 ~0 chain_command_block 13 replace {auto:1b,Command:"/execute @e[type=XPOrb,score_xptimer=5] ~ ~ ~ summon PrimedTnt"}"},{id:"MinecartCommandBlock",Command:"setblock ~4 ~2 ~0 repeating_command_block 3 replace {auto:1b,Command:"/scoreboard players add @e[type=XPOrb] xptimer 1"}"},{id:"MinecartCommandBlock",Command:"setblock ~4 ~2 ~1 chain_command_block 4 replace {auto:1b,Command:"/execute @e[type=PrimedTnt] ~ ~ ~ scoreboard players set @a timer 0"}"},{id:"MinecartCommandBlock",Command:"setblock ~3 ~2 ~1 chain_command_block 4 replace {auto:1b,Command:"/testfor @a {SelectedItem:{id:minecraft:experience_bottle,tag:{display:{Name:"手榴弹 "}}}}"}"},{id:"MinecartCommandBlock",Command:"setblock ~2 ~2 ~1 chain_command_block 12 replace {auto:1b,Command:"/scoreboard players tag @e[type=ThrownExpBottle] add true"}"},{id:"MinecartCommandBlock",Command:"setblock ~1 ~2 ~1 repeating_command_block 4 replace {auto:1b,Command:"/kill @e[score_xptimer_min=800]"}"},{id:"MinecartCommandBlock",Command:"fill ~-1 ~1 ~-1 ~5 ~3 ~2 stained_glass 3 outline"},{id:"MinecartCommandBlock",Command:"fill ~-1 ~1 ~-1 ~5 ~1 ~2 stained_hardened_clay 3"},{id:"MinecartCommandBlock",Command:"fill ~-1 ~3 ~-1 ~5 ~3 ~2 stained_hardened_clay 3"},{id:"MinecartCommandBlock",Command:"setblock ~2 ~2 ~-2 wall_sign 8 replace {Text3:"{"text":"[ 点我移除模组 ]","color":"dark_red","clickEvent":{"action":"run_command","value":"fill ~-3 ~-1 ~ ~3 ~1 ~4 air 0"}}"}"},{id:"MinecartCommandBlock",Command:"/setblock ~ ~-1 ~ minecraft:lava 15"},{id:"MinecartCommandBlock",Command:"setblock ~ ~ ~ air 0"}]}]}

这个版本修复了所有的BUG,包括只让指定的经验球爆炸,只有扔特定名字的经验瓶才能爆炸等等等等,但是,还有一个小BUG,跟MOJANG的武器判定伤害BUG一样,比如用箭♂射♂一个生物,在箭在空中飞的时候换成钻石剑会对生物造成和用钻石剑一样的伤害,而我的这个是扔一个普通的经验瓶然后迅速换成手榴弹名字的经验瓶也会爆炸,MOJANG什么时候修了这个伤害数值BUG(特性),我在把这个BUG修掉也不迟。

使用方法:扔出一个叫做手榴弹的经验瓶就好啦

下面是命令分解

/scoreboard objectives add timer dummy

新建计时器——计分板timer

/scoreboard objectives add xptimer dummy

新建计时器2——计分板xptimer

/testfor @e[type=ThrownExpBottle,tag=true]

高频检测手榴弹名字的经验瓶

/scoreboard players add @a timer 1

如果检测到就给计时器的分数+1

/scoreboard players test @a timer 3

检测计时器的分数是否超过三

/execute @e[type=XPOrb,score_xptimer=5] ~ ~ ~ summon PrimedTnt

如果是则使刚生成的经验球召唤点燃的tnt

/scoreboard players add @e[type=XPOrb] xptimer 1

每tick给经验球的xptimer加一分

/execute @e[type=PrimedTnt] ~ ~ ~ scoreboard players set @a timer 0

让点燃的tnt重置计时器的分数

/testfor @a {SelectedItem:{id:minecraft:experience_bottle,tag:{display:{Name:"手榴弹"}}}}

检测玩家手里物品是否为手榴弹名字的经验瓶

/scoreboard players tag @e[type=ThrownExpBottle] add true

是则给经验瓶添加tag