Guest User

My Java Mcfunction File Code

a guest
Feb 16th, 2018
1,652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. public void WriteCooldown() {
  2. //ttb:cooldown/main
  3. try {
  4. PrintWriter printCooldown = new PrintWriter("C:\\Users\\User\\AppData\\Roaming\\.minecraft\\saves\\TTB 1_13\\datapacks\\ttb\\data\\ttb\\functions\\cooldown\\main.mcfunction");
  5.  
  6. for(int i = 1; i <= 1000; i++) {
  7. printCooldown.println("execute if entity @s[tag=!found_bar] unless entity @a[tag=bar"+i+"] run function ttb:cooldown/"+i+"");
  8. printCooldown.println("execute if entity @s[tag=bar"+i+"] run function ttb:cooldown/"+i+"");
  9. }
  10.  
  11. printCooldown.println("execute if entity @s[scores={example=0}] run tag @s remove found_bar");
  12. printCooldown.close();
  13.  
  14. } catch (Exception e) {
  15. System.out.println("Failed to write the cooldown main.mcfunction");
  16. }
  17.  
  18. //1000 cooldown functions
  19.  
  20. for(int i = 1; i<=1000; i++) {
  21. try {
  22. PrintWriter printCool = new PrintWriter("C:\\Users\\User\\AppData\\Roaming\\.minecraft\\saves\\TTB 1_13\\datapacks\\ttb\\data\\ttb\\functions\\cooldown\\"+i+".mcfunction");
  23. printCool.println("bossbar create boss:"+i+" \"Disunity\"");
  24. printCool.println("bossbar set boss:"+i+" players @s");
  25. printCool.println("bossbar set boss:"+i+" color blue");
  26. printCool.println("bossbar set boss:"+i+" max 1000");
  27. printCool.println("bossbar set boss:"+i+" value 100");
  28. printCool.println("bossbar set boss:"+i+" style progress");
  29.  
  30. printCool.println("tag @s add bar"+i+"");
  31. printCool.println("tag @s add found_bar");
  32.  
  33. printCool.println("execute store result bossbar boss:"+i+" value run scoreboard players get @s cooldown");
  34. printCool.println("scoreboard players remove @s cooldown 1");
  35. printCool.println("execute if entity @s[scores={cooldown=0}] run bossbar remove boss:"+i+"");
  36. printCool.println("execute if entity @s[scores={cooldown=0}] run tag @s remove bar"+i+"");
  37.  
  38. printCool.close();
  39.  
  40. } catch(Exception e) {
  41. System.out.println("Failed to write the cooldown cooldown functions.");
  42. }
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment