00ll00 6 år sedan
förälder
incheckning
e3c62fa3ba

+ 3 - 0
data/lib/functions/randarray/add.mcfunction

@@ -0,0 +1,3 @@
+execute store result storage lib:randarray cache int 1 run scoreboard players get @s mem
+data modify storage lib:randarray out append from storage lib:randarray cache
+kill @s

+ 6 - 0
data/lib/functions/randarray/call.mcfunction

@@ -0,0 +1,6 @@
+#input: $randarray_max mem
+#output: storage lib:randarray out
+
+data modify storage lib:randarray out set value []
+execute if score $randarray_max mem matches 1.. run function lib:randarray/recu
+execute as @e[tag=randarray_marker,sort=random] run function lib:randarray/add

+ 4 - 0
data/lib/functions/randarray/recu.mcfunction

@@ -0,0 +1,4 @@
+summon minecraft:area_effect_cloud ~ ~ ~ {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: ["randarray_marker","randarray_marker_"]}
+scoreboard players operation @e[tag=randarray_marker] mem = $randarray_max mem
+scoreboard players remove $randarray_max mem 1
+execute if score $randarray_max mem matches 1.. run function lib:randarray/recu