VOOZH about

URL: https://minecraft.wiki/w/Template:Snbt

⇱ Template:Snbt – Minecraft Wiki


Template:Snbt

From Minecraft Wiki
Jump to navigation Jump to search
Documentation[view] [edit] [history] [purge]
This template uses Module:Snbt, a script written in Lua.

This template is used to display the SNBT in the same format as in the game.

{{snbt| {test_tag:123b} }}

Output: {test_tag:123b}

<nowiki> tag isn't required, but it is suggested.

{{snbt|<nowiki>{test_tag:'{"text":"123"}'}</nowiki>}}

Output: {test_tag:'{"text":"123"}'}

Supports escaping:

{{snbt|<nowiki>{test_tag:"1\"2\\\"3'4\\"}</nowiki>}}

Output: {test_tag:"1\"2\\\"3'4\\"}

The |background= or |bg= can be specified to improve readability.

|background=block:

{{snbt|<nowiki>{x: 0, y: 55, z: 0, Items: [{Slot: 0b, id: "clock", Count: 1b}, {Slot: 9b, id: "written_book", Count: 1b, tag: {pages: ['{"text":"\'twas brillig and the slithy toves"}', '{"text":"Did gyre and gimble in the wabe."}', '{"text":"All mimsy were the borogoves,"}', '{"text":"And the mome raths outgrabe."}'], author: "LewisCarroll", title: "Jabberwocky"}}], id: "enderchest and "}</nowiki>|bg=block}}
Output:
{x: 0, y: 55, z: 0, Items: [{Slot: 0b, id: "clock", Count: 1b}, {Slot: 9b, id: "written_book", Count: 1b, tag: {pages: ['{"text":"\'twas brillig and the slithy toves"}', '{"text":"Did gyre and gimble in the wabe."}', '{"text":"All mimsy were the borogoves,"}', '{"text":"And the mome raths outgrabe."}'], author: "LewisCarroll", title: "Jabberwocky"}}], id: "enderchest and "}

|background=inline or |background=1:

{{snbt|<nowiki>{id: "clock", Count: 1b}</nowiki>|bg=inline}}

Output: {id: "clock", Count: 1b}

|background=table:

{|class="wikitable"
| A || {{snbt|<nowiki>Id: [I;0,0,0,1]</nowiki>|bg=table}}
|}

Output:

A
Id: [I;0,0,0,1]

Please note that the input must follow the correct SNBT format to render properly; otherwise, bugs like the following may occur:

{{snbt|<nowiki>{test_tag:"\\"\\""}</nowiki>|bg=1}}

Output: {test_tag:"\\"\\""}

Templatedata

[edit source]

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
SNBT1

The SNBT would be displayed. It is suggested to add a <nowiki> tag.

Example
<nowiki>{test:"text"}</nowiki>
Stringrequired
Backgroundbackground bg

Adds a semi-transparent background to the displayed content to make it easier to read.

Suggested values
inline block table 1
Stringoptional
[view] [edit] [history] [purge]The above documentation is transcluded from Template:Snbt/doc.
Retrieved from "https://minecraft.wiki/w/Template:Snbt?oldid=2640408"

Navigation menu