π³ Tree structure#
Bookshelf respects a certain tree structure which can be similar to Java packages, called βmodulesβ in this project. The added features must therefore be positioned in these various modules according to their usefulness.
Module requirements:
Each module must declare a metadata file as detailed in the metadata page.
Each module should be responsible for loading and unloading itself. This includes redefining objectives, constants, and any other necessary elements.
Each module should have a help function tag, a load function tag (responsible for loading the module and its dependencies) and an unload function tag.
Each moduleβs load and unload function tags should be referenced as optional in
#minecraft:load
and#minecraft:unload
respectively.The load function tag for each module must start by unloading all other modules using
#minecraft:unload
. After that, it should load the module and its dependencies. Weak dependencies can be specified with"required"
: false. For example, in the health module:{ "values": [ "#minecraft:unload", "bs.health:__load__", { "id": "#bs.log:load", "required": false } ] }
Feature requirements:
Each feature function should have its own function tag.
A feature is equal to a unique utility, so we should not hesitate to decompose its features in order to make it more readable and to promote reusability.
In addition to these few constraints, the Bookshelf contributor is free to organise their files as they wishes as long as it remains coherent, understandable and it respects the global structure detailed below:
πdata
ββ π <module>
| ββ π .metadata
| | ββ π module.json
β ββ π function
β β ββ π <feature1>
β β β ββ π <feature1>.mcfunction
β β β ββ π ...
β β ββ π <feature2>.mcfunction
β β ββ π __load__.mcfunction
β β ββ π __unload__.mcfunction
β ββ π <predicate|loot_table|...>
β β ββ π <feature1>
β β β ββ π <feature1>.json
β β β ββ π ...
β β ββ π <feature2>.json
β ββ π tags
β ββ π function
β ββ π <feature1>.json
β ββ π ...
ββ π ...
Note
Functions, predicates, structures, loot tables etc. must respect the same structure.