Objify Hack - Craftnite multi hack

Show the power of Objify

// ==UserScript==
// @name         Objify Hack - Craftnite multi hack
// @namespace    http://tampermonkey.net/
// @version      1.9
// @description  Show the power of Objify
// @author       Objify - CEO
// @match        https://craftnite.io/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=craftnite.io
// @grant        none
// @license      by-nd 4.0
// ==/UserScript==
 
//VHC designed by ExplodIng_Andrey
 
//dispose of old client (if any)
if(client) {
  client.dispose();
};

// Block definitions for custom placement
const blocks = {"random": "random", "air":0,"stone":256,"stone_granite":257,"stone_granite_smooth":258,"stone_diorite":259,"stone_diorite_smooth":260,"stone_andesite":261,"stone_andesite_smooth":262,"grass":512,"dirt":770,"coarse_dirt":769,"cobblestone":1024,"planks_oak":1280,"planks_spruce":1281,"planks_birch":1282,"planks_jungle":1283,"planks_acacia":1284,"planks_big_oak":1285,"sapling_oak":1536,"sapling_spruce":1537,"sapling_birch":1538,"sapling_jungle":1539,"sapling_acacia":1540,"sapling_roofed_oak":1541,"bedrock":1792,"flowing_water":2048,"water":2304,"flowing_lava":2560,"lava":2816,"sand":3072,"red_sand":3073,"gravel":3328,"gold_ore":3584,"iron_ore":3840,"coal_ore":4096,"log_oak":4352,"log_spruce":4353,"log_birch":4354,"log_jungle":4355,"leaves_oak":4608,"leaves_spruce":4609,"leaves_birch":4610,"leaves_jungle":4611,"sponge":4864,"sponge_wet":4865,"glass":5120,"lapis_ore":5376,"lapis_block":5632,"dispenser":5888,"sandstone_normal":6144,"sandstone_carved":6145,"sandstone_smooth":6146,"noteblock":6400,"bed":6656,"golden_rail":6912,"detector_rail":7168,"sticky_piston":7424,"web":7680,"double_plant_grass":7936,"fern":7938,"deadbush":8192,"piston":8448,"piston_head":8704,"wool_colored_white":8960,"wool_colored_orange":8961,"wool_colored_magenta":8962,"wool_colored_light_blue":8963,"wool_colored_yellow":8964,"wool_colored_lime":8965,"wool_colored_pink":8966,"wool_colored_gray":8967,"wool_colored_silver":8968,"wool_colored_cyan":8969,"wool_colored_purple":8970,"wool_colored_blue":8971,"wool_colored_brown":8972,"wool_colored_green":8973,"wool_colored_red":8974,"wool_colored_black":8975,"piston_extension":9216,"yellow_flower":9472,"flower_rose":9728,"flower_blue_orchid":9729,"flower_allium":9730,"flower_houstonia":9731,"flower_tulip_red":9732,"flower_tulip_orange":9733,"flower_tulip_white":9734,"flower_tulip_pink":9735,"flower_oxeye_daisy":9736,"brown_mushroom":9984,"red_mushroom":10240,"gold_block":10496,"iron_block":10752,"double_stone_slab":11008,"brick":11012,"stonebrick":11013,"nether_brick":11014,"quartz_block":39681,"stone_slab":11278,"quartz_block_chiseled":11023,"sandstone_top":11273,"quartz_block_top":11279,"brick_block":11520,"tnt":11777,"bookshelf":12032,"mossy_cobblestone":12288,"obsidian":12544,"torch":12804,"fire":13056,"mob_spawner":13312,"oak_stairs":13568,"chest":13824,"redstone_wire":14080,"diamond_ore":14336,"diamond_block":14592,"crafting_table":14848,"wheat":15104,"farmland":15360,"furnace":15616,"lit_furnace":15872,"standing_sign":16128,"wooden_door":16384,"ladder":16640,"rail":16896,"stone_stairs":17152,"wall_sign":17408,"lever":17664,"stone_pressure_plate":17920,"iron_door":18176,"wooden_pressure_plate":18432,"redstone_ore":18688,"lit_redstone_ore":18944,"unlit_redstone_torch":19204,"redstone_torch":19460,"stone_button":19712,"snow_layer":19968,"ice":20224,"snow":20480,"cactus":20736,"clay":20992,"reeds":21248,"jukebox":21505,"fence":21760,"pumpkin":22016,"netherrack":22272,"soul_sand":22528,"glowstone":22784,"portal":23040,"lit_pumpkin":23296,"cake":23552,"unpowered_repeater":23808,"powered_repeater":24064,"glass_white":24320,"glass_orange":24321,"glass_magenta":24322,"glass_light_blue":24323,"glass_yellow":24324,"glass_lime":24325,"glass_pink":24326,"glass_gray":24327,"stained_glass":24328,"glass_cyan":24329,"glass_purple":24330,"glass_blue":24331,"glass_brown":24332,"glass_green":24333,"glass_red":24334,"glass_black":24335,"trapdoor":24576,"monster_egg":24837,"stonebrick_mossy":25089,"stonebrick_cracked":25090,"stonebrick_carved":25091,"brown_mushroom_block":25344,"red_mushroom_block":25600,"iron_bars":25856,"glass_pane":26112,"melon_block":26368,"pumpkin_stem":26624,"melon_stem":26880,"vine":27136,"fence_gate":27392,"brick_stairs":27648,"stone_brick_stairs":27904,"mycelium":28160,"waterlily":28416,"nether_brick_fence":28928,"nether_brick_stairs":29184,"nether_wart":29440,"enchanting_table":29696,"brewing_stand":29952,"cauldron":30208,"end_portal":30464,"end_portal_frame":30720,"end_stone":30976,"dragon_egg":31232,"redstone_lamp":31488,"lit_redstone_lamp":31744,"double_wooden_slab":32000,"wooden_slab":32256,"cocoa":32512,"sandstone_stairs":32768,"emerald_ore":33024,"ender_chest":33280,"tripwire_hook":33536,"tripwire":33792,"emerald_block":34048,"spruce_stairs":34304,"birch_stairs":34560,"jungle_stairs":34816,"command_block":35072,"beacon":35328,"cobblestone_wall":35584,"cobblestone_mossy":35585,"flower_pot":35840,"carrots":36096,"potatoes":36352,"wooden_button":36608,"skull":36864,"anvil":37120,"trapped_chest":37376,"light_weighted_pressure_plate":37632,"heavy_weighted_pressure_plate":37888,"unpowered_comparator":38144,"powered_comparator":38400,"daylight_detector":38656,"redstone_block":38912,"quartz_ore":39168,"hopper":39424,"quartz_block_lines":39682,"quartz_stairs":39936,"activator_rail":40192,"dropper":40448,"hardened_clay_stained_white":40704,"hardened_clay_stained_orange":40705,"hardened_clay_stained_magenta":40706,"hardened_clay_stained_light_blue":40707,"hardened_clay_stained_yellow":40708,"hardened_clay_stained_lime":40709,"hardened_clay_stained_pink":40710,"hardened_clay_stained_gray":40711,"hardened_clay_stained_silver":40712,"hardened_clay_stained_cyan":40713,"hardened_clay_stained_purple":40714,"hardened_clay_stained_blue":40715,"hardened_clay_stained_brown":40716,"hardened_clay_stained_green":40717,"hardened_clay_stained_red":40718,"hardened_clay_stained_black":40719,"stained_glass_pane":40960,"leaves_acacia":41216,"leaves_big_oak":41217,"log2":41473,"acacia_stairs":41728,"dark_oak_stairs":41984,"slime":42240,"barrier":42496,"iron_trapdoor":42752,"prismarine_rough":43008,"prismarine_bricks":43009,"prismarine_dark":43010,"sea_lantern":43264,"hay_block":43520,"carpet":43791,"hardened_clay":44032,"coal_block":44288,"packed_ice":44544,"double_plant":44800,"double_plant_syringa_top":44801,"double_plant_paeonia_top":44805,"standing_banner":45056,"wall_banner":45312,"daylight_detector_inverted":45568,"red_sandstone_normal":45824,"red_sandstone_carved":45825,"red_sandstone_smooth":45826,"red_sandstone_stairs":46080,"double_stone_slab2":46336,"stone_slab2":46592,"spruce_fence_gate":46848,"birch_fence_gate":47104,"jungle_fence_gate":47360,"dark_oak_fence_gate":47616,"acacia_fence_gate":47872,"spruce_fence":48128,"birch_fence":48384,"jungle_fence":48640,"dark_oak_fence":48896,"acacia_fence":49152,"spruce_door":49408,"birch_door":49664,"jungle_door":49920,"acacia_door":50176,"dark_oak_door":50432,"end_rod":50688,"chorus_plant":50944,"chorus_flower":51200,"purpur_block":51456,"purpur_pillar":51712,"purpur_stairs":51968,"purpur_double_slab":52224,"purpur_slab":52480,"end_bricks":52736,"beetroots":52992,"grass_path":53248,"end_gateway":53504,"repeating_command_block":53760,"chain_command_block":54016,"frosted_ice":54272,"magma":54528,"nether_wart_block":54784,"red_nether_brick":55040,"bone_block":55296,"item-snowball-blue":55781,"item-tnt-yellow":55782,"item-woodplank-grey":55783,"item-stoneball-grey":55784,"item-stairs-grey":55785,"item-pistol-grey":55786,"item-pickaxe-grey":55787,"item-uri-yellow":55788,"item-uri-purple":55789,"item-uri-blue":55790,"item-uri-green":55791,"item-uri-grey":55792,"item-ak47-yellow":55793,"item-ak47-purple":55794,"item-ak47-blue":55795,"item-ak47-green":55796,"item-ak47-grey":55797,"item-shotgun-yellow":55798,"item-shotgun-purple":55799,"item-shotgun-blue":55800,"item-shotgun-green":55801,"item-shotgun-grey":55802,"item-sniper-yellow":55803,"item-sniper-purple":55804,"item-sniper-blue":55805,"item-sniper-green":55806,"item-sniper-grey":55807,"observer":55808,"white_shulker_box":56064,"orange_shulker_box":56320,"magenta_shulker_box":56576,"light_blue_shulker_box":56832,"yellow_shulker_box":57088,"lime_shulker_box":57344,"pink_shulker_box":57600,"gray_shulker_box":57856,"light_gray_shulker_box":58112,"cyan_shulker_box":58368,"purple_shulker_box":58624,"blue_shulker_box":58880,"brown_shulker_box":59136,"green_shulker_box":59392,"red_shulker_box":59648,"black_shulker_box":59904,"white_glazed_terracotta":60160,"orange_glazed_terracotta":60416,"magenta_glazed_terracotta":60672,"light_blue_glazed_terracotta":60928,"yellow_glazed_terracotta":61184,"lime_glazed_terracotta":61440,"pink_glazed_terracotta":61696,"gray_glazed_terracotta":61952,"light_gray_glazed_terracotta":62208,"cyan_glazed_terracotta":62464,"purple_glazed_terracotta":62720,"blue_glazed_terracotta":62976,"brown_glazed_terracotta":63232,"green_glazed_terracotta":63488,"red_glazed_terracotta":63744,"black_glazed_terracotta":64000,"concrete_white":64256,"concrete_orange":64257,"concrete_magenta":64258,"concrete_light_blue":64259,"concrete_yellow":64260,"concrete_lime":64261,"concrete_pink":64262,"concrete_gray":64263,"concrete_silver":64264,"concrete_cyan":64265,"concrete_purple":64266,"concrete_blue":64267,"concrete_brown":64268,"concrete_green":64269,"concrete_red":64270,"concrete_black":64271,"concrete_powder_white":64512,"concrete_powder_orange":64513,"concrete_powder_magenta":64514,"concrete_powder_light_blue":64515,"concrete_powder_yellow":64516,"concrete_powder_lime":64517,"concrete_powder_pink":64518,"concrete_powder_gray":64519,"concrete_powder_silver":64520,"concrete_powder_cyan":64521,"concrete_powder_blue":64522,"concrete_powder_brown":64523,"concrete_powder_green":64524,"concrete_powder_red":64525,"concrete_powder_black":64527,"structure_block":65280};

