resourcepack.ai
DOCS

Content

Liquids

A custom liquid is a pool of acid, a healing spring or a cursed lake: an area of water or lava that does something to whoever is in it, and can have its own colour.

What a custom liquid is

Minecraft only has water and lava, and a server can't add a third fluid. A custom liquid is real water or lava with your rules applied inside a box you mark out. It behaves like a fluid because it is one: you swim in it, boats float, it flows, and other plugins see water. What makes it acid is the box, not the blocks.

# liquids/acid.yml
acid:
  base: water            # water | lava
  color: "#3FBF4A"       # optional; keep the quotes
  effect: POISON
  amplifier: 1           # 0 is level I, 1 is level II
  damage: 1.0            # per second
  fireproof: false
FieldDefaultWhat it does
basewaterwater or lava: what it really is
colornone (the water keeps its colour)Hex or a dye name. See Colour
effectnoneA potion effect given while inside
amplifier0The effect's level, counting from 0 (0 to 255)
damage0Damage per second, on top of anything lava already does (0 to 100)
fireprooffalseWhether a lava-based liquid stops burning you
tagsnoneA list of labels, for your own plugin to read (LiquidInfo.tags())

Put the YAML in a liquids/ folder of your content folder (here mypack) and run /rp reload.

Making a pool#

There are two ways, and they make the same thing.

Mark out water that's already there#

These commands need you in game, and the rpengine.liquid permission.

/rp liquid corner              stand at one corner
/rp liquid fill mypack:acid    stand at the opposite corner
/rp liquid clear               remove the pool you're standing in
/rp liquid list                every pool, by world

The two corners make a box, and everything inside it that is the right fluid follows the liquid's rules. Lakes are rarely rectangular, so use several boxes. Where boxes overlap, the oldest pool wins.

Build it with a bucket#

# items/acid_bucket.yml
acid_bucket:
  material: BUCKET
  liquid: mypack:acid

Right-click a block and it places one source block and makes that spot part of the liquid. A block placed next to a pool of the same liquid joins it, so a pond built click by click (even by two people from opposite ends) ends up as one pool.

It's a real source block, so it flows. Water that runs outside the pool is plain water, so dig a basin as you would for vanilla water.

Colour#

color: takes "#3FBF4A", 0x3FBF4A, 3FBF4A, or a dye name such as RED, LIGHT_BLUE or LIME. Quote the # form: without quotes, YAML treats it as a comment and you get no colour and no error.

The game can only tint water by biome, so RP Engine paints the pool with a biome of its own. That has some side effects:

  • A new colour needs a server restart. The biomes go into a datapack in your world folder (datapacks/rpengine_liquids) and the server only reads them at startup. Until then the pool works but is the wrong colour.
  • It bleeds a little. Biomes are stored in 4×4×4 cells, so there's a rim of tinted water round the pool.
  • Small pools look paler. The game blends biome colours over several blocks, so a pool under about 8 blocks across never reaches its full colour, and players with a high biome blend setting see even less.
  • Colours come out muted, because the tint is multiplied by vanilla's dark water texture. A pack can ship a paler water_still texture to get brighter colours, but that makes every ocean on the server pale too, so RP Engine won't do it for you.

Clearing a pool paints it back to the biome that was there when it was made (one biome for the whole box).

Doing more than an effect#

effect and damage are applied every second. For anything else (a title, a sound, a quest step), listen for PlayerLiquidEvent, which fires when someone goes into a pool and again when they come out.