Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config file weirdness on both single-player and dedicated server worlds #47

Closed
ThinkWithPbody opened this issue Apr 1, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@ThinkWithPbody
Copy link

ThinkWithPbody commented Apr 1, 2022

I basically turned off all features but the carrot mode with the following config:

food: {
// Expression that determines the food level to restore when eating a food item
// default: hungerValue
hunger: hungerValue
// Expression that determines the saturation modifier for a food item
// default: saturationValue
saturation: saturationValue
// Expression that determines the time requited to consume an item, given in ticks
// default: consumeDuration
consume-duration: consumeDuration
// Sets the amount of last eaten foods to use for the calculations in this category
// default: 20
// Must be greater or equal to 0
history-length: 20
}
carrot: {
// Enables the carrot style module.
// default: false
enable: true
// Specifies an offset in health points (half hearts) from default health.
// Default health in vanilla is 20 but that may change through mods like Origins.
// The resulting value will be floored before use.
// default: (0.6 * baseHealth) + max(2 * log2(uniqueFoodsEaten), 0)
health-formula: baseHealth + uniqueFoodsEaten
// Specifies the maximum number of health points (half hearts) a player can get to through carrot mode.
// When 0, carrot mode is effectively disabled. (Why would you do this? :P)
// When -1, you can gain a basically infinite amount of hearts.
// default: -1
// Must be inclusively between -1 and 200
max-health: -1
}

The settings some what work in a single-player world. The only problem is that the config line themselves are not respected when I load into a game, and I had to change the commented-out default values for them to work. It gets stranger.

When I take the same config file to the server, neither the config lines nor the default values change the default behaviour. Eating can take very long and will return little food value. Weirder still, the appleskin overlay shows the correct value (food retains their nutritions).

@ThinkWithPbody
Copy link
Author

As a side note, setting history-length to 0 causes single-player worlds to return Invalid Player Data upon loading, and causes the client to crash upon joining a server.

@ahbaker
Copy link

ahbaker commented May 25, 2022

For me the single player mode obeys the configs, but the server version does not. Additionally, when I force the server to create a new config file it generates one without the food section, as below.

{
// Edit the expressions that are used for calculating the player stats after respawning.
// Expressions are mathematical terms with the following variables:
// hunger is the amount of hunger the player had when dying
// saturation is the amount of hunger the player had when dying
respawn: {
// Expression that determines the hunger level after a fresh respawn
// default: max(14, hunger)
hunger: max(14, hunger)
// Expression that determines the saturation level after a fresh respawn
// default: saturation
saturation: saturation
// Sets whether the food history should be cleaned at death
// default: false
reset-history: false
// Sets whether the player's maximum hearts should be reset in carrot mode after death
// default: false
reset-carrot-mode: false
}
// The good ol' carrot style.
// Carrot style means, that you start with a certain amount of hearts and gain more by eating unique foods.
carrot: {
// Enables the carrot style module.
// default: false
enable: false
// Specifies an offset in health points (half hearts) from default health.
// Default health in vanilla is 20 but that may change through mods like Origins.
// The resulting value will be floored before use.
// default: (0.6 * baseHealth) + max(2 * log2(uniqueFoodsEaten), 0)
health-formula: (0.6 * baseHealth) + max(2 * log2(uniqueFoodsEaten), 0)
// Specifies the maximum number of health points (half hearts) a player can get to through carrot mode.
// When 0, carrot mode is effectively disabled. (Why would you do this? :P)
// When -1, you can gain a basically infinite amount of hearts.
// default: -1
// Must be inclusively between -1 and 200
max-health: -1
}
}

@Siphalor Siphalor added the bug Something isn't working label Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants