Thanks @Zanckor for your reply. It turns out I still needed a CapabilityProvider to provide an instance of the capability. I don't really know why this has to be a LazyOptional, but it works as long as I keep my checking code in the IfPresent method. However, I want the data to remain after a player dies. Inside the forge documentations they already pointed out to do it using the PlayerEvent$Clone event, but I still don't get enough context. Is there a needly way to copy the data over to the respawned player.