8000 Block-automation getting x,y,z variables · Issue #144 · Zergatul/cheatutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Block-automation getting x,y,z variables #144

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

Closed
ChisleLP opened this issue May 19, 2025 · 4 comments
Closed

Block-automation getting x,y,z variables #144

ChisleLP opened this issue May 19, 2025 · 4 comments

Comments

@ChisleLP
Copy link
ChisleLP commented May 19, 2025

As it said in "note" of blockAutomation, You can get current block coordinates from x, y, z variables.

But when i try to save

"Ln 1, Col 30: The name 'y' does not exists in the current context."
And so going on.

Soo how am im suppend to use x,y,z?

I've copied this one from urs Example

if (math.abs(player.getY() - y) > 1) {
    return;
}
if (game.blocks.canBeReplaced(x, y, z)) {
    if (game.blocks.getId(x, y - 1, z) == "minecraft:farmland") {
        blockAutomation.useItem("wheat_seeds", "from-top");
    }
}

if (true && game.blocks.getId(x, y, z) == "minecraft:wheat") {
    if (game.blocks.getIntegerTag(x, y, z, "age") == 7) {
        blockAutomation.breakBlock();
    }
}

Using Neoforge 1.21.4
Mods are just:
AppleSkin
Automatic Tool Swap
CheatUtils 3.5.0
Cloth Config API
Freecam
Iris Shaders
Jade
Mouse Tweaks
Sodium
Xaero's World + Mini map

@ChisleLP ChisleLP changed the title Block-automation Block-automation getting x,y,z variables May 19, 2025
@Zergatul
Copy link
Owner

Interesting... you must be the first who uses block automation in neoforge 1.21+
Somehow it is broken here. I will check

@ChisleLP
Copy link
Author

Thanks :'D

For now im using alternativ way:

events.onTickEnd(() => {
    if (player.target.getBlockName() == "minecraft:farmland") {
        keys.use.click();
    } else if (player.target.getBlockName() == "minecraft:wheat") {
        if (game.blocks.getIntegerTag(player.target.getBlockX(), player.target.getBlockY(), player.target.getBlockZ(), "age") == 7) {
            keys.attack.click();
        }
    }
});

But i kinda dislike it, if i try to just build, it getting messed up. :P Hopefully you will find the Solution :3

@Zergatul
Copy link
Owner

Can you try fix: https://github.com/Zergatul/cheatutils/actions/runs/15121591956
Before it these variables were hidden under arg0, arg1, arg2 names

@ChisleLP
Copy link
Author

Sorry for late response, but ye, now it working :3 Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0