用户:
烤乳鸽RoastedSquab查看:94 回复:9 评论:34 创建时间:2020-06-22T18:12:38
没什么要求,把题做对就行——————————————————————————————————————
world.querySelectorAll(".彩蛋").forEach(e=>{
e.onEntityContact(({entity,other})=>{
if(!other.isPlayer){return}
other.player.invisible=true;
world.say(entity.player.name+'找到了彩蛋,获得隐身buff') })})
为什么可以隐身而不能说“用户名+找到了彩蛋,获得隐身buff”
搞错啦!entity是指e!
点赞0
评论
? ?
注意可以隐身不能说话!!!!!!!!!!!!!!
唉,又一个没做对的。。。
还是没搞懂问题在问啥?》
修代码,这个代码可以隐身而不能说话
我记得forEach是这样的呀,xxx.forEach((x)=>{console.log('???')})
gt我没输入啊
来了个复制代码的。。。
????
forEach不是那样写的吗?
我可没复制
你懂代码翻译都是啥不
我的问题是什么?
e只能在特定情况使用,换了就整个代码全废
我测试了,不行
我不会我
请下面的人步伐一致:模型没名字
点赞0
评论
有标签,还名字!
标签也有
……entity.player.name你告诉我entity对象有player.name????
啊啊啊啊气的不行
我还是不当你徒弟了
标签可不代表name
师傅,怎么让玩家加速度哇
entity.player.(walk/run)Speed
Vicent轩我猜会报错的原因是:entity not found
所以我认为应该把 world.say(entity.player.name+'找到了彩蛋,获得隐身buff') })})
改成world.say(other.player.name+'找到了彩蛋,获得隐身buff') })})
点赞1
评论
我阔以
顺便收了代码
应该这样改:
world.querySelectorAll(".走你").forEach(e=>{e.onEntityContact(({entity,other})=>{
if(!other.isPlayer){return}
other.player.invisible=true;
world.say(other.player.name+'找到了彩蛋,获得隐身buff') })})
点赞0
评论
哼哼
应该是‘.彩蛋’
o 不对
改一下
world.querySelectorAll(".彩蛋").forEach((e)=>{ e.onEntityContact(({entity,other})=>{ other.player.invisible=true; world.say(other.player.name+'找到了彩蛋,获得隐身buff') })})