VazkiiMods / Patchouli

Accessible, Data-Driven, Dependency-Free Documentation for Minecraft Modders and Pack Makers
https://vazkiimods.github.io/Patchouli/
Other
311 stars 124 forks source link

Fire an advancement trigger when reading a book #715

Closed TheRealWormbo closed 3 months ago

TheRealWormbo commented 9 months ago

Trigger condition uses the book's resource location, and optionally a specific entry resource location and page number. However, the latter are only triggered by server code opening the book at that entry and page, not by the player going there via interactions with the opened book.

TheRealWormbo commented 9 months ago

This PR has been tested using the following Botania code changes: https://github.com/TheRealWormbo/Botania/commit/2c40fe893b562ee30cb74f5104d401046bd721f9 The advancement for reading the Lexica Botania was successfully awarded on both Forge and Fabric when reading the book in item form, through a lectern, or via the /open-patchouli-book command.

TheRealWormbo commented 5 months ago

The 1.20.1 version of this PR is archived at https://github.com/TheRealWormbo/Patchouli/tree/1.20.1-reading-advancement-trigger, in case that version of Patchouli still receives updates.

The following update to this PR is for 1.20.4, but lacking a corresponding Botania version, it could not be tested thoroughly.