- Minecraft Account: Purchase a separate Minecraft Java Edition account for the bot (~$30)
- Docker: Docker and Docker Compose installed
- Minecraft Server: Paper server (latest version) recommended
- Streaming Key: YouTube or Twitch streaming key
- Free Azure Subscription: Required for Microsoft account authentication
git clone https://github.com/yourusername/Minecraft-Youtube-Follower.git
cd Minecraft-Youtube-FollowerPersonal Microsoft accounts need a free Azure subscription:
- Go to: https://azure.microsoft.com/free/
- Click "Start free"
- Sign up with your Microsoft account
- Verify phone number (credit card required for verification only - no charges)
- Go to: https://portal.azure.com
- Search "Azure Active Directory" → Click on it
- Click "App registrations" in the left menu
- Click "New registration"
- Fill in:
- Name:
MinecraftBot(or any name) - Supported account types: "Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox)"
- Leave redirect URI empty
- Name:
- Click "Register"
- Copy the "Application (client) ID" (a long GUID)
Enable Public Client Flows:
- Click "Authentication" in the left menu
- Scroll to "Advanced settings"
- Set "Allow public client flows" to "Yes"
- Click "Save"
Note: Xbox Live API permission is not available in standard Azure registrations and may not be required.
- Go to: https://help.minecraft.net/
- Search for "Java Edition Game Service API Review" or "API integration request"
- Find and fill out the application form
- Provide:
- Application name: MinecraftBot
- Purpose: Automated spectator bot for streaming
- Azure Client ID:
your-client-id-here - Description: Automated bot that follows players in spectator mode for 24/7 YouTube/Twitch streaming
- Submit and wait for Mojang approval (may take days/weeks)
✅ Once approved: Your application will be added to Mojang's allow list and authentication will work.
See MOJANG_API_APPROVAL.md for detailed instructions.
Copy the example environment file:
cp .env.example .envEdit .env with your settings:
# Minecraft Bot Configuration
MINECRAFT_USERNAME=your_bot_username
SERVER_HOST=your_server_ip
SERVER_PORT=25565
SPECTATOR_PORT=3000
# Azure Authentication
AZURE_CLIENT_ID=your-azure-client-id-here
# Streaming Configuration
STREAM_PLATFORM=youtube
YOUTUBE_STREAM_KEY=your_youtube_stream_key
# OR for Twitch:
# TWITCH_STREAM_KEY=your_twitch_stream_key
# Display Settings
DISPLAY_WIDTH=1920
DISPLAY_HEIGHT=1080
# Audio Mixing
VOICE_VOLUME_GAIN=2.0
GAME_MUSIC_VOLUME_GAIN=0.5
# Mumble Server
MUMBLE_PORT=64738
MUMBLE_SUPERUSER_PASSWORD=changemeEdit bot/spectator-bot.js and add coordinates of interesting builds:
const showcaseLocations = [
{ x: 0, y: 64, z: 0, description: 'Spawn' },
{ x: 100, y: 80, z: 200, description: 'Player Base 1' },
{ x: -150, y: 70, z: 300, description: 'Player Base 2' },
// Add more locations...
];docker-compose build
docker-compose up -dAfter Mojang approval, complete one-time authentication:
- Check logs:
docker-compose logs -f minecraft-spectator-bot - The bot will display a device code like:
To sign in, use a web browser to open the page https://www.microsoft.com/link and enter the code ABC123XYZ - Go to: https://www.microsoft.com/link
- Enter the code shown
- Sign in with your Microsoft account
- Grant permissions if prompted
Note: This is a one-time setup. After authentication, tokens are cached and the bot will connect automatically on future restarts.
- Go to YouTube Studio
- Click "Go Live" → "Stream"
- Copy your "Stream Key"
- Add it to your
.envfile
- Go to Twitch Creator Dashboard
- Settings → Stream
- Copy your "Primary Stream Key"
- Add it to your
.envfile
"Invalid app registration":
- Most likely: Missing Mojang API approval (see Step 3)
- Or: Azure app not configured correctly (check Step 2.3)
"Account does not exist in tenant":
- Azure app registered with wrong account type
- Solution: Re-register with "Accounts in any organizational directory and personal Microsoft accounts"
"invalid_grant":
- Public client flows not enabled
- Solution: Enable "Allow public client flows" in Azure app Authentication settings
- Verify
SERVER_HOSTandSERVER_PORTin.env - Check server allows the bot's IP address
- Ensure server doesn't require whitelist
- Check bot logs:
docker-compose logs minecraft-spectator-bot
- Verify streaming key is correct
- Check streaming service logs:
docker-compose logs minecraft-streaming-service - Ensure spectator bot viewer is accessible at http://localhost:3000
- Check Intel iGPU passthrough (Linux):
ls -la /dev/dri/
- Check Mumble server logs:
docker-compose logs minecraft-mumble-server - Verify port 64738 is accessible
- Test with Mumble client: connect to
localhost:64738
- Reduce stream quality in
docker-compose.yml:
DISPLAY_WIDTH=1280
DISPLAY_HEIGHT=720- Lower video bitrate in
streaming/streaming-service.py:
'-b:v', '2000k', # Reduced from 3000kdocker-compose pull
docker-compose build
docker-compose up -ddocker-compose restartdocker-compose down# All services
docker-compose logs -f
# Specific service
docker-compose logs -f minecraft-spectator-bot
docker-compose logs -f minecraft-streaming-service
docker-compose logs -f minecraft-mumble-server- Never commit
.envfile to git (already in .gitignore) - Keep streaming keys secret
- Use strong password for Mumble superuser
- Tokens are stored in
./bot/config/.auth(never commit this) - Consider firewall rules for exposed ports