PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
4.95k stars 906 forks source link

Add autocompletion for the "version" argument in createBot's options #2053

Open TheBlueBurger opened 3 years ago

TheBlueBurger commented 3 years ago

Is your feature request related to a problem? Please describe.

This solves needing to go to the README when wanting to see the supported versions, or accidentally use a unsupported version

Describe the solution you'd like

In index.d.ts, override the node-minecraft-protocol's "version" argument and replace it with a type of "1.16" | "1.16.1", etc

Describe alternatives you've considered

Going to the README each time to check

Additional context

None

autowert66 commented 3 years ago

Isn't this an issue related to minecraft-protocol? I mean mineflayer.BotOptions extends ClientOptions from minecraft-protocol.

mineflayers BotOptions Interface: ```ts import { Client, ClientOptions } from 'minecraft-protocol' ... export interface BotOptions extends ClientOptions { logErrors?: boolean hideErrors?: boolean loadInternalPlugins?: boolean plugins?: PluginOptions chat?: ChatLevel colorsEnabled?: boolean viewDistance?: ViewDistance mainHand?: MainHands difficulty?: number chatLengthLimit?: number physicsEnabled?: boolean client?: Client brand?: string } ```
minecraft-protocol ClientOtions interface: ```ts export interface ClientOptions { accessToken?: string; checkTimeoutInterval?: number; clientToken?: string; customPackets?: any; hideErrors?: boolean; host?: string; keepAlive?: boolean; password?: string; port?: number; username: string; version?: string; skipValidation?: boolean; stream?: Stream; connect?: (client: Client) => void; agent?: Agent; auth?: "mojang" | "microsoft"; id?: number; } ```
u9g commented 3 years ago

Why cant you just not put it and let the server decide?