Patchouli

Patchouli

134M Downloads

Advancement trigger for reading a Patchouli book

TheRealWormbo opened this issue ยท 0 comments

commented

Describe the feature

There doesn't seem to be a reliable way to trigger an advancement for a player reading a Patchouli book in a lectern on Fabric, since Patchouli itself cancels the event and Fabric does not provide a way to register an event with a higher priority. As a result, any attempt to detect the player interacting with a lectern that has a particular Patchouli book on it is subject to random initialization order between Patchouli and the mod attempting to trigger the advancement.

On Forge there is an optional event priority parameter for registering, so a high priority, non-canceling event that also checks for the Patchouli book on the lectern can be used to implement this. Still, an advancement trigger emitted by Patchouli itself would be a cleaner way to do it.

Additional context

Botania adds an advancement for reading the "Lexica Botania" (a Patchouli book with its own item class) for the first time. Until recently the lexicon could not be placed on a lectern, but when trying to implement that feature (which itself was as simple as adding the item to the corresponding tag) the advancement issue came up.