Lv.1
签名:guess
在 【米粒教程】又水了一期~ 中回复
饭米粒,我这儿有一个类似的反box3plus飞行的代码,但BUG很严重。一是人物站在模型上会警告开挂,二是检测到开挂没有措施。能麻烦看一下么。
world.onTick(({ tick }) => {
if (tick % 16) return;//16个tick执行一次
console.log('执行');
world.querySelectorAll('player').forEach(entity => {
if (entity.player.moveState == Box喵layerMoveState.FLYING && !entity.player.canFly) {
entity.player.directMessage('检测到用户开挂行为');
}
var _0 = false, y = Math.floor(entity.position.y - 2);
for (let x = Math.floor(entity.position.x - 1); x < Math.ceil(entity.position.x + 1); x++) {
for (let z = Math.floor(entity.position.z - 1); z < Math.ceil(entity.position.z + 1); z++) {
if (voxels.getVoxelId(x, y, z) != 0) _0 = true;
}
}
if (!_0 && entity.player.moveState != Box喵layerMoveState.FALL && entity.player.moveState != Box喵layerMoveState.JUMP && entity.player.moveState != Box喵layerMoveState.DOUBLE_JUMP && entity.player.moveState != Box喵layerMoveState.FLYING) {
entity.player.directMessage('检测到用户开挂行为');
}
});
});2023-01-14T09:19:18 点赞:0
在 【代码】2021卡爆服务器毁灭新方法(非毁图) 中回复
world.querySelectorAll("*").forEach((e)=>{
for(let i = 0; i < world.entityQuota(); i ++)
world.createEntity(e)
});
2023-01-25T15:34:08 点赞:0