矢の飛ばしたい!!
はじめに
皆さんは、
「矢をコマンドで飛ばしたい」
「矢は一定のダメージしか与えられない」
など思ったことありますか?
この記事は、矢関連のコマンドを詳しく教えよう!! という記事になります
ダメージ量を変えるコマンドは簡単!
ダメージ量を変えるときに使うコマンドは、
/summon
コマンドだけです!!
まあ厳密に言えば、最後にNBTという値を指定するだけ。
先にコマンドを教えます
/summon arrow ~ ~ ~ {damage:10d}
この一つのコマンドだけでダメージが10に増やせました!!
最後の d を忘れずに
damage:10dのところを好きな値に変えることでダメージ量をかえられます。
矢を飛ばしたい!!
矢を飛ばすために使うコマンドは5つあります。
チャット欄でのコマンドではできないので、コマンドブロックを用意しましょう
execute as @a at @s anchored eyes run summon arrow ^ ^ ^1 {Tags:["arrow"],life:1000s}
execute as @a at @s rotated as @s positioned 0.0 0.0 0.0 run summon armor_stand ^ ^ ^2 {Tags:["Motion"],Marker:1b,Invisible:1b}
execute as @e[tag=arrow] run data modify entity @s Motion set from entity @e[tag=Motion,limit=1] Pos
kill @e[tag=Motion]
tag @e[tag=arrow] remove shot_arrow
この五つのコマンドです。
始めの矢を召喚するコマンドに damage:10d
を追加するとダメージが10の矢を召喚できます。