Mods / Attributer

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


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 183 Sep 24th at 5:53 PM Show attributer-1.0.3.zip
v1.0.2 49 Sep 23rd at 11:47 PM Show attributer-1.0.2.zip
v1.0.1 98 Sep 22nd at 5:31 PM Show attributer-1.0.1.zip
v1.0.0 50 Sep 22nd at 5:19 AM Show attributer-1.0.0.zip

2 Comments (oldest first | newest first)

💬 Yew, Sep 22nd at 3:18 PM

Not yet Craluminum! Working on it though. 

💬 Craluminum, Sep 22nd at 10:26 AM

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

(edit comment delete)