See also: Tank Model.

Fluid cuboids are a JSON object used in many different loaders in Mantle and Tinkers’ Construct to specify the location of fluids in models or renderers. This page describes both the format for fluid cuboids along with common usages of them in Mantle and Tinkers’ Construct.

Format

A fluid cuboid is defined in JSON as follows:

  • (Object): The fluid cuboid object.
    • from (Vector): Start location of the cuboid.
    • to (Vector): End location of the cuboid.
    • faces (Object): Map of face direction to face data. If unset, equivelent to setting all 6 directions to an empty object.
      • <direction> (Object): A single fluid face. Key is one of six direction values.
        • rotation (Integer): Texture rotation in degrees, must be 0, 90, 180, or 270. If unset, defaults to 0.
        • flowing (Boolean): If true, uses the flowing fluid texture, which animates flow towards the texture bottom. If false (default), uses the still fluid texture.

Vector coordinates are in pixel values (that is, 1/16 of a block).

Block Fluids

For the format used from 1.16 to 1.19, see Fluids Model.

Block fluids are JSON files used since 1.20 to specify the location for fluids to render in a block fluid renderer. The block fluid located at assets/<domain>/mantle/model/block_fluids/<name>.json corresponds to the block ID <domain>:<name>. It has the following format:

  • (Object): A block fluid JSON.
    • variants (Object): Object containing a map from variant to fluids. Each key <variant> is a Block State Variant representing the block state properties that receive these fluids.
      • <variant> (String): Path to a template containing the fluid cuboids for this variant.
      • <variant> (Fluid Cuboid): Sets states matching the variant to contain a single fluid cuboid.
      • <variant> (Array): Sets states matching the variant to contain a list of fluid cuboid.

Block Fluids Template

Often, a set of fluid cuboids is the same for several different blocks or block states. In such cases, it is useful to create a template containing that information and reference it from the block state variant.

Templates are located in assets/<domain>/mantle/model/block_fluids/<name>.json for the template named <domain>:<name>. This directory is the same as the directory for block fluids, meaning its important that a template never be stored at the ID of a block. By convention, templates are placed in assets/<domain>/mantle/model/block_fluids/templates/ to avoid this problem (which makes the ID <domain>:templates/<name>).

Block fluid templates have either of the following formats:

  • (Fluid Cuboid): A JSON object represents a template containing a single fluid cuboid.
  • (Array): A JSON list represents a template containing a list of fluid cuboids.

Faucet Fluids

Faucet fluids are a JSON format defined in Mantle and used by Tinkers’ Construct and Ceramics to determine how to render the pouring animation in a block. The faucet fluid for the block ID <domain>:<name> is located in assets/<domain>/mantle/model/faucet_fluid/<name>.json (from 1.20 onwards) or in assets/<domain>/models/faucet_fluid/<name>.json (from 1.16 to 1.19). They have the following format:

  • (Object): A block fluid JSON.
    • variants (Object): Object containing a map from variant to fluids. Each key <variant> is a Block State Variant representing the block state properties that receive these fluids.
      • <variant> (String, since 1.20): Path to a template containing the data for this variant.
      • <variant> (Object): Faucet fluid data specified inline. Follows the same format as templates.

Default Faucet Fluid

The faucet fluid with location mantle:_default is treated as a template, used both as the default if a block has no faucet fluid data defined and allows simplifying the syntax to create faucet fluids.

Faucet Fluid Template

Faucet fluid data is specified in the following format:

  • (Object): A faucet fluid object.
    • side (Fluid Cuboid): Fluid cuboid to render when a faucet is facing sideways.
    • side (Array): List of fluid cuboids to render when a faucet is facing sideways.
    • center (Fluid Cuboid): Fluid cuboid to render when a faucet is facing downwards.
    • center (Array): List of fluid cuboids to render when a faucet is facing downwards.
    • continue (Boolean): If true, the fluid “passes through” the block and should also render in the block below. Defaults to false.

In addition, for any usages of templates other than the default faucet fluid, the following fields exist:

  • (Object): A faucet fluid object.
    • side (Number): Sets the side fluid to a copy of the default fluid with the specified lower bound in pixels.
    • center (Number): Sets the center fluid to a copy of the default fluid with the specified lower bound in pixels.
    • bottom (Number): Sets both the side and center fluids to a copy of the default fluids with the specified lower bound in pixels, assuming its not already set.

Since 1.20, templates may be defined under are located in assets/<domain>/mantle/model/faucet_fluid/<name>.json for the template named <domain>:<name>. This directory is the same as the directory for faucet fluids, meaning its important that a template never be stored at the ID of a block. By convention, templates other than the default are placed in assets/<domain>/mantle/model/block_fluids/templates/ to avoid this problem (which makes the ID <domain>:templates/<name>).

Channel Fluids

For the format used from 1.16 to 1.19, see Channel Model.

Channel fluids are used since 1.20 to define the location of fluids within a casting channel in Tinkers’ Construct or Ceramics. Channel fluids are defined underassets/<domain>/mantle/model/channel_fluids/<name>.json for the block or template named <domain>:<name>. They have the following format:

  • (Object): A channel fluid object.
    • parent (Resource Location): If set, loads properties from the channel fluid template at the specified location for any properties not set in this JSON.
    • down (Fluid Cuboid): Fluid cuboid to when the channel is pouring down.
    • center (Object): Fluid to render in the center of the channel.
      • still (Fluid Cuboid): Fluid to render when the center is not moving.
      • still (Fluid Cuboid): Fluid to render when the center is moving. Will be rotated the proper direction.
    • side (Object): Fluid to render on each of the four sides of the channel.
      • still (Fluid Cuboid): Fluid to render when the side is still.
      • edge (Fluid Cuboid): Fluid to render when there is no fluid entering or exiting that side.
      • in (Fluid Cuboid): Fluid to render when fluid is pouring in from that side.
      • out (Fluid Cuboid): Fluid to render when fluid is pouring out from that side.