-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs.txt
65 lines (43 loc) · 2.5 KB
/
docs.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--DYNLIGHTSLIB--
Welcome to the documentation of Dynlightslib.
Dynlightslib is a mcfunction library that allows you to easily manage lights in Minecraft. It integrates three mechanisms: lights, temporary lights, and dynamic lights. This library is based on the manipulation of light data in a storage and not on several entities. This greatly optimizes its performance because there is no summon for each light.
-Installation
Drag the library into the `<datapack>/data folder`.
In the `<datapack>/data/minecraft/tags/functions` folder, add `"dynlightslib:core/load"` to `load.json`. Add `"dynlightslib:core/tick"` in `tick.json` preferably after the other files to avoid tick delays. Otherwise you can manually execute these functions in the mcfunction files of your datapack.
--Functions--
You can access the library functions directly from the functions folder but you can also access them in `core/commands/<function>/run` to avoid version checking.
The function arguments are in dynlightslib:args in root. you can modify them with these commands :
data modify storage dynlightslib:args root set value {<argument>:<value>}
data modify storage dynlightslib:args root.<argument> set value <value>
execute store result storage dynlightlib:args root.<argument> <type> 1 run ...
Some arguments must be of a certain type. You can format your values in this way :
execute store result .. .. .. <the type> 1 run <a get command>
-light
Allows you to create a light with an id.
Arguments:
Pos: List[double, double, double] -> The position of the light, vector MUST be a double.
id: int -> the ID of the light
level: int -> The light level 0..15
force: bool -> If the light can replace a block if it is not air or water
Exemple:
data modify storage dynlightslib:args root set value {Pos:[10d, 80d, -15d], id:10, level:15, force:False}
function dynlightslib:light
-temporary_light
Allows you to create a temporary light.
Arguments:
Pos: List[double, double, double] -> The position of the light, vector MUST be a double.
Duration: int -> Duration in tick
level: int -> The light level 0..15
force: bool -> If the light can replace a block if it is not air or water
-remove_light
Allow you to delete a light.
Arguments:
id: int -> The id of the light to delete
-enable_dynlight
Toggle on dynamic light for the executor
Exemple:
execute as @e[tag=has_torch] run function dynlightslib:enable_dynlight
-disable_dynlight
Toggle off dynamic light for the executor
Exemple:
execute as @e[tag=!has_torch] run function dynlightslib:disable_dynlight