Diet (Fabric/Forge/Quilt)

Diet (Fabric/Forge/Quilt)

6M Downloads

[Bug]: Syntax Question

Boolyman opened this issue ยท 6 comments

commented

What happened?

Could you provide me an example of what syntax to use for the Food Override line on the server config? I am currently using:

foodOverrides = ["tipsy:poobst;15", "tipsy:honeyken;15", "tipsy:coralslite;15"]

and it's not doing anything. I would like these three items to provide 15% towards that diet category's progress bar.

How do you trigger this bug?

n/a

Forge Version

36.2.23

Mod Version

1.16.5-1.0.2.3

Other Relevant Mod Versions

n/a

Relevant Log Outputs

n/a

commented

You have the syntax correct, but that's not quite what the config's purpose is. It doesn't strictly dictate how much percentage is given to a food's categories, rather it dictates a concept I call quality, which is equivalent to food points + (saturation modifier * food points). This concept is then used to calculate the Diet values in a more complicated formula.

Now, if you're seeing that it isn't doing anything, then it might be a bug. But I'd have to know a few things first. How much food/saturation do those items normally give? Have you already tagged them with appropriate Diet tags to categorize them? Do they normally show the tooltip and the percentage just isn't changing, or does the tooltip not show at all and you expected the config to change that?

commented

Those three foods weren't giving any bonus, despite the tooltip saying they would give 15%. It was probably an error on my end some where. I found a workaround by just making the game trigger the /add Diet command for the player when they eat it.

commented

Okay, if you've found a solution for your use-case then I'll close this issue for now.

commented

So if I DID want to reduce the percentage of bonus that a food gives, where could I do that?

commented

It's what you did above, the foodOverrides list. Each food has a certain quality, which is food points + (saturation modifier * food points). You can calculate the quality yourself using the stats of the food item, and then override it accordingly to how you want to reduce it.

As an example, say you want to reduce the dietary bonus of the vanilla apple by 50% (approximately). The apple has 4 food points and 0.6 saturation modifier, which means it has a quality of 4 + (0.6 * 4) = 6.4. Half of that is 3.2. Then you would just do:

foodOverrides = ["minecraft:apple;3.2"]
commented

gotcha, thanks!