call.mcfunction 677 B

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