用户:豆爸0ENG查看:4 回复:10 评论:4 创建时间:2021-12-19T13:19:25
//根据吉吉喵的教程,我做了一个喵亡后返回“复活点”=>结果出了BUG~~//
~谁来解答一下~

Dianfenghhconst respawnPoint = world.querySelector(`#存档点`)
world.onVoxelContact(({entity, voxel})=> { const voxelName = voxels.name(voxel); if (voxelName === 'lava02'){
entity.hurt(100) } })
for (const e of world.querySelectorAll('*')) { if (e.id.startsWith('存档点')) { e.collides = true e.fixed = true
e.onEntityContact(({ other }) => { if (other.isPlayer) { if (e.position !== other.player.spawnPoint) { other.player.directMessage('到达新的重生点') other.player.spawnPoint = e.position } } }) } }
world.onPlayerJoin(({ entity }) => { entity.onFluidEnter(() => { entity.position.copy(entity.player.spawnPoint) entity.position.y += 4 }) })
world.onPlayerJoin(({ entity }) => { entity.enableDamage = true entity.onDie(() => {
entity.player.forceRespawn() }) })
点赞0
评论
Dianfenghh实在不行从这里搬运: https://box3.codemao.cn/e/f9ca18910c4c8c00598f?p=ETlFQWJki4hHMTIDypejY0q8xVxB5S9ukR2PsgX88CA7u7pzfdLwEx
点赞1
评论