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

Look into Captured Statement error #150

Open
kindlich opened this issue Jun 2, 2024 · 0 comments
Open

Look into Captured Statement error #150

kindlich opened this issue Jun 2, 2024 · 0 comments
Labels
bug Something isn't working CraftTweaker All Issues that are needed by CraftTweaker
Milestone

Comments

@kindlich
Copy link
Member

kindlich commented Jun 2, 2024

CTEventManager.register<RightClickBlockEvent>((event) => {
    var level = event.player.level;
    var pos = event.hitVec.blockPos;
    var block = level.getBlockState(pos);
    level.schedule()
        .sleep(20)
        .run((level) => {
            level.setBlockAndUpdate(event.hitVec.blockPos, <blockstate:minecraft:dirt>);
        })
        .sleep(20)
        .run((level) => {
            level.setBlockAndUpdate(pos, <blockstate:minecraft:grass_block>);
        })
        .sleep(20)
        .run((level) => {
            level.setBlockAndUpdate(pos, block);
        })
        .build();
});

gives a captured statement error

@kindlich kindlich added bug Something isn't working CraftTweaker All Issues that are needed by CraftTweaker labels Jun 2, 2024
@kindlich kindlich added this to the Refactor milestone Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CraftTweaker All Issues that are needed by CraftTweaker
Projects
None yet
Development

No branches or pull requests

1 participant