Since you can use this datapack in your projects (see "fair_use.txt") this documentation is here to help you.


1. Light levels
For simplicity and performance reasons 15 light levels from Minecraft have been simplified to 3 levels:
Low light - represents light level 6
Medium light - represents light level 10
Strong light - represents light level 14

Dynamic light sources can only emit one of the above levels, so please just choose the closest one for your needs (either no light, low light, medium light or strong light).


2. Adding new entities and items

The following /entity_types/ tags determine which entities emit certain light level:
dynlight:low_light_emitters
dynlight:medium_light_emitters
dynlight:strong_light_emitters

The following /items/ tags determine which items emit certain light level:
dynlight:low_light_emitters
dynlight:medium_light_emitters
dynlight:strong_light_emitters

In your datapack extend these tags to add new entities/items or replace to modify the current setup.
If you're a user, you can also edit these tags directly in this datapack.


3. Map making
Because I see the potential in dynamic light without mods for custom maps, I've decided to add some features just for map making.

3.1 Entity tags
You can use the following entity tags (add these by the /tag command) to make an always glowing entity:
dynlightLow
dynlightMedium
dynlightStrong

Example: make the nearest pig starts glowing medium light
/tag @e[type=minecraft:pig,sort=nearest,limit=1] add dynlightMedium

Other tags:
dynlightIgnore - Entities with this tag are completely ignored by the datapack.

3.2 Custom items
You can make any item the glowing one, add dynlightLevel nbt tag to the item tag data, set its value to either "low", "medium" or "strong"
{dynlightLevel:"low"}
{dynlightLevel:"medium"}
{dynlightLevel:"strong"}

Example: "miners hat"
/give @s minecraft:golden_helmet{dynlightLevel:"strong"}

There are also dedicated item modifiers that can add/modify this nbt tag for existing items (easier then with /data command)
dynlight:make_item_emit_no_light
dynlight:make_item_emit_low_light
dynlight:make_item_emit_medium_light
dynlight:make_item_emit_strong_light

Example: make an item in your hand the strong-glowing one
/item modify entity @s weapon.mainhand dynlight:make_item_emit_strong_light


4. Config
The datapack stores its config in dynlight:config command storage. There are the following data:
version (int) - Stores version of the datapack as integer, is increased with every new release. Use this to detect in-game what version of dynamic light (if any) is installed.
updateRate (byte) - Stores how fast light should be updated. Supports only values: 0b, 1b and 10b (0b - no light update, 1b - update light every tick, 10b - update light every 10 ticks).


5. Technical data
This datapack uses light blocks. It has been designed to never break any blocks, however placing a light block cause block update that can destroy nearby "unstable" blocks (blocks that break when you place another block next to them) such as floating grass or flowers, turn off lit redstone lamps that have no power etc. Furthermore light from a light block is the real minecraft light that can melt ice and snow, prevent monster spawning etc.

This datapack uses "dynlight" namespace.
This datapack uses command storage (dynlight:config)
This datapack uses marker entity (all markers have a "dynlightLightPos" entity tag)
This datapack can add entity tags to an item entity (dynlightLebeled, dynlightLow, dynlightMedium, dynlightStrong)

Things that are inaccessible outside the datapack (because they're removed in the same tick they've been created) aren't listed on the list above.

