Commands

KubeJS TFC adds several commands which can be used for debugging or prototyping certain parts of scripts. They all require permission level 3 or higher to use

There are commands for:

List IDs

The list ids commands prints a list of data entries handled by a data type. Each entry can be clicked to describe it. Additionally, the results are printed in alphabetical order and paginated with ten entries per page. Below the printed list will be gold arrows, which can be clicked to see the previous or next page.

The command has the following form:

/kubejs_tfc list_ids <data_type> [<page>]

  • <data_type>: The data type to list entries of. Will take the form of <mod_id>.<type_name>. All data types will suggested.
  • [<page>]: A positive integer, the page to list. Will be clamped to last page of results. Optional.

An example: /kubejs_tfc list_ids tfc.fuels 2

Describe

The describe command prints a overview of the data contained in a data entry.

The command has the following form:

/kubejs_tfc describe <data_type> <id>

  • <data_type>: The data type to retrieve the entry from. Will take the form of <mod_id>.<type_name>. All data types will be suggested.
  • <id>: The id of the entry to describe. The ids of all entries handled by the data type will be suggested.

Example: /kubejs_tfc describe tfc.fuels tfc:coal

The search command prints a list of data entries which apply to a registry entry. Each entry can be clicked to describe it.

The command has the following form:

/kubejs_tfc search <data_type> <value>

  • <data_type>: The data type to retrieve the list from. Will take the form of <mod_id>.<type_name>. All data types will be suggested.
  • <value>: The registry id of the item/block/fluid/entity type that has a data entry in the data type. All objects that have data associated with them will be suggested.

Examples:

  • /kubejs_tfc search tfc.metals tfc:metal/copper
  • /kubejs_tfc search tfc.entity_damage_resistances minecraft:creeper
  • /kubejs_tfc search tfc.fertilizers tfc:powder/wood_ash

The print world settings command, as the name would suggest, prints the TFC Settings of the current level if its chunk generator is TFC-like1.

The command has the following form:

/kubejs_tfc print_world_settings

The rock layer settings within the TFC settings will not be printed, due to their tendency to fill the entire message history. Instead, ~~~ will be printed in yellow; this can be clicked to print them separately.

The print rock settings command, as one might imagine, prints the rock layer settings of the current level if its chunk generator is TFC-like1.

The command has the following form:

/kubejs_tfc print_rock_settings

The print chunk data command, as could be intuited, prints the server ChunkData of the current chunk in a somewhat readable format. Only the information available will be printed. That is to say, if the status is EMPTY, CLIENT (somehow), or INVALID, no additional information will be printed; and the surface and aquifer heights will only be printed if the status is FULL.

The command has the following form:

/kubejs_tfc print_chunk_data

Tree Solver

The tree solver command converts one or more in-world tree templates into trees which properly interact with TFC’s logging mechanic, primarily intended for making easily making tree structures for forests.

This command replaces template blocks in-world with the selected log and leaves blocks with the correct block state. There are three template blocks:

  • minecraft:light_blue_stained_glass: Marks a root position, or the bottom of a tree2. This is the only block that actually needs to be within the scan area. Must have a minecraft:brown_stained_glass block immediately above it; and for a <trunk_size> of 2, it should be in a two by two pattern.
  • minecraft:brown_stained_glass: Marks a log position. The solver climbs upwards from root marker breadth-first along this block. The solver can connect to any log marker in the 3 by 3 by 3 area centered at the current position, though the lowest order3 connection that can be made will be the one used.
  • minecraft:green_stained_glass: Marks a leaf position. Markers beyond the decay range of the leaves block will not be replaced.

All root positions with the scan area will be solved and converted into trees, though the command will fail to run if it encounters a root that does not have the same size as the <trunk_size> argument or a root marker does not have a log marker above it.

The command has the following form:

