[go: up one dir, main page]

Skip to content

MinecraftのSNBTをparse, stringifyができます

Notifications You must be signed in to change notification settings

tsutoringo/snbt.js

Repository files navigation

snbt.js

Minecraft Wiki - SNBT

Example

Parse

import SNBT from './index.js';

let snbt = `{
  display:{
    Name:'{"text":"Apple"}',
    Lore:['{"text":"これはりんご"}']
  }
}`

snbt = SNBT.parse(snbt);

console.log(snbt);

Stringify

import SNBT from './index.js';

let snbt = `{display:{Name:'{"text":"Apple"}',Lore:['{"text":"これはりんご"}']}}`

snbt = SNBT.stringify(
  SNBT.parse(snbt),
  {
    indent: '\t'
  }
);

console.log(snbt);

参考

Sifue Blog

Releases

No releases published

Packages

No packages published