対象をプレイヤーのところへテレポートさせる mobs.teleportToPlayer
ひとことで言うと
エンティティをプレイヤーにテレポートします。
ブロックとコード
@aを@sの元へテレポート
ブロックの文言は公式の日本語版に合わせています(形は簡易表示です)。
mobs.teleportToPlayer(
mobs.target(ALL_PLAYERS),
mobs.target(LOCAL_PLAYER)
)mobs.teleport_to_player(mobs.target(ALL_PLAYERS), mobs.target(LOCAL_PLAYER))引数(ひきすう)
引数とは、ブロックの中で自分で選んだり入力したりする部分のことです。
| 名前 | 選べる値 | 意味 |
|---|---|---|
| target | ターゲットセレクター | どのエンティティがテレポートされるのかを決定するターゲットセレクター |
| destination | ターゲットセレクター | どのプレイヤーにエンティティをテレポートするのかを決定するターゲットセレクター |
使用例
Teleport all zombies to the current player. Run!
JavaScript
mobs.teleportToPlayer(
mobs.entitiesByType(mobs.monster(MonsterMob.Zombie)),
mobs.target(LOCAL_PLAYER)
);Python
mobs.teleport_to_player(mobs.entities_by_type(mobs.monster(ZOMBIE)),
mobs.target(LOCAL_PLAYER))