Lv.1
在 【代码岛3.0】挖方块代码 中回复
world.onPress(({button,raycast:{voxelIndex,hitEntity},entity})=>{
// if(clicker.isPlayer){
if(button=='action0'){
console.clear();
console.warn('position:');
console.log(`${voxelIndex.x},${voxelIndex.y},${voxelIndex.z}`);
console.warn('clicker:');
console.log(entity.player.name);
console.warn('hit player:');
try{
console.log(hitEntity.player.name);
}catch(err){
console.log('nothing-'+err);
}
voxels.setVoxel(voxelIndex.x,voxelIndex.y,voxelIndex.z,'air');
return;
// }
}else if(button=='action1'){}
// }
})2022-01-30T16:16:56 点赞:0