Add attachment holder context to creation
Currently the default initializer for attachment only accepts a supplier. it would be better if it can also accepts a function that provides the current holder of the attachment. https://github.com/FabricMC/fabric/blob/1.21.8/fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/api/attachment/v1/AttachmentRegistry.java#L151
This way if you e.g. wanted an attachment for an entity and provide modification access to the attachment that requires the entity too you don't need to create a method with the entity as one of the args all the time.
I think this was rejected due to generic problems? You can currently somewhat work around it by creating your own entity/world/block entity load event at the right spot, and using the attachment changed event to handle all further changes.
tbh can just have Function<Object, T> and it lies on the modder to properly check. (not too sure how to handle it otherwise either)
I don't think they wanted that, but it's in an issue now
It seems this is not possible with the current API design and we have to close this issue, this is done intentionally https://discord.com/channels/507304429255393322/566276937035546624/1388132874653532210