用户:
五梦樱川查看:1 回复:1 评论:1 创建时间:2023-08-08T13:11:32
我按照官方文档做的,检查跟文档写的一样,不知道什么问题,没交互,控制台也没见报错


for (const npc of world.querySelectorAll('.npc')) {
npc.enableInteract = true
npc.interactRadius = 4.5
npc.interactHint = npc.id
npc.interactColor.set(0,1,0)
if (npc.id == '大唐李太白') {
npc.onInteract(async ({ entity }) => {
textDialog(entity, `${entity.player.name},你好`, npc.id)
})
}
}
