이전퀴즈 데이터팩
This commit is contained in:
11
music_quiz/data/func/function/shuffle/f1.mcfunction
Normal file
11
music_quiz/data/func/function/shuffle/f1.mcfunction
Normal file
@@ -0,0 +1,11 @@
|
||||
execute store result score length func.temp run data get storage func:temp shuffle.list
|
||||
|
||||
execute if score length func.temp matches 0 run return 1
|
||||
|
||||
execute store result score random func.temp run random value 0..2147483646
|
||||
scoreboard players operation random func.temp %= length func.temp
|
||||
|
||||
execute run function func:shuffle/f2 with storage func:temp {index:0}
|
||||
|
||||
execute store result storage func:temp shuffle.index int 1 run scoreboard players get random func.temp
|
||||
function func:shuffle/f2 with storage func:temp shuffle
|
||||
4
music_quiz/data/func/function/shuffle/f2.mcfunction
Normal file
4
music_quiz/data/func/function/shuffle/f2.mcfunction
Normal file
@@ -0,0 +1,4 @@
|
||||
$data modify storage func:temp shuffle.result append from storage func:temp shuffle.list[$(index)]
|
||||
$data remove storage func:temp shuffle.list[$(index)]
|
||||
|
||||
function func:shuffle/f1
|
||||
Reference in New Issue
Block a user