药水物品OOC
此指令基于MC原版制作,不需要模组插件的辅助,此指令需要两个命令,方块分两次输入才能彻底生成完毕,起初不准备这么做,只是因为在低段指令生成完毕之后,会从上方再召唤一个掉落的命令方块下来,指令如下:
第1段,首先需要输入的指令
/summon falling_block ~ ~1.5 ~ {Time:1,BlockState:{Name:"minecraft:redstone_block"},Motion:[0d,-1d,0d],Passengers:[{id:falling_block,Time:1,BlockState:{Name:"minecraft:activator_rail"},Passengers:[{id:command_block_minecart,Command:"/data merge block ~ ~-2 ~ {auto:0b,Command:\"\"}"},{id:command_block_minecart,Command:"/gamerule commandBlockOutput false"},{id:command_block_minecart,Command:"/tellraw @a [{\"text\":\"此命令组拥有两部分,所以会比较麻烦一点\",\"bold\":true,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"green\"}]"},{id:command_block_minecart,Command:"/tellraw @a [{\"text\":\"将20颗钻石和一颗羽毛扔在地上,可合成第1个物品\",\"bold\":true,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"blue\"}]"},{id:command_block_minecart,Command:"/scoreboard objectives add itemr dummy"},{id:command_block_minecart,Command:"/scoreboard objectives add itemer dummy"},{id:command_block_minecart,Command:"setblock ~2 ~-2 ~ repeating_command_block[facing=east]{Command:\"/execute as @e[nbt={Item:{id:\\\"minecraft:feather\\\",Count:1b}}] at @s run scoreboard players set @s itemr 1\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~3 ~-2 ~ chain_command_block[facing=east,conditional=false]{Command:\"/execute as @e[nbt={Item:{id:\\\"minecraft:diamond\\\",Count:20b}}] at @s run scoreboard players set @s itemr 20\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~4 ~-2 ~ chain_command_block[facing=east,conditional=false]{Command:\"/execute as @e[scores={itemr=1}] as @e[scores={itemr=20}] at @s run summon minecraft:item ~ ~ ~ {Item:{id:\\\"minecraft:feather\\\",Count:1b,tag:{display:{Name:'{\\\"text\\\": \\\"速度之羽\\\",\\\"bold\\\": true,\\\"italic\\\": false,\\\"color\\\": \\\"blue\\\"}',Lore:['[{\\\"text\\\": \\\"使用可以得到持续五秒的速度三效果\\\",\\\"bold\\\": true,\\\"color\\\": \\\"dark_gray\\\",\\\"italic\\\": false}]','[{\\\"text\\\": \\\"双击\\\",\\\"color\\\": \\\"green\\\",\\\"bold\\\": true,\\\"italic\\\": false},{\\\"keybind\\\":\\\"key.swapOffhand\\\",\\\"bold\\\": true,\\\"color\\\": \\\"green\\\",\\\"italic\\\": false},{\\\"text\\\": \\\"即可使用\\\",\\\"bold\\\": true,\\\"color\\\": \\\"green\\\",\\\"italic\\\": false}]']},Enchantments:[{}],effect:speed}}}\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~5 ~-2 ~ chain_command_block[facing=east,conditional=false]{Command:\"/execute as @e[scores={itemr=1}] as @e[scores={itemr=20}] at @s run particle minecraft:enchant ~ ~ ~ 0.3 0.3 0.3 0 10 force @a\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~6 ~-2 ~ chain_command_block[facing=east,conditional=false]{Command:\"/execute as @e[scores={itemr=1}] as @e[scores={itemr=20}] at @s run playsound entity.player.levelup player @a ~ ~ ~\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~7 ~-2 ~ chain_command_block[facing=east,conditional=true]{Command:\"/kill @e[scores={itemr=1}]\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~8 ~-2 ~ chain_command_block[facing=east,conditional=true]{Command:\"/kill @e[scores={itemr=20}]\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~9 ~-2 ~ chain_command_block[facing=east,conditional=true]{Command:\"execute as @a[nbt={Inventory:[{id:\\\"minecraft:feather\\\",Count:1b,Slot:-106b,tag:{effect:speed}}]}] at @s run effect give @s minecraft:speed 5 3\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~10 ~-2 ~ chain_command_block[facing=east,conditional=true]{Command:\"/scoreboard players reset @e[scores={itemr=1}] itemr\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~11 ~-2 ~ chain_command_block[facing=east,conditional=true]{Command:\"/scoreboard players reset @e[scores={itemr=20}] itemr\",auto:1b} replace"},{id:command_block_minecart,Command:"/summon minecraft:falling_block ~ ~10 ~ {BlockState:{Name:\"minecraft:command_block\"}}"},{id:command_block_minecart,Command:"setblock ~ ~1 ~ command_block{auto:1b,Command:\"fill ~ ~ ~ ~ ~-3 ~ air\"} replace"},{id:command_block_minecart,Command:"kill @e[type=command_block_minecart,distance=..1]"}]}]}
第2段,在第1段指令执行成功之后,会生成一个命令方块,将第2段复制到生成的命令方块中
/summon falling_block ~ ~1.5 ~ {Time:1,BlockState:{Name:"minecraft:redstone_block"},Motion:[0d,-1d,0d],Passengers:[{id:falling_block,Time:1,BlockState:{Name:"minecraft:activator_rail"},Passengers:[{id:command_block_minecart,Command:"/data merge block ~ ~-2 ~ {auto:0b,Command:\"\"}"},{id:command_block_minecart,Command:"/tellraw @a [{\"text\":\"欢迎使用此命令组的第2部分,这是整个命令组的第2部分合成\",\"bold\":true,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"yellow\"}]"},{id:command_block_minecart,Command:"/tellraw @a [{\"text\":\"将一个末影之眼,10颗末地石以及10颗钻石扔在地上即可合成第2个物品\",\"bold\":true,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"gold\"}]"},{id:command_block_minecart,Command:"setblock ~12 ~-2 ~ chain_command_block[facing=east,conditional=false]{Command:\"/execute as @e[nbt={Item:{id:\\\"minecraft:ender_eye\\\",Count:1b}}] at @s run scoreboard players set @s itemer 1\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~13 ~-2 ~ chain_command_block[facing=east,conditional=false]{Command:\"/execute as @e[nbt={Item:{id:\\\"minecraft:end_stone\\\",Count:10b}}] at @s run scoreboard players set @s itemer 10\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~14 ~-2 ~ chain_command_block[facing=east,conditional=false]{Command:\"/execute as @e[nbt={Item:{id:\\\"minecraft:diamond\\\",Count:10b}}] at @s run scoreboard players set @s itemer 10\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~15 ~-2 ~ chain_command_block[facing=east,conditional=true]{Command:\"/execute as @e[scores={itemer=1}] as @e[scores={itemer=10}] as @e[scores={itemer=10}] at @s run summon minecraft:item ~ ~ ~ {Item:{id:\\\"minecraft:ender_eye\\\",Count:1b,tag:{display:{Name:'{\\\"text\\\": \\\"夜视之眼\\\",\\\"bold\\\": true,\\\"italic\\\": false,\\\"color\\\": \\\"blue\\\"}',Lore:['[{\\\"text\\\": \\\"使用可以得到持续五秒的夜视三效果\\\",\\\"bold\\\": true,\\\"color\\\": \\\"dark_gray\\\",\\\"italic\\\": false}]','[{\\\"text\\\": \\\"双击\\\",\\\"color\\\": \\\"green\\\",\\\"bold\\\": true,\\\"italic\\\": false},{\\\"keybind\\\":\\\"key.swapOffhand\\\",\\\"bold\\\": true,\\\"color\\\": \\\"green\\\",\\\"italic\\\": false},{\\\"text\\\": \\\"即可使用\\\",\\\"bold\\\": true,\\\"color\\\": \\\"green\\\",\\\"italic\\\": false}]']},Enchantments:[{}],effect:night_vision}}}\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~16 ~-2 ~ chain_command_block[facing=east,conditional=false]{Command:\"/execute as @e[scores={itemer=1}] as @e[scores={itemer=10}] as @e[scores={itemer=10}] at @s run particle minecraft:enchant ~ ~ ~ 0.3 0.3 0.3 0 10 force @a\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~17 ~-2 ~ chain_command_block[facing=east,conditional=false]{Command:\"/execute as @e[scores={itemer=1}] as @e[scores={itemer=10}] as @e[scores={itemer=10}] at @s run playsound entity.player.levelup player @a ~ ~ ~\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~18 ~-2 ~ chain_command_block[facing=east,conditional=true]{Command:\"/kill @e[scores={itemer=1}]\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~19 ~-2 ~ chain_command_block[facing=east,conditional=true]{Command:\"/kill @e[scores={itemer=10}]\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~20 ~-2 ~ chain_command_block[facing=east,conditional=false]{Command:\"/execute as @a[nbt={Inventory:[{id:\\\"minecraft:ender_eye\\\",Count:1b,Slot:-106b,tag:{effect:night_vision}}]}] at @s run effect give @s minecraft:night_vision 5 3\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~21 ~-2 ~ chain_command_block[facing=east,conditional=true]{Command:\"/scoreboard players reset @e[scores={itemer=1}] itemer\",auto:1b} replace"},{id:command_block_minecart,Command:"setblock ~22 ~-2 ~ chain_command_block[facing=east,conditional=true]{Command:\"/scoreboard players reset @e[scores={itemer=10}] itemer\",auto:1b} replace"},{id:command_block_minecart,Command:"/tellraw @a [{\"text\":\"命令组制生成完毕!\",\"bold\":true,\"italic\":false,\"underlined\":false,\"strikethrough\":false,\"obfuscated\":false,\"color\":\"green\"}]"},{id:command_block_minecart,Command:"setblock ~ ~1 ~ command_block{auto:1b,Command:\"fill ~ ~ ~ ~ ~-3 ~ air\"} replace"},{id:command_block_minecart,Command:"kill @e[type=command_block_minecart,distance=..1]"}]}]}
当把这条指令按顺序依次执行成功后,整个命令组就完成了,合成表的话会在执行成功时提醒。