MCBE server & Unity game developer!
minyee2913 / 2913module Goto Github PK
View Code? Open in Web Editor NEWModule for BDSX
Module for BDSX
@minyee2913
안티치트 스크립트에서 리치핵 감지 eventerName 데이터값 .name이 빠져있습니다
const system = server.registerSystem(0, 0);
system.listenForEvent("minecraft:player_attacked_entity", eventData => {
try {
let eventer = eventData.data.player;
let entity = eventData.data.attacked_entity;
const eventerName = system.getComponent(eventer, "minecraft:nameable")!.data;
//****const eventerName = system.getComponent(eventer, "minecraft:nameable")!.data.name;
const eventerPos = system.getComponent(eventer, "minecraft:position")!.data;
const entityPos = system.getComponent(entity, "minecraft:position")!.data;
let x = Math.abs(eventerPos.x - entityPos.x);
let y = Math.abs(eventerPos.y - entityPos.y);
let z = Math.abs(eventerPos.z - entityPos.z);
if (x > 4.5 || y > 4.5 || z > 4.5) {
system.executeCommand(`testfor @a[name="${eventerName}",m=!1]`, (edata) => {
if (edata.data.statusCode === 0) {
bedrockServer.executeCommand(`tellraw @a {"rawtext":[{"text":"§c§l${eventerName}님이 비정상 클라이언트로 인해 추방당했습니다"}]}`);
bedrockServer.executeCommand(`kick "${eventerName}" 비정상 클라이언트(리치)로 인해 추방당했습니다`);
}
});
}
}
catch (err) { }
;
});
추가로 직육면체 대각선 공식을 이용해 거리조절이 가능한 리치핵을 더 잡을 수 있을 것 같습니다
let a = Math.pow(eventerPos.x - entityPos.x,2);
let b = Math.pow(eventerPos.y - entityPos.y,2);
let c = Math.pow(eventerPos.z - entityPos.z,2);
let reach = Math.sqrt(a + b + c);
console.log(reach);
if (reach>3.6) {
system.executeCommand(`testfor @a[name="${eventerName}",m=!1]`, (edata) => {
if (edata.data.statusCode === 0) {
system.executeCommand(`tellraw @a {"rawtext":[{"text":"§c§l${eventerName}님이 비정상 클라이언트로 인해 추방당했습니다"}]}`,()=>{});
system.executeCommand(`kick "${eventerName}" 비정상 클라이언트(리치)로 인해 추방당했습니다`,()=>{});
}
});
}
수정 전: 이론상 최대 7.79칸까지 리치핵 허용
수정 후: 최대 5리치 7.79 => 3.6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.