# カメラ基準の座標(posCamera) > 新しくカメラ座標を作成する。右、上、前。 - カテゴリ:位置(positions) - ブロック:右 0 上 0 前 0 - URL:https://makecode.minecraft-okinawa.com/reference/positions/pos-camera/ - Pythonでの名前:pos_camera - 公式データ取得日:2026-11-13 - 動作確認:確認待ち ## JavaScript ```javascript posCamera(0, 0, 0) ``` ## Python ```python pos_camera(0, 0, 0) ``` ## 引数 | 名前 | 値 | 意味 | |---|---|---| | 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) ``` ## 出典 - [MakeCode for Minecraft 公式リファレンス(posCamera)](https://minecraft.makecode.com/reference/positions/pos-camera) 執筆:鈴木孝昌(現役プロジェクトマネージャー/マイクラカップ指導者)/運営:沖縄マイクラ部 プログラミングスクール「クロスウェーブ」(https://minecraft-okinawa.com/)