統合版マイクラのアドオンのビヘイビアのscriptで、モブに触ると触られたモブの名前が表示れるものを作ったのですが動きません。原因を教えてください。
統合版マイクラのアドオンのビヘイビアのscriptで、モブに触ると触られたモブの名前が表示れるものを作ったのですが動きません。原因を教えてください。 [右クリックバージョン]と[叩くバージョン]の2つあります。言語は、javascriptです。 1つ目(右クリックバージョン) import { world, system } from '@minecraft/server'; world.beforeEvents.playerInteractWithEntity.subscribe((ev) => { const player = ev.player; const tatched = ev.target.typeId; player.runCommand(`say ${tatched}`) }); 2つ目(叩くバージョン) import { world, system } from '@minecraft/server'; world.afterEvents.EntityHitEntity.subscribe((ev) => { const tatched = ev.hitEntity.typeId; const player = ev.damagingEntity; player.runCommand(`say ${tatched}`) });
マインクラフト | JavaScript・189閲覧・250
- ・キャンペーン対象の質問は「共感した」→「参加する」に変更されています。
- ・「参加する(共感した)」を押した質問に新しい回答がつくとMy知恵袋に通知がきます。
- ・「参加する(共感した)」を押した後に解除はできません。