JSON

JSON (JavaScript Object Notation) is a lightweight data-interchange format.

In Minecraft, JSON format is used to store the following data:


 * Text in written books, signs, custom names and the, , and commands.
 * The file  that describes a Java Edition resource pack and data pack.
 * The  that describes a Bedrock Edition add-on
 * Files in a resource pack that define models, sound events, and UI.
 * Files in a behavior pack the define entity behaviors.
 * Advancements and statistics (as )
 * The profile data for the Minecraft launcher (as )
 * Information about downloaded versions (as )
 * Files in a data pack that define advancements, loot tables, and tags.

Syntax
A JSON file must always contain opening and closing curly brackets which encapsulate all of the files data. All element names in a JSON file must be contained inside quotes. To define a value, a colon is used after the name, followed by a value. All elements except for the last element in an array or object should have a comma after their value.

Data types
There are 5 different data types in regular JSON: string, number, object, array, and boolean.

String
A string is defined by single or double quotes and can contain any combination of characters or spaces. Some special characters need to escape.

Number
A number is defined by entering in any number.

Object
An object is defined by opening and closing curly brackets and can contain any combination of any data types. The required curly brackets at the beginning and end of a file make an object.

Array
Arrays are defined by opening and closing square brackets and can, again, contain any data types.

Boolean
A boolean is very simple; it can be true or false.

JSON JSON JSON