用户:ray_crazy查看:4 回复:6 评论:4 创建时间:2020-06-21T20:00:21
不多说,直接发
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'){}
// }
})
可以在调试框看到许多信息,放方块代码不知道,求代码!
world.onPress(({button,raycast:{voxelIndex,hitEntity},entity})=>{ 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'){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 + 1,voxelIndex.z,'dark_stone'); return; }
})
点赞0
评论
world.onPress(({button,raycast:{voxelIndex,hitEntity},entity})=>{ 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'){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 + 1,voxelIndex.z,'dark_stone'); return; }
})
点赞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,'stone');
return;
// }
}else if(button=='action1'){}
// }
})
//填充方块代码点赞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'){}
// }
})点赞0
评论