Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by SovereignRed

  • 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!

  • SovereignRed changed the title to [Solved][1.16.4] Overlay not finding capability

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.