// Auto-join message
var joinMessage = "[joined with Objify's advanced hack client by Havvingyy - available on Greasyfork]";

function wasThrown() {
  try {
    throw new Error();
  } catch (e) {
    const stackLines = e.stack.split('\n');
    const callerLine = stackLines[3];
    const functionName = callerLine.match(/\ba853\b/);
    return !!functionName;
  }
}

function countItemInInv(target) {
    let count = 0;
    if (!GAME?.a865?.player?.items) return count;
    for (const item of GAME.a865.player.items) {
        if (item !== -1 && item.a474Id === target && item.total) {
            count += item.total;
        }
    }
    return count;
}

function getBlockName(blockId) {
    for (let [name, id] of Object.entries(blocks)) {
        if (id === blockId) {
            return name;
        }
    }
    return `Block_${blockId}`;
}
 
var client = {
  Hacks: [],
  version: "1.4",
  keyBinds: {},
  inGame: false,
  customBlockId: 256,
  blockMenuOpen: false,
  manualDisconnect: false,
  server: {},
  messageSent: false,
  currentSelectedIndex: 0,
  menuElements: [],
  blockElements: [],
};

client.showMessageStatus = function(message, color = "#00ff00") {
    const statusElement = document.createElement("div");
    statusElement.style.cssText = `
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(50,50,50,0.9) 100%);
        color: ${color};
        padding: 12px 20px;
        border-radius: 8px;
        font-weight: bold;
        font-size: 16px;
        border: 2px solid ${color};
        z-index: 10001;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
        animation: fadeInOut 3s ease-in-out;
    `;
    statusElement.textContent = message;
    
    // Add CSS animation
    if (!document.getElementById('statusAnimationStyle')) {
        const style = document.createElement('style');
        style.id = 'statusAnimationStyle';
        style.textContent = `
            @keyframes fadeInOut {
                0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
                20% { opacity: 1; transform: translateX(-50%) translateY(0px); }
                80% { opacity: 1; transform: translateX(-50%) translateY(0px); }
                100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
            }
        `;
        document.head.appendChild(style);
    }
    
    document.body.appendChild(statusElement);
    
    setTimeout(() => {
        if (statusElement.parentNode) {
            statusElement.parentNode.removeChild(statusElement);
        }
    }, 3000);
};

