Skip to content

Vintage Story mod that makes individual itemstack attributes functional.

Notifications You must be signed in to change notification settings

YewYew/Attributer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://mods.vintagestory.at/attributer


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:

  • None?

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.

About

Vintage Story mod that makes individual itemstack attributes functional.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages