藥水物品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\\\": \\\"使用可以得到持續(xù)五秒的速度三效果\\\",\\\"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段指令執(zhí)行成功之后,會生成一個命令方塊,將第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\\\": \\\"使用可以得到持續(xù)五秒的夜視三效果\\\",\\\"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]"}]}]}
當把這條指令按順序依次執(zhí)行成功后,整個命令組就完成了,合成表的話會在執(zhí)行成功時提醒。