CraftTweaker

CraftTweaker

151M Downloads

[1.16.5] Global Attribute missing once receive damage

TqLxQuanZ opened this issue ยท 1 comments

commented

Issue description

The global attribute (Generic.Armor) applied on an armor using crafttweaker went missing whenever the player wearing it receives damage from any source.

Steps to reproduce

  1. Apply generic armor modifier on any armor.
  2. Wears the armor.
  3. Receives damage from any source.
  4. Checks the armor value again.

Script used

https://gist.github.com/TqLxQuanZ/e1921038202dc4a28350d77d0af27970

The crafttweaker.log file

https://gist.github.com/TqLxQuanZ/5296121387b874c78ec4ab5ce7d22004

Minecraft version

1.16

Forge version

36.2.0

CraftTweaker version

7.1.1.401

Other relevant information

No response

The latest.log file

https://gist.github.com/TqLxQuanZ/850d15cfc664e23b3171880c0c3f4d46

commented

You need to use anyDamage to tell it to match the item regardless of damage value.

<item:minecraft:leather_helmet>.anyDamage().addGlobalAttributeModifier(<attribute:minecraft:generic.armor>, "872db2df-93ea-4efd-8533-6cc4b5f06439", "generic.armor", 2, AttributeOperation.ADDITION, [<equipmentslottype:head>]);