# 座標を足し算する(positions.add) > 2 つの指定位置を追加して新しい位置を作成します。 - カテゴリ:位置(positions) - ブロック:~0 ~0 ~0 + ~0 ~0 ~0 - URL:https://makecode.minecraft-okinawa.com/reference/positions/add/ - 公式データ取得日:2026-11-13 - 動作確認:確認待ち ## JavaScript ```javascript positions.add( pos(0, 0, 0), pos(0, 0, 0) ) ``` ## Python ```python positions.add(pos(0, 0, 0), pos(0, 0, 0)) ``` ## 引数 | 名前 | 値 | 意味 | |---|---|---| | p1 | 座標 | 追加する最初の位置 | | p2 | 座標 | 追加する二番目の位置 | ## 使用例 ### This code: ```javascript let relPosition = positions.add( pos(2, 2, 2), world(3, 3, 3) ) ``` ```python relPosition = positions.add(pos(2, 2, 2), world(3, 3, 3)) ``` ### This code shows the opposite case: ```javascript let worldPosition = positions.add( world(2, 2, 2), pos(3, 3, 3) ) ``` ```python worldPosition = positions.add(world(2, 2, 2), pos(3, 3, 3)) ``` ### Place a block of gold above the player's head by adding some extra height to the player's world position. This uses a relative position as the second position to add 2 blocks to the player's position. ```javascript blocks.place(GOLD_BLOCK, positions.add( player.position(), pos(0, 2, 0) )) ``` ```python blocks.place(GOLD_BLOCK, positions.add(player.position(), pos(0, 2, 0))) ``` ## 出典 - [MakeCode for Minecraft 公式リファレンス(positions.add)](https://minecraft.makecode.com/reference/positions/add) 執筆:鈴木孝昌(現役プロジェクトマネージャー/マイクラカップ指導者)/運営:沖縄マイクラ部 プログラミングスクール「クロスウェーブ」(https://minecraft-okinawa.com/)