2
0

call.mcfunction 664 B

1234567891011
  1. #inputs:
  2. # $randarray_max mem 生成1~max的随机数列,如果有去重则没有last
  3. # $randarray_last mem 上一个数列的末尾,如果不需要去重则为0
  4. #output: storage lib:randarray out
  5. data modify storage lib:randarray out set value []
  6. execute if score $randarray_max mem matches 1.. run function lib:randarray/recu
  7. execute as @e[tag=randarray_marker] if score @s mem = $randarray_last mem run kill @s
  8. execute as @e[tag=randarray_marker,sort=random] run function lib:randarray/add
  9. # tellraw @a ["新随机数组已生成:",{"nbt": "out","storage": "lib:randarray"},",去重:",{"score": {"name": "$randarray_last","objective": "mem"}}]