The player to whom the message will be sent. Can be a Player
or executeCommandPlayerW
instance.
The value to be serialized into a JSON string and sent as a message.
Optional
space: string | numberOptional. Specifies the number of spaces or a string to use for indentation in the JSON output.
The function attempts to serialize the value
into a JSON string after making all of its properties enumerable. It uses the JSONB library which provides custom handling for various data types
(e.g., bigint
, Infinity
, NaN
, etc.). If the serialization fails, it falls back to not make the properties enumerable.
The resulting JSON string is then sent as a message to the specified player.
Sends a JSON-formatted message to a player with formatting.