[1.21.5] Removing an attachment from an entity throws a `NullPointerException` under some circumstances as of v0.123.0+1.21.5
Fuzss opened this issue ยท 0 comments
I'm trying to remove an attachment from a living entity when it dies. This was working without issues before v0.123.0+1.21.5 of Fabric Api. Now an exception is thrown:
java.lang.NullPointerException: Cannot invoke "java.util.IdentityHashMap.remove(Object)" because "this.fabric_dataAttachments" is null
Here is the original issue reported to me: Fuzss/bettertridents#23
I tested this specifically with v0.122.0+1.21.5 and below and it is indeed working fine there.
Here is my code where I remove the attachment (although it's heavily diluted by multi-loader shenanigans): https://github.com/Fuzss/bettertridents/blob/4e7426c5b0a9b0925466a29dc38be29ceb9395db/1.21.5/Common/src/main/java/fuzs/bettertridents/handler/TridentAttachmentHandler.java#L23