Guest User

Untitled

a guest
Sep 29th, 2024
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.89 KB | None | 0 0
  1. on right click on ender chest:
  2. cancel event
  3. if {combatlogg::%player's uuid%} is more than 0.1 seconds ago:
  4. cancel event
  5. send "&cCannot do this in combat, Wait %difference between {combatlogg::%player's uuid%} and now%" to player
  6. else:
  7. set {_1::*} to slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 and 27 of player's enderchest
  8. if {Newenderchestfixed::%player's uuid%} is not set:
  9. loop {_1::*}:
  10. set {enderchest.1::%player's uuid%::%(loop-iteration - 1)%} to loop-value
  11. set {Newenderchestfixed::%player's uuid%} to true
  12. openecpage(1, player)
  13.  
  14. command /enderchest:
  15. trigger:
  16. if {combatlogg::%player's uuid%} is more than 0.1 seconds ago:
  17. send "&cCannot do this in combat, Wait %difference between {combatlogg::%player's uuid%} and now%" to player
  18. else:
  19. set {_1::*} to slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 and 27 of player's enderchest
  20. if {Newenderchestfixed::%player's uuid%} is not set:
  21. loop {_1::*}:
  22. set {enderchest.1::%player's uuid%::%(loop-iteration - 1)%} to loop-value
  23. set {Newenderchestfixed::%player's uuid%} to true
  24. openecpage(1, player)
  25.  
  26.  
  27. on inventory close:
  28. if event-inventory = (metadata tag "Enderchest" of player):
  29. set {_lore::*} to lore of item in slot 50 of metadata tag "Enderchest" of player
  30. set {_1} to first element of {_lore::*} parsed as int
  31. loop 45 times:
  32. set {enderchest.%({_1}-1)%::%player's uuid%::%(loop-value - 1)%} to slot (loop-value - 1) of metadata tag "Enderchest" of player
  33.  
  34. on inventory click:
  35. if event-inventory = (metadata tag "Enderchest" of player):
  36. if event-slot is 46, 47, 48, 48, 49, 50, 51, 52 or 53:
  37. cancel event
  38. if event-slot is 48:
  39. if event-slot is paper:
  40. set {_lore::*} to lore of event-slot
  41. set {_1} to first element of {_lore::*} parsed as int
  42. loop 45 times:
  43. set {enderchest.%({_1}+1)%::%player's uuid%::%(loop-value - 1)%} to slot (loop-value - 1) of metadata tag "Enderchest" of player
  44. openecpage({_1}, player)
  45. if event-slot is 49:
  46. close player's inventory
  47. if event-slot is 50:
  48. if event-slot is paper:
  49. set {_lore::*} to lore of event-slot
  50. set {_1} to first element of {_lore::*} parsed as int
  51. loop 45 times:
  52. set {enderchest.%({_1}-1)%::%player's uuid%::%(loop-value - 1)%} to slot (loop-value - 1) of metadata tag "Enderchest" of player
  53. openecpage({_1}, player)
  54.  
  55.  
  56. function openecpage(i: int, p: player):
  57. clear metadata tag "Enderchest" of {_p}
  58. set metadata tag "Enderchest" of {_p} to chest inventory with 6 rows named " &d&lEnder Chest &5&lPage %{_i}%"
  59. loop 45 times:
  60. set slot (loop-value - 1) of metadata tag "Enderchest" of {_p} to {enderchest.%{_i}%::%{_p}'s uuid%::%(loop-value - 1)%}
  61. set slot 46, 47, 48, 48, 50, 51, 52 and 53 of metadata tag "Enderchest" of {_p} to light gray stained glass pane
  62. set slot 49 of metadata tag "Enderchest" of {_p} to barrier named "&cClose"
  63. if {_p} has permission "enderchest.%({_i} + 1)%":
  64. set slot 50 of metadata tag "Enderchest" of {_p} to paper named "&6Next Page" with lore "%({_i} + 1)%"
  65. if {_i} > 1:
  66. set slot 48 of metadata tag "Enderchest" of {_p} to paper named "&6Previous Page" with lore "%({_i} - 1)%"
  67. open metadata tag "Enderchest" of {_p} to {_p}
  68.  
  69. function openotherecpage(i: int, p: player, f: player):
  70. clear metadata tag "Enderchest2" of {_p}
  71. set metadata tag "Enderchest2" of {_p} to chest inventory with 6 rows named " &d&lEnder Chest &5&lPage %{_i}%"
  72. loop 45 times:
  73. set slot (loop-value - 1) of metadata tag "Enderchest2" of {_p} to {enderchest.%{_i}%::%{_p}'s uuid%::%(loop-value - 1)%}
  74. set slot 46, 47, 48, 48, 50, 51, 52 and 53 of metadata tag "Enderchest" of {_p} to light gray stained glass pane
  75. set slot 49 of metadata tag "Enderchest2" of {_p} to barrier named "&cClose"
  76. open metadata tag "Enderchest2" of {_p} to {_f}
Advertisement
Add Comment
Please, Sign In to add comment