🔬 Dump#

#bs.dump:help

The dump module provides mechanisms for printing the state of any “variables”.


🔧 Functions#

You can find below all functions available in this module.


Dump Var#

#bs.dump:var {var:<values>}

Dump the content of given variables to the chat.

Inputs:

Function macro:

  • Arguments

    • var: Can be any structured data. The only requirement is that all values must be valid string paths to data or scores:

      • [data]: <entity|block|storage> <target> [<path>] [<depth>]

      • [score]: <target> <objective>

Example: View position scores as an array:

function #bs.position:get_pos {scale:1}
function #bs.dump:var {var: ["@s bs.pos.x", "@s bs.pos.y", "@s bs.pos.z"]}

Example: View an undefined score and the player recipe book (with a depth of 1):

function #bs.dump:var {var: {_: "foo bar", recipes: "entity @s recipeBook 1"}}

Important

Due to the implementation and its inherent constraints, it is necessary to escape values at the top level.

function #bs.dump:var {var: '"storage bs:const"'}

Credits: Aksiome


💬 Did it help you?

Feel free to leave your questions and feedback below!