Skip to content

Adding Sippables: JSON

Yoghurt4C edited this page Nov 28, 2020 · 1 revision

Adding Sippables - JSON

First, navigate to data/modid/sippables/. In this directory, create a JSON file - like yourcooljson.json.

Here's an example of how a valid entry might look like. All of the key:entry pairs inside the initial objects are optional, and these are their default values - which are automatically applied to the Sippable if you leave the pair out.

"fluid": {
    "hunger": 0,
    "saturation": 0,
    "damage": 0,
    "effects": {
      "effect": {
        "duration": "1t",
        "level": 0,
        "showParticles": true,
        "showIcon": true
      }
    }
  }

Let's go over all the elements you can fill up to create a valid Sippable for your fluids of choice.

"fluid" - JsonObject

The key to this object specifies the target fluid of the Sippable that's going to be created from inner entries. Valid formats:

"modid:id" - Specifies a single, specific fluid.
"#modid:id" - Specifies a fluid tag. The created Sippable will be applied to all fluids from this tag.
"id" - Specifies a fluid predicate. The created Sippable will be applied to any fluid found in the registry which matches said predicate, regardless of the modid.

"hunger" - JsonPrimitive, int

Specifies the amount of hunger shanks added to the player upon ingesting this Sippable.

"saturation" - JsonPrimitive, float

Specifies the amount of saturation added to the player upon ingesting this Sippable. Since it's a float, don't go too wild.

"damage" - JsonPrimitive, int

Specifies the amount of damage/healing applied to the player upon ingesting this Sippable. Negative values heal, positive values hurt. Obviously.

"effects" - JsonObject

A list of StatusEffects. Each entry within this object is also a JsonObject. Not to be confused with "effect" - those are individual effects, and there can be several of them!

"effect" - JsonObject

The key to this object specifies the StatusEffect that's going to be applied to the player upon ingestion of this Sippable. Valid formats:

"modid:id" - Specifies a single, specific StatusEffect.
"id" - Specifies a single, specific StatusEffect with the `minecraft` modid.

"duration" - JsonPrimitive, String

Specifies the duration of the StatusEffect. The letter at the end specifies how long the effect actually lasts.

Examples:
"1t" = 1 tick, effectively instant. Also the default value.
"1s" = 1 second (Equivalent of 20t).
"1m" = 1 minute (Equivalent of 1200t).
"1h" = 1 hour (Equivalent of 72000t).

"level" - JsonPrimitive, int

Specifies the level/amplifier of the StatusEffect. Friendly reminder that 0 is the default, and 1 is actually stronger than 0.

"showParticles" - JsonPrimitive, boolean

When false, this StatusEffect won't give off annoying particles around the player while it's active.

"showIcon" - JsonPrimitive, boolean

When false, this StatusEffect won't pop up on the IngameHUD effect tracker.

If you've read this and are still clueless, just look at the default Sippables JSON.