baritone icon indicating copy to clipboard operation
baritone copied to clipboard

Add a 'loot' / 'pickup' command to pickup dropped items

Open DyonR opened this issue 6 years ago • 11 comments

I would like to see a 'loot' or 'pickup' command which allows Baritone to pickup the specified list of items. It is similar to #mine, but instead of actually mining the block or items, it will just loot them. A use case for how this can be used: I chop down a lot of trees, but because all the leaves decay sticks, apples and some remaining logs will remain on the ground. Using #pickup or #loot Baritone will automatically pickup these blocks and items Example command: #pickup minecraft:sticks, minecraft:oak_log, minecraft:apples #loot minecraft:sticks, minecraft:oak_log, minecraft:apples As far as I know, the #mine command already does something when the specified blocks are nearby, but it would be great to have this as a 'standalone' feature without needing Baritone to mine.

DyonR avatar Oct 13 '19 00:10 DyonR

Like a "pick these items up" list? Sounds useful. I would like to see this added.

ghost avatar Oct 13 '19 03:10 ghost

I'm pretty sure baritone already does this as it highlights all items that are dropped by the blocks that you break and for me, it goes back and picks them up

AliahX avatar Oct 13 '19 03:10 AliahX

I'm pretty sure baritone already does this as it highlights all items that are dropped by the blocks that you break and for me, it goes back and picks them up

DyonR says that decaying blocks are not counted by Baritone, and drops like sticks and apples will not be picked up / highlighted

ghost avatar Oct 13 '19 04:10 ghost

this would be a really great addition, maybe have a priority list for items that need to be picked up. what would really be cool is if it would place shulkers, put picked up items inside them (if there's no space) and the break them again

ironkeyboard avatar Apr 27 '20 23:04 ironkeyboard

Yeah! That would be awesome. For example when clearing out a huge area for building a huge castle, you still want those huge amounts of material, right? Now they are just being left there, waiting for the end of there existence... ●︿●

GGinso avatar Jun 10 '20 16:06 GGinso

I would really like this feature added, so you can farm stuff like apples if they drop from trees.

darkstar01 avatar Apr 08 '21 23:04 darkstar01

+1

Wolfhound905 avatar Feb 15 '22 16:02 Wolfhound905

Yes

MagnusMss avatar Jul 13 '22 00:07 MagnusMss

minecraft-go-new avatar Jul 25 '22 00:07 minecraft-go-new

Here's some python code if it helps getting this started:

                        case "@@pickup"|"##pickup":
                            range = int(args[0]) if len(args) > 0 else 0
                            target_id = args[1].lower() if len(args) > 1 else None
                            playerPos = Player.getPlayer().getPos()
                            def simplePos(pos): return f"{int(pos.getX())} {int(pos.getY())} {int(pos.getZ())}"
                            items = dict()
                            for entity in World.getEntities():
                                if entity.getType() == "minecraft:item" and (target_id is None or entity.asItem().getContainedItemStack().getItemID()==target_id):
                                    pos = entity.getPos()
                                    if not range or distance(playerPos, pos) < range: items[pos] = entity
                            item_count = len(items)
                            if item_count > 0:
                                Chat.log(f"Picking up {item_count} dropped items within {range if range else 'infinity'} blocks")
                                for pos, item in items.items():
                                    if item.isAlive():
                                        exec(f"{cmd[0]}goto {simplePos(pos)}")
                                        wait_for_altoclef(task) if cmd[0]=="@" else wait_for_baritone(task)
                                Chat.log("JsMacros"+": "+f"Finished picking up {item_count} dropped items")

Bluscream avatar Aug 03 '22 21:08 Bluscream

Mob farming would be easier w/ this

ThaBluNate avatar Feb 27 '24 03:02 ThaBluNate

This workaround should be linked here: https://github.com/cabaletta/baritone/issues/3935#issuecomment-1538988679

Bluscream avatar Feb 27 '24 19:02 Bluscream