# 座標からX・Y・Zの値を取り出す(Position.getValue) > 指定した座標の値を取得します(x、y または z)。 - カテゴリ:位置(positions) - ブロック:○ のX 座標 - URL:https://makecode.minecraft-okinawa.com/reference/positions/get-value/ - Pythonでの名前:Position.get_value - 公式データ取得日:2026-11-13 - 動作確認:確認待ち ## JavaScript ```javascript pos(0, 0, 0).getValue(Axis.X) ``` ## Python ```python pos(0, 0, 0).get_value(Axis.X) ``` ## 引数 | 名前 | 値 | 意味 | |---|---|---| | direction | Axis | 座標の値を返す軸 | ## 使用例 ### Display the player's current altitude in the game chat. The altitude is the y coordinate of the player's current world position. ```javascript player.say("My current altitude is: " + player.position().getValue(Axis.Y)); ``` ```python player.say("My current altitude is: " + str(player.position().get_value(Axis.Y))) ``` ## 出典 - [MakeCode for Minecraft 公式リファレンス(Position.getValue)](https://minecraft.makecode.com/reference/positions/get-value) 執筆:鈴木孝昌(現役プロジェクトマネージャー/マイクラカップ指導者)/運営:沖縄マイクラ部 プログラミングスクール「クロスウェーブ」(https://minecraft-okinawa.com/)