Mods / Attributer - Reborn

Category: #Tweak #Utility
Author: misterandydandy
Side: Both
Created: Mar 17th at 1:49 PM
Last modified: Mar 17th at 1:59 PM
Downloads: 770
Follow Unfollow 21

Latest file for Various v1.19.x:
attributes-1.0.6.zip 1-click install



A multi-class patch that makes lets you set attributes per item dynamically.

Basically wherever the code says "get parent object attribute" it instead "get object attribute if exists first".

Also adds a few new attributes that can be applied to items to modify their functionality.


Requirements:

  • None.

Incompatibilities:

  • Other mods which significantly overwrite base item types.

Mods requiring this:

New Attributes:

  • maxdurability.

Supported Attributes:

  • defaultProtLoss
  • protectionModifiers
    • protectionTier
    • highDamageTierResistant
    • flatDamageReduction
    • relativeProtection
  • statModifiers
    • healingeffectiveness
    • hungerrate
    • rangedWeaponsAcc
    • rangedWeaponsSpeed
    • walkSpeed
  • damage
  • attackpower
  • attackrange
  • miningspeed
  • miningtier
  • health
  • clothescategory
  • breakChanceOnImpact
  • requiresAnvilTier
  • workableTemperature

- Please note, some attributes are enabled by the api by default and do not need this mod.
- Search the official API and official survival mod github repositorys to check.

Attribute Exceptions:

  • perTierFlatDamageReductionLoss
  • perTierRelativeProtectionLoss

These aren't mirrored as other attributes are, as arrays aren't supported by the API.
Instead, they should be TreeAttributes, with the float values of "0" and "1" placed into them.
This is a workaround until the API updates.

How to use (For developers):

  1. Set an attribute on an item.
    1. Example (Set an items attack power):

      1. itemstack.Attributes.SetFloat("attackpower", 12f);

    2. Example (Set an items flat damage reduction):

      1. itemstack.Attributes.GetTreeAttribute("protectionModifiers").SetFloat("flatDamageReduction", 8f);

  2. That's it. It should work if the attribute is supported.

How to use (Standalone):

  1. Use an command that supports or sets attributes.
    1. Example (Set the weapon in your hand's attack power.):

      1. /debug heldstattr attackpower float 1000000

  2. That should do it.

Please note you must mirror attributes exactly, including trees, to how the parent item is.



 I am only keeping it up to date and fixing issue.

 If Yew come back please let me know as I will remove this mod.

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1.0.6 770 Mar 17th at 1:59 PM Show attributes-1.0.6.zip Install now

4 Comments (oldest first | newest first)

💬 misterandydandyAuthor, Mar 26th at 1:38 PM

I am trying to find what is causing the issue because it is using harmony patching what can be a pain in my ass to fix.

💬 Odur27, Mar 23rd at 5:31 AM

We just had roughly the same issue, With Atributer 1.0.5 and RPGItemrarity (non reborn) mods.We swapped to Atributer Reborn 1.0.6 and RPGitemrarity reborn 1.0.5 and had the same crash, we think it was caused by a Faux, The friend says it was a Copper Faux, not sure of the item rarity. the item was with other tools in a trunk (vanilla double chest) when we hovered over the item description it crashed both of us.

Crash Log before changing the mods was as follows.

Running on 64 bit Windows 10.0.22631.0 with 65406 MB RAM
Game Version: v1.19.4 (Stable)
3/22/2024 10:23:56 PM: Critical error occurred in the following mod: attributer@1.0.5
Loaded Mods: acorns@0.5.3, aculinaryartillery@1.1.3, ancientarmory@0.9.5, angelbelt@1.5.0, cheaperarmor@2.0.2, attributer@1.0.5, autopanning@1.0.1, axleinblocks@1.0.18, bettercrates@1.7.0, bettertraders@0.0.5, charcoalpitrebalance@1.0.0, chiseltools@1.10.4, claycasting@1.1.5, hqzlights@1.1.1, extrachests@1.8.0, fancysky@1.0.6, fantasycreatures@0.7.1, free_stone_drops_when_broken@1.0.1, HangingOilLamps@1.0.1, justmoreruins@0.9.8, lumbersling@1.1.0, millwright@1.1.4, bgn_moreclasses@1.0.2, moremolds@1.4.2, leadroof@1.3.4, natshumanskin@1.0.0, natseasystonebricks@1.0.1, nightwatcher@2.0.0, TA_plainsandvalleys@1.0.5, plantmat@1.7.1, primitivesurvival@3.4.9, roas@1.0.0, rpgitemrarity@1.0.4, rustcreatures@1.3.0, ruststones@1.0.5, she1fish@1.2.0, soulshards@1.0.4, Swordz@1.1.5, tprunes@1.1.0, temporal_gears_stack@1.0.0, toolsplus@1.0.1, translocatorengineeringredux@1.4.9, game@1.19.4, abcsreborn@0.1.9, animationmanagerlib@0.7.1, autoatlas@1.0.1, betterjonasdevices@1.1.0, betterruins@0.3.3, buildrefillmod@1.0.1, carryon@1.7.4, commonlib@2.3.4, expandedfoods@1.6.8, extrachutes@1.0.0, freedomunits@1.1.3, herbarium@1.1.0, sailboat@1.2.8, knapster@2.8.1, loreweapons@1.0.1, medievalexpansion@3.13.1, meteoricexpansion@1.2.5, moreanimals@1.3.3, morepiles@1.5.0, onebedsleeping@2.4.0, pileful@1.1.5, rivers@2.7.0, rustboundmagic@1.5.10, scarecrow@1.4.3, scythemold@1.0.1, sharablewaypoints@1.5.4, stonerailings@1.2.0, storagecontroller@1.0.6, storageoptions@1.0.2, strspawnchances@0.1.4, tablet@0.1.4, tarmor@0.1.8, terrapretatrade@1.0.0, th3dungeon@0.2.1-rc.1, creative@1.19.4, vsimgui@1.0.0, survival@1.19.4, vsvillage@0.9.2, workbenchexpansion@1.8.0, xlib@0.8.0-rc.2, awearablelight@1.1.1, betterruinslootchanges@0.0.3, bullseye-continued@2.5.8, tradercamps@1.1.2, configlib@1.0.0, doffanddonagain@4.0.0, em@2.5.1, sleekdoorglass@1.0.0, gespileslib@1.2.0, onestick@1.0.1, simplewinddirection@1.0.2, tpnet@1.14.2, treetapping@1.0.0, wildcraftfruit@1.1.0, wildcraftherb@0.0.0, wildcrafttree@1.1.0, xskills@0.8.0-rc.2, bricklayers@2.5.1, gespilesgran@1.0.1, statushudcont@2.1.1
System.NullReferenceException: Object reference not set to an instance of an object.
at attributer.src.CollectibleObjectPatch.GetHeldItemInfo(CollectibleObject __instance, ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, Boolean withDebugInfo) in C:\Users\Yew\AppData\Roaming\.vintagestory\vscmods\vsmodtemplate-1.5.8\mods-dll\attributer\src\patch\CollectibleObjectPatch.cs:line 30
at Vintagestory.API.Common.CollectibleObject.GetHeldItemInfo_Patch4(CollectibleObject this, ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, Boolean withDebugInfo)
at Vintagestory.API.Common.ItemStack.GetDescription(IWorldAccessor world, ItemSlot inSlot, Boolean debug) in VintagestoryApi\Common\Collectible\ItemStack.cs:line 401
at Vintagestory.Client.NoObf.HudMouseTools.OnRequireInfoText(ItemSlot slot) in VintagestoryLib\Client\Systems\Gui\Huds\HudMouseTools.cs:line 167
at Vintagestory.API.Client.GuiElementItemstackInfo.AsyncRecompose() in VintagestoryApi\Client\UI\Elements\Impl\Interactive\Text\GuiElementItemstackInfo.cs:line 142
at Vintagestory.API.Client.GuiElementItemstackInfo.SetSourceSlot(ItemSlot nowSlot, Boolean forceRecompose) in VintagestoryApi\Client\UI\Elements\Impl\Interactive\Text\GuiElementItemstackInfo.cs:line 252
at Vintagestory.Client.NoObf.HudMouseTools.OnMouseEnterSlot(ItemSlot slot) in VintagestoryLib\Client\Systems\Gui\Huds\HudMouseTools.cs:line 208
at Vintagestory.Client.NoObf.ClientEventManager.TriggerOnMouseEnterSlot(ClientMain game, ItemSlot slot) in VintagestoryLib\Client\Util\ClientEventManager.cs:line 514
at Vintagestory.API.Client.GuiElementItemSlotGridBase.OnMouseMove(ICoreClientAPI api, MouseEvent args) in VintagestoryApi\Client\UI\Elements\Impl\Interactive\Inventory\GuiElementItemSlotGridBase.cs:line 809
at Vintagestory.API.Client.GuiComposer.OnMouseMove(MouseEvent mouse) in VintagestoryApi\Client\UI\GuiComposer.cs:line 512
at Vintagestory.API.Client.GuiDialog.OnMouseMove(MouseEvent args) in VintagestoryApi\Client\UI\Dialog\GuiDialog.cs:line 608
at Vintagestory.Client.NoObf.GuiManager.OnMouseMove(MouseEvent args) in VintagestoryLib\Client\Systems\Gui\GuiManager.cs:line 433
at Vintagestory.Client.NoObf.ClientMain.OnMouseMove(MouseEvent args) in VintagestoryLib\Client\ClientMain.cs:line 1998
at Vintagestory.Client.NoObf.ClientPlatformWindows.UpdateMousePosition() in VintagestoryLib\Client\ClientPlatform\Input.cs:line 111
at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(FrameEventArgs e) in VintagestoryLib\Client\ClientPlatform\GameWindow.cs:line 88
at OpenTK.Windowing.Desktop.GameWindow.Run()
at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs) in VintagestoryLib\Client\ClientProgram.cs:line 324
at Vintagestory.Client.ClientProgram.<>c__DisplayClass9_0.<.ctor>b__1() in VintagestoryLib\Client\ClientProgram.cs:line 128
at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 93

💬 misterandydandyAuthor, Mar 22nd at 11:31 PM

DrakeBD thanks for the crash log I'll take a look tomorrow when I get home.

💬 DrakeBD, Mar 22nd at 9:44 PM

Getting a crash not sure why
Have tools and weapons in my inventory but when i open inventory client just crashes

Game Version: v1.19.5 (Stable)
22/03/2024 21:38:06: Critical error occurred in the following mod: attributerreborn@1.0.6
Loaded Mods: aculinaryartillery@1.1.3, ancientarmory@1.0.0, attributerreborn@1.0.6, bettertraders@0.0.5, ClaimsRadar@1.1.0, landformoverhaul@0.0.2, decor@1.0.15, extrachests@1.8.0, caninae@1.0.10, machairodontinae@1.0.3, pantherinae@1.1.2, sirenia@1.0.1, floralzonescaperegion@1.0.6, floralzonescaribbeanregion@1.0.3, floralzonescentralaustralianregion@1.0.1, immersivecorpsedrop@1.0.2, millwright@1.1.4, OresAPlenty@3.2.0, primitivesurvival@3.4.9, qptech@1.14.4, rpgitemrarityreborn@1.0.5, rustcreatures@1.3.0, sca@1.0.1, sortablestorage@2.2.3, ssppvv@1.0.5, Swordz@1.1.6, tprunes@1.1.0, game@1.19.5, moremolds@1.4.2, abcsreborn@0.2.1, alchemy@1.6.25, th3dungeon@0.2.1, ancienttools@1.5.12, animalcages@3.0.2, animationmanagerlib@0.7.4, betterruins@0.3.4, grtp@1.0.4, butchering@1.5.4, carryon@1.7.4, commonlib@2.3.7, composter@1.1.0, cooperativecombat@1.1.1, expandedfoods@1.6.8, extrainfo@1.7.0, fancyplanters@1.2.0, fieldsofsalt@1.2.1, hangingbaskets@1.1.0, herbarium@1.1.0, vsimgui@1.1.3, sailboat@1.3.0, medievalexpansion@3.13.1, moreanimals@1.3.3, naturalnight@2.1.0, outlawmod@1.2.2, petai@2.2.3, pileful@1.1.5, playerlist@1.8.0, prospecttogether@1.3.0, storagecontroller@1.0.7, rivers@2.7.0, rustboundmagic@1.6.0, sharablewaypoints@1.5.4, simplestep@1.1.7, hudclock@3.4.0, stonebakeoven@1.1.3, storageoptions@1.0.2, temporalstormtimer@1.1.1, vanvar@3.3.0, vintagerpc@1.0.0, vtpp@1.1.1, creative@1.19.5, survival@1.19.5, wildfarmingrevival@1.1.8, workbenchexpansion@1.8.0, cats@2.0.1, configlib@1.1.1, em@2.5.1, feverstonewilds@1.4.5, fsmlib@0.3.1, stonequarry@3.2.1, vsradiomod@0.2.0, wildcraftfruit@1.1.1, wildcraftherb@0.0.0, wildcrafttree@1.1.0, bricklayers@2.5.1, maltiezcrossbows@0.2.2, maltiezfirearms@0.5.0
System.NullReferenceException: Object reference not set to an instance of an object.
at attributer.src.CollectibleObjectPatch.GetHeldItemInfo(CollectibleObject __instance, ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, Boolean withDebugInfo) in C:\Users\andy-\Documents\GitHub\VS-Attributer\mod-src\patch\CollectibleObjectPatch.cs:line 33
at Vintagestory.API.Common.CollectibleObject.GetHeldItemInfo_Patch3(CollectibleObject this, ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, Boolean withDebugInfo)
at Vintagestory.API.Common.ItemStack.GetDescription(IWorldAccessor world, ItemSlot inSlot, Boolean debug) in VintagestoryApi\Common\Collectible\ItemStack.cs:line 401
at Vintagestory.API.Common.ItemSlot.GetStackDescription(IClientWorldAccessor world, Boolean extendedDebugInfo) in VintagestoryApi\Common\Inventory\ItemSlot.cs:line 475
at Vintagestory.Client.NoObf.HudMouseTools.OnRequireInfoText(ItemSlot slot) in VintagestoryLib\Client\Systems\Gui\Huds\HudMouseTools.cs:line 167
at Vintagestory.API.Client.GuiElementItemstackInfo.AsyncRecompose() in VintagestoryApi\Client\UI\Elements\Impl\Interactive\Text\GuiElementItemstackInfo.cs:line 125
at Vintagestory.API.Client.GuiElementItemstackInfo.SetSourceSlot(ItemSlot nowSlot, Boolean forceRecompose) in VintagestoryApi\Client\UI\Elements\Impl\Interactive\Text\GuiElementItemstackInfo.cs:line 252
at Vintagestory.Client.NoObf.HudMouseTools.OnMouseEnterSlot(ItemSlot slot) in VintagestoryLib\Client\Systems\Gui\Huds\HudMouseTools.cs:line 211
at Vintagestory.Client.NoObf.ClientEventManager.TriggerOnMouseEnterSlot(ClientMain game, ItemSlot slot) in VintagestoryLib\Client\Util\ClientEventManager.cs:line 516
at Vintagestory.Client.NoObf.InputAPI.TriggerOnMouseEnterSlot(ItemSlot slot) in VintagestoryLib\Client\API\InputAPI.cs:line 48
at Vintagestory.API.Client.GuiElementItemSlotGridBase.OnMouseMove(ICoreClientAPI api, MouseEvent args) in VintagestoryApi\Client\UI\Elements\Impl\Interactive\Inventory\GuiElementItemSlotGridBase.cs:line 809
at Vintagestory.API.Client.GuiComposer.OnMouseMove(MouseEvent mouse) in VintagestoryApi\Client\UI\GuiComposer.cs:line 512
at Vintagestory.API.Client.GuiDialog.OnMouseMove(MouseEvent args) in VintagestoryApi\Client\UI\Dialog\GuiDialog.cs:line 608
at Vintagestory.Client.NoObf.GuiManager.OnMouseMove(MouseEvent args) in VintagestoryLib\Client\Systems\Gui\GuiManager.cs:line 433
at Vintagestory.Client.NoObf.ClientMain.OnMouseMove(MouseEvent args) in VintagestoryLib\Client\ClientMain.cs:line 1970
at Vintagestory.Client.NoObf.ClientPlatformWindows.UpdateMousePosition() in VintagestoryLib\Client\ClientPlatform\Input.cs:line 111
at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(FrameEventArgs e) in VintagestoryLib\Client\ClientPlatform\GameWindow.cs:line 88
at OpenTK.Windowing.Desktop.GameWindow.Run()
at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs) in VintagestoryLib\Client\ClientProgram.cs:line 324
at Vintagestory.Client.ClientProgram.<>c__DisplayClass9_0.<.ctor>b__1() in VintagestoryLib\Client\ClientProgram.cs:line 128
at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 93

(edit comment delete)