josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
816 stars 108 forks source link

[Feature Request]: SNBT Support #383

Closed lexi-the-cute closed 5 months ago

lexi-the-cute commented 6 months ago

SNBT is like JSON, but slightly modified. It's popular in Minecraft

Here's an example from a pillager captain I spawned in from a spawn egg:

{Patrolling: 0b, DeathTime: 0s, CanJoinRaid: 1b, LeftHanded: 0b, OnGround: 1b, AbsorptionAmount: 0.0f, Attributes: [{Name: "minecraft:generic.follow_range", Modifiers: [{Amount: -0.039180928533448206d, UUID: [I; 1215692498, 439962954, -1670074562, 1719820189], Name: "Random spawn bonus", Operation: 1}], Base: 32.0d}, {Name: "minecraft:generic.movement_speed", Base: 0.3499999940395355d}], PatrolLeader: 1b, Invulnerable: 0b, Brain: {memories: {}}, HandDropChances: [0.085f, 0.085f], Rotation: [90.29369f, 1.3109567f], ArmorDropChances: [0.085f, 0.085f, 0.085f, 2.0f], HurtByTimestamp: 0, BalmData: {}, cardinal_components: {"apoli:powers": {Powers: []}}, cpaCooldown: 0, ArmorItems: [{}, {}, {}, {id: "minecraft:white_banner", tag: {display: {Name: '{"color":"gold","translate":"block.minecraft.ominous_banner"}'}, HideFlags: 32, BlockEntityTag: {id: "minecraft:banner", Patterns: [{Pattern: "mr", Color: 9}, {Pattern: "bs", Color: 8}, {Pattern: "cs", Color: 7}, {Pattern: "bo", Color: 8}, {Pattern: "ms", Color: 15}, {Pattern: "hh", Color: 8}, {Pattern: "mc", Color: 8}, {Pattern: "bo", Color: 15}]}}, Count: 1b}], Air: 300s, HandItems: [{id: "minecraft:crossbow", tag: {Damage: 0}, Count: 1b}, {}], UUID: [I; 1616929473, -1744089093, -1362354276, 1820004306], Inventory: [], Wave: 0, FallDistance: 0.0f, Fire: -1s, Motion: [0.0d, -0.0784000015258789d, 0.0d], Pos: [45.362032689844185d, 79.0d, -0.3426806318999793d], AABB: [45.062032677923256d, 79.0d, -0.6426806438209083d, 45.66203270176511d, 80.95000004768372d, -0.04268061997905037d], CanPickUpLoot: 0b, Health: 24.0f, HurtTime: 0s, FallFlying: 0b, PersistenceRequired: 0b, PortalCooldown: 0, cpadidTP: 0b}
josdejong commented 5 months ago

Thanks for your input, can you add your suggestion to the discussion about supporting JSON dialects in https://github.com/josdejong/svelte-jsoneditor/discussions/357?

josdejong commented 5 months ago

Closing this in favor of #357