client.createKeybindContainer = function() {
    const container = document.createElement("div");
    container.id = "keybindContainer";
    container.style.cssText = `
        position: fixed;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: linear-gradient(135deg, #a47346 0%, #8B5A2B 100%);
        border: 3px solid #3D2317;
        border-radius: 12px;
        z-index: 1000;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        transition: all 0.3s ease;
        max-width: 500px;
        overflow: hidden;
    `;
    
    const header = document.createElement("div");
    header.style.cssText = `
        background: linear-gradient(135deg, #d4a574 0%, #b8926a 100%);
        color: #2C1810;
        padding: 10px 15px;
        font-weight: bold;
        font-size: 16px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        user-select: none;
    `;
    
    const title = document.createElement("span");
    title.textContent = "⚡ KEYBINDS ⚡";
    
    const arrow = document.createElement("span");
    arrow.textContent = "▼";
    arrow.style.cssText = `
        transition: transform 0.3s ease;
        font-size: 14px;
    `;
    
    header.appendChild(title);
    header.appendChild(arrow);
    
    const content = document.createElement("div");
    content.id = "keybindContent";
    content.style.cssText = `
        padding: 15px;
        color: #f4e6d7;
        font-size: 14px;
        line-height: 1.5;
        max-height: 200px;
        overflow-y: auto;
        transition: max-height 0.3s ease, padding 0.3s ease;
    `;
    
    let isCollapsed = false;
    
    header.onclick = () => {
        isCollapsed = !isCollapsed;
        if (isCollapsed) {
            content.style.maxHeight = "0px";
            content.style.padding = "0 15px";
            arrow.style.transform = "rotate(-90deg)";
        } else {
            content.style.maxHeight = "200px";
            content.style.padding = "15px";
            arrow.style.transform = "rotate(0deg)";
        }
    };
    
    container.appendChild(header);
    container.appendChild(content);
    document.body.appendChild(container);
    
    client.keybindContainer = container;
    client.keybindContent = content;
};

client.updateKeybindContent = function() {
    if (!client.keybindContent) return;
    
    let html = `
        <div style="margin-bottom: 10px;">
            <span style="color: #d4a574; font-weight: bold;">6</span> - open menu<br>
            <span style="color: #d4a574; font-weight: bold;">5</span> - block menu<br>
            <span style="color: #d4a574; font-weight: bold;">ctrl+esc</span> - safe exit
        </div>
    `;
    
    for(let i = 0; i < client.Hacks.length; i++){
        if(client.Hacks[i].key == "no keybind") continue;
        html += `<span style='color: #a47346; font-weight: bold;'>${client.Hacks[i].key}</span> - ${client.Hacks[i].name}<br>`;
    }
    
    client.keybindContent.innerHTML = html;
};

client.Hack = class {
  constructor(enable, mainLoop, disable, name, description, key, delay, configurationDefinition){
    this.enable = function(){try {enable(this_);}catch(e){}; this.isEnabled = true};
    this.mainLoop = mainLoop;
    this.disable = function(){try {disable(this_);}catch(e){}; this.isEnabled = false};
    this.name = name;
    this.description = description;
    this.isEnabled = false;
    this.key = key;
 
    this.configurationDefinition = configurationDefinition;
    this.config = {};
    setTimeout(function() {
      this_.configurationDefinition && Object.keys(this_.configurationDefinition).forEach(function (e) {
           this_.config[e] = localStorage[this_.name] && JSON.parse(localStorage[this_.name]).config[e] ? JSON.parse(localStorage[this_.name]).config[e] : this_.configurationDefinition[e].defaultValue != undefined ? this_.configurationDefinition[e].defaultValue : (this_.configurationDefinition[e].possibleValues && this_.configurationDefinition[e].possibleValues[0] != undefined) ? this_.configurationDefinition[e].possibleValues[0] : false;
        });
    }, 1);
 
    client.keyBinds[this.key] = this.name;
    var this_ = this;
    if(!delay){
      delay = 10;
    };
    function loop(){
      if(this_.isEnabled && client){
        this_.mainLoop(this_);
      };
      setTimeout(loop, delay);
    };
    setTimeout(loop, 100);
    client.Hacks.push(this);
  };
};

client.createBlockMenu = function() {
    if (client.blockMenuOpen) {
        client.closeBlockMenu();
        return;
    }
    
    client.blockMenuOpen = true;
    client.currentSelectedIndex = 0;
    client.blockElements = [];
    
    // Create main menu container
    const menu = document.createElement("div");
    menu.id = "blockMenu";
    menu.style.cssText = `
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 60%;
        height: 70%;
        background: linear-gradient(135deg, #a47346 0%, #8B5A2B 50%, #6B4226 100%);
        border: 4px solid #3D2317;
        box-shadow: 0 0 30px rgba(164, 115, 70, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.1);
        z-index: 10000;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        border-radius: 15px;
    `;
    
    // Create header
    const header = document.createElement("div");
    header.style.cssText = `
        background: linear-gradient(135deg, #d4a574 0%, #b8926a 50%, #a47346 100%);
        color: #2C1810;
        padding: 15px;
        text-align: center;
        font-size: 28px;
        font-weight: bold;
        border-bottom: 4px solid #3D2317;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        letter-spacing: 2px;
    `;
    header.textContent = "✦ SELECT BLOCK TO PLACE ✦";
    
    // Create search input
    const searchContainer = document.createElement("div");
    searchContainer.style.cssText = `
        padding: 15px;
        border-bottom: 2px solid #3D2317;
        background: linear-gradient(135deg, #8B5A2B 0%, #6B4226 100%);
    `;
    const searchInput = document.createElement("input");
    searchInput.type = "text";
    searchInput.placeholder = "🔍 Search blocks... (Use Tab to navigate, Enter to select)";
    searchInput.style.cssText = `
        width: 100%;
        padding: 12px 15px;
        font-size: 16px;
        border: 3px solid #3D2317;
        background: linear-gradient(135deg, #f4e6d7 0%, #e8d5c4 100%);
        color: #2C1810;
        border-radius: 25px;
        font-weight: 600;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
    `;
    
    // Create scrollable content area
    const content = document.createElement("div");
    content.style.cssText = `
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
        align-content: start;
        background: linear-gradient(135deg, #a47346 0%, #8B5A2B 100%);
    `;
    
    // Create close button
    const closeBtn = document.createElement("button");
    closeBtn.textContent = "✕";
    closeBtn.style.cssText = `
        position: absolute;
        top: 15px;
        right: 20px;
        background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
        color: white;
        border: 3px solid #d32f2f;
        width: 40px;
        height: 40px;
        font-size: 24px;
        font-weight: bold;
        cursor: pointer;
        border-radius: 50%;
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
        transition: all 0.3s ease;
    `;
    closeBtn.onmouseover = () => {
        closeBtn.style.transform = "scale(1.1)";
        closeBtn.style.boxShadow = "0 6px 12px rgba(0,0,0,0.4)";
    };
    closeBtn.onmouseleave = () => {
        closeBtn.style.transform = "scale(1)";
        closeBtn.style.boxShadow = "0 4px 8px rgba(0,0,0,0.3)";
    };
    closeBtn.onclick = client.closeBlockMenu;
    
    // Function to populate blocks
    function populateBlocks(filter = "") {
        content.innerHTML = "";
        client.blockElements = [];
        const blockEntries = Object.entries(blocks).slice(1); // Skip "random"
        
        blockEntries
            .filter(([name]) => name.toLowerCase().includes(filter.toLowerCase()))
            .forEach(([name, id], index) => {
                const blockBtn = document.createElement("div");
                const isSelected = client.customBlockId === id;
                const isFocused = index === client.currentSelectedIndex;
                
                blockBtn.style.cssText = `
                    background: ${isSelected ? 
                        'linear-gradient(135deg, #f4e6d7 0%, #e8d5c4 50%, #d4a574 100%)' : 
                        isFocused ? 
                        'linear-gradient(135deg, #8B5A2B 0%, #6B4226 50%, #5A3621 100%)' :
                        'linear-gradient(135deg, #6B4226 0%, #5A3621 50%, #4A2A1A 100%)'};
                    color: ${isSelected ? '#2C1810' : '#f4e6d7'};
                    padding: 15px;
                    border: 3px solid ${isSelected ? '#3D2317' : isFocused ? '#d4a574' : '#8B5A2B'};
                    cursor: pointer;
                    text-align: center;
                    font-size: 14px;
                    font-weight: 600;
                    word-wrap: break-word;
                    transition: all 0.3s ease;
                    border-radius: 12px;
                    box-shadow: ${isSelected ? 
                        '0 6px 15px rgba(164, 115, 70, 0.4), inset 0 2px 4px rgba(255,255,255,0.2)' : 
                        isFocused ?
                        '0 6px 12px rgba(212, 165, 116, 0.4), inset 0 2px 4px rgba(255,255,255,0.15)' :
                        '0 4px 8px rgba(0,0,0,0.3), inset 0 1px 2px rgba(255,255,255,0.1)'};
                    transform: ${isSelected ? 'scale(1.05)' : isFocused ? 'scale(1.02)' : 'scale(1)'};
                `;
                
                blockBtn.innerHTML = `
                    <div style="font-weight: bold; margin-bottom: 8px; text-transform: capitalize; letter-spacing: 1px;">
                        ${name.replace(/_/g, ' ')}
                    </div>
                    <div style="font-size: 12px; opacity: 0.8; font-weight: 500;">
                        ID: ${id}
                    </div>
                `;
                
                blockBtn.onclick = () => {
                    client.selectBlock(id);
                };
                
                content.appendChild(blockBtn);
                client.blockElements.push({element: blockBtn, id: id, name: name});
            });
    }
    
    client.selectBlock = function(id) {
        client.customBlockId = id;
        
        // Give player stone if needed
        if (window.GAME?.a865?.player?.a458) {
            const stoneNeeded = 1000 - countItemInInv("stone");
            if (stoneNeeded > 0) {
                GAME.a865.player.a458("stone", stoneNeeded);
            }
        }
        
        client.closeBlockMenu();
        client.updateStatus();
    };
    
    client.updateBlockSelection = function() {
        client.blockElements.forEach((block, index) => {
            const isSelected = client.customBlockId === block.id;
            const isFocused = index === client.currentSelectedIndex;
            
            block.element.style.background = isSelected ? 
                'linear-gradient(135deg, #f4e6d7 0%, #e8d5c4 50%, #d4a574 100%)' : 
                isFocused ? 
                'linear-gradient(135deg, #8B5A2B 0%, #6B4226 50%, #5A3621 100%)' :
                'linear-gradient(135deg, #6B4226 0%, #5A3621 50%, #4A2A1A 100%)';
            
            block.element.style.borderColor = isSelected ? '#3D2317' : isFocused ? '#d4a574' : '#8B5A2B';
            block.element.style.transform = isSelected ? 'scale(1.05)' : isFocused ? 'scale(1.02)' : 'scale(1)';
            block.element.style.boxShadow = isSelected ? 
                '0 6px 15px rgba(164, 115, 70, 0.4), inset 0 2px 4px rgba(255,255,255,0.2)' : 
                isFocused ?
                '0 6px 12px rgba(212, 165, 116, 0.4), inset 0 2px 4px rgba(255,255,255,0.15)' :
                '0 4px 8px rgba(0,0,0,0.3), inset 0 1px 2px rgba(255,255,255,0.1)';
        });
        
        // Scroll to focused element
        if (client.blockElements[client.currentSelectedIndex]) {
            client.blockElements[client.currentSelectedIndex].element.scrollIntoView({
                behavior: 'smooth',
                block: 'center'
            });
        }
    };
    
    // Search functionality
    searchInput.oninput = (e) => {
        populateBlocks(e.target.value);
        client.currentSelectedIndex = 0;
        client.updateBlockSelection();
    };
    
    searchContainer.appendChild(searchInput);
    menu.appendChild(header);
    menu.appendChild(closeBtn);
    menu.appendChild(searchContainer);
    menu.appendChild(content);
    document.body.appendChild(menu);
    
    populateBlocks();
    client.updateBlockSelection();
    searchInput.focus();
};

