Giter Site home page Giter Site logo

2913module's Introduction

My INFO!

MCBE server & Unity game developer!

Anurag's GitHub stats
Top Langs

2913module's People

Contributors

minyee2913 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

whiteice12

2913module's Issues

anticheat(reach)

@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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.