Skip to content

Egg Provider

Provi edited this page Aug 3, 2026 · 1 revision

For inter-mod compatibility and future-proofing against Cobblemon itself, Daycare+ handles eggs through a dedicate class an interface for items that can possess data to create objects of said class.

The interface is essentially a supplier, requiring only that the implementation offers a getEgg(ItemStack) method. By default this is implemented only by Daycare+'s own egg items, but developers can implement the interface as they see fit or use mixins to allow other items to be treated as Pokemon eggs.

Any item that implements PokemonEggProviderItem can be stored in an incubator. The item in the incubator will be the Daycare+ egg, but this can be modified via the POST_EGG_CREATED event hook. Through the use of mixins, eggs from other breeding mods may be converted into Daycare+ eggs, including Cobblemon's own eggs once they release breeding themselves.

To decouple items from egg data, eggs are described as their own class that can be freely converted back and forth between its original form and a PokemonEggItem object (which implements the above interface).

Developers seeking to implement PokemonEggProviderItem should also familiarise themselves with PokemonEgg and its constructors.

Clone this wiki locally