variables: {marihuana::*} = 0 on inventory click: if inventory name of player's current inventory is "&6&lNarkotyki": cancel event if event-slot is 3: if player has 2 diamonds: remove 2 diamonds from player's inventory give wheat seed named "&a&lSadzonka marihuany" with lore "&6Po posadzeniu wyrośnie z niej marihuana" to player close player's inventory else: close player's inventory send "&4Nie masz wystarczająco diamentów, zakupić sadzonkę!" if event-slot is 5: if player has 6 diamonds: remove 6 diamonds from player's inventory give wheat named "&a&lMarihuana" to player close player's inventory else: close player's inventory send "&4Nie masz wystarczająco diamentów, zakupić marihuanę!" on rightclick: if event-block is soil block: if player's tool is wheat seed named "&a&lSadzonka marihuany" with lore "&6Po posadzeniu wyrośnie z niej marihuana": set {_find} to false loop {marihuana::*}: if {marihuana::%loop-index%} is event-location: set {_find} to true set {marihuana::%loop-index%} to event-location if {_find} is false: add event-location to {marihuana::*} send "&aPosadziłeś marihuanę!" on break: if "%event-block%" contains "wheat": set {_location} to event-location set y-coordinate of {_location} to y-coordinate of {_location} - 1 loop {marihuana::*}: if {marihuana::%loop-index%} is {_location}: cancel event set event-block to air remove {marihuana::%loop-index%} from {marihuana::*} if event-block is ripe wheat plant: give wheat named "&a&lMarihuana" to player else: give wheat seed named "&a&lSadzonka marihuany" with lore "&6Po posadzeniu wyrośnie z niej marihuana" to player command /narkotyki: trigger: open chest with 2 rows named "&6&lNarkotyki" to player set player's current inventory's slot 3 to wheat seed named "&a&lSadzonka Marihuany" with lore "&6Koszt: &b2 diamenty" set player's current inventory's slot 5 to wheat named "&a&lMarihuana" with lore "&6Koszt: &b6 diamentów" command /lokacje: permission: marihuana.lokacje permission message: &cBrak uprawnień! trigger: loop {marihuana::*}: send "&a%{marihuana::%loop-index%}%"