Mango — gesture-controlled Minecraft using your webcam (no VR headset required)
Built in 12 hours at HelloHacks and awarded 1st place. Our goal: lower the barrier to “VR-like” experiences using only commodity hardware and open tools — no proprietary games or equipment. MineMotion uses computer vision to turn your whole body into a controller for vanilla Minecraft.
- No proprietary hardware: just a webcam and your PC
- Works with vanilla Minecraft (OS-level keyboard/mouse inputs)
- Full-body + hand gestures for gameplay and menus
- Built fast but thoughtfully: modular detectors, central coordinator, debug HUD
- Pose tracking:
cv/pose_tracking.pywraps MediaPipe Holistic and returns normalized landmarks for pose, hands, and face, plus draw helpers for the debug HUD. - Temporal state:
utils/state_manager.pykeeps a rolling history (≈30 frames) and exposes helpers for positions, velocity, acceleration, and relative measurements. - Gesture detectors: each file in
gestures/detects one gesture and returns an action payload. Examples:shield.py,mining.py,placing.py,movement.py,inventory.py,menuclose.py,cursor_control.py,attack.py,looking.py,hand_scroll.py. - Action coordination:
utils/action_coordinator.pyresolves conflicts and translates gesture events to concrete inputs viacontrols/keyboard_mouse.py(pynput). - Main loop:
main.pyties it together, shows a HUD, and handles hotkeys.
Gameplay
- Movement: walk-in-place to move; lean torso left/right to strafe. Backward is not yet implemented.
- Looking: head tilt/rotation moves the camera (mouse look).
- Attack: right-hand horizontal “punch” = left click.
- Mining: right-hand vertical “stab” transitions into hold left click.
- Place/Use: quick right-hand open sequence = right click.
- Shield: left forearm horizontal, forward at chest height = hold right click.
- Hotbar scroll: rotate open left hand to scroll up/down.
Menus
- Open inventory: left hand swipe left-to-right (as seen by you) enters menu mode and opens inventory.
- Close menu: left hand swipe right-to-left sends ESC and returns to gameplay.
- Cursor control: in menu mode, move the cursor with your right hand; pinch (thumb+index) to click.
Menu mode details and rationale: see MENU_MODE_BEHAVIOR.md.
Prereqs
- Python 3.11 (tested on 3.11.9)
- A webcam with decent lighting
Setup
pip install -r requirements.txtOS permissions for input control
- macOS: System Settings → Privacy & Security → Accessibility and Input Monitoring. Add your terminal/IDE and allow control.
- Windows: Run the script “as Administrator”. Some overlays or anti‑cheat can block simulated input.
python main.pyTips
- Camera selection: edit
main.pyif needed (cv2.VideoCapture(0)→ try1if you have multiple cameras). The HUD notes 0 = iPhone Continuity Camera, 1 = Mac camera. - Focus: ensure Minecraft has focus to receive OS input. The debug HUD is always-on-top for visibility.
Hotkeys (in the MineMotion window)
r— toggle gestures on/off (quick reset releases all inputs)d— toggle debug HUD overlaysc— capture neutral calibration pose (optional)q— quit
main.py— capture loop, detector orchestration, HUD, hotkeyscv/pose_tracking.py— MediaPipe Holistic wrapper and drawingutils/state_manager.py— temporal history and kinematics helpersutils/action_coordinator.py— maps gesture events to actions; manages gameplay vs menu modescontrols/keyboard_mouse.py— OS input viapynputwith safety and state trackinggestures/— one detector per gesture (see files listed above)
Additional docs
MENU_MODE_BEHAVIOR.md— what runs in menu mode and whyLOOKING_GESTURE_INFO.md— head-look details and tuningINVENTORY_FIX.md— fixes and safety around menu transitionsTROUBLESHOOTING.md— common issues and quick recovery
- Create detector in
gestures/
- Inherit
BaseGestureDetector - Use
GestureStateManagerfor positions/velocity; keep internal debounce state inself._state - Return a small action dict, e.g.
{'action': 'my_action', 'confidence': 0.8}
- Register in
main.py
- Instantiate and add to
gesture_detectors - If it competes with others on the same hand, add it to the left/right priority lists
- Handle in
ActionCoordinator
- Consume your action in the appropriate handler, release conflicting actions as needed
- Press
rto quickly reset (releases all inputs and clears errors) - Watch the HUD for the orange error banner and check the console stack trace
- See
TROUBLESHOOTING.mdfor OS-specific tips (e.g., macOS Accessibility, Windows Admin)
We wanted VR‑like immersion without the cost and lock‑in. MineMotion turns any webcam into a controller for a game you already own, keeping the experience open, accessible, and fun.
- MediaPipe Holistic (pose, hands, face) and OpenCV
- HelloHacks — built in 12 hours; awarded 1st place
- Designed for desktop Minecraft; other titles may work but aren’t tested
- Lighting and camera placement affect tracking quality
- Avoid online servers with anti‑cheat; MineMotion simulates inputs like a keyboard/mouse, but be respectful of game/server rules