Posted February 11, 20205 yr 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!
February 11, 20205 yr 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).
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.