function sdSlot(player: player, slot: integer, inv: text, item: item, name: text, lore: text, commands: text): if inventory name of {_player}'s current inventory is "%{_inv}%": if {_name} is not "" or " ": set slot {_slot} of {_player}'s current inventory to {_item} named "%colored {_name}%" with lore "%colored {_lore}%" else: set slot {_slot} of {_player}'s current inventory to {_item} with lore "%colored {_lore}%" set {_cml::*} to {_commands} split at "||" clear {sdGuiSlot%{_slot}%Of%{_inv}%For%{_player}%Comms::*} loop {_cml::*}: add loop-value to {sdGuiSlot%{_slot}%Of%{_inv}%For%{_player}%Comms::*} function sdOpen(player: player, rows: integer, name: text): open chest with {_rows} rows named "%colored {_name}%" to {_player} wait a tick loop {sdGuiChests::*}: if "%loop-value%" is "%{_name}%": stop add {_name} to {sdGuiChests::*} on inventory click: loop {sdGuiChests::*}: if "%colored loop-value%" is "%colored inventory name of player's current inventory%": if slot clicked slot of player's current inventory is not air: cancel event loop {sdGuiSlot%clicked slot%Of%inventory name of player's current inventory%For%player%Comms::*}: if "%loop-value-2%" is not "" or " ": execute player command "%loop-value-2%" stop variables: {os.koxy.szki3lko.%player%} = 0 {os.koxy.szki3lko.odbierz1.%player%} = false {os.koxy.szki3lko.odbierz2.%player%} = false on eat golden apple:1: add 1 to {os.koxy.szki3lko.%player%} if {os.koxy.szki3lko.%player%} = 5: set {os.koxy.szki3lko.odbierz1.%player%} to true if {os.koxy.szki3lko.%player%} = 10: set {os.koxy.szki3lko.odbierz2.%player%} to true command /sprawdz: trigger: send "%{os.koxy.szki3lko.%player%}%" command /osiagniecia []: trigger: sdOpen(player, 1, "&9Osiagniecia") sdSlot(player, 0, "&9Osiagniecia", golden apple:1, "&9Osiagniecia &6KOXY", "", "szosiagniecia koxy") command /szosiagniecia []: trigger: if arg 1 is "koxy": sdOpen(player, 1, "&9Osiagniecia &6KOXY") if {os.koxy.szki3lko.odbierz1.%player%} is false: sdSlot(player, 0, "&9Osiagniecia &6KOXY", golden apple:1, "Stopien I", "&4Nie", "") else if {os.koxy.szki3lko.odbierz1.%player%} is true: sdSlot(player, 0, "&9Osiagniecia &6KOXY", golden apple:1, "Stopien I", "&2Tak", "odbierz koxy1") else if {os.koxy.szki3lko.odbierz1.%player%} is 10: sdSlot(player, 0, "&9Osiagniecia &6KOXY", golden apple:1, "Stopien I", "Odebrano", "") if {os.koxy.szki3lko.odbierz2.%player%} is false: sdSlot(player, 1, "&9Osiagniecia &6KOXY", golden apple:1, "Stopien II", "&4Nie", "") else if {os.koxy.szki3lko.odbierz2.%player%} is true: sdSlot(player, 1, "&9Osiagniecia &6KOXY", golden apple:1, "Stopien II", "&2Tak", "odbierz koxy2") else if {os.koxy.szki3lko.odbierz2.%player%} is 10: sdSlot(player, 1, "&9Osiagniecia &6KOXY", golden apple:1, "Stopien II", "Odebrano", "") if arg 1 is "refy": open chest with 1 rows named "&9Osiagniecia: &eREFILE" to player format slot 0 of player with golden apple:0 named "&9Osiagniecia: &eREFILE" to close command /odbierz []: trigger: if arg 1 is "koxy1": close player's inventory add 5 diamond to player set {os.koxy.szki3lko.odbierz1.%player%} to 10 if arg 1 is "koxy2": close player's inventory add 25 gold ingot to player set {os.koxy.szki3lko.odbierz2.%player%} to 10