Cardinal-Components-API icon indicating copy to clipboard operation
Cardinal-Components-API copied to clipboard

Run cleanup action

Open F0Xde opened this issue 4 years ago • 2 comments

Is it possible to execute some action when the component is being removed / unregistered?

F0Xde avatar Aug 03 '21 20:08 F0Xde

Hello, what exactly do you mean by that? Components are never unregistered or removed.

UpcraftLP avatar Aug 03 '21 21:08 UpcraftLP

Even when the object it is attached to gets "destroyed"? Like when an entity / chunk / whatever is unloaded?

F0Xde avatar Aug 04 '21 11:08 F0Xde

Very late but : you can use Quilt's or Fabric's standard library events for this. I could add it as a feature to CCA, but it doesn't seem common enough to justify it really.

Pyrofab avatar Aug 14 '23 08:08 Pyrofab