client.closeBlockMenu = function() {
    const menu = document.getElementById("blockMenu");
    if (menu) {
        menu.remove();
    }
    client.blockMenuOpen = false;
    client.blockElements = [];
};

client.updateStatus = function() {
    const statusText = client.customBlockId !== 256 ? `Custom Block: ${getBlockName(client.customBlockId)}` : "";
    if (client.hackList) {
        setTimeout(() => {
            client.hackList.innerHTML = client.hackList.innerHTML;
        }, 10);
    }
};

client.MenuElement = class {
  constructor(Hacks, title, left, top){
    var menuElement = document.createElement("div");
    menuElement.style = "left:"+left+"; color: rgba(255, 255, 255, 1) !important; top:"+top+"; margin: 25px; text-align: center; background: linear-gradient(135deg, #a47346 0%, #8B5A2B 50%, #6B4226 100%) !important; font-family: inherit; width:20%; height: 60%; position: absolute; border: 4px solid #3D2317; border-radius: 15px; box-shadow: 0 0 20px rgba(164, 115, 70, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.1);";
    menuElement.id = title;
    menuElement.innerHTML = "<div style='border-bottom: 4px solid #3D2317; padding: 8%; background: linear-gradient(135deg, #d4a574 0%, #b8926a 50%, #a47346 100%); font-size: 200%; color: #2C1810; font-weight: bold; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); letter-spacing: 1px;' id="+title+"header >"+title+"</div>";
    client.menuElement.appendChild(menuElement);
    
    for(let i = 0; i < Hacks.length; i++) {
      var part = document.createElement("div");
      part.style = 'border-bottom: 4px solid #3D2317; font-size: 200%; transition: all 0.3s ease; padding: 3%;';
      part.id = Hacks[i].name;
      part.tabIndex = 0; // Make focusable
      
      if(Hacks[i].configurationDefinition) {
        let random = Math.floor(Math.random()*1000000);
        part.innerHTML = "<null>"+Hacks[i].name+"</null><img style='width: 25px;float:right;cursor:pointer; filter: brightness(0.9) sepia(1) hue-rotate(25deg) saturate(1.2);' onmouseover='this.style.filter=`brightness(0.5) sepia(1) hue-rotate(25deg) saturate(1.2)`' onmouseleave='this.style.filter=`brightness(0.9) sepia(1) hue-rotate(25deg) saturate(1.2)`' id="+random+" src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAu1JREFUeJzt2L1qFFEAhuEv0Ub8KawsBBuDVqK9pBS8g9yGhY2VVyEItl6AYqmdipb2NoJFEAOCXTDEwh+yyv7Nzu45c+Z54FS7xcfMvDuwCQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBOlR4ww6Ukd5LcSrKd5EvZOSzgdJLbSXaTXE6yn+Sw6KIGnUnyKMmPJMcnzrsk1wvuYra7ST5l8p59T3IvyVbBXU3ZTvIikxf55DlIcrPYOqbZS3KU6fftYbFljdnL9IsskjrNi+P49+c7pQa25FnmByKSeiwSx5/zoNDGpnzIYhdbJOUtE8dxkidlZq5mu/SAfxws8d2LSV5FJCXsJXma5Z6fr2vaMir3s/gvkjdJGcu+Of6c3RJjW3MuyceIpFZd43gef/X25mqSzxFJbbrG8TbJhQJ7m7YTkdREHBUSSR3EUTGRlCWOARBJGeIYEJFsljgGSCSbIY4BE8l6iaMBIlkPcTREJP0SR4NE0g9xNEwkqxHHCIikG3GMiEiW0zWONxHHYIlkMeIYMZHMJg5EMoU4+Eskk8TBf0TyiziYauyRiIO5xhqJOFjY2CIRB0sbSyTioLPWIxEHK2s1EnHQm9YiEQe9ayUScbA2Q49klTjOF9jLAA01EnGwMUOLRBxs3FAiEQfF1B6JOCiu1kjEQTVqi0QcVKeWSMRBtUpHIg6qVyoScTAYm45EHAzOpiIRB4O17kjEweCtKxJx0Iy+I+kax+uIg0r1FYk4aNaqkYiD5nWN5FvEwUh0jUQcjMa6IxEHg7euSMRBM/qORBw0p69IxEGzVo1EHDSvayTiYDSWjUQcjM6ikYiD0ZoXiTgYvStJXmYyjKMkj5OcLbiLKbZKDxipa0luJDlM8j7Jftk5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMzwEyaMP2qlEyFaAAAAAElFTkSuQmCC'>";
        setTimeout(function () {
          document.getElementById(random).onclick = function (event,element) {
            client.renderConfig(Hacks[i]);
          }
          document.getElementById(random).onmouseover = function () {
            client.followText = Hacks[i].name+" options";
          }
          document.getElementById(random).onmouseleave = function () {
            client.followText = "";
          }
        }, 10);
      } else {
        part.innerHTML = "<null>"+Hacks[i].name+"</null>";
      }
      
      document.getElementById(title).appendChild(part);
      client.menuElements.push(part);
      
      const toggleHack = () => {
        if(!window.GAME) {client.error("You must be in a game to enable hacks!"); return};
        if(!Hacks[i].isEnabled){
          Hacks[i].enable();
          document.getElementById(Hacks[i].name).style.background = "linear-gradient(135deg, #f4e6d7 0%, #e8d5c4 100%)";
          document.getElementById(Hacks[i].name).style.color = "#2C1810";
          document.getElementById(Hacks[i].name).style.fontWeight = "bold";
          document.getElementById(Hacks[i].name).style.textShadow = "1px 1px 2px rgba(0,0,0,0.2)";
        } else {
          Hacks[i].disable();
          document.getElementById(Hacks[i].name).style.background = "transparent";
          document.getElementById(Hacks[i].name).style.color = "rgba(255, 255, 255, 1)";
          document.getElementById(Hacks[i].name).style.fontWeight = "normal";
          document.getElementById(Hacks[i].name).style.textShadow = "none";
        };
      };
      
      document.getElementById(Hacks[i].name).addEventListener("mousedown", function (event){
        if(event.target!=document.getElementById(Hacks[i].name) && event.target!=document.getElementById(Hacks[i].name).children[0]) {
          return;
        }
        toggleHack();
      });
      
      document.getElementById(Hacks[i].name).addEventListener("keydown", function (event){
        if(event.key === 'Enter') {
          toggleHack();
        }
      });
      
      document.getElementById(Hacks[i].name).addEventListener("mouseover", function (event){
          if(event.target!=document.getElementById(Hacks[i].name) && event.target!=document.getElementById(Hacks[i].name).children[0]) {
            return;
          }
          if(!Hacks[i].isEnabled) {
            document.getElementById(Hacks[i].name).style.background = "linear-gradient(135deg, rgba(164, 115, 70, 0.3) 0%, rgba(139, 90, 43, 0.3) 100%)";
          }
          client.followText = Hacks[i].description;
      });
      document.getElementById(Hacks[i].name).addEventListener("mouseleave", function (event){
          if(event.target!=document.getElementById(Hacks[i].name) && event.target!=document.getElementById(Hacks[i].name).children[0]) {
            return;
          }
          if(!Hacks[i].isEnabled) {
            document.getElementById(Hacks[i].name).style.background = "transparent";
          }
          client.followText = "";
      });
    };
  };
};
 
client.menuToggled = 0;
client.menuElement = document.createElement("div");
document.body.appendChild(client.menuElement);
client.menuElement.id = "vhc-menu";
client.menuElement.style.width = "100%";
client.menuElement.style.height = "100%";
client.menuElement.style.background = "rgba(0, 0, 0, 0.5)";
client.menuElement.style.position = "absolute";
client.menuElement.style.zIndex = 1000;
client.menuElement.style.top = "0";
 
client.hackList = document.createElement("h1");
document.body.appendChild(client.hackList);
client.hackList.style.color = "#fff";
client.hackList.style.position = "fixed";
client.hackList.style.top = "40%";
client.hackList.innerHTML = "VHC version "+client.version+"<br>";
client.hackList.style.zIndex = 1000;
client.hackList.style.fontSize = "20px";
client.hackList.style.textAlign = "left";
client.hackList.style.textShadow = "2px 2px 4px rgba(0,0,0,0.5)";
client.hackList.style.fontWeight = "600";
 
client.errorElement = document.createElement("h1");
document.body.appendChild(client.errorElement);
client.errorElement.style.color = "#fff";
client.errorElement.style.position = "absolute";
client.errorElement.style.top = "10%";
client.errorElement.style.width = "10%";
client.errorElement.style.fontSize = "100%";
client.errorElement.style.left = "40%";
client.errorElement.style.border = "solid red 1px";
client.errorElement.style.borderRadius = "7px";
client.errorElement.style.backgroundColor = "red";
client.errorElement.innerHTML = "client.errorElement";
client.errorElement.style.opacity = 0;
client.errorElement.style.transition = "all 0.3s";
client.errorElement.style.zIndex = "1000";
 
client.followText = "";
client.follow = document.createElement("div");
client.follow.style.pointerEvents = "none";
client.follow.style.position = "absolute";
client.follow.style.minWidth = "10em";
client.follow.style.maxWidth = "20em";
client.follow.style.zIndex = "9999";
client.follow.style.background = "linear-gradient(135deg, #a47346 0%, #8B5A2B 100%)";
client.follow.style.color = "#f4e6d7";
client.follow.style.padding = "8px 12px";
client.follow.style.borderRadius = "8px";
client.follow.style.boxShadow = "0 4px 12px rgba(0,0,0,0.3)";
client.follow.style.fontWeight = "600";
client.follow.style.fontSize = "14px";
document.body.appendChild(client.follow);
document.body.addEventListener("mousemove", function (e){
    client.follow.innerHTML = client.followText;
    client.followText ? client.follow.style.border = "2px solid #3D2317" : client.follow.style.border = "";
    x = e.pageX;
    y = e.pageY;
    client.follow.style.left = (x+10)+"px";
    client.follow.style.top = (y+10)+"px";
    if(x+10 > innerWidth-client.follow.getBoundingClientRect().width) client.follow.style.left = (innerWidth-client.follow.getBoundingClientRect().width)+"px"
});
 
client.error = function (text) {
  var audio = document.createElement("Audio");
  audio.src = "files/assets/31197478/1/Error-UI.mp3";
  audio.play();
  client.errorElement.innerHTML = text;
  client.errorElement.style.opacity = 1;
  setTimeout(function(){client.errorElement.style.opacity = 0;}, 1000)
};

