Posted January 16, 20214 yr I have a capability STATE_CAPABILITY in IHaveMana, of class IState. I want to take out the IState an entity has, probably using getCapability. As below. But, I couldn't find a way to convert LazyOptional<IState> to IState. @Nullable public static IState getIStates(Entity entityliving) { if (entityliving instanceof LivingEntity) return (IState) entityliving.getCapability(IHaveMana.STATE_CAPABILITY, null).cast(); return null; } Should I give more detail?
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.