This page (revision-1) was last changed on 20-Apr-2024 11:53 by Hiroaki Tateshita

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
20-Apr-2024 11:53 2 KB Hiroaki Tateshita

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 added 54 lines
[{PageViewPlugin}]
[Import map in Minecraft]
!!!Abstract
マインクラフトに何らかの形でデータをインポートしたい
!!!Topics
*こんなのできました
[{Image width='500' src='Import data in Minecraft/inuyama_mee.png'}]
[1][2]の資料をみつつ、Excelにこんな形(1シートがX,Z方向の輪切り、高さ方向に別シートに設計図を書いていくイメージ)
[{Image width='500' src='Import data in Minecraft/minecraft design w excel.png'}]
それを[ExcelVBA]使って、[JavaScript]で使える3次元配列のテキストデータをつくり、マイクラのMakecode上の[JavaScript]のテキストエディタ側で貼り付けます。
同じやり方でH2Aロケットも
[{Image width='500' src='Import data in Minecraft/h2a_minecraft.png'}]
ISSも
[{Image width='500' src='Import data in Minecraft/iss_minecraft.png'}]
*まずはTextファイル
|テキストファイルで、3次元配列を作って、それをMakecodeの[JavaScript]部分に張り付けることを試したい
{{{
let array: string[][][]
let y_cnt = 0
let z_cnt = 0
let x_cnt = 0
player.onChat("bld", function () {
    array = [[[[[["COBBLESTONE", "BLOCK_OF_QUARTZ", "COBBLESTONE"], [["BLOCK_OF_QUARTZ", "COBBLESTONE", "COBBLESTONE"], [["", "COBBLESTONE", "COBBLESTONE"]], [[[["COBBLESTONE", "COBBLESTONE", "COBBLESTONE"], [["COBBLESTONE", "COBBLESTONE", "COBBLESTONE"], [["COBBLESTONE", "COBBLESTONE", "COBBLESTONE"]], [[[["COBBLESTONE", "COBBLESTONE", "COBBLESTONE"], [["COBBLESTONE", "COBBLESTONE", "COBBLESTONE"], [["COBBLESTONE", "COBBLESTONE", "COBBLESTONE"]]]
    y_cnt = 0
    for (let z_array of array) {
        z_cnt = 0
        for (let x_array of z_array) {
            x_cnt = 10
            for (let str of x_array) {
                if (str == "COBBLESTONE") {
                    blocks.place(COBBLESTONE, pos(x_cnt, y_cnt, z_cnt))                }
                if (str == "BLOCK_OF_QUARTZ") {
                    blocks.place(BLOCK_OF_QUARTZ, pos(x_cnt, y_cnt, z_cnt))
                }
                x_cnt += 1
            }
            z_cnt += 1
        }
        y_cnt += 1
    }
})
}}}
*上記の3次元配列の文字列を作るには!?
|[ExcelVBA]使うか
*何か手ごろなデータは?
|お城を立ててみよう。メートル単位の寸法がわかる適当なお城ないかな。犬山城とか[1][2]。
!!!Reference
#[#1]National Treasure Inuyama Castle, 2022年10月4日アクセス, 写真・映像<<国宝犬山城, [https://inuyama-castle.jp/castle/photos-and-video]
#[#2][CastleHunting|https://www.pinterest.jp/castlesseltcas], 2022年10月4日アクセス, [https://www.pinterest.jp/pin/122582421098984397/]