client.preventKicks = function() {
    // Store original WebSocket close handler
    if (window.G && G.socket) {
        const originalClose = G.socket.close;
        const originalOnClose = G.socket.onclose;
        const originalOnError = G.socket.onerror;
        
        // Override WebSocket close to prevent unwanted disconnections
        G.socket.close = function(code, reason) {
            // Only allow manual disconnects or specific codes
            if (client.manualDisconnect || code === 1000 || code === 1001) {
                return originalClose.call(this, code, reason);
            }
            console.log("Prevented auto-disconnect with code:", code, "reason:", reason);
            return false;
        };
        
        // Override onclose to handle reconnection
        G.socket.onclose = function(event) {
            if (!client.manualDisconnect && event.code !== 1000 && event.code !== 1001) {
                console.log("Attempting reconnection...");
                setTimeout(() => {
                    if (!client.manualDisconnect) {
                        location.reload();
                    }
                }, 2000);
                return;
            }
            if (originalOnClose) {
                return originalOnClose.call(this, event);
            }
        };
        
        // Override onerror to prevent error-based kicks
        G.socket.onerror = function(event) {
            console.log("WebSocket error prevented:", event);
            // Don't call original error handler to prevent kicks
            return false;
        };
    }
    
    // Hook into game disconnect function
    if (window.GAME) {
        const originalDisconnect = GAME.disconnect;
        GAME.disconnect = function() {
            if (client.manualDisconnect) {
                return originalDisconnect.call(this);
            }
            console.log("Prevented game disconnect");
            return false;
        };
    }
    
    // Prevent page unload unless manual
    window.addEventListener('beforeunload', function(e) {
        if (!client.manualDisconnect) {
            e.preventDefault();
            e.returnValue = '';
            return '';
        }
    });
    
    // Hook into potential kick packets
    if (window.WebSocket && WebSocket.prototype.send) {
        const originalSend = WebSocket.prototype.send;
        WebSocket.prototype.send = function(data) {
            // Check for kick/ban packets and block them
            if (data instanceof ArrayBuffer || data instanceof Uint8Array) {
                const view = new DataView(data instanceof ArrayBuffer ? data : data.buffer);
                const opcode = view.getUint8(0);
                
                // Block common kick/disconnect opcodes (adjust these based on game)
                const kickOpcodes = [254, 255, 200, 201, 202]; // Common disconnect opcodes
                if (kickOpcodes.includes(opcode)) {
                    console.log("Blocked potential kick packet with opcode:", opcode);
                    return;
                }
            }
            
            return originalSend.call(this, data);
        };
    }
    
    console.log("Anti-kick protection enabled");
};

client.safeDisconnect = function() {
    client.manualDisconnect = true;
    if (window.GAME && GAME.disconnect) {
        GAME.disconnect();
    } else {
        window.location.reload();
    }
};
 
document.addEventListener("keydown", function(event) {
    // Handle menu navigation for block menu
    if (client.blockMenuOpen && client.blockElements.length > 0) {
        if (event.key === 'Tab') {
            event.preventDefault();
            if (event.shiftKey) {
                client.currentSelectedIndex = (client.currentSelectedIndex - 1 + client.blockElements.length) % client.blockElements.length;
            } else {
                client.currentSelectedIndex = (client.currentSelectedIndex + 1) % client.blockElements.length;
            }
            client.updateBlockSelection();
            return;
        }
        if (event.key === 'Enter') {
            event.preventDefault();
            if (client.blockElements[client.currentSelectedIndex]) {
                client.selectBlock(client.blockElements[client.currentSelectedIndex].id);
            }
            return;
        }
        if (event.key === 'Escape') {
            client.closeBlockMenu();
            return;
        }
    }
    
    // Handle menu navigation for main menu
    if (client.menuToggled && client.menuElements.length > 0) {
        if (event.key === 'Tab') {
            event.preventDefault();
            const currentIndex = client.menuElements.findIndex(el => el === document.activeElement);
            let nextIndex;
            
            if (event.shiftKey) {
                nextIndex = currentIndex <= 0 ? client.menuElements.length - 1 : currentIndex - 1;
            } else {
                nextIndex = currentIndex >= client.menuElements.length - 1 ? 0 : currentIndex + 1;
            }
            
            client.menuElements[nextIndex].focus();
            return;
        }
    }
    
    if (event.key == "6") {
      client.menuToggled = !client.menuToggled;
      if(!client.menuToggled && client.inGame){if(client.menuToggled){GAME.uiManager.menuActive=false;};GAME.a865.player.controls.lock(); GAME.closea793(); GAME.inChat = false};
      
      // Focus first menu element when opening
      if (client.menuToggled && client.menuElements.length > 0) {
        setTimeout(() => {
          client.menuElements[0].focus();
        }, 100);
      }
    };
    if (event.key == "5") {
      if (!client.blockMenuOpen && document.activeElement.tagName !== 'INPUT') {
        event.preventDefault();
        client.createBlockMenu();
      }
    };
    if (event.key == "Escape" && event.ctrlKey) {
      client.safeDisconnect();
    };
    if (client.keyBinds[event.key]) {
      try {
        if(document.activeElement==document.getElementById("chat")) return;
      } catch (e) {}
      if(!client.inGame) {client.error("You must be in a game to enable hacks!"); return};
      for(let i = 0; i < client.Hacks.length; i++){
        if(client.Hacks[i].name == client.keyBinds[event.key]){
          if(client.Hacks[i].isEnabled){
            client.Hacks[i].disable();
            document.getElementById(client.Hacks[i].name).style.background = "transparent";
            document.getElementById(client.Hacks[i].name).style.color = "rgba(255, 255, 255, 1)";
            document.getElementById(client.Hacks[i].name).style.fontWeight = "normal";
            document.getElementById(client.Hacks[i].name).style.textShadow = "none";
          } else {
            client.Hacks[i].enable();
            document.getElementById(client.Hacks[i].name).style.background = "linear-gradient(135deg, #f4e6d7 0%, #e8d5c4 100%)";
            document.getElementById(client.Hacks[i].name).style.color = "#2C1810";
            document.getElementById(client.Hacks[i].name).style.fontWeight = "bold";
            document.getElementById(client.Hacks[i].name).style.textShadow = "1px 1px 2px rgba(0,0,0,0.2)";
          };
        };
      };
    };
});
 
