Create Fabric

Create Fabric

7M Downloads

Event Firing - Compatibilities

muriplz opened this issue ยท 4 comments

commented

Describe the Bug

When opening a Screen of a BlockEntity it calls EnvExecutor#runWhenOn() which doesn't fire the proper events for other mods to be able to control it.

I think the issue is here https://github.com/Fabricators-of-Create/Porting-Lib/blob/1.20.1/utility/src/main/java/io/github/fabricators_of_create/porting_lib/util/EnvExecutor.java#L10

Sources:

Reproduction Steps

...

Expected Result

Being able to cancel the event, so another mod can handle it, such as a Land Claiming mod

Screenshots and Videos

No response

Crash Report or Log

No response

Operating System

windows 11

Mod Version

0.5.1d

Minecraft Version

1.20.1

Other Mods

No response

Additional Context

No response

commented

what are the proper events?

commented

If there isn't a corresponding event that Fabric itself supports
https://fabricmc.net/wiki/tutorial:event_index

then the mod should create its own to make it able for other mods to handle interactions, such as who opened a Train Station
https://fabricmc.net/wiki/tutorial:events

commented

these screens are fully client side, so your example of a land claiming mod preventing opening them makes no sense.
If you have a specific use case, maybe something can be implemented. Closing for now.

commented

But all the screens can modify server's files through packets, and there is no way to deny that from happening unless making a specific addon to bring the events with mixins.
I'll do a proper suggestion for this on main Create in a near future, for now I'll stick to try to maintain this