Data Attributes Incompatability
poisson-fish opened this issue ยท 3 comments
Describe the Bug
Data attributes issue here.
Minecraft Version: 1.18.2
Fabric Version: 0.14.8
Fabric API Version: 0.56.1
Data Attributes Version: 1.1.7
Create Version: 0.4.1
When loading a newly generated world with only Create-Fabric AND Data Attributes mods installed the client crashes calling modifyGravity() while ticking the first living entity.
Log of crash here.
I'm happy to help fix in anyway I can. Capable in Java and debugging, but I'm not familiar with either mods and this is an entity tick crash so could use some suggestions for where to look. Would love to get these two mods working together, as PlayerEx depends on Data Attributes.
Edit: Debugging this crash I got this error:
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.entity.attribute.EntityAttributeInstance.getValue()" because the return value of "net.minecraft.entity.LivingEntity.getAttributeInstance(net.minecraft.entity.attribute.EntityAttribute)" is null
Reproduction Steps
- Load Minecraft version 1.18.2 with Data Attributes and Create-Fabric mods installed
- Generate new singleplayer world
- Generation fails at 100% with CTD.
Expected Result
- Load Minecraft version 1.18.2 with Data Attributes and Create-Fabric mods installed
- Generate new singleplayer world
- Generation succeeds and world loads.
Screenshots and Videos
No response
Crash Report or Log
Operating System
Windows 10
Mod Version
0.4.1
Minecraft Version
1.18.2
Other Mods
Additional Context
Crash happens on first living entity tick with a modifyGravity() call.
Porting Lib adds two more attributes to entities here. The crash happens here when the attribute is queried. Data Attributes is somehow making our additions not apply. To fix the crash we just need to add a null check there, but it really shouldn't be null in the first place and might cause unexpected behavior down the line.
Cause appears to be this line. If data attributes are present, it completely cancels all further processing.