{"id":48666092,"url":"https://github.com/oxidized-mc/mc-types","last_synced_at":"2026-04-10T11:01:06.263Z","repository":{"id":348720431,"uuid":"1199551502","full_name":"oxidized-mc/mc-types","owner":"oxidized-mc","description":"Minecraft game types — BlockPos, Vec3, ResourceLocation, Direction, GameType, and more","archived":false,"fork":false,"pushed_at":"2026-04-02T22:55:49.000Z","size":55,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T02:36:00.878Z","etag":null,"topics":["block-pos","game-types","minecraft","minecraft-java","open-source","oxidized-mc","resource-location","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oxidized-mc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-02T13:14:39.000Z","updated_at":"2026-04-02T22:55:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/oxidized-mc/mc-types","commit_stats":null,"previous_names":["oxidized-mc/mc-types"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/oxidized-mc/mc-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidized-mc%2Fmc-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidized-mc%2Fmc-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidized-mc%2Fmc-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidized-mc%2Fmc-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxidized-mc","download_url":"https://codeload.github.com/oxidized-mc/mc-types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidized-mc%2Fmc-types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31639524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["block-pos","game-types","minecraft","minecraft-java","open-source","oxidized-mc","resource-location","rust"],"created_at":"2026-04-10T11:01:01.740Z","updated_at":"2026-04-10T11:01:06.258Z","avatar_url":"https://github.com/oxidized-mc.png","language":"Rust","readme":"# oxidized-mc-types\n\n[![CI](https://github.com/oxidized-mc/mc-types/actions/workflows/ci.yml/badge.svg)](https://github.com/oxidized-mc/mc-types/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nFoundational Minecraft game types for the [Oxidized MC](https://github.com/oxidized-mc)\necosystem — a Minecraft Java Edition implementation in Rust.\n\nThis crate provides type-safe coordinate systems, geometry primitives, game enums,\nand resource identifiers used throughout the Minecraft protocol and game logic.\n\n## Quick Start\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\noxidized-mc-types = \"0.1.0\"\n```\n\n```rust\nuse oxidized_mc_types::{BlockPos, SectionPos, Vec3, Direction, ResourceLocation};\n\n// Block positions with type-safe coordinate conversions\nlet block = BlockPos::new(100, 64, -200);\nlet section = SectionPos::from_block_pos(\u0026block);\nlet chunk = block.chunk_pos();\n\n// Entity positions with floating-point precision\nlet pos = Vec3::new(100.5, 64.0, -200.5);\nlet moved = pos.add_vec(\u0026Vec3::new(0.0, 1.0, 0.0));\n\n// Namespaced identifiers\nlet loc = ResourceLocation::new(\"minecraft\", \"stone\").unwrap();\nassert_eq!(loc.to_string(), \"minecraft:stone\");\n\n// Directions for block adjacency\nlet facing = Direction::North;\nlet opposite = facing.opposite();\n```\n\n## Type Reference\n\n### Coordinates\n\n| Type | Description | Components |\n|------|-------------|------------|\n| `BlockPos` | Block position in world space | `x, y, z: i32` |\n| `SectionPos` | Chunk section position | `x, y, z: i32` |\n| `GlobalPos` | Block position + dimension key | `BlockPos` + `ResourceKey` |\n| `ChunkPosExt` | Extension trait for `ChunkPos` | `x, z: i32` |\n| `Vec3` | Entity position / velocity | `x, y, z: f64` |\n| `Vec3i` | Integer 3D vector | `x, y, z: i32` |\n| `Vec2` | 2D float vector | `x, y: f32` |\n\n### Geometry\n\n| Type | Description |\n|------|-------------|\n| `Aabb` | Axis-aligned bounding box for collision detection and spatial queries |\n| `EntityDimensions` | Width/height dimensions for entity hitboxes |\n| `Rotations` | 3-float rotation for entity parts (head, arms, legs) |\n\n### Game Enums\n\n| Type | Description | Wire Format |\n|------|-------------|-------------|\n| `GameType` | Survival / Creative / Adventure / Spectator | VarInt (0–3) |\n| `Difficulty` | Peaceful / Easy / Normal / Hard | VarInt (0–3) |\n| `Direction` | Down / Up / North / South / West / East | VarInt (0–5) |\n| `Pose` | Entity pose (standing, sneaking, swimming, etc.) | VarInt (0–17) |\n| `ChatVisibility` | Full / System / Hidden | VarInt (0–2) |\n| `HumanoidArm` | Left / Right | VarInt (0–1) |\n| `ParticleStatus` | All / Decreased / Minimal | VarInt (0–2) |\n| `EquipmentSlot` | Main hand, off hand, armor slots, body | VarInt (0–7) |\n| `InteractionHand` | Main hand / Off hand | VarInt (0–1) |\n\n### Identifiers\n\n| Type | Description |\n|------|-------------|\n| `ResourceLocation` | Namespaced identifier (`minecraft:stone`) |\n| `ResourceKey\u003cT\u003e` | Typed registry key binding a `ResourceLocation` to a specific registry |\n\n### Interaction \u0026 Raycasting\n\n| Type | Description |\n|------|-------------|\n| `BlockHitResult` | Result of a block raycast (location, face, block position) |\n| `HitResultType` | Miss / Block / Entity discriminant |\n| `InteractionResult` | Outcome of a block or entity interaction |\n| `BlockState` | Opaque block state identifier (data resolution is the registry's job) |\n\n## Coordinate Conversions\n\n```text\n   Vec3 (f64)\n     │\n     ▼ floor components\n   BlockPos (i32)\n     │\n     ├──► SectionPos    (\u003e\u003e 4 on each axis)\n     │\n     └──► ChunkPos      (\u003e\u003e 4 on x/z, drops y)\n           │\n           └──► SectionPos  (with explicit y section)\n```\n\nAll conversions are provided as methods — use `block_pos.chunk_pos()`,\n`SectionPos::from_block_pos()`, etc. Never perform manual bit-shifts.\n\n## Wire Format\n\nAll game enums implement `read(\u0026mut Bytes)` and `write(\u0026self, \u0026mut BytesMut)`\nfor protocol wire encoding (VarInt). Coordinate types (`BlockPos`, `SectionPos`)\nsupport packed `i64` encoding matching the vanilla protocol format.\n\n## For Downstream Crate Authors\n\n- **Import types, not modules**: `use oxidized_mc_types::BlockPos;`\n- **Use conversion methods**: `block_pos.chunk_pos()` instead of manual `\u003e\u003e 4` shifts\n- **Don't match on struct fields**: Field layout may change in future versions\n- **Check `McTypesError`**: Construction/validation errors are returned via this enum\n\n## Contributing\n\nContributions are welcome! Please see the [Oxidized MC](https://github.com/oxidized-mc)\norganization for project-wide guidelines.\n\n## License\n\nLicensed under the [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxidized-mc%2Fmc-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxidized-mc%2Fmc-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxidized-mc%2Fmc-types/lists"}