Getting Started
After forking the repository, follow these steps to get the development environment running:Install Node.js
Ensure you have Node.js installed (tested on v22.x):Enable corepack:
If you get
Cannot find matching keyid, update corepack:Start Contributing
Read the Tasks Categories and Workflow sections below, then start coding!
Project Structure
The project consists of three main parts:1. Core (src/)
The main application source code that integrates all other parts.
Technology: Originally Webpack, migrated to Esbuild, now using Rsbuild.
Scripts:
src/- Main app source codesrc/react/- React components and UI- Almost all UI components are here
- Each component has a base (reused in app and storybook)
- Providers wrap components and supply context
- Check
DeathScreencomponent as an example
2. Renderer (renderer/)
Improved version of prismarine-viewer for rendering the game world.
Key Files:
renderer/viewer/lib/worldrenderer.ts- Adds objects to Three.js (sections)renderer/viewer/lib/models.ts- Prepares rendering data (blocks) in workerrenderer/playground/playground.ts- Playground for testing rendering
3. Storybook (.storybook/)
Tool for developing and testing React components in isolation.
Location: All stories are in src/react/**/*.stories.tsx
Scripts:
Development Scripts
Common Commands
Testing
Production Build
Architecture Details
How Modules Work
Mineflayer:- Provides the
botvariable - Wrapper for
node-minecraft-protocol - Used to connect and interact with Minecraft servers
- Not all events are exposed - sometimes need
bot._client.on('packet_name', ...) - Supports most mineflayer plugins
Tasks Categories
Contributions are welcome in these areas (ordered by current priority):1. Client-Side Logic (High Priority)
Everything related to client-side packets and server compatibility. Priority Tasks:- Rewrite or fix physics logic (use Botcraft or Grim as reference)
- Implement basic minecart/boat/horse riding
- Fix auto-jump module (false triggers, performance)
- Investigate connection issues with specific servers
- Set up automated testing against anti-cheat plugins
- Make more servers playable
- Fix anti-cheat detection issues
2. Three.js Renderer
Improve and fix rendering issues. Example Tasks:- Improve/fix entity rendering
- Update entities on specific packets
- Investigate performance issues
- Work on playground code
- Fix entity rendering issues (including position updates)
- Implement camera mode switching (first/third person)
- Add animated blocks
- Add armor rendering
setScissor)
3. Server-Side Logic
Contribute to Flying Squid fork (space-squid). Example Tasks:- Add missing commands (e.g.,
/scoreboard) - Basic physics (fall damage, falling blocks)
- Entity AI (spawning, attacking)
- PvP implementation
- Emit packets on specific events
- Make adventure maps playable
- Make most adventure maps playable
- Enable game completion from scratch (crafting, dimensions, terrain)
- Make Bedwars playable
4. Frontend/UI
Create new React components and improve UI (including mobile support). Examples:- New UI screens
- Mobile touch controls improvements
- Accessibility features
- Settings UI enhancements
Development Workflow
Identify the Problem
- Test on public server or local setup
- Create reproducible environment
- Document the issue
Debug and Isolate
- Use browser DevTools
- Enable packet logging if needed
- Use debugger to step through code
- Isolate the root cause
Making Protocol Changes
When working with Minecraft protocol:Protocol Documentation
- Latest version: wiki.vg/Protocol
- Previous versions: wiki.vg/Protocol_version_numbers
Generated Packet Files
src/generatedClientPackets.ts- Server → Client packetssrc/generatedServerPackets.ts- Client → Server packets
Linking Dependencies Locally
To test changes in dependencies like flying-squid:Updating Dependencies
Update Git Dependencies
Check and update git-based dependencies:This will:
- Show which git dependencies have updates
- Ask if you want to update them
- Skip dependencies in
pnpm.updateConfig.ignoreDependencies
Update PrismarineJS Packages
Update to latest versions:
minecraft-data(update version twice in package.json)mineflayerminecraft-protocolprismarine-blockprismarine-chunkprismarine-item
Development Tips
Fast Development Reload
Fast Development Reload
Press
Y in-game to reload the application into the same world/server.React Profiling
React Profiling
To enable React profiling:
- Disable
REACT_APP_PROFILINGcode first - Use React DevTools Profiler
Use the Debugger
Use the Debugger
VSCode has excellent debugging support. Use
--no-sources flag for faster source map parsing.Clear Cache
Clear Cache
If things don’t work after upgrading dependencies:
Production Testing
Production Testing
The same
dist folder is used for dev and prod builds. Test production builds before deploying.Testing Guidelines
Unit Tests
Location:**/*.test.ts files in src/ and renderer/
We’re working to improve test coverage. Contributions of tests are very welcome!
Cypress E2E Tests
Location:cypress/ folder
Pull Request Guidelines
- Let us know what you’re working on (GitHub issue or Discord)
- Test thoroughly before opening PR
- Allow maintainer edits when opening the PR
- Follow the workflow outlined above
- Add tests if possible
- Update documentation if needed
Getting Help
- GitHub Issues: Report bugs or request features
- Discord: Ask questions and discuss development
- Documentation: Check existing docs and code comments
Code Style
The project uses ESLint for code style:- TypeScript for all new code
- Follow existing patterns in the codebase
- Comment complex logic
- Use meaningful variable names
Useful Resources
- Mineflayer Documentation
- Minecraft Protocol Documentation
- Three.js Documentation
- PrismarineJS GitHub
Next Steps
- Debugging - Learn debugging techniques
- Proxy Setup - Set up development proxy
- Docker - Use Docker for development
Happy coding! If you have any questions, feel free to ask on GitHub or Discord.
