エージェントを指定した場所へテレポートさせる agent.teleport

エージェント公式データ取得日:2026年11月13日動作確認待ち

ひとことで言うと

指定した方向、位置にエージェントをテレポートさせる。

ブロックとコード

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

引数(ひきすう)

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

名前選べる値意味
pos座標エージェントをテレポートさせる位置
dir方向テレポートさせられたエージェントが向く向きの四方位

使用例

Teleport the Agent 100 blocks up when the agentjump command is typed in the chat.

JavaScript

player.onChat("agentjump", function () {
    agent.teleport(pos(0,100,0), WEST);
});

Python

def on_on_chat():
    agent.teleport(pos(0, 100, 0), WEST)
player.on_chat("agentjump", on_on_chat)

Teleport the agent anywhere in two dimensions from the current location. The Agent goes to a random location 50 blocks North or South, and 50 blocks East or West. The agent moves when the sendagent command is typed in the chat.

JavaScript

player.onChat("sendagent", function () {
    agent.teleport(randpos(
    pos(-50, 0, 50),
    pos(50, 0, -50)), NORTH);
});

Python

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