command /plecak: trigger: open chest with 1 row named "{@tag} &fPlecak" to player wait 2 ticks format slot 3 of player with 1 iron sword named "Plecak Zelazny" to close then run [execute player command "/plecak1215" format slot 5 of player with 1 diamond sword named "Plecak Diamentowy" to close then run [execute player command "/plecak2j1231" command /plecak1215: trigger: wait 2 ticks open chest with 1 row named "&fPlecak Zelazny" to player wait 2 ticks loop {przedmiotyplecak1::*}: set player's current inventory's slot loop-index parsed as integer to loop-value stop command /plecak2j1231: trigger: wait 2 ticks open chest with 1 row named "&fPlecak Diamentowy" to player wait 2 ticks loop {przedmiotyplecak2::*}: set player's current inventory's slot loop-index parsed as integer to loop-value stop on inventory close: if "%inventory name of player's current inventory%" is "&fPlecak Zelazny": set {_i} to 0 loop 9 times: set {przedmiotyplecak1::%{_i}%} to player's current inventory's slot {_i} add 1 to {_i} stop if "%inventory name of player's current inventory%" is "&fPlecak Diamentowy": set {_i} to 0 loop 9 times: set {przedmiotyplecak2::%{_i}%} to player's current inventory's slot {_i} add 1 to {_i} stop