/kubejs_tfc tree_solver <trunk_size> <log_block> <leaves_block> <from> <to>

  • <trunk_size>: An integer, either 1 or 2, the trunk size of the templates to solve
  • <log_block>: A block. Is limited to and will only suggest blocks with TFC’s branch direction property. See the log block type for custom logs.
  • <leaves_block>: A block. Is limited to and will only suggest TFC leaves blocks. See the leaves block type for custom leaves.
  • <from>: A block position, one corner of the scan area. Supports relative positions.
  • <to>: A block position, the other corner of the scan area. Supports relative positions.
As an example
pre-solve
A tree template using the marker blocks. The tree solver command is typed in the chat box

post-solve
A tree, as solved from the template in the previous image

It can also handle rather strange forms
pre-solve
A tree template, though the log markers are in a large brick form

post-solve
A brick of logs as solved from the template in the previous image. Ostensibly, a tree

Inspect 2D Noise

The inspect 2D noise command displays the selected registered Noise2D in-world with the given parameters. In order to inspect a noise, it must be registered.

The command has the following form:

/kubejs_tfc inspect_2d_noise <from> <to> <input_range> <output_range> <noise>

  • <from>: A block position, one corner of the display area. Supports relative positions.
  • <to>: A block position, the other corner of the display area. Supports relative positions.
  • <input_range>: A range4, the range which the noise will be sampled over for the x and z axes.
  • <output_range>: A range4, the expected range for output values of the noise.
  • <noise>: The name of the noise to inspect.

This command fills space in-world by sampling the noise over the <input_range> in the largest x-z square bounded by the <from> and <to> positions’ x and z coordinates. The value of the noise at the sampled position will then be mapped to a y position within the bounds of <from> and <to> and white stained glass will be placed at that position. If the value is beyond the bounds of <output_range>, then red stained glass will be placed at the edge of the y-boundaries instead. If the value is infinite, then lime stained glass will be placed instead. If the value is NaN, then purple stained glass will be placed instead.

Inspect 3D Noise

The inspect 3D noise command displays the selected registered Noise3D in-world with the given parameters. In order to inspect a noise, it must be registered.

The command has the following form:

/kubejs_tfc inspect_3d_noise <from> <to> <input_range> <output_range> <noise> [<y_value>]

  • <from>: A block position, one corner of the display area. Supports relative positions.
  • <to>: A block position, the other corner of the display area. Supports relative positions.
  • <input_range>: A range4, the range which the noise will be samples over for the x, y, and z axes.
  • <output_range>: A range4, the expected range for output values of the noise.
  • <noise>: The name of the noise to inspect.
  • [<y_value>]: A number. If present, the 3D noise is treated as a 2D noise by only sampling it at the given this y-value, and placed in-world as if it were a 2D noise.

This command fills space in-world by sampling the noise over the <input_range> in the largest x-y-z cube bounded by the <from> and <to> positions’ x, y, and z coordinates. The value of the noise at the sampled position will then be mapped onto a gradient of stained glass, as described below, and the block will be placed at that position. If the value is beyond the bounds of <output_range>, then the positions will be filled with air.

The gradient, from lowest to highest, is represented as:

  • White Stained Glass
  • Pink Stained Glass
  • Red Stained Glass
  • Orange Stained Glass
  • Yellow Stained Glass
  • Lime Stained Glass
  • Light Blue Stained Glass
  • Light Gray Stained Glass
  • Gray Stained Glass
  • Cyan Stained Glass
  • Green Stained Glass
  • Blue Stained Glass
  • Magenta Stained Glass
  • Purple Stained Glass
  • Brown Stained Glass
  • Black Stained Glass
  1. Implements TFC’s `ChunkGeneratorExtension  2

  2. While this is the bottom of a tree, there is nothing preventing a branch from ‘drooping’ to heights lower than that of a root position 

  3. Order 1: share a face, order 2: share an edge, order 3: share a vertex 

  4. A pair of numbers  2 3 4