Skip to content

Conversation

TheSharkyOfficial
Copy link

Bad skin JSON sometimes occur with NPC players on servers, this will fix the JSON by adding missing quotes if found.

Example of JSON of a NPC player (notice the missing quotes) :

{textures:{SKIN:{url:"http://textures.minecraft.net/texture/b67168621fdb0cf3f7e57cb5166d48e9e9c87d677494339f3b8feec8c3a36b"}}}

For comparison, this is what a normal player skin data looks like :

{
  "timestamp" : 1754070097924,
  "profileId" : "ec7732e7890547fdae796508b583fef3",
  "profileName" : "wtfsofie",
  "signatureRequired" : true,
  "textures" : {
    "SKIN" : {
      "url" : "http://textures.minecraft.net/texture/c000d56909bcbb3542c65a2eb1b1c4810f907b277d041da2a1b16c894a96030c",
      "metadata" : {
        "model" : "slim"
      }
    },
    "CAPE" : {
      "url" : "http://textures.minecraft.net/texture/cb40a92e32b57fd732a00fc325e7afb00a7ca74936ad50d8e860152e482cfbde"
    }
  }
}```

Bad JSON sometimes occur with NPC players on servers
@extremeheat
Copy link
Member

That should be using mojangson

@rom1504
Copy link
Member

rom1504 commented Aug 2, 2025

@rom1504
Copy link
Member

rom1504 commented Aug 3, 2025

Please remove this custom parsing and use https://github.com/PrismarineJS/node-mojangson instead

Copy link
Contributor

@Omena0 Omena0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the linting errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants