用户:
在下犯罪卿查看:3 回复:4 评论:3 创建时间:2021-10-24T15:12:58
求碰到喵地返回存档点代码!求求了
爱编程_编程喵喵world.onVoxelContact(async ({ entity, voxel }) => {
if (!entity.isPlayer) return
if (voxel == voxels.id('lava02')) {
entity.hurt(entity.maxHp)
world.say(entity.player.name + ' 玩家被岩浆烧喵了')
entity.position.copy(entity.player.spawnPoint)
entity.position.y += 4
world.say(entity.player.name + ' 玩家复活')
entity.hp = entity.maxHp
}
if (voxel == voxels.id('lab_material_10')) {
entity.hurt(5)
world.say(entity.player.name + '被铁轨电了一下')
entity.player.directMessage('如果被电没血了(下次快快离开)点右键脱离卡点')
}
})
点赞0
评论
char_木泽
world.onVoxelContact(({ x, y, z, voxel,entity }) => {
const voxelName = voxels.name(voxel); // 将方块id转换名称
if (voxelName === 'grass'){ // 如果方块名称是grass
entity.position.copy(entity.player.spawnPoint)
entity.position.y += 4
}
});点赞0
评论