Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void WriteCooldown() {
- //ttb:cooldown/main
- try {
- PrintWriter printCooldown = new PrintWriter("C:\\Users\\User\\AppData\\Roaming\\.minecraft\\saves\\TTB 1_13\\datapacks\\ttb\\data\\ttb\\functions\\cooldown\\main.mcfunction");
- for(int i = 1; i <= 1000; i++) {
- printCooldown.println("execute if entity @s[tag=!found_bar] unless entity @a[tag=bar"+i+"] run function ttb:cooldown/"+i+"");
- printCooldown.println("execute if entity @s[tag=bar"+i+"] run function ttb:cooldown/"+i+"");
- }
- printCooldown.println("execute if entity @s[scores={example=0}] run tag @s remove found_bar");
- printCooldown.close();
- } catch (Exception e) {
- System.out.println("Failed to write the cooldown main.mcfunction");
- }
- //1000 cooldown functions
- for(int i = 1; i<=1000; i++) {
- try {
- PrintWriter printCool = new PrintWriter("C:\\Users\\User\\AppData\\Roaming\\.minecraft\\saves\\TTB 1_13\\datapacks\\ttb\\data\\ttb\\functions\\cooldown\\"+i+".mcfunction");
- printCool.println("bossbar create boss:"+i+" \"Disunity\"");
- printCool.println("bossbar set boss:"+i+" players @s");
- printCool.println("bossbar set boss:"+i+" color blue");
- printCool.println("bossbar set boss:"+i+" max 1000");
- printCool.println("bossbar set boss:"+i+" value 100");
- printCool.println("bossbar set boss:"+i+" style progress");
- printCool.println("tag @s add bar"+i+"");
- printCool.println("tag @s add found_bar");
- printCool.println("execute store result bossbar boss:"+i+" value run scoreboard players get @s cooldown");
- printCool.println("scoreboard players remove @s cooldown 1");
- printCool.println("execute if entity @s[scores={cooldown=0}] run bossbar remove boss:"+i+"");
- printCool.println("execute if entity @s[scores={cooldown=0}] run tag @s remove bar"+i+"");
- printCool.close();
- } catch(Exception e) {
- System.out.println("Failed to write the cooldown cooldown functions.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment