# 画面にタイトルを表示する(gameplay.title) > 選択したターゲットのタイトルとサブタイトルを表示します。 - カテゴリ:ゲームプレイ(gameplay) - ブロック:@a にタイトル "Title" サブタイトル "Sub title" を表示する - URL:https://makecode.minecraft-okinawa.com/reference/gameplay/title/ - 公式データ取得日:2026-11-13 - 動作確認:確認待ち ## JavaScript ```javascript gameplay.title(mobs.target(ALL_PLAYERS), "Title", "Sub title") ``` ## Python ```python gameplay.title(mobs.target(ALL_PLAYERS), "Title", "Sub title") ``` ## 引数 | 名前 | 値 | 意味 | |---|---|---| | target | ターゲットセレクター | 選択するプレイヤーとエンティティ | | title | 文字列 | 表示する大きなタイトル | | subTitle | 文字列 | 表示するサブタイトル | ## 使用例 ### In the treasure mini-game below, a diamond is placed randomly around the current positions. All players are then teleported to the location and shown a message to start looking for the diamond. ```javascript player.onChat("hunt", function () { blocks.place(DIAMOND_BLOCK, pos(Math.randomRange(-10, 10), Math.randomRange(-3, -2), Math.randomRange(-10, 10))) mobs.teleportToPosition( mobs.target(ALL_PLAYERS), pos(0, 0, 0) ) gameplay.title(mobs.target(ALL_PLAYERS), "READY?", "Find the hidden diamond!") }) ``` ```python def on_on_chat(): blocks.place(DIAMOND_BLOCK, pos(Math.random_range(-10, 10), Math.random_range(-3, -2), Math.random_range(-10, 10))) mobs.teleport_to_position(mobs.target(ALL_PLAYERS), pos(0, 0, 0)) gameplay.title(mobs.target(ALL_PLAYERS), "READY?", "Find the hidden diamond!") player.on_chat("hunt", on_on_chat) ``` ## 出典 - [MakeCode for Minecraft 公式リファレンス(gameplay.title)](https://minecraft.makecode.com/reference/gameplay/title) 執筆:鈴木孝昌(現役プロジェクトマネージャー/マイクラカップ指導者)/運営:沖縄マイクラ部 プログラミングスクール「クロスウェーブ」(https://minecraft-okinawa.com/)