options: pass-nums: 29 and 30, 31, 38, 39, 40, 47, 48, 49 function loginScreen(g: player, loc: location): open chest with 6 rows named "&c&lLOGIN" to {_g} set {sdEnderPlayerTemp::%{_g}%} to {_loc} wait 2 ticks loop 54 times: if inventory name of {_g}'s current inventory is "&c&lLOGIN": set slot loop-number -1 of {_g}'s current inventory to gray glass pane named "&0" loop integers from 11 to 15: if inventory name of {_g}'s current inventory is "&c&lLOGIN": set slot loop-number of {_g}'s current inventory to glass pane named "&f&l-" loop {@pass-nums}: add 1 to {_num} if inventory name of {_g}'s current inventory is "&c&lLOGIN": set slot loop-number of {_g}'s current inventory to {_num} of stone button named "&f&l%{_num}%" if inventory name of {_g}'s current inventory is "&c&lLOGIN": set slot 33 of {_g}'s current inventory to green glass pane named "&a&lLOGIN" set slot 42 of {_g}'s current inventory to orange glass pane named "&6&lRESET" set slot 51 of {_g}'s current inventory to red glass pane named "&c&lREMOVE CHEST" on click on ender chest: cancel event wait 2 ticks close player's inventory wait a tick set {_wait} to yaml value "passwords.lock-time" from file "../../sdEnder/config.yml" set {_ww} to {_wait} parsed as timespan if difference between {sdEnderPlayerBlock::%player%} and now is bigger than {_ww}: loginScreen(player, location of event-block) else: set {_mess} to yaml value "passwords.max-attemsts-message" from file "../../sdEnder/config.yml" send "%colored {_mess}%" command /sdEnder [] [] []: permission: op trigger: if arg-1 is "reset": if arg-2 is "pass": delete {sdEnderPlayerPass::%arg-3%} send "&aPassword removed from &e%arg-3%'s &aenderchest" if arg-2 is "att": set {sdEnderPlayerTry::%player%} to 0 send "&aAll attempts from &e%arg-3%'s &aenderchest were removed" on place of ender chest: if {sdEnderPlayerPass::%player%} is not set: open chest with 6 rows named "&c&lSET PASSWORD" to player set {sdEnderPlayerTemp::%player%} to location of event-block wait 2 ticks loop 54 times: if inventory name of player's current inventory is "&c&lSET PASSWORD": set slot loop-number -1 of player's current inventory to gray glass pane named "&0" loop integers from 11 to 15: if inventory name of player's current inventory is "&c&lSET PASSWORD": set slot loop-number of player's current inventory to glass pane named "&f&l-" loop {@pass-nums}: add 1 to {_num} if inventory name of player's current inventory is "&c&lSET PASSWORD": set slot loop-number of player's current inventory to {_num} of stone button named "&f&l%{_num}%" if inventory name of player's current inventory is "&c&lSET PASSWORD": set slot 33 of player's current inventory to green glass pane named "&a&lSAVE" set slot 42 of player's current inventory to orange glass pane named "&6&lRESET" set slot 51 of player's current inventory to red glass pane named "&c&lREMOVE CHEST" else: if difference between {sdEnderPlayerBlock::%player%} and now is bigger than 1 minute: loginScreen(player, location of event-block) else: set {_mess} to yaml value "passwords.max-attemsts-message" from file "../../sdEnder/config.yml" send "%colored {_mess}%" on inventory click: if inventory name of player's current inventory is "&c&lSET PASSWORD" or "&c&lLOGIN": cancel event if slot clicked slot of player's current inventory is red glass pane: close player's inventory set block at {sdEnderPlayerTemp::%player%} to air if slot clicked slot of player's current inventory is orange glass pane: loop integers from 11 to 15: if inventory name of player's current inventory is "&c&lSET PASSWORD" or "&c&lLOGIN": set slot loop-number of player's current inventory to glass pane named "&f&l-" if slot clicked slot of player's current inventory is green glass pane: loop integers from 11 to 15: add 1 to {_nol} if name of slot loop-number of player's current inventory is not "&f&l-": set {_NdP::%{_nol}%} to uncolored name of slot loop-number of player's current inventory else: send "&c&lYou must fill every field" stop loop 5 times: if {_pass} is not set: set {_pass} to "%{_NdP::%loop-number%}%" else: set {_pass} to "%{_pass}%%{_NdP::%loop-number%}%" if {sdEnderPlayerPass::%player%} is not set: set {sdEnderPlayerPass::%player%} to {_pass} send "&2&lYour new password is: &a&l%{_pass}%" else: if {_pass} is {sdEnderPlayerPass::%player%}: open the player's ender chest to the player set {_mesop} to yaml value "passwords.success-message" from file "../../sdEnder/config.yml" send "%colored {_mesop}%" set {sdEnderPlayerTry::%player%} to 0 else: loop integers from 11 to 15: if inventory name of player's current inventory is "&c&lSET PASSWORD" or "&c&lLOGIN": set slot loop-number of player's current inventory to glass pane named "&f&l-" set {_atm} to yaml value "passwords.attempts" from file "../../sdEnder/config.yml" if {sdEnderPlayerTry::%player%} is not set: set {sdEnderPlayerTry::%player%} to 0 else: if {sdEnderPlayerTry::%player%} < {_atm}: add 1 to {sdEnderPlayerTry::%player%} set {_messatt} to yaml value "passwords.failed-message" from file "../../sdEnder/config.yml" replace all "_ATT_" in {_messatt} with "%{sdEnderPlayerTry::%player%}%" replace all "_MAXATT_" in {_messatt} with "%{_atm}%" send "%colored {_messatt}%" else: close player's inventory set {_mess} to yaml value "passwords.max-attemsts-message" from file "../../sdEnder/config.yml" send "%colored {_mess}%" set {sdEnderPlayerBlock::%player%} to now set {sdEnderPlayerTry::%player%} to 0 if slot clicked slot of player's current inventory is stone button: set {_sN} to name of slot clicked slot of player's current inventory loop integers from 11 to 15: if name of slot loop-number of player's current inventory is "&f&l-": if inventory name of player's current inventory is "&c&lSET PASSWORD" or "&c&lLOGIN": set slot loop-number of player's current inventory to green glass pane named "&f&l%{_sN}%" stop if inventory name of player's current inventory is "&c&lLOGIN": cancel event