Hi! I am really new to modding, this is my first try at it, so please forgive me if I am making a basic mistake here. Basically I have a capability attached to the player that I want displayed in an overlay at the top of the screen. The capability works and all, and the overlay displays, when it is not based off of the capability. My problem is that when I try to get the player's capability to set the width of the overlay bar, it doesn't find anything.
The mod allows players to increase their "cultivation" as they kill things, but even though the cultivation capability is properly attached on login and everything, the overlay event finds a capability of 0. Below are the links for the class with the overlay itself and the event call, respectively. I'm not really sure how to fix this.
https://github.com/Sovereign99/CultivationMod/blob/main/src/main/java/net/sovereign/cultivation/setup/gui/CultivationGui.java
https://github.com/Sovereign99/CultivationMod/blob/main/src/main/java/net/sovereign/cultivation/handlers/EventHandler.java#L41