Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.15.2] Capabilities Not Attaching Properly


soravoid
 Share

Recommended Posts

Currently, I'm trying to make a sword with a "charges capability" which will strike lighting down onto the entity every four hits (which is a whole other can of worms). I've listed the relevant classes below, but it's on a Github in case I missed anything.

 

Main class:

https://github.com/soravoid/Exceed/blob/master/src/main/java/com/github/soravoid/exceed/Exceed.java

 

Event Bus:

https://github.com/soravoid/Exceed/blob/master/src/main/java/com/github/soravoid/exceed/ExceedEventBusSub.java

 

The Capability Provider:

https://github.com/soravoid/Exceed/blob/master/src/main/java/com/github/soravoid/exceed/capabilities/ChargesCapability.java

 

Sword class:

https://github.com/soravoid/Exceed/blob/master/src/main/java/com/github/soravoid/exceed/items/weapons/StaticElectricitySword.java

 

Thank you in advance!

Link to comment
Share on other sites

Apart from what diesieben said, if you're adding capabilities to your own item, you shouldn't be using the AttachCapabilitiesEvent.  Instead override initCapabilities() and return your capability provider there (see BucketItem for an example of how Forge attaches a fluid handler capability to buckets).

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.

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.