Jump to content

[1.18] Replacement for the CapabilityManager.INSTANCE.register() method


MonkeyKnight

Recommended Posts

I have coded a capability which keeps track of several properties of the Player. All my code is error free, except when I try and register the capability with the CapabilityManager. I have looked in the forge docs but cannot find any examples of this. My entire class is this:

public class CapabilityExample {
    public static Capability<IExample> EXAMPLE_CAPABILITY = CapabilityManager.get(new CapabilityToken<>() {});
    
    public static void register() {
        CapabilityManager.INSTANCE.register(IExample.class);
    }
}

I am getting an error message that reads, "The method register(Class<IExample>) is undefined for the type CapabilityManager. I have looked into the Capability manager and do not see another way to do this. Is there a new method for registering for 1.18?

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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