マイクラPEでコマンドブロックを使った回路の作り方は?マインクラフト
結論:
チェストと地点の識別を明確にし、コマンドを整理した回路。
ポイント:
- コマンドブロックの設置:コマンドブロックを設置し、必要なコマンドを入力する準備をする。
- スコアボードの設定:/scoreboard objectives add randomchesttimer dummyでスコアボードを作成する。
- エンティティの生成:/summonコマンドで必要なエンティティを生成し、識別用のタグを付ける。
- 反復とチェーンの設定:反復コマンドブロックとチェーンコマンドブロックを使い、処理の流れを作成する。
- 効果音の追加:効果音を追加するために、条件付きチェーンコマンドブロックを使用して音を再生する。
マイクラPEでコマンドブロックを使った回路の作り方は?
今回は、マイクラPEでコマンドブロックを使った回路の作成方法についてお話しします。
具体的には、チェストをランダムに選び、指定した地点にコピーするという面白い仕組みです。
さらに、エフェクトや効果音も加えられると、より楽しい体験になりますよ。
それでは、実際の手順を見ていきましょう!
きっと、あなたのマイクラライフがもっと充実するはずです。
コマンドブロックを使った回路の具体的な作成手順
まずは、コマンドブロックを使った回路を作成するための準備をしましょう。
最初に、必要なコマンドを実行して、スコアボードやエンティティを設定します。
以下のコマンドをチャットに入力してください。
/scoreboard objectives add randomchesttimer dummy
/summon minecraft:armor_stand 10 11 10
/summon minecraft:armor_stand 11 11 11
/summon minecraft:armor_stand 12 11 10
/summon minecraft:armor_stand 13 11 11
/tag @e[type=armor_stand,x=10,y=10,z=10,dx=3,dy=1,dz=1] add randomchest
/tag @e[type=armor_stand,x=10,y=10,z=10,c=1,r=1,tag=randomchest] add ori
これで、必要なエンティティとスコアボードが設定されました。
次に、回路のメイン部分を作成します。
コマンドブロックを使って、以下の手順を実行してください。
まず、反復コマンドブロックを設置し、次のコマンドを入力します。
/scoreboard players add @e[tag=ori,type=armor_stand] randomchesttimer 1
次に、チェーンコマンドブロックを設置し、以下のコマンドを順番に入力します。
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ tag @r[tag=randomchest,type=armor_stand,c=1] add A
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ tag @r[tag=randomchest,tag=!A,type=armor_stand,c=1] add B
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ tag @r[tag=randomchest,tag=!A,tag=!B,type=armor_stand,c=1] add C
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ tag @e[tag=randomchest,tag=!A,tag=!B,tag=!C,type=armor_stand,c=1] add D
これで、ランダムにチェストを選ぶ準備が整いました。
次に、選ばれたチェストを指定した地点にコピーするコマンドを追加します。
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ execute @e[tag=randomchest,tag=A,type=armor_stand] ~ ~ ~ clone ~ ~ ~ ~ ~ ~ 20 20 20
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ execute @e[tag=randomchest,tag=B,type=armor_stand] ~ ~ ~ clone ~ ~ ~ ~ ~ ~ 20 20 30
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ execute @e[tag=randomchest,tag=C,type=armor_stand] ~ ~ ~ clone ~ ~ ~ ~ ~ ~ 30 20 20
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ execute @e[tag=randomchest,tag=D,type=armor_stand] ~ ~ ~ clone ~ ~ ~ ~ ~ ~ 30 20 30
これで、選ばれたチェストが指定した地点にコピーされるようになります。
次に、選ばれたチェストのタグを削除するコマンドを追加します。
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ tag @e[tag=randomchest,tag=A,type=armor_stand] remove A
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ tag @e[tag=randomchest,tag=B,type=armor_stand] remove B
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ tag @e[tag=randomchest,tag=C,type=armor_stand] remove C
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ tag @e[tag=randomchest,tag=D,type=armor_stand] remove D
最後に、スコアボードの値をリセットするコマンドを追加します。
/scoreboard players set @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] randomchesttimer 0
これで、基本的な回路が完成しました!
次に、エフェクトや効果音を追加する方法についてお話しします。
効果音を追加するには、最後のコマンドの後に、条件付きチェーンコマンドブロックを設置し、以下のコマンドを入力します。
例えば、効果音を追加する場合は、次のようにします。
/execute @e[tag=ori,type=armor_stand,scores={randomchesttimer=400..}] ~ ~ ~ playsound minecraft:entity.experience_orb.pickup master @a ~ ~ ~ 1 1
これで、チェストがコピーされる際に効果音が鳴るようになります。
エフェクトについては、パーティクルがバグで使えないため、今回は省略しますが、他のエフェクトを使うこともできます。
以上が、コマンドブロックを使った回路の作成手順です。
この回路を使って、ぜひ楽しいマイクラライフを送ってくださいね!
Yes
