Quilt Loader 1
Loading...
Searching...
No Matches
net.fabricmc.loader.api.ObjectShare Interface Reference

Object share for inter-mod communication, obtainable through FabricLoader#getObjectShare. More...

Inheritance diagram for net.fabricmc.loader.api.ObjectShare:
org.quiltmc.loader.impl.ObjectShareImpl

Detailed Description

Object share for inter-mod communication, obtainable through FabricLoader#getObjectShare.

The share allows mods to exchange data without directly referencing each other. This makes simple interaction easier by eliminating any compile- or run-time dependencies if the shared value type is independent of the mod (only Java/game/Fabric types like collections, primitives, String, Consumer, Function, ...).

Active interaction is possible as well since the shared values can be arbitrary Java objects. For example exposing a Runnable or Function allows the "API" user to directly invoke some program logic.

It is required to prefix the share key with the mod id like mymod:someProperty. Mods should not modify entries by other mods. The share is thread safe.


The documentation for this interface was generated from the following file:
  • src/fabric/api/java/net/fabricmc/loader/api/ObjectShare.java