diff --git a/docs/FAQ.md b/docs/FAQ.md index 8eba6d8..f0eb1e1 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -20,6 +20,18 @@ Get-AppxPackage -AllUsers | Where Name -Match ".*Minecraft.*" | Select Name,Inst Use the PackageFullName field in place of the `Microsoft.MinecraftUWP_8wekyb3d8bbwe` for the command above. +## Replit + +Replit may [not support](https://github.com/PrismarineJS/bedrock-protocol/issues/363) the necessary outbound UDP connections required to connect to a Minecraft server. For further assistance using Replit, please contact Replit support or consider using an alternative hosting service if hosting locally is not possible. + +Some alternatives: +* [Gitpod](https://www.gitpod.io/) + * Gitpod is a cloud development environment for teams to efficiently and securely develop software, right from your browser. +* [Github Codespaces](https://github.com/features/codespaces) + * A Codespace is a developer environment like Gitpod that's hosted in the cloud, accessed in your browser. +* [Google Colab](https://colab.research.google.com/) + * Google Colab is a Jupyter notebook environment. Jupyter notebook offer a Python environment where you can write, explain, visualize and execute code straight from a web-based developer environment. For more information on using Colab for JavaScript projects, see [Mineflayer on Google Colab](https://colab.research.google.com/github/PrismarineJS/mineflayer/blob/master/docs/mineflayer.ipynb). + ## Kicked during login NOTE: If you not receiving any errors, the error probably logged in debug mode which is not enabled. To enable it, set `process.env.DEBUG = 'minecraft-protocol'` to the top of the file diff --git a/src/rak.js b/src/rak.js index ace74af..fafe27c 100644 --- a/src/rak.js +++ b/src/rak.js @@ -68,7 +68,12 @@ class RakNativeClient extends EventEmitter { done(ret.extra.toString()) } }) - }, timeout, () => { throw new RakTimeout('Ping timed out') }) + }, timeout, () => { + if ('REPLIT_ENVIRONMENT' in process.env) { + console.warn('A Replit environment was detected. Replit may not support the necessary outbound UDP connections required to connect to a Minecraft server. Please see https://github.com/PrismarineJS/bedrock-protocol/blob/master/docs/FAQ.md for more information.') + } + throw new RakTimeout('Ping timed out') + }) } connect () {