Diagamez

Light level update datapack

Oct 1st, 2026
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.33 KB | None | 0 0
  1. ## light.json (context int provider)
  2. {
  3. "type": "minecraft:number_dispatcher",
  4. "cases": [
  5. {
  6. "condition": {
  7. "type": "minecraft:location_check",
  8. "predicate": {
  9. "light": {
  10. "light": 0
  11. }
  12. }
  13. },
  14. "value": 0
  15. },
  16. {
  17. "condition": {
  18. "type": "minecraft:location_check",
  19. "predicate": {
  20. "light": {
  21. "light": 1
  22. }
  23. }
  24. },
  25. "value": 1
  26. },
  27. {
  28. "condition": {
  29. "type": "minecraft:location_check",
  30. "predicate": {
  31. "light": {
  32. "light": 2
  33. }
  34. }
  35. },
  36. "value": 2
  37. },
  38. {
  39. "condition": {
  40. "type": "minecraft:location_check",
  41. "predicate": {
  42. "light": {
  43. "light": 3
  44. }
  45. }
  46. },
  47. "value": 3
  48. },
  49. {
  50. "condition": {
  51. "type": "minecraft:location_check",
  52. "predicate": {
  53. "light": {
  54. "light": 4
  55. }
  56. }
  57. },
  58. "value": 4
  59. },
  60. {
  61. "condition": {
  62. "type": "minecraft:location_check",
  63. "predicate": {
  64. "light": {
  65. "light": 5
  66. }
  67. }
  68. },
  69. "value": 5
  70. },
  71. {
  72. "condition": {
  73. "type": "minecraft:location_check",
  74. "predicate": {
  75. "light": {
  76. "light": 6
  77. }
  78. }
  79. },
  80. "value": 6
  81. },
  82. {
  83. "condition": {
  84. "type": "minecraft:location_check",
  85. "predicate": {
  86. "light": {
  87. "light": 7
  88. }
  89. }
  90. },
  91. "value": 7
  92. },
  93. {
  94. "condition": {
  95. "type": "minecraft:location_check",
  96. "predicate": {
  97. "light": {
  98. "light": 8
  99. }
  100. }
  101. },
  102. "value": 8
  103. },
  104. {
  105. "condition": {
  106. "type": "minecraft:location_check",
  107. "predicate": {
  108. "light": {
  109. "light": 9
  110. }
  111. }
  112. },
  113. "value": 9
  114. },
  115. {
  116. "condition": {
  117. "type": "minecraft:location_check",
  118. "predicate": {
  119. "light": {
  120. "light": 10
  121. }
  122. }
  123. },
  124. "value": 10
  125. },
  126. {
  127. "condition": {
  128. "type": "minecraft:location_check",
  129. "predicate": {
  130. "light": {
  131. "light": 11
  132. }
  133. }
  134. },
  135. "value": 11
  136. },
  137. {
  138. "condition": {
  139. "type": "minecraft:location_check",
  140. "predicate": {
  141. "light": {
  142. "light": 12
  143. }
  144. }
  145. },
  146. "value": 12
  147. },
  148. {
  149. "condition": {
  150. "type": "minecraft:location_check",
  151. "predicate": {
  152. "light": {
  153. "light": 13
  154. }
  155. }
  156. },
  157. "value": 13
  158. },
  159. {
  160. "condition": {
  161. "type": "minecraft:location_check",
  162. "predicate": {
  163. "light": {
  164. "light": 14
  165. }
  166. }
  167. },
  168. "value": 14
  169. },
  170. {
  171. "condition": {
  172. "type": "minecraft:location_check",
  173. "predicate": {
  174. "light": {
  175. "light": 15
  176. }
  177. }
  178. },
  179. "value": 15
  180. }
  181. ]
  182. }
  183.  
  184. ## compute_max.json (context int provider)
  185. {
  186. "type": "minecraft:max",
  187. "inputs": [
  188. {
  189. "type": "minecraft:score",
  190. "target": {
  191. "type": "minecraft:fixed",
  192. "name": "up"
  193. },
  194. "score": "light.light"
  195. },
  196. {
  197. "type": "minecraft:score",
  198. "target": {
  199. "type": "minecraft:fixed",
  200. "name": "down"
  201. },
  202. "score": "light.light"
  203. },
  204. {
  205. "type": "minecraft:score",
  206. "target": {
  207. "type": "minecraft:fixed",
  208. "name": "north"
  209. },
  210. "score": "light.light"
  211. },
  212. {
  213. "type": "minecraft:score",
  214. "target": {
  215. "type": "minecraft:fixed",
  216. "name": "east"
  217. },
  218. "score": "light.light"
  219. },{
  220. "type": "minecraft:score",
  221. "target": {
  222. "type": "minecraft:fixed",
  223. "name": "south"
  224. },
  225. "score": "light.light"
  226. },{
  227. "type": "minecraft:score",
  228. "target": {
  229. "type": "minecraft:fixed",
  230. "name": "west"
  231. },
  232. "score": "light.light"
  233. }
  234. ]
  235. }
  236.  
  237. ## update_light.mcfunction
  238. execute store result score up light.light positioned ~ ~1 ~ run compute entity @s integer light:light
  239. execute store result score down light.light positioned ~ ~-1 ~ run compute entity @s integer light:light
  240. execute store result score east light.light positioned ~1 ~ ~ run compute entity @s integer light:light
  241. execute store result score west light.light positioned ~-1 ~ ~ run compute entity @s integer light:light
  242. execute store result score north light.light positioned ~ ~ ~-1 run compute entity @s integer light:light
  243. execute store result score south light.light positioned ~ ~ ~1 run compute entity @s integer light:light
  244. execute store result entity @s brightness.sky int 1 run compute default integer light:compute_max
Advertisement
Add Comment
Please, Sign In to add comment