commit
More MC renders
diff --git a/src/docs.ts b/src/docs.ts
index 3924a75..4d1c975 100644
--- a/src/docs.ts
+++ b/src/docs.ts
@@ -255,9 +255,9 @@ var GROUPS = [
id: "minecraft", name: "Minecraft", blurb: "Skins and Hypixel stats for a Minecraft account.",
endpoints: [
{ m: "GET", path: "/minecraft/general/:uuid", auth: "public",
- desc: "A player's Mojang identity: username, UUID (both dashed and short forms), skin and cape texture URLs, the skin's arm model (classic or slim), and ready-to-embed avatar / head / body render images. Returns 404 if no Minecraft account has that UUID.",
+ desc: "A player's Mojang identity: username, UUID (both dashed and short forms), skin and cape texture URLs, the skin's arm model (classic or slim), and a set of ready-to-embed mc-heads render images (face, head, body, player, combo, skin) — each render includes the overlay/hat layer, with `_flat` variants for the inner skin only. Returns 404 if no Minecraft account has that UUID.",
params: [["uuid", "Minecraft UUID — 32 hex characters, dashes optional."], ["?fresh / ?nocache / ?refresh", "Skip the cache and fetch fresh."]],
- example: 'GET /minecraft/general/853c80ef3c3749fdaa49938b674adae6 → { name, uuid, skin_url, cape_url, skin_model, render: { avatar, head, body } }' },
+ example: 'GET /minecraft/general/853c80ef3c3749fdaa49938b674adae6 → { name, uuid, skin_url, cape_url, skin_model, render: { face, face_flat, head, head_flat, body, body_flat, player, player_flat, combo, skin } }' },
{ m: "GET", path: "/minecraft/hypixel/:uuid", auth: "public",
desc: "A player's Hypixel stats: the full player object (network level and every game's stats — Bedwars, SkyWars, Duels, and the rest) plus their SkyBlock profiles. Always returns 200; the 'source' field tells you whether each section loaded ('ok') or why it's null — 'not_found' if the player has never joined Hypixel, 'unavailable' if this server isn't serving Hypixel data.",
params: [["uuid", "Minecraft UUID — 32 hex characters, dashes optional."], ["?fresh / ?nocache / ?refresh", "Skip the cache and fetch fresh."]],
diff --git a/src/minecraft.ts b/src/minecraft.ts
index 6013914..3381361 100644
--- a/src/minecraft.ts
+++ b/src/minecraft.ts
@@ -21,6 +21,7 @@ import type {
const MOJANG_PROFILE = "https://sessionserver.mojang.com/session/minecraft/profile";
const HYPIXEL_BASE = "https://api.hypixel.net/v2";
const CRAFTHEAD = "https://crafthead.net";
+const MCHEADS = "https://mc-heads.net";
const TTL_SECONDS = 300;
const USER_AGENT = "doughmination-restful/2.0 (+https://doughmination.uk)";
@@ -218,10 +219,23 @@ export async function getMinecraftGeneral(
skin_url,
skin_model,
cape_url,
+ // mc-heads renders the overlay (hat/jacket/second layer) by default, so the
+ // base URLs include the outer layer; the `_flat` variants append `/nohelm`
+ // to drop it and show the inner skin only. `face` is the 2D head, `head`
+ // the isometric 3D head, `body` the isometric 3D full body, `player` the
+ // flat front-facing full body, `combo` a face+body composite, and `skin`
+ // the raw texture PNG.
render: {
- avatar: `${CRAFTHEAD}/avatar/${short}`,
- head: `${CRAFTHEAD}/head/${short}`,
- body: `${CRAFTHEAD}/body/${short}`,
+ face: `${MCHEADS}/avatar/${short}`,
+ face_flat: `${MCHEADS}/avatar/${short}/nohelm`,
+ head: `${MCHEADS}/head/${short}`,
+ head_flat: `${MCHEADS}/head/${short}/nohelm`,
+ body: `${MCHEADS}/body/${short}`,
+ body_flat: `${MCHEADS}/body/${short}/nohelm`,
+ player: `${MCHEADS}/player/${short}`,
+ player_flat: `${MCHEADS}/player/${short}/nohelm`,
+ combo: `${MCHEADS}/combo/${short}`,
+ skin: `${MCHEADS}/skin/${short}`,
},
updated_at: Date.now(),
};
diff --git a/src/types.ts b/src/types.ts
index bc24915..fc06f72 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -436,8 +436,31 @@ export interface UnifiedMinecraftGeneral {
skin_model: "classic" | "slim" | null;
/** Raw cape texture file URL; null if the account has no cape. */
cape_url: string | null;
- /** Ready-to-embed render URLs from the public crafthead.net proxy. */
- render: { avatar: string; head: string; body: string };
+ /** Ready-to-embed render URLs from the public mc-heads.net proxy. Base URLs
+ * include the overlay (hat/jacket) layer; `_flat` variants show the inner
+ * skin only. */
+ render: {
+ /** 2D head, overlay on. */
+ face: string;
+ /** 2D head, overlay off. */
+ face_flat: string;
+ /** Isometric 3D head, overlay on. */
+ head: string;
+ /** Isometric 3D head, overlay off. */
+ head_flat: string;
+ /** Isometric 3D full body, overlay on. */
+ body: string;
+ /** Isometric 3D full body, overlay off. */
+ body_flat: string;
+ /** Flat front-facing full body, overlay on. */
+ player: string;
+ /** Flat front-facing full body, overlay off. */
+ player_flat: string;
+ /** Face + body composite. */
+ combo: string;
+ /** Raw skin texture PNG. */
+ skin: string;
+ };
updated_at: number;
}