カメラ基準の座標 posCamera

位置公式データ取得日:2026年11月13日Python:pos_camera動作確認待ち

ひとことで言うと

新しくカメラ座標を作成する。右、上、前。

ブロックとコード

ブロックの文言は公式の日本語版に合わせています(形は簡易表示です)。

引数(ひきすう)

引数とは、ブロックの中で自分で選んだり入力したりする部分のことです。

名前選べる値意味
x数値左(-x)または右(+x)方向の座標(ブロック単位)
y数値上(+y)または下(-y)方向の座標(ブロック単位)
z数値後ろ(-z)または前(-z)方向の座標(ブロック単位)

使用例

If the player is heading in a Northwest direction, the distance in front is in the North direction if the player's heading is more toward the North than the West. In the following example, an orange concrete block is placed in front of the player. This code will place the block on the North side of the player since the player is heading more toward the North.

JavaScript

blocks.place(ORANGE_CONCRETE, posCamera(0, 0, 5))

Python

blocks.place(ORANGE_CONCRETE, pos_camera(0, 0, 5))

Make two chat commands. One command creates a two-axis marker in the ground using relative coordinates. The other command will place a block of diamond at a distance of 5 blocks in front of the player. Have the player face toward the Northwest direction on the coordinate axes of polished andesite and place a diamond block.

JavaScript

player.onChat("twoaxis", function () {
    for (let index = 0; index <= 16; index++) {
        blocks.place(POLISHED_ANDESITE, pos(0, -1, index))
        blocks.place(POLISHED_ANDESITE, pos(0, -1, -1 - index))
        blocks.place(POLISHED_ANDESITE, pos(index , -1, 0))
        blocks.place(POLISHED_ANDESITE, pos(-1 - index , -1, 0))
    }
blocks.print(
    "N",
    YELLOW_CONCRETE,
    pos(0, 3, -33),
    EAST
    )
    blocks.print(
    "W",
    YELLOW_CONCRETE,
    pos(-33, 3, 0),
    NORTH
    )
})

player.onChat("placeplayer", function () {
    blocks.place(DIAMOND_BLOCK, posCamera(0, 0, 5))
})

Python

def on_on_chat():
    for index in range(17):
        blocks.place(POLISHED_ANDESITE, pos(0, -1, index))
        blocks.place(POLISHED_ANDESITE, pos(0, -1, -1 - index))
        blocks.place(POLISHED_ANDESITE, pos(index, -1, 0))
        blocks.place(POLISHED_ANDESITE, pos(-1 - index, -1, 0))
    blocks.print("N", YELLOW_CONCRETE, pos(0, 3, -33), EAST)
    blocks.print("W", YELLOW_CONCRETE, pos(-33, 3, 0), NORTH)
player.on_chat("twoaxis", on_on_chat)

def on_on_chat2():
    blocks.place(DIAMOND_BLOCK, pos_camera(0, 0, 5))
player.on_chat("placeplayer", on_on_chat2)
執筆:鈴木孝昌官公庁のWeb・システム開発を担当する現役プロジェクトマネージャー。マイクラカップ沖縄代表チームを指導(第6回・第7回、第7回TBS賞)。
沖縄マイクラ部で、子どもたちにMakeCodeを教えています。プロフィールと編集方針
Instagramで教室の様子を見る
noteで記事を読む