Page 1 of 1

Attach GUI to SimpleEntityWithOwner?

Posted: Fri Mar 13, 2026 1:29 am
by hgschmie
I have a mod that revolves around a SimpleEntityWithOwner at the core. Now I want to add a gui to it. The GUI is fully custom and works fine if I attach it e.g. to a container.

However, if I register to receive the on_gui_opened event for my custom entities, nothing happens. I never receive an event for that.

Can I attach a GUI to such an entity or only to entities that already have a GUI? If I can not attach a GUI, what would be a good replacement (I need four directions so the entity needs to be rotatable but other than that rather bare-bones, which is why SimpleEntityWithOwner was attractive).

Thanks for any pointers. I did not really find anything on the forum.

-h

Re: Attach GUI to SimpleEntityWithOwner?

Posted: Fri Mar 13, 2026 6:39 pm
by Osmo
That is correct, you don't get on_gui_opened event for entities that don't have a gui. You could detect it with a custom input event, but it will function incorrectly (triggers on click rather than on release (or the other way around)).
The simplest rotatable entities i could think of are: storage-tank, valve, constant-combinator and display-panel. Storage tank is usually a good option, you can make it not have visible or functional pipe connections by making then linked.

Re: Attach GUI to SimpleEntityWithOwner?

Posted: Sat Mar 14, 2026 3:48 am
by hgschmie
Thanks for the quick answer. I will try a custom event first.