Diet (Fabric/Forge/Quilt)

Diet (Fabric/Forge/Quilt)

6M Downloads

[Bug]: Having all food groups to near 100% gives hunger 4 effect

vAlpha3 opened this issue · 8 comments

commented

Minecraft Version

1.20.1

What happened?

Eating foods to max out the diet bars seems to have constantly given hunger 4 effect, so I am constantly dying of starvation. To be specific, this is on the latest "All of Fabric 7" mod pack. And the effect is from the diet mod as it shows in the effects list. I cannot find a config to change this. The food I was eating is the "Peanut Butter and Jam" sandwich from Croptopia, as it gave +3% to all 5 food groups.

How do you trigger this bug?

  1. Eat food to maximize food bars

...

Loader

Fabric

Loader Version

Fabric 0.14.25

API Version

Fabric API 0.91.0

Mod Version

Diet 2.1.1+1.20.1

Relevant Log Outputs

No response

commented

Happening in Forge 2.0.1*1.19.2 as well

commented

It seems to be linked to sugar because my fruits is not maxxed but I am getting this effect. Intentional?

commented

Ah just to note. it seems to occur when sugar is over 80%

commented

Yes. Sugar is bad for you.

Though UI really should be altered to indicate that.

commented

Here's a datapack that disables the hunger affect from sugar, though I feel like it would be better to have a version that if you have all of your other food groups above 50% it avoids hunger. Not sure how to do that though.

hungerless_diet.zip

  • Note created for Minecraft 1.19.2, using the datapack from this repo as the base, replace is set to true so at some point in the future if additional food groups are added it may be a problem.

Basic is the builtin.js file to this:

{
  "replace": true,
  "groups": [
    "fruits",
    "grains",
    "proteins",
    "sugars",
    "vegetables"
  ],
  "effects": [
    {
      "attributes": [
        {
          "name": "minecraft:generic.max_health",
          "operation": "add",
          "amount": 2.0
        },
        {
          "name": "minecraft:generic.attack_damage",
          "operation": "add",
          "amount": 2.0
        },
        {
          "name": "minecraft:generic.attack_speed",
          "operation": "multiply_total",
          "amount": 0.1
        }
      ],
      "conditions": [
        {
          "groups": ["proteins", "fruits", "vegetables", "grains"],
          "match": "all",
          "above": 0.8,
          "below": 1.0
        }
      ]
    },
    {
      "attributes": [
        {
          "name": "minecraft:generic.max_health",
          "operation": "add",
          "amount": 2.0
        },
        {
          "name": "minecraft:generic.knockback_resistance",
          "operation": "add",
          "amount": 0.10
        },
        {
          "name": "minecraft:generic.armor_toughness",
          "operation": "add",
          "amount": 1.0
        }
      ],
      "conditions": [
        {
          "groups": ["proteins", "fruits", "vegetables", "grains"],
          "match": "every",
          "above": 0.8,
          "below": 1.0
        }
      ]
    },
    {
      "attributes": [
        {
          "name": "minecraft:generic.movement_speed",
          "operation": "multiply_base",
          "amount": 0.25
        }
      ],
      "conditions": [
        {
          "groups": ["sugars"],
          "match": "all",
          "above": 0.8,
          "below": 1.0
        }
      ]
    }
  ]
}
commented

I mean, eating too much sugar is supposed to be detrimental… that’s the intended mechanic (afaik)… and it’s a good one, providing the further challenge of balancing sugar intake… not too much, not too little.

The real “problem” is food bar UI doesn’t communicate that well.

Perhaps the sugar bar should start using a different color, or a symbol for negative impact on health/hunger, from the amount forwards where it begins to be detrimental.

commented

I feel like saying too much sugar is bad for you ignores some of the realities of playing a video game under the guise of just saying "Sugar bad for you."

First 100% seems to suggest that it's already 100% of your daily intake of something, going above 100% means that you have more than you're daily allowed amount and sounds bad.

Additionally mod packs based around Create for example are hard to avoid Sugar, late game food sources are Honeyed Apples, Sweet Rolls, Chocolate Glazed Berries and Bars of Chocolate.

There is a potion based mod called Create Confectionery where it adds a stacking potion effect system based around creation convections that give you potion effects, all have sugar.

Farmer's Delight adds a potion effect based tea system that uses Honey as a method of increasing potion tiers / lengths.

Sugar as a straight punishment locks off certain aspects of the game.

If you were instead to say something like if you have a 'balanced' diet, so 3 or more food groups in good standing eating sugar doesn't give you the negative side effects, because you're eating your fruit and vegies you're allowed desert without a debuff.

I could write out a datapack for that but I feel like it would need a large number of conditions to achieve the effect?

Example, that cuts out the base template and only focuses on sugar, this example will avoid hunger if any group is above 50%:

    {
      "attributes": [
        {
          "name": "minecraft:generic.movement_speed",
          "operation": "multiply_base",
          "amount": 0.25
        }
      ],
      "conditions": [
        {
          "groups": ["sugars"],
          "match": "all",
          "above": 0.8,
          "below": 1.0
        }
      ]
    },
    {
      "status_effects": [
        {
          "name": "minecraft:hunger",
          "power": 3
        }
      ],
      "conditions": [
        {
          "groups": ["sugars"],
          "match": "all",
          "above": 0.8,
          "below": 1.0
        },
        {
          "groups": ["fruit"],
          "match": "all",
          "above": 0.0,
          "below": 0.5
        },
        {
          "groups": ["grain"],
          "match": "all",
          "above": 0.0,
          "below": 0.5
        },
        {
          "groups": ["protein"],
          "match": "all",
          "above": 0.0,
          "below": 0.5
        },
        {
          "groups": ["vegetables"],
          "match": "all",
          "above": 0.0,
          "below": 0.5
        }
      ]
    }

commented

Yes… that’s why sugar is meant to be balanced, (neither omitted or filled up on), as a game mechanic… of all the four categories, it’s the one that is in many in-game foods.

Removing the negative consequence of maxing sugar in-game is cheesing the intention of the mod.

The problem is the UI miscommunicates that mechanic.

(Though, of course, it is customizable as you’ve correctly pointed out)

IOW… the datapack “fix” is not a fix for a bug in the mod. It’s a totally valid customization for a modpack or one’s own world though.