
[1.20.1] Attribute Modification incorrectly processed entities generated through structures
HaktyGaona opened this issue · 2 comments
Report an issue or feature request
Mod Version:
entityjs-0.3.6-1.20.1
Minecraft Version:
Minecraft1.20.1
Minecraft Modloader:
Forge 47.3.11
Describe the Bug/Feature Request:
I tried to modify entity properties using example code, such as changing the iron golem to 200 health points, but in reality, I was unable to successfully modify it. The villagers and pillager did not have full health points even after increasing the maximum health points.
It seems to only occur in entities generated through structure.
I used Nbtedit to check the entities generated through the structures and confirmed the occurrence of the event.
Sometimes some mods intentionally modify the properties of entities generated through structures. It would be better if there was a way to avoid this.
Screenshots or Logs:
Used the same example code as Wiki.
Environment:
This is normal behavior. When storing an entity in a structure it will store the entity's current health via nbt, whether it's full health or not that number will remain unchanged even if their base registry attributes are changed. This would result in the entity having 20/200 health if you were to change the health attribute later on.
To remedy this you can either in an EntityEvents.spawned check if their health is the same as their max health and heal them or update the structure nbts to spawn in entities that have the updated max health.