Guest User

Experience Handling Command (Minecraft)

a guest
Jan 21st, 2022
1,503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. ## score2points
  2. xp set @s 0 points
  3. xp set @s 129 levels
  4. execute if score in math matches 512.. run xp add @s 512 points
  5. execute if score in math matches 512.. run scoreboard players remove in math 512
  6. execute if score in math matches 256.. run xp add @s 256 points
  7. execute if score in math matches 256.. run scoreboard players remove in math 256
  8. execute if score in math matches 128.. run xp add @s 128 points
  9. execute if score in math matches 128.. run scoreboard players remove in math 128
  10. execute if score in math matches 64.. run xp add @s 64 points
  11. execute if score in math matches 64.. run scoreboard players remove in math 64
  12. execute if score in math matches 32.. run xp add @s 32 points
  13. execute if score in math matches 32.. run scoreboard players remove in math 32
  14. execute if score in math matches 16.. run xp add @s 16 points
  15. execute if score in math matches 16.. run scoreboard players remove in math 16
  16. execute if score in math matches 8.. run xp add @s 8 points
  17. execute if score in math matches 8.. run scoreboard players remove in math 8
  18. execute if score in math matches 4.. run xp add @s 4 points
  19. execute if score in math matches 4.. run scoreboard players remove in math 4
  20. execute if score in math matches 2.. run xp add @s 2 points
  21. execute if score in math matches 2.. run scoreboard players remove in math 2
  22. execute if score in math matches 1.. run xp add @s 1 points
  23. execute if score in math matches 1.. run scoreboard players remove in math 1
  24. xp set @s 5 levels
  25.  
  26. #level2points
  27. ######################################################
  28. # calculate experience points required for that level
  29. #
  30. # xp = | 2*l + 7; [0,16]
  31. # | 5*l - 38; [17-31]
  32. # | 9*l - 158; [32,inf]
  33. ######################################################
  34.  
  35. scoreboard players operation out math = in math
  36. execute if score in math matches 0..16 run scoreboard players operation out math *= #2 constant
  37. execute if score in math matches 17..31 run scoreboard players operation out math *= #5 constant
  38. execute if score in math matches 32.. run scoreboard players operation out math *= #9 constant
  39. execute if score in math matches 0..16 run scoreboard players add out math 7
  40. execute if score in math matches 17..31 run scoreboard players remove out math 38
  41. execute if score in math matches 32.. run scoreboard players remove out math 158
  42.  
  43. #scoreboard players operation out math *= in1 math
  44. #scoreboard players operation out math /= #100 constant
Advertisement
Add Comment
Please, Sign In to add comment