Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]Waypoints For LiquidBounce Nextgen #5303

Open
liquidbounce-thebestclient opened this issue Jan 13, 2025 · 0 comments
Open

[FEATURE]Waypoints For LiquidBounce Nextgen #5303

liquidbounce-thebestclient opened this issue Jan 13, 2025 · 0 comments
Labels
🔥 enhancement New feature or request 🌑 nextgen

Comments

@liquidbounce-thebestclient

LiquidBounce Branch

Nextgen

Describe your feature request.

Waypoints likes 2b2t clients idk.

it's hard to remember your base underground , but with waypoints , that's helpful
module goes like render a tag above the position , and the tag contains display the distance to position, position xyz ,and a mark
the mark scale change with the distance

Additional context

pls build waypoints

i'm trying to scripting like waypoint, but i failed,here is my script:

/**

  • LiquidBounce NextGen Waypoints Script
  • 实现指定坐标的标签显示功能
    */

// 配置部分

const waypoints = [
{ x: 100, y: 64, z: 100, name: "Waypoint1" },
{ x: 200, y: 70, z: 200, name: "Waypoint2" },
]; // 自定义目标点
const maxDistance = 50; // 最大显示距离
const tagColor = "\u00a7a"; // 标签颜色

// 计算两点之间的距离
function calculateDistance(x1, y1, z1, x2, y2, z2) {
return Math.sqrt(
Math.pow(x2 - x1, 2) +
Math.pow(y2 - y1, 2) +
Math.pow(z2 - z1, 2)
);
}

// 渲染逻辑,每帧调用
mc.thePlayer.renderWorldCallback = () => {
const player = mc.thePlayer;

if (!player) return; // 玩家未加载时跳过渲染

waypoints.forEach((waypoint) => {
    const distance = calculateDistance(
        player.posX,
        player.posY,
        player.posZ,
        waypoint.x,
        waypoint.y,
        waypoint.z
    );

    if (distance <= maxDistance) {
        const screenPos = Renderer.worldToScreen(
            waypoint.x + 0.5,
            waypoint.y + 0.5,
            waypoint.z + 0.5
        );

        if (screenPos) {
            Renderer.drawStringWithShadow(
                `${tagColor}${waypoint.name} [${Math.floor(distance)}m]`,
                screenPos.getX(),
                screenPos.getY(),
                0xFFFFFF
            );
        }
    }
});

};

idk did the script api change?

@github-actions github-actions bot added 🌑 nextgen 🔥 enhancement New feature or request labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔥 enhancement New feature or request 🌑 nextgen
Projects
None yet
Development

No branches or pull requests

1 participant