Jump to content

[SOLVED][1.20.1]Custom capability getCapability() lazyOptional returns null


Recommended Posts

Posted (edited)

Hello!

I have created a custom capability InfusionCapability that gets attached to all BlockEntities extending the class BaseInfusionEntity. Whenever I interact with the BE or place it down I get an error:
 

  Reveal hidden contents

BaseInfusionEntity.java

  Reveal hidden contents

When I try to access the capability at the BE tick method it seems to exist and work, but when the getCapability method gets called it's null. Any help would be appreciated 😀

 

Github Repository:

https://github.com/ChamoisEST/MiningMadness/tree/1.20.1/src/main

Edited by ChamoisEST
  • ChamoisEST changed the title to [1.20.1]Custom capability getCapability() lazyOptional returns null
Posted

These are fixed now, the line was just a residue of me trying to fix the capability and changing things up multiple times. Still doesn't seem to be helping, the infusionCapability and lazyInfusionHandler are still null when getCapability gets called. 

Posted
  Reveal hidden contents

There you go.

  • ChamoisEST changed the title to [SOLVED][1.20.1]Custom capability getCapability() lazyOptional returns null

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.