Skip to content

Updated setCommandBlock's 3rd argument #3356

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

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

FlooferLand
Copy link
Contributor

@FlooferLand FlooferLand commented Apr 24, 2024

The 3rd argument is now a dict that needs users to set several options on the command block, not just a boolean called trackOutput.

Please consider dynamically generating the index.d.ts from now on.

This file is seemingly manually written as its outdated in some parts, compared to docs/api.md (which contains the latest docs).
This makes it very difficult to work with TypeScript, as some functions make no sense. I have spent 5 whole hours trying to figure out a way I could execute commands longer than 256 characters, being unable to set the command on the command block even after engineering 4 completely different methods of doing it, and I've only now just found out there's a convenient argument to the setCommandBlock to do just that.
I've spotted other cases where the completion is wrong earlier but I can't list any of them from the top of my head.

You could use JSDoc, and in fact you kind of should as it would also provide ordinary JavaScript users with completion. Then there are tools to automatically generate an index.d.ts from the JSDoc inside a project.

The 3rd argument is needed to set the options now
Copy link
Member

@extremeheat extremeheat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can try doing JSDoc -> TS generation, but I don't think this generation would work easy without alot of work with the present mineflayer codebase. mineflayer uses mixin-like logic which is not like conventional TS programs

@rom1504 rom1504 merged commit 04ad6db into PrismarineJS:master Apr 28, 2024
21 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants