Mods / Attributer

Category: #Tweak #Utility
Author: Yew
Side: Both
Created: Sep 21st 2022 at 3:57 AM
Last modified: Sep 24th 2022 at 5:53 PM
Downloads: 1673
Follow Unfollow 20

Latest file:
attributer-1.0.3.zip



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:

  • Dunno yet, report some.

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.

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

Version For Game version Downloads Release date Changelog Download
v1.0.3 1322 Sep 24th 2022 at 5:53 PM Show attributer-1.0.3.zip
v1.0.2 98 Sep 23rd 2022 at 11:47 PM Show attributer-1.0.2.zip
v1.0.1 152 Sep 22nd 2022 at 5:31 PM Show attributer-1.0.1.zip
v1.0.0 101 Sep 22nd 2022 at 5:19 AM Show attributer-1.0.0.zip

3 Comments (oldest first | newest first)

💬 Streetwind, Mar 13th at 8:34 PM

In case anyone is wondering - no, the current version (1.0.3) does not work with 1.18. The server thread freezes as soon as the game tries to apply damage from a creature to the player.

💬 Yew, Sep 22nd 2022 at 3:18 PM

Not yet Craluminum! Working on it though. 

💬 Craluminum, Sep 22nd 2022 at 10:26 AM

Can it be used to change transformations? E.g. groundStorageTransform

(edit comment delete)