minecraft-expanded-datapack/data/undeadm-random/functions/rand20.mcfunction

25 lines
1.7 KiB
Mcfunction

scoreboard players set $value rnd_random 0
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:2,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:3,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:4,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:5,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:6,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:7,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:8,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:9,Tags:["Random"]}
execute store result score $value rnd_gen as @e[tag=Random,limit=1,sort=random] run data get entity @s DisabledSlots
scoreboard players operation $value rnd_random += $value rnd_gen
kill @e[tag=Random]
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["Random"]}
execute store result score $value rnd_gen as @e[tag=Random,limit=1,sort=random] run data get entity @s DisabledSlots 10
scoreboard players operation $value rnd_random += $value rnd_gen
kill @e[tag=Random]
scoreboard players add $value rnd_random 1