Skip to content

Set all blocks in an instance container into air #1855

Closed Answered by Codestech1
Codestech1 asked this question in Help
Discussion options

You must be logged in to vote

Again, found it by myself

instance.chunks.forEach {
    it.sections.forEach { sec ->
        sec.blockPalette().getAllPresent { x, y, z, value ->
            if (Block.fromStateId(value.toShort()) != Block.AIR) {
                gameInstance.setBlock(x, y, z, Block.AIR)
            }
        }
    }
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Codestech1
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Codestech1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants