Guest User

factorial.json

a guest
May 1st, 2017
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 1.44 KB | None | 0 0
  1. {
  2.     "criteria": {
  3.         "nothing": {
  4.             "trigger": "minecraft:impossible"
  5.         }
  6.     },
  7.     "rewards": {
  8.         "commands": [
  9.             "advancement revoke @s only command:maths/factorial",
  10.             "scoreboard players add @s sc 0",
  11.             "tellraw @s[score_sc_min=0,score_sc=0,score_ix1=-1] {\"text\":\"Your number is too small!\"}",
  12.             "scoreboard players set @s[score_sc_min=0,score_sc=0,score_ix1=-1] sc 3",
  13.             "tellraw @s[score_sc_min=0,score_sc=0,score_ix1_min=13] {\"text\":\"Your number is too big!\"}",
  14.             "scoreboard players set @s[score_sc_min=0,score_sc=0,score_ix1_min=13] sc 3",
  15.             "scoreboard players set @s[score_sc_min=0,score_sc=0] ox1 1",
  16.             "scoreboard players set @s[score_sc_min=0,score_sc=0,score_ix1_min=0,score_ix1=0] sc 2",
  17.             "execute @s[score_sc_min=0,score_sc=0] ~ ~ ~ scoreboard players operation @s ic = @s ix1",
  18.             "scoreboard players set @s[score_sc_min=0,score_sc=0] sc 1",
  19.            
  20.             "execute @s[score_sc_min=1,score_sc=1] ~ ~ ~ scoreboard players operation @s ox1 *= @s ic",
  21.             "scoreboard players remove @s[score_sc_min=1,score_sc=1] ic 1",
  22.             "scoreboard players set @s[score_sc_min=1,score_sc=1,score_ic=0] sc 2",
  23.            
  24.             "advancement grant @s[score_sc=1] only command:maths/factorial",
  25.             "tellraw @s[score_sc=2,score_sc_min=2] [\"\",{\"text\":\"Factorial of \"},{\"score\":{\"name\":\"@s\",\"objective\":\"ix1\"}},{\"text\":\" is \"},{\"score\":{\"name\":\"@s\",\"objective\":\"ox1\"}}]",
  26.             "scoreboard players set @s[score_sc_min=2] sc 0"
  27.         ]
  28.     }
  29. }
Add Comment
Please, Sign In to add comment