хавайте 5 часов тестировки
Код:
const script = registerScript({
name: "fixed Spider(WallClimb) for matrix",
version: "3.3.7",
authors: ["fr1zehack"]
});
script.registerModule({
name: "WallClimb",
category: "Movement",
description: "wXsp fusion climb"
}, (m) => {
const B = Java.type("net.minecraft.util.math.Box");
const L = Java.type("net.minecraft.block.Block");
let t = 0;
function s(e, p) {
if (!p || e.shape.isEmpty()) return;
const y = e.pos.y, Y = p.pos.y;
if (t % 2 !== 0) return;
if (!(y >= Y || (p.isSneaking && p.onGround))) return;
const b = e.shape.boundingBox;
if (!b) return;
const d = 1e-5;
const q = new B(
b.minX + d, b.minY, b.minZ + d,
b.maxX - d, b.maxY, b.maxZ - d
);
e.shape = L.createCuboidShape(
q.minX * 16, q.minY * 16, q.minZ * 16,
q.maxX * 16, q.maxY * 16, q.maxZ * 16
);
}
function c(p) {
if (!p) return;
t++;
if (p.horizontalCollision && !p.onGround && t % 2 === 0) {
p.onGround = true;
p.velocity.y = 0.28;
} else if (!p.horizontalCollision) {
t = 0;
}
}
m.on("enable", () => {
t = 0;
});
m.on("blockShape", (e) => {
s(e, mc.player);
});
m.on("playerMovementTick", () => {
c(mc.player);
});
m.on("disable", () => {
t = 0;
});
});