Create Fabric

Create Fabric

7M Downloads

Data Attributes Incompatability

poisson-fish opened this issue ยท 3 comments

commented

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

  1. Load Minecraft version 1.18.2 with Data Attributes and Create-Fabric mods installed
  2. Generate new singleplayer world
  3. Generation fails at 100% with CTD.

Expected Result

  1. Load Minecraft version 1.18.2 with Data Attributes and Create-Fabric mods installed
  2. Generate new singleplayer world
  3. Generation succeeds and world loads.

Screenshots and Videos

No response

Crash Report or Log

https://pastebin.com/B8B16cyu

Operating System

Windows 10

Mod Version

0.4.1

Minecraft Version

1.18.2

Other Mods

Data Attributes

Additional Context

Crash happens on first living entity tick with a modifyGravity() call.

commented

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.

commented

Cause appears to be this line. If data attributes are present, it completely cancels all further processing.

commented

Null check has been added and will be included in the next Create release, but I think the root of this issue is on Data Attributes to fix.