Metadata-Version: 2.4
Name: mc-proxy-hypixel
Version: 0.1.0
Summary: Minecraft 1.8.9 proxy with packet injection — books, GUIs, scoreboards and more
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: cryptography>=41.0
Requires-Dist: aiohttp>=3.9
Requires-Dist: requests>=2.31

# mcproxy

A Minecraft 1.8.9 proxy (Protocol 47) with packet injection — connect to `localhost` and get forwarded to Hypixel (or any server) with extra features only you can see.

## Features

- Full online-mode MITM encryption (RSA + AES-CFB8)
- Zlib compression support
- **Readable book GUI** — open a custom Written Book the server never sees
- **Fake chest GUI** — custom inventory menus with named/lored items
- **Sidebar scoreboard** — client-side stats display
- **Tab-list header/footer** — custom text above/below the player list
- **Sound effects** — play any 1.8 sound at any position
- **Titles & action bar** — on-screen overlays
- **Chat injection** — local messages with full `§`/`&` colour code support
- Hook system — intercept incoming chat and player commands

## Install

```bash
pip install -r requirements.txt
```

## Quick start

```bash
python run.py
```

On first run it will prompt you to log in via `microsoft.com/link`.  
Your token is cached in `~/.mcproxy_auth.json` for future starts.

Connect your **1.8.9** client to `localhost:25565`.

### Force re-login

```bash
python run.py --reauth
# or
python tools/get_token.py --force
```

## Usage

Edit `run.py` to add your own commands, or copy from `examples/full.py`:

```python
from mcproxy import MinecraftProxy, named_slot

proxy = MinecraftProxy()

@proxy.player_chat
async def on_chat(conn, message: str):
    if message == "#hello":
        await conn.send_message("§ahello!")
        return True   # consume — don't forward to server
```

### All API methods

```python
# Chat / messages
await conn.send_message("§ahave a §egood §cday!")   # local only
await conn.send_message("Hello!", color="gold", bold=True)
await conn.send_chat("gg everyone")                  # sends as the player

# Titles & overlays
await conn.send_title("§6GG!", subtitle="§7well played")
await conn.send_action_bar("§eabove the hotbar")

# Book
await conn.open_book("§6Title", "Author", ["page one", "page two"])

# Chest GUI
from mcproxy import named_slot
await conn.open_chest("§8Menu", rows=3, items={
    4:  named_slot(160, "§aOption A", ["§7some lore"], damage=5),
    13: named_slot(160, "§cOption B", damage=14),
})

# Scoreboard
await conn.show_scoreboard("§6Stats", ["§eKills: §f10", "§eDeaths: §f2"])
await conn.clear_scoreboard()

# Sound
await conn.play_sound("random.levelup", x, y, z)

# Tab list
await conn.set_tab_list("§6§lProxy", "§7connected")
```

## Tools

| Script | Purpose |
|--------|---------|
| `tools/get_token.py` | Log in / refresh Microsoft auth |
| `tools/check_auth.py` | Show cached token details |
| `tools/clear_auth.py` | Delete cached token |

## Structure

```
mcproxy/
├── __init__.py      re-exports public API
├── auth.py          Microsoft device-flow authentication
├── chat.py          colour/format helpers  (mc_text, translate_codes, …)
├── connection.py    ProxyConnection  (protocol + injection API)
├── crypto.py        AESCipher, server_hash, session_join
├── nbt.py           NBT helpers + slot_item / named_slot
├── protocol.py      VarInt, PacketBuilder, PacketReader, Encrypted streams
└── proxy.py         MinecraftProxy  (server + hooks)

examples/
├── basic.py         minimal example
└── full.py          all features / in-game commands

tools/
├── get_token.py     standalone auth helper
├── check_auth.py    inspect cached token
└── clear_auth.py    delete cached token

run.py               main entry point (auth + proxy start)
```

## License

MIT
