用户:
BOTPLAY查看:0 回复:2 评论:0 创建时间:2021-10-16T08:33:05
world.onVoxelContact(({entity, voxel, x, y, z }) => {
if(voxel === voxels.id("grass")) {
entity.hurt(100)
}
})
world.onVoxelContact(({entity, voxel, x, y, z }) => {
if(voxel === voxels.id("acacia")) {
entity.hurt(100)
}
})
world.onVoxelContact(({entity, voxel, x, y, z }) => {
if(voxel === voxels.id("green_leaf")) {
entity.hurt(100)
}
})
world.onPlayerJoin(({ entity }) => {
console.log(`${entity.player.name}进入了空岛`)
});
world.onVoxelContact(({entity, voxel, x, y, z }) => {
if(voxel === voxels.id("dirt")) {
entity.hurt(100)
}
})
world.onPlayerJoin(({ entity }) => {
entity.onFluidEnter(() => {
entity.position.copy(entity.player.spawnPoint)
entit.hurt(100)
})
})
console.clear()
world.onPlayerJoin(({entity})=> {
entity.enableDamage = true
})
这串代码有错吗?一直执行不了还不报错
源码极客有错,而且还挺多——侦测碰到方块的那几个事件代码中,你导入了entity、voxel、x、y、z这些参数,但是你只用了entity和voxel这2个参数,剩下的那三个侦测碰到方块的坐标的参数都没有用到,所以报错了。
点赞0
评论