<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Vectorized Velocity]]></title><description><![CDATA[<p dir="auto">Changes the velocity direction or strength based on the incoming packet or minecraft player's facing direction. Usually not useful unless you need to be flying sideways or <strong>your facing direction</strong>.</p>
<p dir="auto">Released js for LiquidBounce Nextgen 0.28.1, Licensed under GPLv3</p>
<pre><code class="language-javascript">

function __require(path) {
    if (path.startsWith("@embedded")) {
        return globalThis
    }

    if (path.startsWith("@minecraft-yarn-definitions/types/")) {
        return {
            [path.substring(path.lastIndexOf("/") + 1)]: Java.type(path
                .replaceAll("@minecraft-yarn-definitions/types/", "")
                .replaceAll("/", ".")
            )
        }
    }
    return require(path);
}
var exports = {}

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// imports
/* eslint-disable unused-imports/no-unused-imports */
const _embedded_1 = __require("@embedded");
const EntityVelocityUpdateS2CPacket_1 = __require("@minecraft-yarn-definitions/types/net/minecraft/network/packet/s2c/play/EntityVelocityUpdateS2CPacket");
/* eslint-enable unused-imports/no-unused-imports */
// DO NOT TOUCH ANYTHING ABOVE THIS LINE, also not sure why it didn't work
const script = _embedded_1.registerScript.apply({
    name: "vectorized-velocity-xz",
    version: "1.0.0",
    authors: ["commandblock2"]
});
script.registerModule({
    name: "vectorized-velocity-xz",
    description: "Port of the old script for legacy, for those anticheat that doesn't have proper velocity detection",
    category: "Combat",
    settings: {
        offsetBasedOnPlayerOrIncomingVelocity: _embedded_1.Setting.choose({
            name: "OffsetBasedOnPlayerOrIncomingVelocity",
            choices: ["player", "incoming"],
            default: "player"
        }),
        offset: _embedded_1.Setting.float({
            name: "AngleOffset",
            default: 0,
            range: [-180, 180]
        }),
        amplitude: _embedded_1.Setting.float({
            name: "Amplitude",
            default: 1,
            range: [-100, 100]
        })
    }
}, (mod) =&gt; {
    mod.on("packet", (event) =&gt; {
        if (!_embedded_1.mc.player)
            return;
        const packet = event.packet;
        if (packet instanceof EntityVelocityUpdateS2CPacket_1.EntityVelocityUpdateS2CPacket &amp;&amp; packet.entityId == _embedded_1.mc.player.id) {
            const yaw = mod.settings.offset.get() +
                (mod.settings.offsetBasedOnPlayerOrIncomingVelocity.getValue() == "player" ?
                    -_embedded_1.mc.player.yaw : (Math.atan2(packet.getVelocityX(), packet.getVelocityZ()) * 180 / Math.PI));
            const velocity = Math.sqrt(packet.getVelocityX() * packet.getVelocityX() + packet.getVelocityZ() * packet.getVelocityZ())
                * 8000 * mod.settings.amplitude.get();
            // graaljs traps here:
            // 1. it eats error here when we have loss in precision and does not update the value
            // 2. packet.velocityX and packet.getVelocityX() is very different (public double getVelocityX() { return (double)this.velocityX / 8000.0; })
            // and when reading velocityX graaljs calls getVelocityX() and when writing velocityX it directly writes that
            packet.velocityX = Math.round(velocity * Math.sin(yaw / 180 * Math.PI));
            packet.velocityZ = Math.round(velocity * Math.cos(yaw / 180 * Math.PI));
        }
    });
});
</code></pre>
<hr />
<p dir="auto">original typescript script, won't run directly in LiquidBounce, for more info, see <a href="https://github.com/commandblock2/minecraft-LBNG-types" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/commandblock2/minecraft-LBNG-types</a></p>
<pre><code class="language-typescript">// imports
/* eslint-disable unused-imports/no-unused-imports */
import {
    Setting,
    Vec3i,
    Vec3d,
    MathHelper,
    BlockPos,
    Hand,
    RotationAxis,
    mc,
    Client,
    RotationUtil,
    ItemUtil,
    NetworkUtil,
    InteractionUtil,
    BlockUtil,
    MovementUtil,
    ReflectionUtil,
    ParameterValidator,
    UnsafeThread,
    registerScript
} from "@embedded";
import { EntityVelocityUpdateS2CPacket } from "@minecraft-yarn-definitions/types/net/minecraft/network/packet/s2c/play/EntityVelocityUpdateS2CPacket";
/* eslint-enable unused-imports/no-unused-imports */
// DO NOT TOUCH ANYTHING ABOVE THIS LINE, also not sure why it didn't work


const script = registerScript.apply({
    name: "vectorized-velocity-xz",
    version: "1.0.0",
    authors: ["commandblock2"]
});

script.registerModule({
    name: "vectorized-velocity-xz",
    description: "Port of the old script for legacy, for those anticheat that doesn't have proper velocity detection", 
    category: "Combat",
    settings: {
        offsetBasedOnPlayerOrIncomingVelocity: Setting.choose({
            name: "OffsetBasedOnPlayerOrIncomingVelocity",
            choices: ["player", "incoming"], 
            default: "player"
        }),
        offset: Setting.float({
            name: "AngleOffset",
            default: 0, 
            range: [-180, 180]
        }),
        amplitude: Setting.float({
            name: "Amplitude",
            default: 1,
            range: [-100, 100]
        })
    }
}, (mod) =&gt; {
    mod.on("packet", (event) =&gt; {
        if (!mc.player)
            return;

        const packet = event.packet
        if (packet instanceof EntityVelocityUpdateS2CPacket &amp;&amp; packet.entityId == mc.player.id) {

            const yaw = mod.settings.offset.get() + 
            (mod.settings.offsetBasedOnPlayerOrIncomingVelocity.getValue() == "player" ? 
            -mc.player.yaw : (Math.atan2(packet.getVelocityX(), packet.getVelocityZ()) * 180 / Math.PI));

            const velocity = Math.sqrt(packet.getVelocityX() * packet.getVelocityX() + packet.getVelocityZ() * packet.getVelocityZ())
             * 8000 * mod.settings.amplitude.get();

            // graaljs traps here:
            // 1. it eats error here when we have loss in precision and does not update the value
            // 2. packet.velocityX and packet.getVelocityX() is very different (public double getVelocityX() { return (double)this.velocityX / 8000.0; })
            // and when reading velocityX graaljs calls getVelocityX() and when writing velocityX it directly writes that
            packet.velocityX = Math.round(velocity * Math.sin(yaw / 180 * Math.PI))
            packet.velocityZ = Math.round(velocity * Math.cos(yaw / 180 * Math.PI))

        }
    })
})
</code></pre>
]]></description><link>https://forum.liquidbounce.net/topic/8437/vectorized-velocity</link><generator>RSS for Node</generator><lastBuildDate>Fri, 08 May 2026 14:45:11 GMT</lastBuildDate><atom:link href="https://forum.liquidbounce.net/topic/8437.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Mar 2025 16:20:29 GMT</pubDate><ttl>60</ttl></channel></rss>