小中学生から大人まで幅広い年代層に大人気のゲーム「Minecraft」を使って、プログラミングをするための環境を作っていきたいと思います!
普段Minecraftを遊んでいるパソコンがあれば、簡単にできるのでぜひ参考にしてみてください!
Minecraftでプログラミングするために、MakeCode(Code Connection)というビジュアルプログラミング言語を利用できるアプリをインストールします。
Scratchに似ているので、小学生でも楽しくプログラミングを学ぶことができると思います!
今回は、プログラミングをするわけではなく、プログラミングをするための環境を作る段階の説明になります。
小さなお子様だと難しいことが多いので、できるだけ大人の方と一緒にやってもらえるといいと思います!
![](https://teech-lab.com/wp-content/uploads/2021/01/hosome-cutout.png)
大人でも大変じゃぞ。
パソコンで遊べるMinecraftには、「Windows10版(統合版)」と「Java版」と呼ばれる2種類が存在します。
今回は「Windows10版」を利用しますので、Windows10版(統合版)をインストールしていない方は、「マイクラ購入からダウンロード、インストールまでを画像付きで簡単解説!」を参考にしてインストールしてみてください。
![](https://teech-lab.com/wp-content/uploads/2022/01/ecf264ad6dfbf7cf4998c06f987ac2e9-300x169.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/ecf264ad6dfbf7cf4998c06f987ac2e9-300x169.png)
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
もし、Java版しか持ってなくてどうしてもJava版でプログラミングがしてみたいと思っている方がいれば、「MinecraftとScratch3.0を使ったプログラミング環境の作成」という記事もありますので参考にしてみてください。
Windows10版より複雑ですがScratchを使って学ぶことが可能です!
![](https://teech-lab.com/wp-content/uploads/2022/01/49d5d4fa69f350a8730adbfad11231e1-300x169.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/49d5d4fa69f350a8730adbfad11231e1-300x169.png)
Minecraftで何を建築するか迷ったら、Kindle Unlimitedがおすすめ!
Minecraftの建築のアイデア集などもたくさん読めるのでぜひ参考にしてみてください!
![](https://teech-lab.com/wp-content/uploads/2021/01/odoroki-cutout.png)
![](https://teech-lab.com/wp-content/uploads/2021/01/odoroki-cutout.png)
![](https://teech-lab.com/wp-content/uploads/2021/01/odoroki-cutout.png)
こんな本も読み放題じゃ!!
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
Code Connectionをインストールしよう!
では早速、Code Connectionをインストールして、Minecraftでプログラミングができるようにしていきます!
ここからは、Minecraft Windows10版(統合版)がインストールされている前提で進めていきますので、インストールしていない方は、「マイクラ購入からダウンロード、インストールまでを画像付きで簡単解説!」を参考にしてインストールしてからこちらの記事をみてください!
![](https://teech-lab.com/wp-content/uploads/2022/01/ecf264ad6dfbf7cf4998c06f987ac2e9-300x169.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/ecf264ad6dfbf7cf4998c06f987ac2e9-300x169.png)
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
Microsoft StoreからCode Connectionをインストールしよう!
Code Connectionは、Microsoft Storeからインストールができます!
まずはMicrosoft Storeを開きましょう!
スタートの横の「検索」ボタンを選択して、「Microsoft Store」と入力します。
最も一致する検索結果に「Microsoft Store」アプリが出てきますので、ダブルクリックして開きます!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-1-1024x576.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-1-1024x576.jpg)
こんな感じでMicrosoft Storeが開いたら、上部の検索フィールドに「Code Connect」と入力してみてください。
赤枠にあるように「Code Connection for Minecraft」が出てきますので、選択します。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-2-1024x798.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-2-1024x798.jpg)
Code Connection for Minecraftが開いたら、「入手」ボタンを選択しましょう!
インストールが始まりますので、少し待ちます。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-3-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-3-1024x555.jpg)
しばらくするとインストールが終わって、「開く」に変わったと思います。
これでインストールは完了です。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-4-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-4-1024x555.jpg)
Code Connection for Minecraftのショートカットを作成しておこう!
先ほどまででインストールは終わったのですが、デスクトップからCode Connection for Minecraftが開けるほうが便利なので、ショートカットを作成していきます。
一度デスクトップに戻ってもらって、「スタート(Windowsマーク)」を選択します。
最近追加されたものに「Code Connection for Minecraft」が表示されていると思いますので、デスクトップにドラック&ドロップしてみてください。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-5-1024x576.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-5-1024x576.jpg)
するとCode Connection for Minecraftのショートカットがデスクトップに配置されたと思います。
これでいつでもデスクトップから開けるようになりました!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-6-1024x576.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-6-1024x576.jpg)
Minecraft Windows10版と連携してみよう!
ここからは実際にMinecraft Windows10版とCode Connection for Minecraftを連携させてみようと思います!
実際にMinecraftでワールドを作成して、Code Connection for Minecraftの使い方を簡単にまとめていますので、参考にしてみてください。
Minecraftを起動して、ワールドを作成しよう!
まずはMinecraftを起動します!
「Minecraft Launcher」をダブルクリックして、起動してください。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-7-1024x576.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-7-1024x576.jpg)
Minecraft Launcherが開いたら、「プレイ」を選択してMinecraftを開きます!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-8-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-8-1024x555.jpg)
Minecraftが開いたら「遊ぶ」を選択しましょう!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-10-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-10-1024x555.jpg)
ワールドは新しく作りたいので、「新しく作る」を選択しましょう!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-11-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-11-1024x555.jpg)
ここも「世界を新しく作る」で大丈夫です!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-12-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-12-1024x555.jpg)
新しくワールドを作りますが、今回はプログラミング学習なので下記の設定にします。
設定を変更したら、「作る」を選択します!
- 世界の名前:お好きな名前
- デフォルトゲームモード:クリエイティブ
- 難易度:ピース
- 世界のタイプ:フラット
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-1024x555.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-58-1024x555.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-59-1024x555.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-59-1024x555.png)
これでプログラミング用のワールドの作成ができました!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-60-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-60-1024x555.jpg)
「/」キーを押して、コマンド入力モードにしておきます。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-60-1-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-60-1-1024x555.jpg)
Code Connectionを起動して、Minecraftと接続しよう!
続いては、Code Connection for Minecraftを起動して、Minecraftと接続していきます!
先ほど作成した「Code Connection for Minecraft」のショートカットをダブルクリックして起動します。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-60-3-1024x576.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-60-3-1024x576.jpg)
Code Connectionの画面が表示されたら、Minecraftで使うコマンドが表示されるので「コピー」ボタンを押してコピーしましょう!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-60.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-60.png)
Minecraftに戻って、先ほどコピーしたコマンドをMinecraftに貼り付けます。
貼り付けたら「Enter」キーを押してください。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-61-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-61-1024x555.jpg)
接続が完了すると、Code Connectionの画面が変わります。
この画面になったら接続は完了です!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-61.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-61.png)
Make Codeを起動して、プロジェクトを作成しよう!
ここまでできたらMake Codeを利用して、簡単なプログラミングを書いて動作確認してみましょう!
「Make Code」を選択して、エディターを起動しましょう!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-61.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-61.png)
Make Codeの画面が出ますので、「新しいプロジェクト」を選択します!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-62-1017x1024.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-62-1017x1024.jpg)
プロジェクトに名前をつける必要がありますが、ここはお好きな名前で大丈夫です!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-62-1-1017x1024.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-62-1-1017x1024.jpg)
こんな感じでプロジェクトが作成できれば完了です!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-62-1024x555.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-62-1024x555.png)
Minecraft Windows10とMakeCodeを使ってプログラミングしてみよう!
ここまでできたら動作確認という意味も込めて、簡単なプログラミングをしてみましょう!
プログラミングする内容は、下記の通りです。
- チャットで「ジャンプ」を送信したら処理を開始する。
- プレイヤーの位置を「0,0,0」にテレポートさせる。
- ブロックを「1,1,1」に置く。
ジャンプを押したら、プレイヤーの目の前にブロックが表示されていれば動作確認は完了になります!
チャットで「ジャンプ」を送信したら処理を開始する。
まずはチャットでジャンプを送信したら処理を開始するようにしていきましょう!
使うブロックは、初期である「チャットコマンド”run”を入力した時」です。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-64-1024x575.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-64-1024x575.png)
「run」を「ジャンプ」に書き換えてください。
処理を開始するためのブロックはこれでだけです!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-65-1024x575.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-65-1024x575.png)
プレイヤーの位置を「0,0,0」にテレポートさせる。
続いては、プレイヤーの位置を「0,0,0」にテレポートさせます。
0,0,0が何を指しているかというと、「x,y,z」の位置情報です。
Minecraftは、0,0,0を起点に数字が割り振られています。
具体的な説明は今回は省きますが、簡単に説明すると下記にような感じです。
では「0,0,0」にプレイヤーをテレポートさせるためのブロックを配置しましょう!
「プレイヤー」を選択して、「現在の位置から(~0~0~0)にテレポートする」ブロックをドラック&ドロップしてください。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-66-1024x555.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-66-1024x555.png)
先ほどの「チャットコマンド”ジャンプ”を入力した時」の間に入れたら処理は完了です。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-67-1024x575.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-67-1024x575.png)
ブロックを「1,1,1」に置く。
続いてはプレイヤーの目の前にブロックを置く処理を追加していきましょう。
「ブロック」から「ブロックを(~0~0~0)の地点に置く」ブロックをドラック&ドロップしてきます。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-68-1024x555.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-68-1024x555.png)
先ほどと同様に「現在の位置から(~0~0~0)にテレポートする」ブロックの下に配置します。
ただこのままだと(0,0,0)に配置することになってしまいますね。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-69-1024x575.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-69-1024x575.png)
ブロック配置を画像のように「1,1,1」に変更しましょう!
これでブロックがプレイヤーの目の前(正確には、右1、前1、上1の場所)に表示されると思います。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-70-1024x575.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-70-1024x575.png)
Make Codeで実行しておく!
チャットでジャンプを送信したら処理を開始させるには、Make Codeで実行しておく必要があります。
右下の「▶︎」ボタンを押しましょう!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-71-1024x555.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-71-1024x555.png)
こんな感じで赤くなって「■」になっていれば大丈夫です!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-72-1024x555.png)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-72-1024x555.png)
Minecraftで処理を開始してみよう!
これで最後になります!!
Minecraftでチャットにジャンプを送信して、処理を実行しましょう!
まずはマイクラの画面に戻ります。
この時はまだ、何もない状態ですね。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-73-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-73-1024x555.jpg)
「T」キーを押して、チャット画面を開きましょう!
ここで「ジャンプ」と入力します。
![](https://teech-lab.com/wp-content/uploads/2022/01/image-73-1-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-73-1-1024x555.jpg)
「Esc」キーを押して、Minecraftの画面を見ると目の前にブロックが表示されていることを確認できましたね!!
これで実際に連携して動いていることを確認できました!
![](https://teech-lab.com/wp-content/uploads/2022/01/image-73-2-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2022/01/image-73-2-1024x555.jpg)
![](https://teech-lab.com/wp-content/uploads/2021/01/odoroki-cutout.png)
![](https://teech-lab.com/wp-content/uploads/2021/01/odoroki-cutout.png)
![](https://teech-lab.com/wp-content/uploads/2021/01/odoroki-cutout.png)
ほんとにブロックが置かれてるとは驚きじゃ!!
Minecraft Windows10とMakeCodeを使って色々建築してみよう!
ここまでできればプログラミングを勉強しながら、色々建築することが可能です。
ぜひお好きなものをプログラミングで建築してみてください!
私もMinecraft Windows10とMakeCodeを使ったサンプルを作成しています。
次何をしようか迷った方や、子供にどうやって教えたらいいか迷っている方は、ぜひ参考にしてみてください!
Minecraftで何を建築するか迷ったら、Kindle Unlimitedがおすすめ!
Minecraftの建築のアイデア集などもたくさん読めるのでぜひ参考にしてみてください!
![](https://teech-lab.com/wp-content/uploads/2021/01/odoroki-cutout.png)
![](https://teech-lab.com/wp-content/uploads/2021/01/odoroki-cutout.png)
![](https://teech-lab.com/wp-content/uploads/2021/01/odoroki-cutout.png)
こんな本も読み放題じゃ!!
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
![](https://teech-lab.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
![](https://teech-lab.com/wp-content/uploads/2021/01/egao-cutout.png)
![](https://teech-lab.com/wp-content/uploads/2021/01/egao-cutout.png)
![](https://teech-lab.com/wp-content/uploads/2021/01/egao-cutout.png)
プログラミングを楽しむんじゃぞ!