New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

starlightskinapi

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

starlightskinapi

Starlight SkinAPI Wrapper

latest
Source
npmnpm
Version
1.0.10
Version published
Maintainers
1
Created
Source

Starlight SkinAPI Wrapper

This package is a Starlight SkinAPI wrapper

Oficial Starlight SkinAPI Documentation : https://docs.lunareclipse.studio/

Installation

npm install starlightskinapi

fetchSkinInfo function usage:

import { fetchSkinInfo } from "starlightskinapi";

async function main(){
    const playerNickname = "RinckoZ_";
    const infoResult = await fetchSkinInfo(playerNickname)

    if (infoResult.success){
        console.log(infoResult.playerUUID)
        console.log(infoResult.skinUrl)
        console.log(infoResult.userCape)
        console.log(infoResult.skinTextureWidth)
        console.log(infoResult.skinTextureHeight)
    }
}
main();

Output:

f169e30f110943dfba445da3b7dee1ce
http://textures.minecraft.net/texture/4d24cc4874ba673963ca57818a0be02666aa80f4747d00b45571e380ed9b54f7
http://textures.minecraft.net/texture/2340c0e03dd24a11b15a8b33c2a7e9e32abb2051b2481d0ba7defd635ca7a933
64
64

If the nick or uuid is not found, success will be false, and you will have the error property

async function main(){
    const playerNickname = "NicknameVeryLongAndUnlikely";
    const infoResult = await fetchSkinInfo(playerNickname)

    if (!infoResult.success){
        console.log(infoResult.error)
    }
}
main();

Output:

Unknown player username/uuid.

See how to get a render pose

import { RenderCrops, RenderTypes, fetchSkinRender } from "starlightskinapi";
import { writeFile } from "node:fs/promises"

async function main(){
    const playerNickname = "RinckoZ_";
    const renderResult = await fetchSkinRender(playerNickname, {
        type: RenderTypes.Default,
        crop: RenderCrops.Full,
    })

    if (!renderResult.success){
        console.log(renderResult.error)
        return;
    }

    if (renderResult.success){
        const { buffer, url } = renderResult;
        console.log(url) // 
        await writeFile("./render.png", buffer);
    }
}
main();

Output:

You can customize the model, camera and lighting options

import { RenderCrops, RenderTypes, fetchSkinRender } from "starlightskinapi";
import { writeFile } from "node:fs/promises"

async function main(){
    const playerNickname = "RinckoZ_";

    const renderResult = await fetchSkinRender(playerNickname, {
        type: RenderTypes.Default,
        crop: RenderCrops.Full,
        model: {
            capeEnabled: true,
            // ... other model options ...
        },
        camera: {
            cameraPosition: { x: "10", y: "10", z: "-20" },
            cameraWidth: 720,
            cameraHeight: 1080,
            // ... other camera options ...
        },
        lighting: {
            dirLightPos: { x: "-10", y: "10", z: "-10" },
            // ... other lighting options ...
        },
    });

    if (!renderResult.success){
        console.log(renderResult.error)
        return;
    }

    if (renderResult.success){
        const { buffer } = renderResult;
        await writeFile("./customized.png", buffer);
    }
}
main();

Output:

Full Render Type List

Render TypesSupported CropsPreview
DefaultFull, Bust, Face
MarchingFull, Bust, Face
WalkingFull, Bust, Face
CrouchingFull, Bust, Face
CrossedFull, Bust, Face
CrissCrossFull, Bust, Face
CheeringFull, Bust, Face
RelaxingFull, Bust, Face
TrudgingFull, Bust, Face
CoweringFull, Bust, Face
PointingFull, Bust, Face
LungingFull, Bust, Face
DungeonsFull, Bust, Face
FacepalmFull, Bust, Face
SleepingFull, Bust
DeadFull, Bust, Face
ArcherFull, Bust, Face
FacepalmFull, Bust, Face
MojavatarFull, Bust
UltimateFull, Bust, Face
IsometricFull, Bust, Face
HeadFull
BitzelFull, Bust, Face
PixelFull, Bust, Face
OrnamentFull
SkinDefault, Processed

Keywords

minecraft

FAQs

Package last updated on 16 Mar 2024

Did you know?

Socket

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.

Install

Related posts