Add a configuration option to customize food values #490
-
It would be tremendously useful if configuration options to customize the hunger, saturation, and effects of every food item was added. food-levels:
bread:
hunger: 3
saturation: 2
cookie:
hunger: 5
saturation: 5
effects:
mining_fatigue:
duration: 20 # ticks
amplifier: 0
show-icon: false
show-particles: false
speed:
duration: 100
amplifier: 1 Edible blocks such as cake could also be included. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Implemented in build 1515, but perfected in build 1516 ;) This new Note about effects. To remove a vanilla effect you must specify a negative duration, or a 0.0 or negative chance. Here's all the options explained with comments: settings:
food-properties:
spider_eye: # the food to edit
nutrition: 2 # this is the amount of hunger points restored
saturation-modifier: 0.8 # The amount of saturation to restore. Equation used is "nutrition * saturation-modifier * 2"
is-meat: false # marks a food as edible for wolfs
can-always-eat: false # marks if this food can be eaten even at full hunger
fast-food: false # how long it takes to eat food (false: 32 ticks, true: 16 ticks)
effects: # list of all the effects to be applied when eaten (can have multiples, like golden enchanted apples)
poison: # effect to apply
duration: 100 # duration of effect (in ticks)
chance: 1.0 # chance for effect to be applied (0.0 - 1.0)
visible: true # shows particles
amplifier: 0 # amplification of effect
ambient: false # true to make particles less obtrusive on screen (like beacon effects)
show-icon: true # show effect icon on HUD Example of changing the nutrition value: settings:
food-properties:
apple:
nutrition: 8 Example of changing the duration of an effect: settings:
food-properties:
spider_eye:
effects:
poison:
duration: 200 Example of how to remove a vanilla effect: settings:
food-properties:
enchanted_golden_apple:
effects:
resistance:
duration: -1 I've taken the liberty to compile a list of all the vanilla food properties in this yaml format. It can be viewed at this gist: https://gist.github.com/BillyGalbreath/4fdfba991bd020e814eabf5143e3b225 |
Beta Was this translation helpful? Give feedback.
Implemented in build 1515, but perfected in build 1516 ;)
https://github.com/PurpurMC/Purpur/blob/b3042f20eb9abd16e43816c01111815d5ff2ea7f/patches/server/0261-Configurable-food-attributes.patch
This new
food-properties
section is built to be overrides. This means the option will be empty by default to get vanilla default values. Add a food that you want to override, and set only the values you want to override. Everything not overridden will remain at vanilla default values.Note about effects. To remove a vanilla effect you must specify a negative duration, or a 0.0 or negative chance.
Here's all the options explained with comments: