Skip to content

Registering a fluid as a Liquid Fuel Type

techno-sam edited this page Nov 8, 2024 · 13 revisions

Important

We've seen a lot of bug reports about users' datapacks not working. So far, every single one has been caused by incorrect structure.
Make sure that to use data/mydatapack/railways_liquid_fuel/... instead of data/railways_liquid_fuel/...

How to add a new type

Adding a custom type is quite simple - just set up a basic datapack (more information here) and add some files under the data/⁠<namespace>/⁠railways_liquid_fuel directory. Files must end in .json but can be located in any sub-directory, as long as the full path does not violate Minecraft's ResourceLocation path check. The full specification for these JSON files can be found in the table below.

JSON Specification

Key Value Type Default Value Description
fluids string array N/A Each string represents the namespaced identifier of an fluid or tag that holds fluids that will have this type applied to it.
fuel_ticks integer 400 The amount of ticks of fuel time this the fluids above add to the timer, based on one tenth of a bucket, 100mb = 400 ticks by default (for context: 500 ticks is the default for lava buckets)
invalid boolean false Should this fluid type be marked as invalid and removed as a fuel type.

Other Information

The fluids array can contain either fluid id's minecraft:water or fluid tag id's #c:water.

Custom types will always override builtin types (types added through code), but behavior is undefined if multiple custom types define the same fluid. In the future, custom types defining the same fluid will override each other in alphabetical order.

Examples

data/example/railways_liquid_fuel/biofuel.json

{
  "fluids": [
    "createaddition:bioethanol",
    "garnished:peanut_oil"
  ],
  "fuel_ticks": 10
}

data/example/railways_liquid_fuel/steam.json

{
  "fluids": [
    "mekanism:steam"
  ],
  "fuel_ticks": 20
}

data/example/railways_liquid_fuel/water.json

{
  "fluids": [
    "#c:water"
  ],
  "fuel_ticks": 20
}

data/example/railways_liquid_fuel/remove_lava.json

{
  "fluids": [
    "minecraft:lava"
  ],
  "invalid": true
}

Clone this wiki locally