ChestScannerLib
MCDReforged library: scan and read container contents via player crosshair or coordinates
API
Installation command
!!MCDR plugin install chest_scanner_libAuthor
Repository
Synced at
...
Last update
...
Latest version
Total downloads
14
Back to catalogue
mcdr-chest-scanner
MCDReforged library plugin: retrieve chest contents by player's crosshair target or block coordinates, with double chest support.
Install
Declare as dependency in your plugin's mcdreforged.plugin.json:
{
"dependencies": {
"chest_scanner_lib": ">=0.1.0"
}
}
Dependencies
| Dependency | Type |
|---|---|
| MCDReforged >=2.14.0 | Plugin platform |
| MinecraftDataAPI | Player position/rotation (for find_targeted_chest) |
| hjson >=3.1 | Python package (pip install hjson) |
API
All functions return ({item_id: qty}, None) on success or (None, error_code) on failure.
High-level
find_targeted_chest(server, player, max_distance=6.0)
Scan the chest the player is looking at, with double chest merge.
items, err = find_targeted_chest(server, "Steve")
if err:
server.logger.warning(f"Scan failed: {err}")
scan_chest_rcon(server, x, y, z)
Scan chest at given coordinates, with double chest merge.
items, err = scan_chest_rcon(server, 10, 64, 20)
Low-level
| Function | Returns | Description |
|---|---|---|
detect_facing_type(server, x, y, z) | (facing, type) or None | Probe chest block state via execute if block |
read_double_chest(server, x, y, z, primary_items) | dict | Detect partner half + merge 54 slots |
expand_items(items, acc) | None | Recursively expand nested items (shulker boxes) into Counter |
parse_rcon_block_items(raw) | (list, None) or (None, err) | Parse RCON data get block response |
parse_block_coords(raw) | (x, y, z) or None | Extract coordinates from RCON response prefix |
Error codes
| Code | Meaning |
|---|---|
no_rcon | RCON not running or query failed |
no_api / no_pos | Cannot get player position (raycast only) |
not_container | Block is not a container |
not_found | No container in raycast range |
empty | Container is empty |
parse_error / unknown_format | SNBT parsing failed |
Implementation
- DDA voxel traversal (Amanatides & Woo) — raycast visits every block, no gaps
- Double chest merge —
execute if blockprobestype/facing, auto-merges 54 slots - Trapped chest support —
minecraft:chest+minecraft:trapped_chest - SNBT parsing — extracted from MinecraftDataAPI preprocessing + hjson
License
MIT
README source: README.md