function fWheat(l: location, d: number, pz: number, c: number, p: player): loop all blocks in radius ({_pz::%{_p}%} + 4) of {_l::%{_p}%}: if loop-block is fully grown wheat plant: play sound "ITEM_CROP_PLANT" at volume 0.7 at pitch 0.3 at location of loop-block if {_c::%{_p}%} > 0: set loop-block to wheat plant add 1 to {_d::%{_p}%} add -1 to {_c::%{_p}%} else: set loop-block to air add 1 to {_d::%{_p}%} function fCarrot(l: location, d: number, pz: number, c: number, p: player): loop all blocks in radius ({_pz::%{_p}%} + 4) of {_l::%{_p}%}: if loop-block is fully grown carrot plant: play sound "ITEM_CROP_PLANT" at volume 0.7 at pitch 0.3 at location of loop-block if {_c::%{_p}%} > 0: set loop-block to carrot plant add 1 to {_d::%{_p}%} add -1 to {_c::%{_p}%} else: set loop-block to air add 1 to {_d::%{_p}%} function fPotato(l: location, d: number, pz: number, c: number, p: player): loop all blocks in radius ({_pz::%{_p}%} + 4) of {_l::%{_p}%}: if loop-block is fully grown potato plant: play sound "ITEM_CROP_PLANT" at volume 0.7 at pitch 0.3 at location of loop-block if {_c::%{_p}%} > 0: set loop-block to potato plant add 1 to {_d::%{_p}%} add -1 to {_c::%{_p}%} else: set loop-block to air add 1 to {_d::%{_p}%} function fBeetroot(l: location, d: number, pz: number, c: number, p: player): loop all blocks in radius ({_pz::%{_p}%} + 4) of {_l::%{_p}%}: if loop-block is fully grown beetroot plant: play sound "ITEM_CROP_PLANT" at volume 0.7 at pitch 0.3 at location of loop-block if {_c::%{_p}%} > 0: set loop-block to beetroot plant add 1 to {_d::%{_p}%} add -1 to {_c::%{_p}%} else: set loop-block to air add 1 to {_d::%{_p}%} function fGiveAutoFarm(t: text, p: player, i: item): if arg 1 is set: set {_t} to arg 1 if arg 2 is set: set {_p} to arg 2 set {_i} to a player head set {_n} to nbt compound of {_i} if {_t} is "wheat": set {_name} to "&e&lᴡʜᴇᴀᴛ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;-1504850576,-331921807,-1631623817,-126124336],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2IzYzg0ZTRiZGFmNWNjNWY4NTYzMmFjOTI4ZDA1OWZjMmYxZmYwY2M5ZTU5OThmMWZlOGIyMjc4ODFhZGE4NSJ9fX0==""}]}}}" to {_n} if {_t} is "carrot": set {_name} to "&6&lᴄᴀʀʀᴏᴛ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;1614860007,-262520195,-1340003496,1902795156],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjJlMTBmODZmYzU2MDZlY2YzNGFkNDgwNzgxNjBiYmI3NzY4MjM2YTNkMjQxNTA3NTg2MmQzZDQ1MjYwNzJiZSJ9fX0==""}]}}}" to {_n} if {_t} is "potato": set {_name} to "&f&lᴘᴏᴛᴀᴛᴏ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;-84685895,-1383251578,-1667352216,1863931608],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2Y0NjI0ZWJmN2Q0MTlhMTFlNDNlZDBjMjAzOGQzMmNkMDlhZDFkN2E2YzZlMjBmNjMzOWNiY2ZlMzg2ZmQxYyJ9fX0==""}]}}}" to {_n} if {_t} is "beetroot": set {_name} to "&5&lʙᴇᴇᴛʀᴏᴏᴛ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;-860087388,-1897116498,-1504804187,1139486691],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTgzN2Y2NGRhOGI3MzUxMzliNGIwMTczZTY2ZjZkODBiMjA4MWM4NjhjNjgxM2EyMDExMmI4YWVjYTVjN2Y2NiJ9fX0==""}]}}}" to {_n} set tag "autofarm;type;%{_i}%" of {_i} to "%{_t}%" set tag "autofarm;autofarm;%{_i}%" of {_i} to true set tag "autofarm;level;%{_i}%" of {_i} to 0 set tag "autofarm;drop;%{_i}%" of {_i} to 0 set tag "autofarm;coal;%{_i}%" of {_i} to 0 set tag "autofarm;seeds;%{_i}%" of {_i} to 0 set tag "autofarm;owners;%{_i}%" of {_i} to 1 set tag "autofarm;speed;%{_i}%" of {_i} to 20 set tag "autofarm;destroyed;%{_i}%" of {_i} to 0 set tag "autofarm;placed;%{_i}%" of {_i} to 0 set tag "autofarm;withdrawed;%{_i}%" of {_i} to 0 set tag "autofarm;{_owners::*};%{_i}%" of {_i} to "---" give 1 of {_i} named "%{_name}%" with lore "&fᴘʟᴀᴄᴇ ɪᴛ ᴛᴏ sᴛᴀʀᴛ ᴀᴜᴛᴏ ғᴀʀᴍɪɴɢ" to {_p} else: send "&d&lxᴍᴀᴄʜɪɴᴇs &8> &cʏᴏᴜ ᴍᴜsᴛ sᴇʟᴇᴄᴛ ᴘʟᴀʏᴇʀ ᴛᴏ ɢɪᴠᴇ ʜɪᴍ/ʜᴇʀ ᴀᴜᴛᴏғᴀʀᴍ" to {_p} else: send "&d&lxᴍᴀᴄʜɪɴᴇs &8> &csᴇʟᴇᴄᴛ ᴀᴜᴛᴏғᴀʀᴍ ᴛʏᴘᴇ" to {_p} function fPlaceAutoFarm(p: player, l: location, pz: number, d: number, c: number, i: item): cancel event if block bellow {_l} is birch fence or oak fence or spruce fence or jungle fence or acacia fence or dark oak fence or mangrove fence or cherry fence or crimson fence or warped fence: set {_l} to {_i} remove one of {_i} from player's inventory play sound "ITEM_TRIDENT_HIT_GROUND" at volume 0.7 at pitch 0.3 at location of {_l} set {_b} to {_l} parsed as block set tag "autofarm;owner;%{_b}%" of nbt of {_b} to "%{_p}%" set {_checker} to tag "autofarm;type;%{_i}%" of {_i} set tag "autofarm;type;%{_b}%" of nbt of {_b} to "%{_checker}%" set {_checker} to tag "autofarm;level;%{_i}%" of {_i} set tag "autofarm;level;%{_b}%" of nbt of {_b} to "%{_checker}%" set {_checker} to tag "autofarm;drop;%{_i}%" of {_i} set tag "autofarm;drop;%{_b}%" of nbt of {_b} to "%{_checker}%" set {_checker} to tag "autofarm;coal;%{_i}%" of {_i} set tag "autofarm;coal;%{_b}%" of nbt of {_b} to "%{_checker}%" set {_checker} to tag "autofarm;seeds;%{_i}%" of {_i} set tag "autofarm;seeds;%{_b}%" of nbt of {_b} to "%{_checker}%" set {_checker} to tag "autofarm;owners;%{_i}%" of {_i} set tag "autofarm;owners;%{_b}%" of nbt of {_b} to "%{_checker}%" set {_checker} to tag "autofarm;speed;%{_i}%" of {_i} set tag "autofarm;speed;%{_b}%" of nbt of {_b} to "%{_checker}%" create holo "&d&lᴀᴜᴛᴏғᴀʀᴍ;&fᴄʟɪᴄᴋ ᴛᴏ ᴏᴘᴇɴ" with id "autoFarm.%{_l}%" at block above {_l} send "&d&lᴀᴜᴛᴏғᴀʀᴍ &8> &fᴘʟᴀᴄᴇᴅ ɴᴇᴡ ᴀᴜᴛᴏғᴀʀᴍ" to {_p} stop else: send "&d&lᴀᴜᴛᴏғᴀʀᴍ &8> &cᴀᴜᴛᴏғᴀʀᴍ ᴍᴜsᴛ ʙᴇ ᴘʟᴀᴄᴇᴅ ᴏɴ ᴀɴʏ ᴛʏᴘᴇ ᴏғ ғᴇɴᴄᴇ" to {_p} function fOpenGUI(p: player, pz: number, d: number, c: number, l: location, b: block): play sound "ITEM_BOOK_PAGE_TURN" at volume 0.7 at pitch 0.3 at location of {_p} set {_checker} to tag "autofarm;type;%{_p}%" of nbt of {_b} if {_checker} is "wheat": set {_type} to "ᴡʜᴇᴀᴛ" if {_checker} is "carrot": set {_type} to "ᴄᴀʀʀᴏᴛ" if {_checker} is "potato": set {_type} to "ᴘᴏᴛᴀᴛᴏ" if {_checker} is "beetroot": set {_type} to "ʙᴇᴇᴛʀᴏᴏᴛ" set {_g} to chest inventory with 6 rows named "&d&l%{_type}% ᴀᴜᴛᴏғᴀʀᴍ" set slot [integers between 0 and 8] and [integers between 46 and 53] of {_g} to gray stained glass pane named "&r" set slot 45 of {_g} to barrier named "&cʟᴇᴀᴠᴇ" with lore "&7ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴄʟᴏsᴇ ᴛʜɪs ɢᴜɪ" set {_i} to a player head set {_n} to nbt compound of {_i} if {_type} is "wheat": set {_name} to "&e&lᴡʜᴇᴀᴛ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;-1504850576,-331921807,-1631623817,-126124336],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2IzYzg0ZTRiZGFmNWNjNWY4NTYzMmFjOTI4ZDA1OWZjMmYxZmYwY2M5ZTU5OThmMWZlOGIyMjc4ODFhZGE4NSJ9fX0==""}]}}}" to {_n} if {_type} is "carrot": set {_name} to "&6&lᴄᴀʀʀᴏᴛ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;1614860007,-262520195,-1340003496,1902795156],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjJlMTBmODZmYzU2MDZlY2YzNGFkNDgwNzgxNjBiYmI3NzY4MjM2YTNkMjQxNTA3NTg2MmQzZDQ1MjYwNzJiZSJ9fX0==""}]}}}" to {_n} if {_type} is "potato": set {_name} to "&f&lᴘᴏᴛᴀᴛᴏ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;-84685895,-1383251578,-1667352216,1863931608],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2Y0NjI0ZWJmN2Q0MTlhMTFlNDNlZDBjMjAzOGQzMmNkMDlhZDFkN2E2YzZlMjBmNjMzOWNiY2ZlMzg2ZmQxYyJ9fX0==""}]}}}" to {_n} if {_type} is "beetroot": set {_name} to "&5&lʙᴇᴇᴛʀᴏᴏᴛ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;-860087388,-1897116498,-1504804187,1139486691],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTgzN2Y2NGRhOGI3MzUxMzliNGIwMTczZTY2ZjZkODBiMjA4MWM4NjhjNjgxM2EyMDExMmI4YWVjYTVjN2Y2NiJ9fX0==""}]}}}" to {_n} set {_checker} to tag "autofarm;owner;%{_b}%" of nbt of {_b} set slot 4 of {_g} to {_i} named "%{_name}%" with lore "&7* &fᴏᴡɴᴇʀ&8: &e%{_checker}%" set slot 31 of {_g} to {_type} named "&d&lᴡɪᴛʜᴅʀᴀᴡ ᴄʀᴏᴘs" with lore "&7* &fᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴡɪᴛʜᴅʀᴀᴡ ᴀʟʟ%nl%&7* &fᴍᴀɢᴀᴢɪɴᴀᴛᴇᴅ ᴄʀᴏᴏᴘs ᴀɴᴅ sᴇᴇᴅs" set slot 19 of {_g} to gold ingot named "&d&lᴜᴘɢʀᴀᴅᴇs" with lore "&7* &fᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴜᴘɢʀᴀᴅᴇ ᴀᴜᴛᴏғᴀʀᴍ" if {_type} is "beetroot" or "wheat": set slot 21 of {_g} to wheat seeds named "&d&lsᴇᴇᴅs ᴍᴀɢᴀᴢɪɴᴇ" with lore "&7* &fᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴍᴀɴᴀɢᴇ sᴇᴇᴅs ᴛᴏ ᴘʟᴀɴᴛ" if {_type} is "carrot" or "potato": set slot 21 of {_g} to wheat seeds named "&d&lsᴇᴇᴅs ᴍᴀɢᴀᴢɪɴᴇ" with lore "&7* &fᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴍᴀɴᴀɢᴇ sᴇᴇᴅs ᴛᴏ ᴘʟᴀɴᴛ" set slot 23 of {_g} to coal named "&d&lғᴜᴇʟ ᴍᴀɴᴀɢᴇ" with lore "&7* &fᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴍᴀɴᴀɢᴇ ғᴜᴇʟ" set slot 25 of {_g} to redstone dust named "&d&lᴘɪᴄᴋᴜᴘ ᴀᴜᴛᴏғᴀʀᴍ" with lore "&7* &fᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴅᴇsᴛʀᴏʏ ᴀᴜᴛᴏғᴀʀᴍ%nl%&7* &fᴀɴᴅ ᴘɪᴄᴋᴜᴘ ɪᴛ%nl%&r%nl%&7* &fʏᴏᴜ ᴡɪʟʟ ɴᴏᴛ ʟᴏsᴛ ᴍᴀɢᴀᴢɪɴᴇᴅ ᴄᴏᴀʟ,%nl%&7* &fᴄʀᴏᴘs ᴀɴᴅ sᴇᴇᴅs. ᴛʜᴇʏ ᴡɪʟʟ ʙᴇ sᴀᴠᴇᴅ ᴀɴᴅ%nl%&7* &fʏᴏᴜ ᴡɪʟʟ ʙᴇ ᴀʙʟᴇ ᴛᴏ ᴡɪᴛʜᴅʀᴀᴡ ᴛʜᴇᴍ ʟᴀᴛᴇʀ" set slot 29 of {_g} to knowledge book named "&d&lsᴛᴀᴛɪsᴛɪᴄs" with lore "&7* &fᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ sᴇᴇ sᴛᴀᴛɪsᴛɪᴄs ʟɪsᴛ" set slot 33 of {_g} to lever named "&d&lsᴇᴛᴛɪɴɢs & ᴘᴇʀᴍɪssɪᴏɴs" with lore "&7* &fᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴇᴅɪᴛ ᴀɴᴅ%nl%&7* &fsᴇᴇ ᴀᴜᴛᴏғᴀʀᴍ sᴇᴇᴛɪɴɢs ᴀɴᴅ ᴘᴇʀᴍɪssɪᴏɴs" open {_g} to {_p} function fOpenGUICoal(p: player, c: number, b: block): play sound "ITEM_BOOK_PAGE_TURN" at volume 0.7 at pitch 0.3 at location of {_p} set {_checker} to tag "autofarm;coal;%{_b}%" of nbt of {_b} set {_gc} to chest inventory with 2 rows named "&d&lғᴜᴇʟ ᴍᴀɢᴀᴢɪɴᴇ" if {_checker} < 64: set slot 0 of {_gc} to {_checker} of coal if {_checker} > 64: set {_slots} to 1 if {_checker} > 128: set {_slots} to 2 if {_checker} > 192: set {_slots} to 3 if {_checker} > 256: set {_slots} to 4 if {_checker} > 320: set {_slots} to 5 if {_checker} > 384: set {_slots} to 6 if {_checker} > 448: set {_slots} to 7 if {_checker} > 512: set {_slots} to 8 set {_s} to 0 loop ({_slots} -1) times: set slot {_s} of {_gc} to 64 of coal remove 64 from {_checker} add 1 to {_s} set slot {_slots} of {_gc} to {_checker} of coal set slot 9 of {_gc} to barrier named "&cʟᴇᴀᴠᴇ" with lore "&7ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴄʟᴏsᴇ ᴛʜɪs ɢᴜɪ" set slot 17 of {_gc} to emerald named "&d&lᴅᴇᴘᴏsɪᴛ ᴄᴏᴀʟ" with lore "&7* &fɪғ ʏᴏᴜ ᴀʀᴇ ʜᴏʟᴅɪɴɢ ᴄᴏᴀʟ ᴄʟɪᴄᴋ%nl%&7* &fʜᴇʀᴇ ᴛᴏ ᴅᴇᴘᴏsɪᴛ ɪᴛ ᴛᴏ ᴀᴜᴛᴏғᴀʀᴍ" set slot [integers between 10 and 16] of {_gc} to gray stained glass pane named "&r" open {_gc} to {_p} function fDepositCoal(b: block, p: player, a: number): play sound "BLOCK_ANVIL_PLACE" at volume 0.7 at pitch 0.3 at location of {_p} if {_p} is holding coal: set {_x} to "%{_p}'s tool%" set {_x} to first 2 characters of {_x} replace all " " in {_x} with "" set {_x} to {_x} parsed as integer remove "%{_x}%" coal from {_p}'s inventory add "%{_x}%" to tag "autofarm;coal;%{_b}%" of nbt of {_b} close {_p}'s inventory wait 4 ticks open {_gc} to {_p} else: send "&d&lᴀᴜᴛᴏғᴀʀᴍ &8> &cʏᴏᴜ ᴍᴜsᴛ ʜᴏʟᴅɪɴɢ ᴄᴏᴀʟ" to {_p} function fOpenGUISeeds(p: player, c: number, b: block): play sound "ITEM_BOOK_PAGE_TURN" at volume 0.7 at pitch 0.3 at location of {_p} set {_type} to tag "autofarm;type;%{_b}%" of nbt of {_b} set {_checker} to tag "autofarm;seeds;%{_b}%" of nbt of {_b} set {_gs} to chest inventory with 2 rows named "&d&lsᴇᴇᴅs ᴍᴀɢᴀᴢɪɴᴇ" if {_type} is "wheat": set {_type} to "wheat seeds" if {_type} is "beetroot": set {_type} to "beetroot seeds" if {_checker} < 64: set slot 0 of {_gs} to {_checker} of {_type} if {_checker} > 64: set {_slots} to 1 if {_checker} > 128: set {_slots} to 2 if {_checker} > 192: set {_slots} to 3 if {_checker} > 256: set {_slots} to 4 if {_checker} > 320: set {_slots} to 5 if {_checker} > 384: set {_slots} to 6 if {_checker} > 448: set {_slots} to 7 if {_checker} > 512: set {_slots} to 8 set {_s} to 0 loop ({_slots} -1) times: set slot {_s} of {_gs} to 64 of {_type} remove 64 from {_checker} add 1 to {_s} set slot {_slots} of {_gs} to {_checker} of {_type} set slot 9 of {_gs} to barrier named "&cʟᴇᴀᴠᴇ" with lore "&7ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴄʟᴏsᴇ ᴛʜɪs ɢᴜɪ" set slot 17 of {_gs} to emerald named "&d&lᴅᴇᴘᴏsɪᴛ sᴇᴇᴅs" with lore "&7* &fɪғ ʏᴏᴜ ᴀʀᴇ ʜᴏʟᴅɪɴɢ {_type} ᴄʟɪᴄᴋ%nl%&7* &fʜᴇʀᴇ ᴛᴏ ᴅᴇᴘᴏsɪᴛ ɪᴛ ᴛᴏ ᴀᴜᴛᴏғᴀʀᴍ" set slot [integers between 10 and 16] of {_gs} to gray stained glass pane named "&r" open {_gs} to {_p} function fDepositSeeds(b: block, p: player, a: number): play sound "BLOCK_ANVIL_PLACE" at volume 0.7 at pitch 0.3 at location of {_p} set {_type} to tag "autofarm;type;%{_b}%" of nbt of {_b} if {_type} is "wheat": set {_type} to "wheat seeds" if {_type} is "beetroot": set {_type} to "beetroot seeds" if {_p} is holding {_type}: set {_x} to "%{_p}'s tool%" set {_x} to first 2 characters of {_x} replace all " " in {_x} with "" set {_x} to {_x} parsed as integer remove "%{_x}%" {_type} from {_p}'s inventory add "%{_x}%" to tag "autofarm;seeds;%{_b}%" of nbt of {_b} close {_p}'s inventory wait 4 ticks open {_gs} to {_p} else: send "&d&lᴀᴜᴛᴏғᴀʀᴍ &8> &cʏᴏᴜ ᴍᴜsᴛ ʜᴏʟᴅɪɴɢ {_type}" to {_p} function fWithdrawCrops(b: block, p: player, d: number): set {_type} to tag "autofarm;type;%{_b}%" of nbt of {_b} if {_type} is "wheat": set {_type} to "wheat seeds" if {_type} is "beetroot": set {_type} to "beetroot seeds" set {_amount} to tag "autofarm;drop;%{_b}%" of nbt of {_b} drop {_amount} of {_type} under {_p} set tag "autofarm;drop;%{_b}%" of {_b} to 0 send "&d&lᴀᴜᴛᴏғᴀʀᴍ &8> &aᴡɪᴛʜᴅʀᴀᴡᴇᴅ %{_amount}% ᴄʀᴏᴏᴘs" to {_p} play sound "ENTITY_PLAYER_LVLUP" at volume 0.7 at pitch 0.3 at location of {_p} function fCloseGUI(p: player): close {_p}'s inventory play sound "ITEM_SHIELD_BLOCK" at volume 0.7 at pitch 0.3 at location of {_p} function fOpenGUIUpgrades(p: player, b: block, pz: number): play sound "ITEM_BOOK_PAGE_TURN" at volume 0.7 at pitch 0.3 at location of {_p} set {_gu} to chest inventory with 5 rows named "&d&lᴜᴘɢʀᴀᴅᴇs" set slot [integers between 0 and 8] and [integers between 37 and 45] of {_gu} to gray stained glass pane named "&r" set {_lvl} to tag "autofarm;level;%{_b}%" of nbt of {_b} set slot 36 of {_gu} to barrier named "&cʟᴇᴀᴠᴇ" with lore "&7ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴄʟᴏsᴇ ᴛʜɪs ɢᴜɪ" if {_lvl} is 5: set slot 19 of {_gu} to netherite ingot named "&d&lʀᴀɴɢᴇ" with lore "&7ᴛʜɪs ɪɴᴄʀᴇᴀsᴇ ᴀᴜᴛᴏғᴀʀᴍ ʀᴀɴɢᴇ%nl%&r%nl%&8* &fʟᴇᴠᴇʟ &c&lᴍᴀx%nl%&r%nl%&8* &fᴛʜɪs ʟᴇᴠᴇʟ&7: &d%{_blocks}% &fʙʟᴏᴄᴋs%nl%&8* &fɴᴇxᴛ ʟᴇᴠᴇʟ&7: &cᴍᴀx &fʙʟᴏᴄᴋs%nl%&r%nl%&8* &fᴜᴘɢʀᴀᴅᴇ ᴄᴏsᴛ&7: &cᴍᴀx" if {_lvl} < 5: set {_blocks} to {_lvl} + 4 set {_next} to {_blocks} + 4 set {_cost} to {_lvl} * 2000 set slot 19 of {_gu} to netherite ingot named "&d&lʀᴀɴɢᴇ" with lore "&7ᴛʜɪs ɪɴᴄʀᴇᴀsᴇ ᴀᴜᴛᴏғᴀʀᴍ ʀᴀɴɢᴇ%nl%&r%nl%&8* &fʟᴇᴠᴇʟ &d&l%{_lvl}%%nl%&r%nl%&8* &fᴛʜɪs ʟᴇᴠᴇʟ&7: &d%{_blocks}% &fʙʟᴏᴄᴋs%nl%&8* &fɴᴇxᴛ ʟᴇᴠᴇʟ&7: &d%{_next}% &fʙʟᴏᴄᴋs%nl%&r%nl%&8* &fᴜᴘɢʀᴀᴅᴇ ᴄᴏsᴛ&7: &d%{_cost}$%%nl%&r%nl%&a&nᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴜᴘɢʀᴀᴅᴇ" set {_head} to a player head set {_n} to nbt compound of {_head} add nbt compound of "{SkullOwner:{Id:[I;-1232833884,707153456,-1766754080,-475208717],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWE0NDBiZDdhZWYxOWRmYjE1ZDQ2OWZhNzg1MWQzMGE1NzdhOWJkM2MxZTgwZDJhYjJmODFiZjQ2OGI3NDNkMSJ9fX0==""}]}}}" to {_n} set {_owners} to tag "autofarm;owners;%{_b}%" of nbt of {_b} if {_owners} is 5: set slot 22 of {_gu} to {_head} named "&d&lᴏᴡɴᴇʀs" with lore "&7ᴛʜɪs ɪɴᴄʀᴇᴀsᴇ ɴᴜᴍʙᴇʀ ᴏғ ᴘʟᴀʏᴇʀs%nl%&7ᴡʜᴏ ᴄᴀɴ ᴇᴅɪᴛ ᴀɴᴅ ᴘɪᴄᴋᴜᴘ ᴀᴜᴛᴏғᴀʀᴍ%nl%&r%nl%&8* &fʟᴇᴠᴇʟ &c&lᴍᴀx%nl%&r%nl%&8* &fᴛʜɪs ʟᴇᴠᴇʟ&7: &d%{_owners}% &fᴘʟᴀʏᴇʀs%nl%&8* &fɴᴇxᴛ ʟᴇᴠᴇʟ&7: &cᴍᴀx &fᴘʟᴀʏᴇʀs%nl%&r%nl%&8* &fᴜᴘɢʀᴀᴅᴇ ᴄᴏsᴛ&7: &cᴍᴀx" if {_owners} < 5: set {_next} to {_owners} + 1 set {_cost} to {_owners} * 3000 set slot 22 of {_gu} to {_head} named "&d&lᴏᴡɴᴇʀs" with lore "&7ᴛʜɪs ɪɴᴄʀᴇᴀsᴇ ɴᴜᴍʙᴇʀ ᴏғ ᴘʟᴀʏᴇʀs%nl%&7ᴡʜᴏ ᴄᴀɴ ᴇᴅɪᴛ ᴀɴᴅ ᴘɪᴄᴋᴜᴘ ᴀᴜᴛᴏғᴀʀᴍ%nl%&r%nl%&8* &fʟᴇᴠᴇʟ &d&l%{_owners}%%nl%&r%nl%&8* &fᴛʜɪs ʟᴇᴠᴇʟ&7: &d%{_owners}% &fᴘʟᴀʏᴇʀs%nl%&8* &fɴᴇxᴛ ʟᴇᴠᴇʟ&7: &d%{_next}% &fᴘʟᴀʏᴇʀs%nl%&r%nl%&8* &fᴜᴘɢʀᴀᴅᴇ ᴄᴏsᴛ&7: &d%{_cost}$%%nl%&r%nl%&a&nᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴜᴘɢʀᴀᴅᴇ" set {_speed} to tag "autofarm;speed;%{_b}%" of nbt of {_b} if {_speed} is 5: set slot 25 of {_gu} to feather named "&d&lsᴘᴇᴇᴅ" with lore "&7ᴛʜɪs ᴅᴇᴄʀᴇᴀsᴇ ᴛɪᴍᴇ ʙᴇᴛᴡᴇᴇɴ%nl%&7ᴅᴇsᴛʀᴏʏ ᴀɴᴅ ʀᴇᴘʟᴀᴄᴇ ᴄʀᴏᴘ%nl%&r%nl%&8* &fᴛʜɪs ʟᴇᴠᴇʟ&7: &d%{_speed}% &fsᴇᴄᴏɴᴅs%nl%&8* &fɴᴇxᴛ ʟᴇᴠᴇʟ&7: &cᴍᴀx &fsᴇᴄᴏɴᴅs%nl%&r%nl%&8* &fᴜᴘɢʀᴀᴅᴇ ᴄᴏsᴛ&7: &cᴍᴀx" if {_speed} < 5: set {_next} to {_speed} -2 set {_cost} to {_speed} * 500 set slot 25 of {_gu} to feather named "&d&lsᴘᴇᴇᴅ" with lore "&7ᴛʜɪs ᴅᴇᴄʀᴇᴀsᴇ ᴛɪᴍᴇ ʙᴇᴛᴡᴇᴇɴ%nl%&7ᴅᴇsᴛʀᴏʏ ᴀɴᴅ ʀᴇᴘʟᴀᴄᴇ ᴄʀᴏᴘ%nl%&r%nl%&8* &fᴛʜɪs ʟᴇᴠᴇʟ&7: &d%{_speed}% &fsᴇᴄᴏɴᴅs%nl%&8* &fɴᴇxᴛ ʟᴇᴠᴇʟ&7: &d%{_next}% &fsᴇᴄᴏɴᴅs%nl%&r%nl%&8* &fᴜᴘɢʀᴀᴅᴇ ᴄᴏsᴛ&7: &d%{_cost}$%%nl%&r%nl%&a&nᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴜᴘɢʀᴀᴅᴇ" function fUpgradeRangeConfirmation(p: player, b: block, lvl: number): play sound "ITEM_BOOK_PAGE_TURN" at volume 0.7 at pitch 0.3 at location of {_p} set {_checker} to tag "autofarm;level;%{_b}%" of nbt of {_b} set {_money} to {_checker} * 2000 set {_gc} to chest inventory with 1 row named "&d&lᴄᴏɴғɪʀᴍᴀᴛɪᴏɴ" set slot [integers between 0 and 8] of {_gc} to gray stained glass pane named "&r" set slot 3 of {_gc} to lime candle named "&aᴄᴏɴғɪʀᴍ ᴜᴘɢʀᴀᴅᴇ" with lore "&r%nl%&8* &fᴡʜᴇɴ ʏᴏᴜ ᴡɪʟʟ ᴄʟɪᴄᴋ ʜᴇʀᴇ%nl%&8* &fʏᴏᴜ ᴡɪʟʟ ʟᴏsᴛ %{_money}% $%nl%&8* &fᴀɴᴅ ʏᴏᴜʀ ʀᴀɴɢᴇ ᴡɪʟʟ ʙᴇ ɪɴᴄʀᴇᴀsᴇᴅ%nl%&r%nl%&a&oᴄʟɪᴄᴋ ᴛᴏ ᴄᴏɴғɪʀᴍ" set slot 5 of {_gc} to red candle named "&cᴄᴀɴᴄᴇʟ" with lore "&r%nl%&8* &fᴡʜᴇɴ ʏᴏᴜ ᴡɪʟʟ ᴄʟɪᴄᴋ ʜᴇʀᴇ%nl%&8* &fᴜᴘɢʀᴀᴅᴇ ᴡɪʟʟ ʙᴇ ᴄᴀɴᴄᴇʟᴇᴅ" if {_checker} is 5: close {_p}'s inventory send title "&c&lᴏʜ ɴᴏ" with subtitle "&fʏᴏᴜ ʜᴀᴠᴇ ʀᴇᴀᴄʜᴇᴅ ᴍᴀx ʟᴇᴠᴇʟ" to {_p} wait 4 seconds open {_gu} to player if {_checker} < 5: if {_p}'s balance >= {_money}: close {_p}'s inventory wait 4 ticks open {_gc} to {_p} else: close {_p}'s inventory send title "&c&lᴏʜ ɴᴏ" with subtitle "&fʏᴏᴜ ᴅᴏ ɴᴏᴛ ʜᴀᴠᴇ ɴᴇᴇᴅᴇᴅ ᴍᴏɴᴇʏ" to {_p} wait 4 seconds open {_gu} to {_p} function fUpgradeOwnersConfirmation(p: player, b: block, lvl: number): play sound "ITEM_BOOK_PAGE_TURN" at volume 0.7 at pitch 0.3 at location of {_p} set {_checker} to tag "autofarm;owners;%{_b}%" of nbt of {_b} set {_money} to {_checker} * 3000 set {_gc} to chest inventory with 1 row named "&d&lᴄᴏɴғɪʀᴍᴀᴛɪᴏɴ" set slot [integers between 0 and 8] of {_gc} to gray stained glass pane named "&r" set slot 3 of {_gc} to lime candle named "&aᴄᴏɴғɪʀᴍ ᴜᴘɢʀᴀᴅᴇ" with lore "&r%nl%&8* &fᴡʜᴇɴ ʏᴏᴜ ᴡɪʟʟ ᴄʟɪᴄᴋ ʜᴇʀᴇ%nl%&8* &fʏᴏᴜ ᴡɪʟʟ ʟᴏsᴛ %{_money}% $%nl%&8* &fᴀɴᴅ ʏᴏᴜʀ ᴏɴᴡᴇʀs ʟɪᴍɪᴛ ᴡɪʟʟ ʙᴇ ɪɴᴄʀᴇᴀsᴇᴅ%nl%&r%nl%&a&oᴄʟɪᴄᴋ ᴛᴏ ᴄᴏɴғɪʀᴍ" set slot 5 of {_gc} to red candle named "&cᴄᴀɴᴄᴇʟ" with lore "&r%nl%&8* &fᴡʜᴇɴ ʏᴏᴜ ᴡɪʟʟ ᴄʟɪᴄᴋ ʜᴇʀᴇ%nl%&8* &fᴜᴘɢʀᴀᴅᴇ ᴡɪʟʟ ʙᴇ ᴄᴀɴᴄᴇʟᴇᴅ" if {_checker} is 5: close {_p}'s inventory send title "&c&lᴏʜ ɴᴏ" with subtitle "&fʏᴏᴜ ʜᴀᴠᴇ ʀᴇᴀᴄʜᴇᴅ ᴍᴀx ʟᴇᴠᴇʟ" to {_p} wait 4 seconds open {_gu} to player if {_checker} < 5: if {_p}'s balance >= {_money}: close {_p}'s inventory wait 4 ticks open {_gc} to {_p} else: close {_p}'s inventory send title "&c&lᴏʜ ɴᴏ" with subtitle "&fʏᴏᴜ ᴅᴏ ɴᴏᴛ ʜᴀᴠᴇ ɴᴇᴇᴅᴇᴅ ᴍᴏɴᴇʏ" to {_p} wait 4 seconds open {_gu} to {_p} function fUpgradeSpeedConfirmation(p: player, b: block, lvl: number): play sound "ITEM_BOOK_PAGE_TURN" at volume 0.7 at pitch 0.3 at location of {_p} set {_checker} to tag "autofarm;speed;%{_b}%" of nbt of {_b} set {_money} to {_checker} * 500 set {_gc} to chest inventory with 1 row named "&d&lᴄᴏɴғɪʀᴍᴀᴛɪᴏɴ" set slot [integers between 0 and 8] of {_gc} to gray stained glass pane named "&r" set slot 3 of {_gc} to lime candle named "&aᴄᴏɴғɪʀᴍ ᴜᴘɢʀᴀᴅᴇ" with lore "&r%nl%&8* &fᴡʜᴇɴ ʏᴏᴜ ᴡɪʟʟ ᴄʟɪᴄᴋ ʜᴇʀᴇ%nl%&8* &fʏᴏᴜ ᴡɪʟʟ ʟᴏsᴛ %{_money}% $%nl%&8* &fᴀɴᴅ ʏᴏᴜʀ sᴘᴇᴇᴅ ᴡɪʟʟ ʙᴇ ɪɴᴄʀᴇᴀsᴇᴅ%nl%&r%nl%&a&oᴄʟɪᴄᴋ ᴛᴏ ᴄᴏɴғɪʀᴍ" set slot 5 of {_gc} to red candle named "&cᴄᴀɴᴄᴇʟ" with lore "&r%nl%&8* &fᴡʜᴇɴ ʏᴏᴜ ᴡɪʟʟ ᴄʟɪᴄᴋ ʜᴇʀᴇ%nl%&8* &fᴜᴘɢʀᴀᴅᴇ ᴡɪʟʟ ʙᴇ ᴄᴀɴᴄᴇʟᴇᴅ" if {_checker} is 5: close {_p}'s inventory send title "&c&lᴏʜ ɴᴏ" with subtitle "&fʏᴏᴜ ʜᴀᴠᴇ ʀᴇᴀᴄʜᴇᴅ ᴍᴀx ʟᴇᴠᴇʟ" to {_p} wait 4 seconds open {_gu} to player if {_checker} < 5: if {_p}'s balance >= {_money}: close {_p}'s inventory wait 4 ticks open {_gc} to {_p} else: close {_p}'s inventory send title "&c&lᴏʜ ɴᴏ" with subtitle "&fʏᴏᴜ ᴅᴏ ɴᴏᴛ ʜᴀᴠᴇ ɴᴇᴇᴅᴇᴅ ᴍᴏɴᴇʏ" to {_p} wait 4 seconds open {_gu} to {_p} function fPickUpAutoFarm(p: player, b: block, i: item, l: location) :: item: set {_t} to tag "autofarm;type;%{_b}%" of nbt of {_b} set {_i} to a player head set {_n} to nbt compound of {_i} if {_t} is "wheat": set {_name} to "&e&lᴡʜᴇᴀᴛ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;-1504850576,-331921807,-1631623817,-126124336],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2IzYzg0ZTRiZGFmNWNjNWY4NTYzMmFjOTI4ZDA1OWZjMmYxZmYwY2M5ZTU5OThmMWZlOGIyMjc4ODFhZGE4NSJ9fX0==""}]}}}" to {_n} if {_t} is "carrot": set {_name} to "&6&lᴄᴀʀʀᴏᴛ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;1614860007,-262520195,-1340003496,1902795156],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjJlMTBmODZmYzU2MDZlY2YzNGFkNDgwNzgxNjBiYmI3NzY4MjM2YTNkMjQxNTA3NTg2MmQzZDQ1MjYwNzJiZSJ9fX0==""}]}}}" to {_n} if {_t} is "potato": set {_name} to "&f&lᴘᴏᴛᴀᴛᴏ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;-84685895,-1383251578,-1667352216,1863931608],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2Y0NjI0ZWJmN2Q0MTlhMTFlNDNlZDBjMjAzOGQzMmNkMDlhZDFkN2E2YzZlMjBmNjMzOWNiY2ZlMzg2ZmQxYyJ9fX0==""}]}}}" to {_n} if {_t} is "beetroot": set {_name} to "&5&lʙᴇᴇᴛʀᴏᴏᴛ ᴀᴜᴛᴏғᴀʀᴍ" add nbt compound of "{SkullOwner:{Id:[I;-860087388,-1897116498,-1504804187,1139486691],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTgzN2Y2NGRhOGI3MzUxMzliNGIwMTczZTY2ZjZkODBiMjA4MWM4NjhjNjgxM2EyMDExMmI4YWVjYTVjN2Y2NiJ9fX0==""}]}}}" to {_n} if {_p}'s target-block is {_i}: set {_p}'s target-block to air play sound "ENTITY_VILLAGER_YES" at volume 0.7 at pitch 0.3 at location of {_p} delete holo "autoFarm.%{_l}%" set tag "autofarm;owner;%{_i}%" of nbt of {_i} to "%{_p}%" set {_checker} to tag "autofarm;type;%{_b}%" of {_b} set tag "autofarm;type;%{_i}%" of nbt of {_i} to "%{_checker}%" set {_checker} to tag "autofarm;level;%{_b}%" of {_b} set tag "autofarm;level;%{_i}%" of nbt of {_i} to "%{_checker}%" set {_checker} to tag "autofarm;drop;%{_b}%" of {_b} set tag "autofarm;drop;%{_i}%" of nbt of {_i} to "%{_checker}%" set {_checker} to tag "autofarm;coal;%{_b}%" of {_b} set tag "autofarm;coal;%{_i}%" of nbt of {_i} to "%{_checker}%" set {_checker} to tag "autofarm;seeds;%{_b}%" of {_b} set tag "autofarm;seeds;%{_i}%" of nbt of {_i} to "%{_checker}%" set {_checker} to tag "autofarm;owners;%{_b}%" of {_b} set tag "autofarm;owners;%{_i}%" of nbt of {_i} to "%{_checker}%" set {_checker} to tag "autofarm;speed;%{_b}%" of {_b} set tag "autofarm;speed;%{_i}%" of nbt of {_i} to "%{_checker}%" return {_i} function fInformationGUI(p: player, b: block): set {_gi} to chest inventory with 5 rows named "&d&lɪɴғᴏʀᴍᴀᴛɪᴏɴs" set slot [integers between 0 and 8] and [integers between 37 and 45] of {_gi} to gray stained glass pane named "&r" set slot 36 of {_gi} to barrier named "&cʟᴇᴀᴠᴇ" with lore "&7ᴄʟɪᴄᴋ ʜᴇʀᴇ ᴛᴏ ᴄʟᴏsᴇ ᴛʜɪs ɢᴜɪ" set {_checker} to tag "autofarm;level;%{_b}%" of nbt of {_b} set {_checker2} to tag "autofarm;owners;%{_b}%" of nbt of {_b} set {_checker3} to tag "autofarm;speed;%{_b}%" of nbt of {_b} set slot 19 of {_gi} to copper ingot named "&e&lᴜᴘɢʀᴀᴅᴇs" with lore "&8* &fʀᴀɴɢᴇ ʟᴇᴠᴇʟ&7: &f%{_checker}%%nl%&8* &fᴏᴡɴᴇʀs ʟɪᴍɪᴛ&7: &f%{_checker2}%%nl%&8* &fsᴘᴇᴇᴅ&7: &f%{_checker3}%" set slot 21 of {_gi} to iron ingot named "&e&lᴏᴡɴᴇʀs" with lore "&8* &f