Posted May 15, 20214 yr 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 Edited May 15, 20214 yr by SovereignRed
May 15, 20214 yr Author 46 minutes ago, diesieben07 said: Capability data is not synchronized to the client by default or automatically. You have to send a custom packet. I thought that might be the case but I haven't learned how to do that yet so I couldn't try. I'll look into that tomorrow, thank you!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.