Paste #103052: Nearest objective

Date: 2022/11/06 09:20:05 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


                on delta time secondly every:10:
                    - if !<player.inventory.contains_item[glowstone_dust].quantity[30]>:
                        - define glowstone.distance <player.location.distance[<player.location.find_blocks[glowstone].within[50].first>].round.if_null[51]>
                        - define glowstone.location <player.location.find_blocks[glowstone].within[50].first>
                        - define glowstone.objective "<&7>There's some glowstone to mine over here [<[glowstone.location].x> <[glowstone.location].y> <[glowstone.location].z>]"
                        - define objective:->:<[glowstone]>

                    - if !<player.inventory.contains_item[spider_eye].quantity[5]>:
                        - define spider.distance <player.location.distance[<player.location.find_entities[spider].within[50].first.location>].round.if_null[51]>
                        - define spider.location <player.location.find_entities[spider].within[50].first.location>
                        - define spider.objective "<&7>There are some spiders for spider eyes over here [<[spider.location].x> <[spider.location].y> <[spider.location].z>]"
                        - define objective:->:<[spider]>

                    - if !<player.inventory.contains_item[gold_ingot].quantity[8]>:
                        - define goldore.distance <player.location.distance[<player.location.find_blocks[gold_ore].within[50].first>].round.if_null[51]>
                        - define goldore.location <player.location.find_blocks[gold_ore].within[50].first>
                        - define goldore.objective "<&7>There's some gold ore to mine over here [<[goldore.location].x> <[goldore.location].y> <[goldore.location].z>]"
                        - define objective:->:<[goldore]>

                        - define deepslategoldore.distance <player.location.distance[<player.location.find_blocks[deepslate_gold_ore].within[50].first>].round.if_null[51]>
                        - define deepslategoldore.location <player.location.find_blocks[deepslate_gold_ore].within[50].first>
                        - define deepslategoldore.objective "<&7>There's some gold ore to mine over here [<[deepslategoldore.location].x> <[deepslategoldore.location].y> <[deepslategoldore.location].z>]"
                        - define objective:->:<[deepslategoldore]>

                        - define granitegoldore.distance <player.location.distance[<player.location.find_blocks[brown_glazed_terracotta].within[50].first>].round.if_null[51]>
                        - define granitegoldore.location <player.location.find_blocks[brown_glazed_terracotta].within[50].first>
                        - define granitegoldore.objective "<&7>There's some gold ore to mine over here [<[granitegoldore.location].x> <[granitegoldore.location].y> <[granitegoldore.location].z>]"
                        - define objective:->:<[granitegoldore]>

                    - narrate <list[<[glowstone.distance]>|<[spider.distance]>|<[glowstone.distance]>|<[deepslategoldore.distance]>|<[granitegoldore.distance]>].lowest.location>