Jump to content

Recommended Posts

Posted

Hello,

My goal is to create a custom inventory slot, next to the already existing armor slots. I'm not entirely sure how to accomplish this, but I've read some things online about forge capabilities. It seems like the best way to go, except there doesn't seem to be much information on it. Could anyone help get me started? 

  • Like 1
  • 3 weeks later...
Posted
On 9/14/2017 at 3:18 PM, diesieben07 said:

For example you do not need a separate interface and implementation class, you can just make a class that extends ItemStackHandler and use that as your capability.

So I'm not sure I completely follow you. I've created a class that extends ItemStackHandler, but I'm not sure what goes in there since I'm not creating an interface class. And since I don't need a capability provider, what would I put in the second parameter of event#addCapability()?

@SubscribeEvent
public void attachCapability(AttachCapabilitiesEvent<Entity> event) {
	if (event.getObject() instanceof EntityPlayer) {
            event.addCapability(INV_SLOT,);
        }
  }

 

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.