client.MAIN = function() {
    let statusLine = client.customBlockId !== 256 ? `<br><span style="color: #d4a574; font-weight: bold;">Custom Block: ${getBlockName(client.customBlockId)}</span>` : "";
    let messageStatus = client.messageSent ? `<br><span style="color: #00ff00; font-weight: bold;">✓ Join message sent!</span>` : "";
    client.hackList.innerHTML = "<span style='color: #d4a574; font-size: 24px; font-weight: bold;'>✦ OBJIFY HACK v"+client.version+" ✦</span>"+statusLine+messageStatus+"<br>";
    
    for(let i = 0; i < client.Hacks.length; i++){
      if(client.Hacks[i].isEnabled){
        client.hackList.innerHTML += "<span style='color: #a47346; font-weight: bold;'>●</span> " + client.Hacks[i].name+(client.Hacks[i].type ? " <b style='color: #d4a574'>["+client.Hacks[i].type+"]</b>" : " ")+"<br>";
      };
    };
    
    if (client.menuToggled) {
        document.exitPointerLock();
        client.menuElement.style.display = "block";
    } else {
        client.menuElement.style.display = "none";
    }
    setTimeout(client.MAIN, 10);
};
client.dispose = function () {
  console.log("disposing of client version "+client.version);
  client.Hacks.forEach(hack => {
    if(hack.isEnabled) {
      hack.disable();
    };
  });
  for (element in client) {
    client[element].outerHTML = "";
    delete client[element];
  };
  client = undefined;
};
client.renderConfig = function (hack) {
  var elem = document.getElementById(hack.name);
  if(!elem.children[2]) {
    var config = document.createElement("div");
    config.style.background = "linear-gradient(135deg, #d4a574 0%, #b8926a 100%)";
    config.style.border = "4px solid #3D2317";
    config.style.position = "fixed";
    config.style.width = "20%";
    config.style.marginLeft = "-4px";
    config.style.borderRadius = "8px";
    config.style.boxShadow = "0 6px 15px rgba(0,0,0,0.3)";
    config.innerHTML = "<div style='border-bottom:4px solid #3D2317; padding: 10px; color: #2C1810; font-weight: bold; text-align: center; font-size: 18px;'>⚙️ SETTINGS ⚙️</div><div></div>";
    elem.appendChild(config);
    var list = config.children[1];
    list.style.fontSize = "18px";
    list.style.padding = "15px";
    list.style.color = "#2C1810";
    list.style.fontWeight = "600";
 
    Object.values(hack.configurationDefinition).forEach(function(config, index){
        switch(config.type) {
            case 0:
                list.innerHTML += "<div style='margin: 10px 0;'>" + Object.keys(hack.configurationDefinition)[index]+" <input type='checkbox' style='transform: scale(1.2); margin-left: 8px;' id='"+Object.keys(hack.configurationDefinition)[index]+"' onchange='client.processConfigChange.call(this, client.Hacks["+client.Hacks.indexOf(hack)+"], "+index+")'></input></div>";
                setTimeout(function(){
                    document.getElementById(Object.keys(hack.configurationDefinition)[index]).checked = hack.config[Object.keys(hack.configurationDefinition)[index]];
                }, 10);
                break
            case 1:
                list.innerHTML += "<div style='margin: 10px 0;'>" + Object.keys(hack.configurationDefinition)[index]+" <select style='margin-left: 8px; padding: 4px; border: 2px solid #3D2317; border-radius: 4px; background: #f4e6d7;' id='"+Object.keys(hack.configurationDefinition)[index]+"' onchange='client.processConfigChange.call(this, client.Hacks["+client.Hacks.indexOf(hack)+"], "+index+")'></select></div>";
                config.possibleValues.forEach(function(possibleValue) {
                    document.getElementById(Object.keys(hack.configurationDefinition)[index]).innerHTML += "<option value='"+possibleValue+"'>"+possibleValue+"</option>";
                });
                setTimeout(function(){
                    document.getElementById(Object.keys(hack.configurationDefinition)[index]).value = hack.config[Object.keys(hack.configurationDefinition)[index]];
                }, 10);
                break
            case 2:
                list.innerHTML += "<div style='margin: 10px 0;'>" + Object.keys(hack.configurationDefinition)[index]+" <input style='margin-left: 8px; padding: 4px; border: 2px solid #3D2317; border-radius: 4px; background: #f4e6d7; width: 80px;' id='"+Object.keys(hack.configurationDefinition)[index]+"' onchange='client.processConfigChange.call(this, client.Hacks["+client.Hacks.indexOf(hack)+"], "+index+")'></input></div>";
                setTimeout(function(){
                    document.getElementById(Object.keys(hack.configurationDefinition)[index]).value = hack.config[Object.keys(hack.configurationDefinition)[index]];
                }, 10);
                break
        }
    });
  }
  if(elem.children[2].style.display == "block") {
    elem.children[2].style.display = "none";
    elem.children[1].style.transform = "rotate(0deg)";
  } else {
    elem.children[2].style.display = "block";
    elem.children[1].style.transform = "rotate(180deg)";
  }
}
client.processConfigChange = function (hack,index) {
    var value = this.type == "checkbox" ? this.checked : this.value;
    var configName = Object.keys(hack.config)[index];
    hack.config[configName]=value;
    localStorage[hack.name] = localStorage[hack.name] || "{\"config\":{}}";
    var newData = JSON.parse(localStorage[hack.name]);
    newData.config[configName] = value;
    localStorage[hack.name] = JSON.stringify(newData);
}

client.hookBlockPlacement = function() {
    if (window.G && G.Grid && G.Grid.prototype.a637) {
        const originalA637 = G.Grid.prototype.a637;
        G.Grid.prototype.a637 = function() {
            if (wasThrown() && arguments[1].length === 1 && arguments[1][0] == 256 && client.customBlockId !== 256) {
                arguments[1] = [client.customBlockId];
            }
            return originalA637.apply(this, arguments);
        };
    }
};

