command /sell []: trigger: if arg 1 is "cobblestone": if player has cobblestone: while amount of cobblestone in player's inventory is bigger than 0: add 1 to {_amount.%player%} remove 1 cobble from player's inventory add 0.05 to {_payout.%player%} message "" message " &e&lSold %{_amount.%player%}% Items:" message "" message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each" message "&7 and received &a$%{_payout.%player%}% &7in total." message "" add {_payout.%player%} to player's balance stop else: message "&c&lHey! &7You don't have enough of this item to sell it." if arg 1 is "stone": if player has stone: while amount of stone in player's inventory is bigger than 0: add 1 to {_amount.%player%} remove 1 stone from player's inventory add 0.07 to {_payout.%player%} message "" message " &e&lSold %{_amount.%player%}% Items:" message "" message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each" message "&7 and received &a$%{_payout.%player%}% &7in total." message "" add {_payout.%player%} to player's balance stop else: message "&c&lHey! &7You don't have enough of this item to sell it." if arg 1 is "charcoal": if player has charcoal: while amount of charcoal in player's inventory is bigger than 0: add 1 to {_amount.%player%} remove 1 charcoal from player's inventory add 0.10 to {_payout.%player%} message "" message " &e&lSold %{_amount.%player%}% Items:" message "" message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each" message "&7 and received &a$%{_payout.%player%}% &7in total." message "" add {_payout.%player%} to player's balance stop else: message "&c&lHey! &7You don't have enough of this item to sell it." if arg 1 is "coal": if player has coal item: while amount of coal item in player's inventory is bigger than 0: add 1 to {_amount.%player%} remove 1 coal item from player's inventory add 0.15 to {_payout.%player%} message "" message " &e&lSold %{_amount.%player%}% Items:" message "" message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each" message "&7 and received &a$%{_payout.%player%}% &7in total." message "" add {_payout.%player%} to player's balance stop else: message "&c&lHey! &7You don't have enough of this item to sell it." if arg 1 is "ironnugget": if player has iron nugget: while amount of iron nugget in player's inventory is bigger than 0: add 1 to {_amount.%player%} remove 1 iron nugget from player's inventory add 0.30 to {_payout.%player%} message "" message " &e&lSold %{_amount.%player%}% Items:" message "" message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each" message "&7 and received &a$%{_payout.%player%}% &7in total." message "" add {_payout.%player%} to player's balance stop else: message "&c&lHey! &7You don't have enough of this item to sell it." if arg 1 is "ironingot": if player has iron ingot: while amount of iron ingot in player's inventory is bigger than 0: add 1 to {_amount.%player%} remove 1 iron ingot from player's inventory add 0.50 to {_payout.%player%} message "" message " &e&lSold %{_amount.%player%}% Items:" message "" message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each" message "&7 and received &a$%{_payout.%player%}% &7in total." message "" add {_payout.%player%} to player's balance stop else: message "&c&lHey! &7You don't have enough of this item to sell it." if arg 1 is "goldnugget": if player has gold nugget: while amount of gold nugget in player's inventory is bigger than 0: add 1 to {_amount.%player%} remove 1 gold nugget from player's inventory add 0.60 to {_payout.%player%} message "" message " &e&lSold %{_amount.%player%}% Items:" message "" message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each" message "&7 and received &a$%{_payout.%player%}% &7in total." message "" add {_payout.%player%} to player's balance stop else: message "&c&lHey! &7You don't have enough of this item to sell it." if arg 1 is "goldingot": if player has gold ingot: while amount of gold ingot in player's inventory is bigger than 0: add 1 to {_amount.%player%} remove 1 gold ingot from player's inventory add 0.70 to {_payout.%player%} message "" message " &e&lSold %{_amount.%player%}% Items:" message "" message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each" message "&7 and received &a$%{_payout.%player%}% &7in total." message "" add {_payout.%player%} to player's balance stop else: message "&c&lHey! &7You don't have enough of this item to sell it." if arg 1 is not set: execute player command "/sellall" if arg 1 is "log": if player has 17:0: while amount of 17:0 in player's inventory is bigger than 0: add 1 to {_amount.%player%} remove 1 17:0 from player's inventory add 0.10 to {_payout.%player%} message "" message " &e&lSold %{_amount.%player%}% Items:" message "" message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each" message "&7 and received &a$%{_payout.%player%}% &7in total." message "" add {_payout.%player%} to player's balance stop else: message "&c&lHey! &7You don't have enough of this item to sell it." if arg 1 is not set: execute player command "/sellall" command /sellall: trigger: open chest with 4 rows named "Sell your items" to player wait 0.6 ticks format slot 0 of player with paper named "&a&lYour Balance" with lore "&fMoney &a%player's balance%" to be unstealable format slot 10 of player with cobblestone named "&e&lLow Quality Stone" with lore "&7&oTier 1 Item||||&fPrice &a$0.05 each||&r ||&6&lClick &fto sell all your low quality stone." to run [player command "/sell cobblestone"] format slot 19 of player with stone named "&e&lHigh Quality Stone" with lore "&7&oTier 2 Item||||&fPrice &a$0.07 each||&r ||&6&lClick &fto sell all your high quality stone." to run [player command "/sell stone"] format slot 11 of player with charcoal named "&e&lLow Quality Coal" with lore "&7&oTier 1 Item||||&fPrice &a$0.10 each||&r ||&6&lClick &fto sell all your low quality coal." to run [player command "/sell charcoal"] format slot 20 of player with coal item named "&e&lHigh Quality Coal" with lore "&7&oTier 2 Item||||&fPrice &a$0.15 each||&r ||&6&lClick &fto sell all your high quality coal." to run [player command "/sell coal"] format slot 12 of player with iron nugget named "&e&lLow Quality Iron" with lore "&7&oTier 1 Item||||&fPrice &a$0.30 each||&r ||&6&lClick &fto sell all your low quality iron." to run [player command "/sell ironnugget"] format slot 21 of player with iron ingot named "&e&lHigh Quality Iron" with lore "&7&oTier 2 Item||||&fPrice &a$0.50 each||&r ||&6&lClick &fto sell all your high quality iron" to run [player command "/sell ironingot"] format slot 13 of player with gold nugget named "&e&lLow Quality Gold" with lore "&7&oTier 1 Item||||&fPrice &a$0.60 each||&r ||&6&lClick &fto sell all your low quality gold." to run [player command "/sell goldnugget"] format slot 22 of player with gold ingot named "&e&lHigh Quality Gold" with lore "&7&oTier 2 Item||||&fPrice &a$0.70 each||&r ||&6&lClick &fto sell all your high quality gold" to run [player command "/sell goldingot"] format slot 14 of player with 17:0 named "&e&lLog" with lore "&7&oTier 1 Item||||&fPrice &a$0.10 each||&r ||&6&lClick &fto sell all your log" to run [player command "/sell log"]