Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on right click on ender chest:
- cancel event
- if {combatlogg::%player's uuid%} is more than 0.1 seconds ago:
- cancel event
- send "&cCannot do this in combat, Wait %difference between {combatlogg::%player's uuid%} and now%" to player
- else:
- 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
- if {Newenderchestfixed::%player's uuid%} is not set:
- loop {_1::*}:
- set {enderchest.1::%player's uuid%::%(loop-iteration - 1)%} to loop-value
- set {Newenderchestfixed::%player's uuid%} to true
- openecpage(1, player)
- command /enderchest:
- trigger:
- if {combatlogg::%player's uuid%} is more than 0.1 seconds ago:
- send "&cCannot do this in combat, Wait %difference between {combatlogg::%player's uuid%} and now%" to player
- else:
- 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
- if {Newenderchestfixed::%player's uuid%} is not set:
- loop {_1::*}:
- set {enderchest.1::%player's uuid%::%(loop-iteration - 1)%} to loop-value
- set {Newenderchestfixed::%player's uuid%} to true
- openecpage(1, player)
- on inventory close:
- if event-inventory = (metadata tag "Enderchest" of player):
- set {_lore::*} to lore of item in slot 50 of metadata tag "Enderchest" of player
- set {_1} to first element of {_lore::*} parsed as int
- loop 45 times:
- set {enderchest.%({_1}-1)%::%player's uuid%::%(loop-value - 1)%} to slot (loop-value - 1) of metadata tag "Enderchest" of player
- on inventory click:
- if event-inventory = (metadata tag "Enderchest" of player):
- if event-slot is 46, 47, 48, 48, 49, 50, 51, 52 or 53:
- cancel event
- if event-slot is 48:
- if event-slot is paper:
- set {_lore::*} to lore of event-slot
- set {_1} to first element of {_lore::*} parsed as int
- loop 45 times:
- set {enderchest.%({_1}+1)%::%player's uuid%::%(loop-value - 1)%} to slot (loop-value - 1) of metadata tag "Enderchest" of player
- openecpage({_1}, player)
- if event-slot is 49:
- close player's inventory
- if event-slot is 50:
- if event-slot is paper:
- set {_lore::*} to lore of event-slot
- set {_1} to first element of {_lore::*} parsed as int
- loop 45 times:
- set {enderchest.%({_1}-1)%::%player's uuid%::%(loop-value - 1)%} to slot (loop-value - 1) of metadata tag "Enderchest" of player
- openecpage({_1}, player)
- function openecpage(i: int, p: player):
- clear metadata tag "Enderchest" of {_p}
- set metadata tag "Enderchest" of {_p} to chest inventory with 6 rows named " &d&lEnder Chest &5&lPage %{_i}%"
- loop 45 times:
- set slot (loop-value - 1) of metadata tag "Enderchest" of {_p} to {enderchest.%{_i}%::%{_p}'s uuid%::%(loop-value - 1)%}
- set slot 46, 47, 48, 48, 50, 51, 52 and 53 of metadata tag "Enderchest" of {_p} to light gray stained glass pane
- set slot 49 of metadata tag "Enderchest" of {_p} to barrier named "&cClose"
- if {_p} has permission "enderchest.%({_i} + 1)%":
- set slot 50 of metadata tag "Enderchest" of {_p} to paper named "&6Next Page" with lore "%({_i} + 1)%"
- if {_i} > 1:
- set slot 48 of metadata tag "Enderchest" of {_p} to paper named "&6Previous Page" with lore "%({_i} - 1)%"
- open metadata tag "Enderchest" of {_p} to {_p}
- function openotherecpage(i: int, p: player, f: player):
- clear metadata tag "Enderchest2" of {_p}
- set metadata tag "Enderchest2" of {_p} to chest inventory with 6 rows named " &d&lEnder Chest &5&lPage %{_i}%"
- loop 45 times:
- set slot (loop-value - 1) of metadata tag "Enderchest2" of {_p} to {enderchest.%{_i}%::%{_p}'s uuid%::%(loop-value - 1)%}
- set slot 46, 47, 48, 48, 50, 51, 52 and 53 of metadata tag "Enderchest" of {_p} to light gray stained glass pane
- set slot 49 of metadata tag "Enderchest2" of {_p} to barrier named "&cClose"
- open metadata tag "Enderchest2" of {_p} to {_f}
Advertisement
Add Comment
Please, Sign In to add comment