Closed SwanX1 closed 1 year ago
Related to: #6
@nekomaster1000 @Dariensg I'd like your opinions and approval on this.
It looks good to me honestly! This is what I was proposing in solution to #6.
The one change I might have, if possible, is that the wildcard effects all, including things with an existing entry, as long as the entry doesn't have that specific field set itself. So like, if you have baked potato with an effect set but no eat duration set, the wildcard eat duration would still affect that. But if carrot has a specific eat duration set, wildcard won't take precedence there. I'm not sure how possible this is, but it would make things easier for people that want to set a global eat duration, but also have effects for a large number of food.
The other question I have is what if people want a global effect on all food items but then also for individual food items to have specialized effects in addition to this? Would there be a good way to use a wildcard effect without it getting overwritten by the specialized effects. I know you could just add the wildcard effect to all the specialized arrays as well, but I'm just trying to think of ways to eliminate as much repetition and tedium as possible!
The one change I might have, if possible, is that the wildcard effects all, including things with an existing entry, as long as the entry doesn't have that specific field set itself.
I had that idea, but I excluded it because it'd be confusing to code. I will accept this suggestion purely because someone else would like it.
The other question I have is what if people want a global effect on all food items but then also for individual food items to have specialized effects in addition to this?
The problem is that effects
is a seperate (array) field for the item. It would be even more confusing to some people, and even when coding, because default behaviour would overwrite it (ref: previous suggestion).
I think we should keep it so that it overwrites the wildcard effects. Some people may also want to not add the global effect to an item, so overriding it would be as simple as:
# Poison is applied to every food...
[["*".effects]]
effect = "minecraft:poison"
amplifier = 1
duration = 15
# ...except a golden apple
["minecraft:golden_apple"]
effects = []
Fair enough! So my first suggestion you'll take but not the second? I agree with you that it's good to have an override option, and that wouldn't be possible with the wildcard effects adding to all arrays!
Some people may also want to not add the global effect to an item, so overriding it would be as simple as:
# Poison is applied to every food... [["*".effects]] effect = "minecraft:poison" amplifier = 1 duration = 15 # ...except a golden apple ["minecraft:golden_apple"] effects = []
I very much like this approach! Simple and straightforward to understand, it'd work very well! 👍
Of course you already know my vote :) 100% yes!
This is outdated.
Right now the config consists of two elements:
eat_cookies_berries_fast
andeffects
. My proposal is to change the entire config into a map (key->value data structure) of sorts.General
only contains one config, and is really unextendable, which can be merged into each food itself, to make it more extendable. To add more than one effect to a food, you need to create multiple entries for that food, which can make the config disorganized.The new config only consists of item -> food data configurations. The food data configuration is as follows: any attributes to be changed are in their seperate fields, like
eat_duration
(in ticks),saturation
, andhunger
, then a seperate fieldeffects
, which lists the effects. Note that every field is optional, except foritem.effects[].effect
, which requires an effect identifier.There is also a new wildcard (
*
) selector for items, in case you would like to change something globally. The non-wildcard-items take precedence, so you'd have to overwrite every customized food which you want to tweak, because the wildcard will not affect it.These changes would warrant a major version change, which would bump the version number to
2.0.0