Closed James103 closed 4 years ago
Actually the attribute has the name scalingfeast.maxHungerMod
, so if you switch to that, everything will work.
In hindsight, I'm not sure why I named it that. In the moment, it made sense but looking back, it seems unintuitive.
I mainly did this because the max hunger isn't being stored as a attribute but instead as a capability, with a separate capability for modifying it (which I haven't changed for backwards compatibility, I see now that I should've made it an attribute and any version 2.0 will see that change made). Doing a percentage modifier like "+300% max hunger" won't actually see your max hunger go up by 300% but instead you'll see the modifier value changed by 300% so any bonuses to your max hunger via SOL:Carrot Edition integration etc. will be increased by 300%, if that makes sense.
Feel free to continue the discussion here if you like to propose a different way of doing this that's ideally backwards compatible but for now, this issue is going to be closed as it's not applicable.
I actually came up with an idea that should be backwards compatible and should allow a more direct alteration of max hunger
To future me: Store an NBTTagByte in each NBTTagCompound in IFoodCapModifier that represents the operation to perform. Follow the same steps taken by Minecraft for attribute values.
Mod Version: scalingfeast-1.5.0 Minecraft Version: 1.12.2 Loaded Mods: (Reproducible with just Scaling Feast)
Describe the bug attribute.name.scalingfeast.maxHunger is unlocalized.
Steps to Reproduce
/give @p minecraft:diamond_shovel 1 0 {AttributeModifiers:[{AttributeName:"scalingfeast.maxHunger",Name:"a",Amount:10,Operation:0,UUIDLeast:131107,UUIDMost:716360,Slot:"mainhand"}]}
Expected behavior attribute.name.scalingfeast.maxHunger is localized as "Max Hunger".
Additional context The potion effects of Hunger Plus and Hunger Minus correctly say "Max Hunger".
Also, modifiers affecting this attribute that are attached to various items seems to have no effect. Is there something wrong with the setup in the following commands (executed in that order), or is it a bug within Scaling Feast?
/sf setMax @p 500
/effect @p saturation 2 255
/give @p minecraft:diamond_shovel 1 0 {AttributeModifiers:[{AttributeName:"scalingfeast.maxHunger",Name:"a",Amount:10,Operation:2,UUIDLeast:131107,UUIDMost:71636,Slot:"mainhand"}]}
/give @p minecraft:diamond_shovel 1 0 {AttributeModifiers:[{AttributeName:"scalingfeast.maxHunger",Name:"b",Amount:10,Operation:1,UUIDLeast:131107,UUIDMost:716360,Slot:"mainhand"}]}
/give @p minecraft:diamond_shovel 1 0 {AttributeModifiers:[{AttributeName:"scalingfeast.maxHunger",Name:"b",Amount:10,Operation:0,UUIDLeast:131107,UUIDMost:71630,Slot:"mainhand"}]}