本帖最后由 Freerr 于 2016-7-22 21:06 编辑

经过我蛋疼了N个星期后终于做出了完整版本,这个版本有手榴弹高爆雷闪光弹烟雾弹四种手雷,还用了村民的自定义交易,然后我也用这个东西成功混进了TML,好了不说了,放OOC
  1. /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:"/scoreboard objectives add crafting dummy"},{id:"MinecartCommandBlock",Command:"/title @a title [{"text":"手榴弹模组安装成功","color":"red"}]"},{id:"MinecartCommandBlock",Command:"/title @a subtitle [{"text":"Freerr制作","color":"aqua"}]"},{id:"MinecartCommandBlock",Command:"/setblock ~ ~-1 ~-2 minecraft:air"},{id:"MinecartCommandBlock",Command:"/difficulty easy"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":""}]"},{id:"MinecartCommandBlock",Command:"/tellraw @a [{"text":"向村民丢一个绿宝石使其变成军火贩子!","color":"red","bold":"true"}]"},{id:"MinecartCommandBlock",Command:"setblock ~0 ~2 ~0 repeating_command_block 1 replace {auto:1b,Command:"/testfor @a {SelectedItem:{id:minecraft:experience_bottle,tag:{display:{Name:\\"手榴弹\\",Lore:[0:\\"右键丢出使用\\"]}}}}"}"},{id:"MinecartCommandBlock",Command:"setblock ~0 ~3 ~0 chain_command_block 9 replace {auto:1b,Command:"/scoreboard players tag @e[type=ThrownExpBottle] add true"}"},{id:"MinecartCommandBlock",Command:"setblock ~0 ~4 ~0 chain_command_block 1 replace {auto:1b,Command:"/scoreboard players add @e[type=XPOrb] xptimer 1"}"},{id:"MinecartCommandBlock",Command:"setblock ~0 ~5 ~0 chain_command_block 1 replace {auto:1b,Command:"/execute @e[type=ThrownExpBottle,tag=true] ~ ~ ~ scoreboard players add @a timer 1"}"},{id:"MinecartCommandBlock",Command:"setblock ~0 ~6 ~0 chain_command_block 1 replace {auto:1b,Command:"/scoreboard players test @a timer 3"}"},{id:"MinecartCommandBlock",Command:"setblock ~0 ~7 ~0 chain_command_block 9 replace {auto:1b,Command:"/execute @e[type=XPOrb,score_xptimer=5] ~ ~ ~ summon PrimedTnt"}"},{id:"MinecartCommandBlock",Command:"setblock ~0 ~8 ~0 chain_command_block 1 replace {auto:1b,Command:"/execute @e[type=PrimedTnt] ~ ~ ~ scoreboard players set @a timer 0"}"},{id:"MinecartCommandBlock",Command:"setblock ~1 ~2 ~0 repeating_command_block 1 replace {auto:1b,Command:"/scoreboard players tag @e[type=Item] add GBL {Item:{id:minecraft:magma_cream,tag:{display:{Lore:[\\"按Q丢出使用\\"],Name:\\"高爆雷\\"}}},OnGround:1b}"}"},{id:"MinecartCommandBlock",Command:"setblock ~1 ~3 ~0 chain_command_block 1 replace {auto:1b,Command:"/execute @e[type=Item,tag=GBL,score_timer_min=50] ~ ~ ~ summon Creeper ~ ~ ~ {ighted:1,Fuse:0,ExplosionRadius:10b}"}"},{id:"MinecartCommandBlock",Command:"setblock ~1 ~4 ~0 chain_command_block 1 replace {auto:1b,Command:"/scoreboard players tag @e[type=Item] add SGD {Item:{id:minecraft:slime_ball,tag:{display:{Lore:[\\"按Q丢出使用\\"],Name:\\"闪光弹\\"}}},OnGround:1b}"}"},{id:"MinecartCommandBlock",Command:"setblock ~1 ~5 ~0 chain_command_block 1 replace {auto:1b,Command:"/execute @e[type=Item,tag=SGD,score_timer_min=50] ~ ~ ~ effect @e[r=5] 15 15 0 true"}"},{id:"MinecartCommandBlock",Command:"setblock ~1 ~6 ~0 chain_command_block 1 replace {auto:1b,Command:"/scoreboard players tag @e[type=Item] add YWD {Item:{id:minecraft:firework_charge,tag:{display:{Lore:[\\"按Q丢出使用\\"],Name:\\"烟雾弹\\"}}},OnGround:1b}"}"},{id:"MinecartCommandBlock",Command:"setblock ~1 ~7 ~0 chain_command_block 1 replace {auto:1b,Command:"/execute @e[type=Item,tag=YWD,score_timer_min=50] ~ ~ ~ /particle largesmoke ~ ~2 ~ 5 5 5 0.0 10000"}"},{id:"MinecartCommandBlock",Command:"setblock ~1 ~8 ~0 chain_command_block 1 replace {auto:1b,Command:"/kill @e[type=Item,score_timer_min=50]"}"},{id:"MinecartCommandBlock",Command:"setblock ~2 ~2 ~0 repeating_command_block 1 replace {auto:1b,Command:"/scoreboard players add @e[type=Item] timer 1 {Item:{id:minecraft:magma_cream,tag:{display:{Lore:[\\"按Q丢出使用\\"],Name:\\"高爆雷\\"}}},OnGround:1b}"}"},{id:"MinecartCommandBlock",Command:"setblock ~2 ~3 ~0 chain_command_block 1 replace {auto:1b,Command:"/scoreboard players add @e[type=Item] timer 1 {Item:{id:minecraft:slime_ball,tag:{display:{Lore:[\\"按Q丢出使用\\"],Name:\\"闪光弹\\"}}},OnGround:1b}"}"},{id:"MinecartCommandBlock",Command:"setblock ~2 ~4 ~0 chain_command_block 1 replace {auto:1b,Command:"/scoreboard players add @e[type=Item] timer 1 {Item:{id:minecraft:firework_charge,tag:{display:{Lore:[\\"按Q丢出使用\\"],Name:\\"烟雾弹\\"}}},OnGround:1b}"}"},{id:"MinecartCommandBlock",Command:"setblock ~2 ~5 ~0 chain_command_block 1 replace {auto:1b,Command:"/execute @e[type=Villager] ~ ~ ~ scoreboard players tag @e[type=Item,r=1] add CM {Item:{id:\\"minecraft:emerald\\"},OnGround:1b}"}"},{id:"MinecartCommandBlock",Command:"setblock ~2 ~6 ~0 chain_command_block 1 replace {auto:1b,Command:"/execute @e[type=Item,tag=CM] ~ ~ ~ execute @e[type=Villager,r=1] ~ ~ ~ scoreboard players tag @e[type=Villager,r=1] add CM1"}"},{id:"MinecartCommandBlock",Command:"setblock ~2 ~7 ~0 chain_command_block 1 replace {auto:1b,Command:"/entitydata @e[type=Villager,tag=CM1] {Profession:3,CustomName:\\"军火贩子\\",CustomNameVisible:1,Offers:{Recipes:[{maxUses:99999,buy:{id:gold_ingot,Count:10},sell:{id:experience_bottle,Count:1,tag:{display:{Name:\\"手榴弹\\",Lore:[右键丢出使用]}}}},{maxUses:99999,buy:{id:gold_ingot,Count:20},sell:{id:magma_cream,Count:1,tag:{display:{Name:\\"高爆雷\\",Lore:[按Q丢出使用]}}}},{maxUses:99999,buy:{id:gold_ingot,Count:20},sell:{id:slime_ball,Count:1,tag:{display:{Name:\\"闪光弹\\",Lore:[按Q丢出使用]}}}},{maxUses:99999,buy:{id:gold_ingot,Count:20},sell:{id:firework_charge,Count:1,tag:{display:{Name:\\"烟雾弹\\",Lore:[按Q丢出使用]}}}}]}}"}"},{id:"MinecartCommandBlock",Command:"setblock ~2 ~8 ~0 chain_command_block 1 replace {auto:1b,Command:"/execute @e[tag=CM1] ~ ~ ~ kill @e[type=Item,tag=CM,r=1]"}"},{id:"MinecartCommandBlock",Command:"/setblock ~ ~-1 ~ minecraft:lava 15"},{id:"MinecartCommandBlock",Command:"setblock ~ ~ ~ air 0"}]}]}
复制代码


命令详解:
  1. //只需执行一次的命令{
  2. init:/gamerule commandBlockOutput false
  3. //关闭命令方块输出
  4. init:/scoreboard objectives add timer dummy
  5. //新建计时器——计分板timer
  6. init:/scoreboard objectives add xptimer dummy
  7. //新建计时器2——计分板xptimer
  8. init:/scoreboard objectives add crafting dummy
  9. //新建用于合成的计分板
  10. init:/title @a title [{"text":"手榴弹模组安装成功","color":"red"}]
  11. //主标题
  12. init:/title @a subtitle [{"text":"Freerr制作","color":"aqua"}]
  13. //副标题
  14. init:/setblock ~ ~-1 ~-2 minecraft:air
  15. //替换命令方块为空气
  16. init:/difficulty easy
  17. //修改难度为简单(和平模式下高爆雷不可用)
  18. //无聊的提示部分{
  19. init:/tellraw @a [{"text":""}]
  20. init:/tellraw @a [{"text":""}]
  21. init:/tellraw @a [{"text":""}]
  22. init:/tellraw @a [{"text":""}]
  23. init:/tellraw @a [{"text":""}]
  24. init:/tellraw @a [{"text":""}]
  25. init:/tellraw @a [{"text":""}]
  26. init:/tellraw @a [{"text":""}]
  27. init:/tellraw @a [{"text":""}]
  28. init:/tellraw @a [{"text":""}]
  29. init:/tellraw @a [{"text":""}]
  30. init:/tellraw @a [{"text":""}]
  31. init:/tellraw @a [{"text":""}]
  32. init:/tellraw @a [{"text":""}]
  33. init:/tellraw @a [{"text":""}]
  34. init:/tellraw @a [{"text":""}]
  35. init:/tellraw @a [{"text":""}]
  36. init:/tellraw @a [{"text":""}]
  37. init:/tellraw @a [{"text":""}]
  38. init:/tellraw @a [{"text":"向村民丢一个绿宝石使其变成军火贩子!","color":"red","bold":"true"}]
  39. //(其实是我懒得换行)
  40. //}
  41. //}
  42. //手榴弹引爆部分{
  43. rcb:/testfor @a {SelectedItem:{id:minecraft:experience_bottle,tag:{display:{Name:"手榴弹",Lore:[0:"右键丢出使用"]}}}}
  44. //检测玩家手里的物品是否合格
  45. cond:/scoreboard players tag @e[type=ThrownExpBottle] add true
  46. //合格则给经验瓶添加tag
  47. /scoreboard players add @e[type=XPOrb] xptimer 1
  48. //每tick给经验球的xptimer加一分
  49. /execute @e[type=ThrownExpBottle,tag=true] ~ ~ ~ scoreboard players add @a timer 1
  50. //增加计时器分数
  51. /scoreboard players test @a timer 3
  52. //检测计时器的分数是否超过三
  53. cond:/execute @e[type=XPOrb,score_xptimer=5] ~ ~ ~ summon PrimedTnt
  54. //如果是则使xptimer分数小于5的经验球召唤点燃的tnt
  55. /execute @e[type=PrimedTnt] ~ ~ ~ scoreboard players set @a timer 0
  56. //让点燃的tnt重置计时器的分数
  57. //}
  58. //拓展手雷引爆部分{
  59. new 1 0 0
  60. rcb:/scoreboard players tag @e[type=Item] add GBL {Item:{id:minecraft:magma_cream,tag:{display:{Lore:["按Q丢出使用"],Name:"高爆雷"}}},OnGround:1b}
  61. //给高爆雷添加tag
  62. /execute @e[type=Item,tag=GBL,score_timer_min=50] ~ ~ ~ summon Creeper ~ ~ ~ {ighted:1,Fuse:0,ExplosionRadius:10b}
  63. //使高爆雷爆炸
  64. /scoreboard players tag @e[type=Item] add SGD {Item:{id:minecraft:slime_ball,tag:{display:{Lore:["按Q丢出使用"],Name:"闪光弹"}}},OnGround:1b}
  65. //给闪光弹添加tag
  66. /execute @e[type=Item,tag=SGD,score_timer_min=50] ~ ~ ~ effect @e[r=5] 15 15 0 true
  67. //给闪光弹5格以内的实体添加失明效果
  68. /scoreboard players tag @e[type=Item] add YWD {Item:{id:minecraft:firework_charge,tag:{display:{Lore:["按Q丢出使用"],Name:"烟雾弹"}}},OnGround:1b}
  69. //给烟雾弹添加tag
  70. /execute @e[type=Item,tag=YWD,score_timer_min=50] ~ ~ ~ /particle largesmoke ~ ~2 ~ 5 5 5 0.0 10000
  71. //让烟雾弹在五格范围内生成烟雾效果
  72. /kill @e[type=Item,score_timer_min=50]
  73. //清除爆炸后的手雷
  74. //}
  75. //三种拓展手雷计时部分{
  76. new 2 0 0
  77. rcb:/scoreboard players add @e[type=Item] timer 1 {Item:{id:minecraft:magma_cream,tag:{display:{Lore:["按Q丢出使用"],Name:"高爆雷"}}},OnGround:1b}
  78. //给高爆雷的计时器加一分
  79. /scoreboard players add @e[type=Item] timer 1 {Item:{id:minecraft:slime_ball,tag:{display:{Lore:["按Q丢出使用"],Name:"闪光弹"}}},OnGround:1b}
  80. //给闪光弹的计时器加一分
  81. /scoreboard players add @e[type=Item] timer 1 {Item:{id:minecraft:firework_charge,tag:{display:{Lore:["按Q丢出使用"],Name:"烟雾弹"}}},OnGround:1b}
  82. //给烟雾弹的计时器加一分
  83. //}
  84. //自定义村民部分{
  85. /execute @e[type=Villager] ~ ~ ~ scoreboard players tag @e[type=Item,r=1] add CM {Item:{id:"minecraft:emerald"},OnGround:1b}
  86. //让村民给物品添加tag
  87. /execute @e[type=Item,tag=CM] ~ ~ ~ execute @e[type=Villager,r=1] ~ ~ ~ scoreboard players tag @e[type=Villager,r=1] add CM1
  88. //让物品给村民添加tag
  89. /entitydata @e[type=Villager,tag=CM1] {Profession:3,CustomName:"军火贩子",CustomNameVisible:1,Offers:{Recipes:[{maxUses:99999,buy:{id:gold_ingot,Count:10},sell:{id:experience_bottle,Count:1,tag:{display:{Name:"手榴弹",Lore:[右键丢出使用]}}}},{maxUses:99999,buy:{id:gold_ingot,Count:20},sell:{id:magma_cream,Count:1,tag:{display:{Name:"高爆雷",Lore:[按Q丢出使用]}}}},{maxUses:99999,buy:{id:gold_ingot,Count:20},sell:{id:slime_ball,Count:1,tag:{display:{Name:"闪光弹",Lore:[按Q丢出使用]}}}},{maxUses:99999,buy:{id:gold_ingot,Count:20},sell:{id:firework_charge,Count:1,tag:{display:{Name:"烟雾弹",Lore:[按Q丢出使用]}}}}]}}
  90. //修改符合条件的村民NBT
  91. /execute @e[tag=CM1] ~ ~ ~ kill @e[type=Item,tag=CM,r=1]
  92. //修改完成后清除物品
  93. //}
复制代码
没了,还有不要和我说有什么BUG,那个是特性[img=0,1]file:///C:\Users\Owen9\AppData\Roaming\Tencent\QQ\Temp\FO)@LU[4H{FW4W}%XBSMF}A.png[/img]【手动滑稽】