Posted December 28, 20213 yr 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?
December 28, 20213 yr Author Oh, Thanks. So it would look like this? public class CapabilitiesRegisterEvent { @SubscribeEvent public void registerCaps(RegisterCapabilitiesEvent event) { event.register(IExample.class); } }
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.