
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@magicyan/minecraft
Advanced tools
Functions to fetch data from various minecraft apis with typed data
Install with
npm install @magicyan/minecraft
pnpm install @magicyan/minecraft
yarn add @magicyan/minecraft
bun install @magicyan/minecraft
This package is a Starlight Skin API wrapper
Oficial Starlight Skin API Documentation : https://docs.lunareclipse.studio/
import { fetchSkinRender, fetchSkinInfo } from "@magicyan/minecraft";
// Fetch skin information for a player
const skinInfo = await fetchSkinInfo("Notch");
console.log(skinInfo);
// Generate a render URL
const result = await fetchSkinRender("Notch", "isometric", "full");
console.log(result.url); // URL to the rendered image
import { fetchSkinInfo } from "@magicyan/minecraft";
async function getSkinInfo() {
// You can use either a Minecraft username or UUID
const result = await fetchSkinInfo("Notch");
if (result.success) {
console.log("Player UUID:", result.playerUUID);
console.log("Skin URL:", result.skinUrl);
console.log("Cape URL:", result.userCape);
console.log("Skin Type:", result.skinType); // "slim" or "wide"
} else {
console.error("Error:", result.error);
}
}
import { fetchSkinRender } from "@magicyan/minecraft";
import fs from "node:fs";
async function saveSkinRender() {
const result = await fetchSkinRender("Notch", "default", "full");
if (result.success) {
// Save the image to a file
fs.writeFileSync("skin-render.png", result.buffer);
console.log("Saved render to skin-render.png");
} else {
console.error("Error:", result.error);
}
}
The library supports numerous render types, including:
default: Standard standing posewalking: Walking posecrouching: Sneaking poseisometric: Isometric view of the playerhead: Close-up of the player"s headsleeping: Player lying downdungeons: Minecraft Dungeons style poseultimate: Dramatic hero poseCheck the SkinRenderType type for all available options.
Each render type supports specific crop options:
full: Full body renderbust: Upper bodyface: Face onlyhead: Head only (available for some render types)skin render type:
default: Original skin textureprocessed: Processed skin texturebarebones: Basic skin textureconst options = {
camera: {
cameraPosition: { x: "15", y: "20", z: "-30" }, // Camera position coordinates
cameraFocalPoint: { x: "0", y: "18", z: "0" }, // Camera focus point
cameraWidth: 1200, // Image width
cameraHeight: 1200, // Image height
renderScale: 1.5, // Scale of the render
cameraFOV: 45, // Field of view
isometric: false, // Orthographic camera
dropShadow: true // Enable drop shadow
}
};
const options = {
lighting: {
dirLightPos: { x: "-10", y: "10", z: "-10" }, // Direction light position
dirLightColor: "ffffff", // Directional light color (hex)
dirLightIntensity: 1, // Directional light intensity
globalLightColor: "ffffff", // Global light color (hex)
globalLightIntensity: 0.5 // Global light intensity
}
};
const options = {
model: {
skinUrl: "https://example.com/custom-skin.png", // Custom skin URL
skinType: "slim", // "slim" or "wide"
capeTexture: "https://example.com/cape.png", // Custom cape texture
capeEnabled: true, // Enable/disable cape
playerModelShading: true // Enable shading on player model
}
};
// Default pose
const defaultResult = await fetchSkinRender("RinckoZ_", "default", "full");
// Walking pose
const walkingResult = await fetchSkinRender("RinckoZ_", "walking", "full");
// Isometric view
const isometricResult = await fetchSkinRender("RinckoZ_", "isometric", "full");
// Profile view (good for thumbnails)
const profileResult = await fetchSkinRender("RinckoZ_", "profile", "face");
const dramaticLightResult = await fetchSkinRender("RinckoZ_", "default", "full", {
lighting: {
dirLightPos: { x: "10", y: "10", z: "-5" },
dirLightColor: "ff9900", // Orange light
dirLightIntensity: 1.5,
globalLightColor: "0066ff", // Blue ambient light
globalLightIntensity: 0.7
}
});
A JavaScript/TypeScript library for interacting with Minecraft server information using the mcsrvstat API.
This library provides a simple interface to query Minecraft server status, retrieve server icons, and other relevant information. It's ideal for applications that need to check or display Minecraft server data in real-time.
This library uses the mcsrvstat.us service for server status information.
import { fetchServerStatus } from "@magicyan/minecraft";
// For Java Edition servers
async function checkServer() {
const serverInfo = await fetchServerStatus("hypixel.net");
if (serverInfo.online) {
console.log(`Server is online with ${serverInfo.players.online}/${serverInfo.players.max} players`);
console.log(`Running version: ${serverInfo.version}`);
} else {
console.log("Server is offline");
}
}
// For Bedrock Edition servers
async function checkBedrockServer() {
const serverInfo = await fetchServerStatus("play.nethergames.org", true);
// Process the result
}
import { isServerOnline } from "@magicyan/minecraft";
async function quickCheck() {
const online = await isServerOnline("hypixel.net");
console.log(online ? "Server is online!" : "Server is offline");
// For Bedrock servers
const bedrockOnline = await isServerOnline("play.nethergames.org", true);
}
import { fetchServerIcon } from "@magicyan/minecraft";
async function getServerIcon() {
const result = await fetchServerIcon("hypixel.net");
if (result.success) {
// Access the icon as a Buffer
const iconBuffer = result.data.buffer;
// Or use the direct URL
const iconUrl = result.data.url;
// Save to file, display in UI, etc.
} else {
console.error(`Failed to fetch icon: ${result.error}`);
}
}
Retrieving Minecraft player profiles, sessions, and related information using Mojang's API services.
This library provides functions to access Minecraft player data, including basic profile information, session details, skins, and capes. It's designed for applications that need to access or display Minecraft player information in a simple, type-safe way.
import { fetchMinecraftProfile } from "@magicyan/minecraft";
async function getPlayerProfile() {
const result = await fetchMinecraftProfile("RinckoZ_");
if (result.success) {
const profile = result.data;
console.log(`Player UUID: ${profile.id}`);
console.log(`Player Name: ${profile.name}`);
console.log(`Legacy Account: ${profile.legacy ? "Yes" : "No"}`);
console.log(`Demo Account: ${profile.demo ? "Yes" : "No"}`);
} else {
console.error(`Failed to fetch profile: ${result.error}`);
}
}
import { fetchMinecraftProfileSession } from "@magicyan/minecraft";
async function getPlayerSession() {
// First get the player UUID (or use it directly if you have it)
const profileResult = await fetchMinecraftProfile("RinckoZ_");
if (!profileResult.success) {
console.error("Could not find player");
return;
}
const uuid = profileResult.data.id;
const sessionResult = await fetchMinecraftProfileSession(uuid);
if (sessionResult.success) {
const session = sessionResult.data;
// Access skin URL
const skinUrl = session.properties[0]?.textures.SKIN?.url;
console.log(`Skin URL: ${skinUrl}`);
// Check if player has a slim skin model
const hasSlimModel = !!session.properties[0]?.textures.SKIN?.metadata?.model;
console.log(`Slim skin model: ${hasSlimModel ? 'Yes' : 'No'}`);
// Access cape URL if available
const capeUrl = session.properties[0]?.textures.CAPE?.url;
if (capeUrl) {
console.log(`Cape URL: ${capeUrl}`);
} else {
console.log('Player does not have a cape');
}
} else {
console.error(`Failed to fetch session: ${sessionResult.error}`);
}
}
Interacting with the Mush API to retrieve player statistics and leaderboard data for various Minecraft mini-games.
This library provides a set of functions to access player information, statistics, and leaderboards for the Mush Minecraft server. It supports various mini-games including BedWars, SkyWars, PvP, Murder, and more. The library is fully typed for a better development experience.
import { fetchMushPlayerInfo } from "@magicyan/minecraft";
async function getPlayerInfo() {
// Can use either player name or UUID
const result = await fetchMushPlayerInfo("RinckoZ_");
if (result.success) {
const player = result.data;
// Basic player information
console.log(`Username: ${player.account.username}`);
console.log(`UUID: ${player.account.uniqueId}`);
console.log(`Online Status: ${player.connected ? 'Online' : 'Offline'}`);
console.log(`First Login: ${new Date(player.firstLogin).toLocaleDateString()}`);
console.log(`Last Login: ${new Date(player.lastLogin).toLocaleDateString()}`);
// Player rank and tags
console.log(`Rank: ${player.rankTag.name} (${player.rankTag.color})`);
console.log(`Best Tag: ${player.bestTag.name} (${player.bestTag.color})`);
console.log(`Profile Tag: ${player.profileTag.name} (${player.profileTag.color})`);
// Accessing game stats (example for BedWars)
const bedwarsStats = player.stats.bedwars;
console.log(`BedWars Kills: ${bedwarsStats.kills}`);
console.log(`BedWars Wins: ${bedwarsStats.wins}`);
console.log(`BedWars KDR: ${bedwarsStats.fkdr}`);
} else {
console.error(`Failed to fetch player: ${result.error}`);
}
}
import { fetchMushLeaderboard } from "@magicyan/minecraft";
async function getLeaderboard() {
// Available games: "bedwars", "skywars", "pvp", "party", "hg", "murder", "quickbuilders", "ctf"
const result = await fetchMushLeaderboard("bedwars");
if (result.success) {
const leaderboard = result.data;
// Display top 5 players
console.log("=== Top 5 BedWars Players ===");
leaderboard.slice(0, 5).forEach((player, index) => {
console.log(`#${index + 1}: ${player.account.username} - Kills: ${player.get("kills")}, Wins: ${player.get("wins")}`);
});
} else {
console.error(`Failed to fetch leaderboard: ${result.error}`);
}
}
FAQs
Functions to fetch data from various minecraft apis with typed data
The npm package @magicyan/minecraft receives a total of 25 weekly downloads. As such, @magicyan/minecraft popularity was classified as not popular.
We found that @magicyan/minecraft demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.