client.init = function() {
  console.log(client.version+" running on "+navigator.platform);
  
  client.preventKicks();
  client.hookBlockPlacement();
  client.createKeybindContainer();
  
  const hookInterval = setInterval(() => {
    if (window.G && G.Grid && G.Grid.prototype.a637) {
      client.hookBlockPlacement();
      clearInterval(hookInterval);
    }
  }, 1000);
  
  //hacks (updated keybinds to avoid WASD, E, Arrow keys, 1234)
  var Fly = new client.Hack(function () {
    G.CONFIG.a143 = true;
  }, function () {
 
  }, function () {
    G.CONFIG.a143 = false;
  }, "Fly", "Enable flight", "f");
  var WaterLevel = new client.Hack(function (this_) {
    this_.a = GAME.oceanHeightTo
  }, function () {
    GAME.oceanHeightTo = Number(this.config["water level"]);
    this.type = this.config["water level"];
    if(!Number(this.config["water level"])) this.config["water level"] = this.oldlev;
    this.oldlev = this.config["water level"];
  }, function (this_) {
    GAME.oceanHeightTo = this_.a;
  }, "WaterLevel", "Change the water height on your side", "no keybind", false, {"water level":{defaultValue:260,type:2}});
  var SpeedHack = new client.Hack(function () {
 
  }, function () {
    if(G.Keybinds.moveForward.a730) GAME.a865.player.vZ=2.5;
  }, function () {
 
  }, "SpeedHack", "Increase walking speed", "v");
  var RapidFire = new client.Hack(function (this_) {
    if(!Date.now.a) {
      window.a = Date.now;
      Date.now=function(){
        function getStackTrace(){
          var obj = this;
          Error.captureStackTrace(obj, getStackTrace);
          return obj.stack;
        }
        if(getStackTrace().includes("a822er.update")) {
          return a.call(Date);
        } else {
          return a.call(Date)*(window.multiplier||1)-(window.warp||0);
        }
      }
      Date.now.a=true;
    }
  }, function () {
    this.type = this.config.multiplier+"x";
    if(this.oldmult != undefined && this.config.multiplier != this.oldmult) {
      if(!Number(this.config.multiplier)) this.config.multiplier = this.oldmult;
      window.warp = a.call(Date)-Date.now();
    }
    window.multiplier = this.config.multiplier;
    this.oldmult = this.config.multiplier;
  }, function (this_) {
    window.warp = a.call(Date)-Date.now();
    window.multiplier = 1;
  }, "RapidFire", "Shoot and reload faster", "no keybind", false, {multiplier:{defaultValue:2,type:2}});
  var InfAmmo = new client.Hack(function (this_) {
    this_.a = GAME.a865.player.updatea809Total;
    GAME.a865.player.updatea809Total = new Function;
  }, function () {
 
  }, function (this_) {
    GAME.a865.player.updatea809Total = this_.a;
  }, "InfAmmo", "Never run out of ammunition", "g");
  var TriggerBot = new client.Hack(function (this_) {
    this_.geometry = new THREE.BufferGeometry();
    this_.geometry.setFromPoints([new THREE.Vector3(0, 0, 0),new THREE.Vector3(0, 0, 1)]);
    this_.material = new THREE.LineBasicMaterial({
        depthTest: false,
        depthWrite: false,
        fog: false,
    });
    this_.hitboxes = [];
  }, function () {
    var chunks = [];
    GAME.scene.children.forEach(function(e) {
      if(e.type == "Mesh") {
        chunks.push(e);
      }
    });
     var this_ = this;
     G.othera822ers.forEach(function (player) {
        if(player && player.a240 && !player.hitbox_triggerBot) {
          var hitbox = new THREE.Mesh(new THREE.BoxGeometry);
          hitbox.scale.set(3,10,3);
          hitbox.renderOrder = 9999;
          hitbox.material.depthTest = false;
          hitbox.material.transparent = true;
          hitbox.material.opacity = 0;
          player.hitbox_triggerBot = hitbox;
          this_.hitboxes.push(hitbox);
          player.a240.add(hitbox);
          hitbox.visible = true;
          hitbox.player = player;
        }
    });
    this.raycaster = this.raycaster || new THREE.Raycaster();
    this.raycaster.set(GAME.a865.player.camera.position, vec=new THREE.Vector3(),GAME.a865.player.camera.getWorldDirection(vec),vec);
    var result = this.raycaster.intersectObjects(this.hitboxes.concat(chunks));
    if(result[0] && result[0].object.player && result[0].object.parent) {
      G.Keybinds.shoot.a730=true
      setTimeout(function () {
        G.Keybinds.shoot.a730=false;
      }, 10);
    }
  }, function (this_) {
    this_.hitboxes.forEach(function (hitbox) {
       hitbox.parent.remove(hitbox);
       delete hitbox.player.hitbox_triggerBot;
     });
     GAME.pointerLockEnabled=false;
  }, "TriggerBot", "Shoots your gun when automatically there is a player under your crosshair", "no keybind");
  var ESP = new client.Hack(function (this_) {
    this_.hitboxes = [];
  }, function () {
    var this_ = this;
    G.othera822ers.forEach(function (e) {
      if(e &&e.a240 && !e.hitbox) {
          var geometry = new THREE.BoxGeometry();
          var edges = new THREE.EdgesGeometry(geometry);
          var hitbox = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({
              color: "red",
              fog: false,
              depthTest: false,
              transparent: true,
              opacity: 0.8,
              linewidth: 2
          }));
          hitbox.scale.set(3,10,3);
          hitbox.renderOrder=Infinity
          hitbox.position.y++;
          this_.hitboxes.push(hitbox);
          hitbox.player=e;
          e.hitbox=hitbox;
          e.a240.add(hitbox);
      }
    });
  }, function (this_) {
    this_.hitboxes.forEach(function (e) {
      e.parent.remove(e);
      delete e.player.hitbox;
    });
    this_.hitboxes = []
  }, "ESP", "See players through walls!", "h");
  var InfoHUD = new client.Hack(function (this_){
    if(!this_.HUD) {
      this_.HUD = document.createElement("div");
      this_.HUD.style = "position: fixed; top: 2vh; right: 15vw; background: linear-gradient(135deg, rgba(164, 115, 70, 0.9) 0%, rgba(107, 66, 38, 0.9) 100%); border: 2px solid #3D2317; border-radius: 10px; padding: 15px; width: 20vw; color: #f4e6d7; font-weight: 600; box-shadow: 0 4px 15px rgba(0,0,0,0.3);"
    }
    document.body.appendChild(this_.HUD);
    this_.HUD.style.display = "block";
    this_.kills = this_.kills || 0;
    this_.old = this_.old || 0;
  }, function () {
      this.HUD.innerHTML = "<div style='color: #d4a574; font-weight: bold; margin-bottom: 8px; text-align: center;'>📊 PLAYER INFO 📊</div>Player position: <span style='color: #d4a574;'>X "+Math.trunc(GAME.a865.player.position.x*100)/100+" Y "+Math.trunc(GAME.a865.player.position.y*100)/100+" Z "+Math.trunc(GAME.a865.player.position.z*100)/100+"</span><br>Connected to: <span style='color: #d4a574;'>"+G.socket.url.split("/")[2]+"</span><br>Total kills: <span style='color: #d4a574;'>"+(this.kills+GAME.a865.player.a649)+"</span><br><span style='font-size: 12px; opacity: 0.8;'>"+new Date().toGMTString()+"</span>";
      if(GAME.a865.player.a649 == 0) {
        this.kills += this.old;
      }
      this.old = GAME.a865.player.a649;
  }, function (this_) {
      this_.HUD.style.display = "none";
  }, "InfoHUD", "Nice HUD for valuable info!", "j");
  var NoFog = new client.Hack(function (this_) {
    this_.a = GAME.a865.scene.fog.far;
    GAME.a865.scene.fog.far = Infinity;
  }, function () {
 
  }, function (this_) {
    GAME.a865.scene.fog.far = this_.a;
  }, "NoFog", "Get rid of the fog", "no keybind");
  var ChatSpam = new client.Hack(function () {
 
  }, function () {
    document.getElementById("chat").value = crypto.randomUUID();
    var e = new a201;
    e.msg = GAME.chatInput.value;
    G.socket.send(e.a614());
  }, function () {
 
  }, "ChatSpam", "Spam the game chat", "no keybind", false);
  window.stophacks = new client.Hack(function () {
    client.Hacks.forEach(function (hack) {
      if(!hack.isEnabled) return
      hack.disable();
      document.getElementById(hack.name).style.background = "transparent";
      document.getElementById(hack.name).style.color = "rgba(255, 255, 255, 1)";
      document.getElementById(hack.name).style.fontWeight = "normal";
      document.getElementById(hack.name).style.textShadow = "none";
    });
  }, function () {
      stophacks.disable();
      document.getElementById(stophacks.name).style.background = "transparent";
      document.getElementById(stophacks.name).style.color = "rgba(255, 255, 255, 1)";
      document.getElementById(stophacks.name).style.fontWeight = "normal";
      document.getElementById(stophacks.name).style.textShadow = "none";
  }, function () {
 
  }, "Disable all hacks", "Disable all hacks", "z");
  //menu elements
  new client.MenuElement([Fly, WaterLevel, SpeedHack], "Movement", "0%", "0%");
  new client.MenuElement([RapidFire, InfAmmo, TriggerBot], "Combat", "25%", "0%");
  new client.MenuElement([ESP, InfoHUD, NoFog], "Render", "50%", "0%");
  new client.MenuElement([ChatSpam, stophacks], "Game", "75%", "0%");
  
  function tempLoop(){
    if(window.GAME) {
      client.inGame = true;
      client.preventKicks();
      GAME.disconnect=function(){if(!client.menuToggled){location.reload()}};
      try {
        var obj = JSON.parse(localStorage.config);
        client.Hacks.forEach(function (hack) {
         if(hack.name in obj) {
           hack.enable();
           document.getElementById(hack.name).style.background = "linear-gradient(135deg, #f4e6d7 0%, #e8d5c4 100%)";
           document.getElementById(hack.name).style.color = "#2C1810";
           document.getElementById(hack.name).style.fontWeight = "bold";
           document.getElementById(hack.name).style.textShadow = "1px 1px 2px rgba(0,0,0,0.2)";
         }
        });
      } catch (e) {}
      client.updateKeybindContent();
      return;
    }
    setTimeout(tempLoop, 1);
  }
  tempLoop();
  localStorage.config = localStorage.config || "{\"autoGG\":true}";
  client.MAIN();
};

// Socket message handler with auto-join message
let checkInterval = setInterval(() => {
    if (typeof(G) !== 'undefined' && typeof(G.socket) !== 'undefined' && G.socket !== null && G.socket.binaryType == "arraybuffer") {
        clearInterval(checkInterval);
        G.socket.onmessage = new Proxy(G.socket.onmessage || function(){}, {
            apply: function (target, scope, args) {
                var i = new DataView(args[0].data);
                let opcode = i.getUint8(0);
 
                if (opcode === G.a823.RPCMatchRemainingTime) {
                    var c, ratio;
                    (c = new RPCMatchRemainingTime).a615(i);
                    if (!client.server.time) {
                        client.server.r = 3;
                        var e = new a201();
                        e.msg = joinMessage;
                        G.socket.send(e.a614());
                        
                        // Show visual feedback that message was sent
                        client.messageSent = true;
                        client.showMessageStatus("✓ Join message sent to chat!", "#00ff00");
                        
                        // Reset after 10 seconds
                        setTimeout(() => {
                            client.messageSent = false;
                        }, 10000);
                    } else {
                        ratio = (Date.now() - client.server.time)/1000;
                        if (ratio >= 1)
                            client.server.r = ratio;
                    }
                    client.server.time = Date.now();
                }
 
                let data = target.apply(scope, args);
                return data;
            }
        });
    }
}, 1000);

client.init();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址