https://github.com/marcono1234/light-level-datapack
Minecraft datapack querying the light level using block predicates.
https://github.com/marcono1234/light-level-datapack
datapack minecraft
Last synced: 4 months ago
JSON representation
Minecraft datapack querying the light level using block predicates.
- Host: GitHub
- URL: https://github.com/marcono1234/light-level-datapack
- Owner: Marcono1234
- Created: 2019-10-29T15:08:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-30T15:57:49.000Z (over 6 years ago)
- Last Synced: 2025-08-31T05:43:15.771Z (10 months ago)
- Topics: datapack, minecraft
- Language: mcfunction
- Size: 11.7 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# light-level-datapack
Minecraft datapack which uses the `light` [block predicate](https://minecraft.gamepedia.com/Predicate) introduced in 19w38a and stores the result as scoreboard score.
## Repository layout
The [datapack](/datapack) folder contains the actual datapack as a separate folder.
This allows separating meta information (like this README file, license, ...) from files used by the datapack.
## Usage
### Initialization
Should happen automatically when the datapack is (re-)loaded. However, it can also be triggered manually by running:
```
/function marcono1234:light_level/_init
```
### Actions
#### Get light level
1. Run
```
/function marcono1234:light_level/get_light_level
```
Afterwards the fake player `#result` (since v1.1) and if an entity is executing the function that entity (i.e. `@s`) will have the light level value as `light_level` score.
```
/scoreboard players get @s light_level
```
:warning: The light level represents the "visible light (`max(sky-darkening,block)`)". Therefore outside during day it will be 15, making you unable to determine the block light level.
### Removal
To remove all scoreboard objectives added by this datapack, run:
```
/function marcono1234:light_level/_remove
```
Afterwards the datapack folder should be removed since it won't work correctly anymore.
It can be [initialized](#Initialization) to become functional again.