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

Add support for destroying Blocks #5

Open
theaddonn opened this issue Nov 5, 2024 · 1 comment
Open

Add support for destroying Blocks #5

theaddonn opened this issue Nov 5, 2024 · 1 comment

Comments

@theaddonn
Copy link

There are a lot of ways to break blocks, but the Scripting API doesn't offer any direct way to destroy a block.
You surely can just run a command that makes this possible in the API, but adding a Polyfill for this might introduce the needed abstraction.

In my opinion a simple solution would be good enough, such as the following:

let block = world
    .getDimension("minecraft:overworld")
    .getBlock(Vec.from(0, 0, 0))
    .destroy({
        replacement: "air",
        drops: true,
        ...
     })

Would you consider this as useful/does this even make sense or is it just me being lazy and loving pretty abstractions?

@stirante
Copy link
Member

stirante commented Nov 8, 2024

Adding a new method to an existing type seems pretty annoying so that the autocomplete doesn't complain about it. It could fit into CommandUtils though.

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