your current location:首页 > news>Minecraftjson meaning in Chinese how to use the Minecraftjson file

Minecraftjson meaning in Chinese how to use the Minecraftjson file

2024-12-17 06:01:46|Myriagame |source:minecraft skins

Original JSON text (Raw Json Text) is a format for Minecraft to send and display rich texts for players, and it can also be sent by commands and packets.Primitive JSON text is written in JSON.

Java Edition

The original JSON text consists of a chat composition.The structure itself has only one root object, but this root object can contain sub -objects, and these sub -objects can also have their own sub -objects, push according to this.Objects can include formats and interactive events, which will also be applied to their sub -objects.

The format of the chat component can be JSON string, JSON array or JSON object.Strings and arrays are used for long -drawn objects, as mentioned below.

The values ​​and Boolean values ​​in the chat component will be regarded as string processing.

Display the string of the original text directly.The effect is the same as the object with only label Text.For example, "a" and {"text": "a"} are equivalent.Contains a list of multiple text objects.The effect is the same as the text object containing the Extra array. [1] For example, ["a", "b", "c" and {"text": "A "," Extra ": [B", "C"]} is equivalent.A chat component.To take effect, it must include content components: Text, Translate, Score, Selector, KeyBind or NBT.It contains multiple components that are allowed, but only one will take effect. [2] Other components are optional.Content: Pure text Text: Display the original text directly.The contents inside will be righteous.Content: Translated text translate: The string containing the translation logo will display the corresponding text in the language selected by the player.If the corresponding translation is not found, you will check the corresponding translations in the EN_us.json .If it is not found, the identifier is directly output.The identifier is consistent with the identifier of the language file found from the ASSETS folder or resource package.With: Optional.The parameters in the list will be assigned to the variable in the translation.When there is no translate, ignore.The translation can include variables used in unknown text.These variables are defined directly in the identifier, which has nothing to do with the JSON object.Variables usually use %s (displaying the next parameter) or %1 $ s (display the first parameter; you can replace the 1 into it with it with it with it with it with it with it with it with it with it with it with it with it.Other numbers appear in the form of specified other parameters). [3] If the variable is not provided for a variable, the variable will not be displayed.Content: The value of the scoring board (needs to be parsed) SCORE: Show the current score of a holder under the specified score.If the designated holder or the score does not exist, or the holder does not be tracked by the score item, it will not display any content.Name: holders who are displayed in scores.You can use a specified name, selector or "*".If a selector, the selector cannot choose multiple entities.If you are *, the reader's own score will be displayed (for example, /Tellraw @a {"score": {"name": "*", "Objective": "Obj"}} will show each online player to show their scores in the "OBJ" goal). [4] objective: To display the internal name of the score of the score item.Value: Optional.If you exist, the value of the target will be covered with the value of this parameter.Content: physical name (need to be parsed) Selector: The string containing the target selector, showing the name of the selected player and the entity.If the selector finds multiple entities, the name of all the selected entities will be displayed, and the semi -angle comma is separated.When the name is suspended on the name, it will display tool tips containing names, types, and UUID; click on the name of a player's name will appear a private message for the player; press and hold ⇧ shift Click the playerThe name will be filled in the chat box; pressing ⇧ shift Click the name of the non -player entity to fill in the UUID into the chat box.Content: Key key position Keybind: The string containing the key position identifier will display the name of the button that operates the currently binding button.For example, if you use the default configuration, {"keybind": "key.inventory"} will display "E".Content: The value of NBT (needs to be parsed) NBT: The string containing a section of the NBT path is used to find the value of the specified NBT data label from the entity, block or storage.If the value is a string, it displays its content; other values ​​will be displayed as SNBT, without spaces and changes.If the value is a chat component, the display method is affected by Interpret.If multiple values ​​are found (usually caused by selecting multiple objects or paths, you can choose multiple values), and all values ​​will be displayed, and half -angle comma is separated.There are Block, Entity or Storage at the same time.It contains multiple components that are allowed, but only one will take effect.

[5] interpret: optional, the default "false".If you are specified as "True", you will try to consider each value obtained as the original JSON text chat component and analyze it.If the analysis fails, no content will be displayed.When there is no NBT, ignore it.Block: Specify the coordinates of the block entity of the NBT data tag.Coordinates can be absolute coordinates or relative coordinates.When there is no NBT, ignore it.ENTITITY: Specify the entity to obtain NBT data tags in the form of a target selector.When there is no NBT, ignore it.Storage: Specify the naming space ID of the command storage to obtain the NBT data label.When there is no NBT, ignore it.Sub -object Extra: The list of additional original JSON text objects displayed after the text.Sub -text object.The sub -object will inherit all the formats and interaction events of the parent object unless it is specified.Format COLOR: Optional, color used when rendering characters.The valid value is: Black , DARK_BLUE , DARK_GREEN , Dark_aqua , DARK_RED , DARK_PURPLE , GOLD , Gray , DARK_GAY , Blue , , GREEN , Aqua , Red , Light_purple , YELLOW , White and > reset Set to "#" will use a color defined in 6 -bit hexadecimal colors.Bold: Optional.Whether the text is rendered as a rough body.Italic: optional.Whether the text is rendered as an oblique body.The name name of the oblique body can also be used to cancel the oblique body by setting this value to "false".UnderLined: optional.Whether to draw a line for text.Strikethrough: Optional.Whether it is an additional delete line.Obfuscated: optional.Whether the text is fuzzy.FONT: Optional.Use font rendering text defined in the /FONT .The default Minecraft: Default .Separator law [New: 1.17]: Optional.Replace the symbols used when displaying multiple values ​​(default ",").Can be a string or another chat component.Interactive event INSERTION: Optional.When the player holds the

"Copy_to_clipboard": Copy the value into the clipboard.Value: specified URL, file path, information, command or page number.HOVEREVENT: Optional.Make a prompt text when the player is suspended on the text.Action: Prompt the type of text.The valid value is: "Show_text": Show the original JSON text object."Show_item": Show the prompt text of an item.The text is the same as the prompt text that appears on the item in the item bar."Show_entity": Show the name, type and UUID of the entity.Used in selector.Value: The format of this label depends on the value of Action.It is not recommended, please use Contents instead."Show_text": Another JSON text object.You can use string, array or object."SHOW_ITEM": Snbt string containing an item.See Player.dat format#object structure."Show_entity": contains a string of SNBT.It does not contain all physical data, and only has the name, type and UUID of the entity.Name: Optional, if you are not specified, hide this parameter.Specify the name of the entity and display it.Including JSON texts that will be parsed as text objects.If the string cannot be parsed as a text object, the entire prompt text will be displayed as "invalid entity!".Type: Optional, if you are not specified, hide this parameter.Specify the type of the entity.Including a pure text that will be regarded as a physical type, it can be any text.ID: Optional, if it is not specified, it is displayed as an empty line.Specify the UUID of the entity.Including a pure text that will be regarded as UUID, it can be any text.Contents: The format of this label depends on the value of Action."Show_text": Another JSON text object.You can use string, array or object."Show_item": the items to be displayed.ID: The named space item ID of items.If it is invalid, it is regarded as Minecraft: Air .Count: optional.Number of items.Tag: optional.NBT tags containing items.See Player.dat format#object structure."Show_entity": The entity to be displayed.Name: Optional, if you are not specified, hide this parameter.The original JSON text object that is displayed as a physical name.Type: Specify the type of the entity.It should be a named space entity ID.If it is invalid, it is considered Minecraft: Pig .ID: Specify the UUID of the entity.It should be an effective hexadecimal UUID connected by a connected character.Due to the existence of Extra tags, the above format can be recubled into very complicated and diverse string.However, JSON text does not have to be so complicated: almost all attributes are optional.

Parsing component

Some components ("Score", "Selector" and "NBT") will not always exist in the object.These contents will be analyzed: After obtaining the specified data from the world, the data will be converted into text components, and then this conversion component will be replaced with the original component.The analysis will be completed by the notice sign, the first opening of the book and using the command.It can also be completed through the loot table function "set_name" and "set_lore".Do not analyze these components by yourself in the custom name.

In addition, the analysis will be fixed.Therefore, the content of these components will no longer change, nor will they adjust the corresponding values ​​due to changes in the environment.

Base rock version

Unlike the Java version, the original JSON text in the base rock version is simpler and stricter.

Root tags.Rawtext: Contains a list of all text objects.Basic chat object.Text: The original text string that appears directly in the text.Ignore when there is translate.Selector: Picking "@a" directly in the text, "@s" and other selectors will be converted.Translate: Use the translation identification symbol displayed by the language selected by the player.This recognition symbol is the same as the identifiers found in the LANG file of the ASSETS file or material bag.With: a list containing the chat string parameter used by Translate.There is no effect in other cases.The text corresponding to the parameters used in the current language (for example, the first element in the list corresponds to "%% 1" in translate).Score score: The value in the score can be used in the text.Name: You can use "@S", "@A" and other target selection devices or pseudonym, which has nothing to do with Selector.If you are *, the reader's own scores will be displayed (for example, /Tellraw @a {"rawtext": [{"score": {"name": "*", "Objective ":" obj "}}]} shows each online player that they are scored in" OBJ ").Objective: Select the name of the name of the name of the score of the score.