猫史档案馆


【box3】怎么使用movementBounds代码来设置玩家活动范围?

用户:西伯利亚狐西伯利亚狐查看:32 回复:6 评论:32 创建时间:2020-10-09T20:12:02


超大地图活动范围和普通地图一样,现在我要把活动范围扩大,要怎么做?


回复

上一页1 页 / 共 1下一页
许pTgk许pTgk

点赞0


评论


传奇无敌传奇无敌

world.querySelectorAll('player').forEach((x)=>{x.player.movementBounds=new Box3Bounds3(new Box3Vector3(-50,-50,-50),new Box3Vector3(306,114,306)})

点赞0


评论


西伯利亚狐西伯利亚狐

world.querySelectorAll('player').forEach((x)=>{x.player.movementBounds=new Box3Bounds3(new Box3Vector3(0,-50,0),new Box3Vector3(255,100,255))})

点赞0


评论


༺༽༾ཊ源代码(养佬中)ཏ༿༼༻༺༽༾ཊ源代码(养佬中)ཏ༿༼༻

    world.onPress(({ entity, button, raycast, getVoxels }) => {
        let pos = raycast.voxelIndex
        if (button === 'action0') {//如果按下鼠标左键
            if (voxels.getVoxel(pos.x, pos.y, pos.z) == voxels.id('medium_gray')) {
                voxels.setVoxel(pos.x, pos.y, pos.z, 0);//设置焦点位置的方块为air(空气)
                YANGMAO = YANGMAO + 1
                entity.player.directMessage('你获得了一个羊毛');
            };
        };
    });

点赞0


评论


༺༽༾ཊ源代码(养佬中)ཏ༿༼༻༺༽༾ཊ源代码(养佬中)ཏ༿༼༻

谢谢!

点赞0


评论


西伯利亚狐西伯利亚狐

    world.onPress(async({ entity, button, raycast, getVoxels }) => {
        let pos = raycast.voxelIndex
        if (button === 'action0') {//如果按下鼠标左键
            if (voxels.getVoxel(pos.x, pos.y, pos.z) == voxels.id('medium_gray')) {
                voxels.setVoxel(pos.x, pos.y, pos.z, 0);//设置焦点位置的方块为air(空气)
                while(true){
                    YANGMAO = YANGMAO + 1
                    entity.player.directMessage('你获得了一个羊毛');
                    await sleep(2000)
                };
            };
        };
    });

点赞0


评论