猫史档案馆


【代码岛3.0】挖方块代码

用户:ray_crazyray_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'){}
    // }
})

可以在调试框看到许多信息,放方块代码不知道,求代码!


回复

上一页1 页 / 共 1下一页
编程猫侦探编程猫侦探

沙发

点赞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(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


评论


高贵的木叶龙A35d高贵的木叶龙A35d

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


评论


Blue_夜梦流星Blue_夜梦流星

我们

点赞0


评论


马虎的星能猫Gqjt马虎的星能猫Gqjt

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


评论