Skip to content

Add loot finding#86

Merged
xpple merged 14 commits intomasterfrom
loot-finding
Jun 23, 2025
Merged

Add loot finding#86
xpple merged 14 commits intomasterfrom
loot-finding

Conversation

@xpple
Copy link
Owner

@xpple xpple commented Jun 9, 2025

This PR adds (back!) loot finding to SeedMapper. The command for this is /sm:locate loot <amount> <item> [<enchantment conditions>]. Currently, the following structures are supported: Buried Treasures, Desert Pyramids, End Cities, Igloos and Ruined Portals. I hope to support Fortresses and Bastions too but those will have to wait. Also, the implementation of loot finding is much better than it used to be!

@xpple xpple marked this pull request as draft June 9, 2025 19:50
@xpple xpple force-pushed the loot-finding branch 7 times, most recently from 9527910 to 35fde37 Compare June 9, 2025 20:35
@vanvac
Copy link

vanvac commented Jun 15, 2025

ok wtf
you can filter enchants wait this is crazy good

@vanvac
Copy link

vanvac commented Jun 15, 2025

some weird beaviour with locating things with enchants some things are impossible to find in certian dimentions and others combos just dont exist and so running it with those enchants will make the search go on for ever and ever and ever so maybe adding a /sm:stop command to stop any and all tasks
image
this should not be allowed and so the suggestion/ syntax whatever minecraft has for commands and stuff

ancient cities loot just dosen't show up at all (ok I just took a looka at cubiomes source and many structures including ancient city loot tables just arent there, guessing there will be support for them in the future)

locating stuff with desert temples is weird
image
image

sometimes the temple just isnt there
other times the enchants on the books are wrong
image
image
image
/sm:locate loot 1 book with depth_strider *

other wise ruined portal loot is very realiable even with enchants
i havent checked other dimentions yet but there seems to be a really hard complete system freeze when loading loot tables for auto complete in the chat not quite sure what is causing that yet will do further investigation

@xpple
Copy link
Owner Author

xpple commented Jun 15, 2025

Thank you for the review!

some weird beaviour with locating things with enchants some things are impossible to find in certian dimentions and others combos just dont exist and so running it with those enchants will make the search go on for ever and ever and ever [...] this should not be allowed and so the suggestion/ syntax whatever minecraft has for commands and stuff

Yes, unfortunately with the library I am using it is currently not possible to check which enchantments are compatible with which items. I kind of rely on the player to know what they are doing.

so maybe adding a /sm:stop command to stop any and all tasks

Yep, I will probably add this. Note that currently you can stop tasks by executing the command again: it will prompt you to stop the previous task.

ancient cities loot just dosen't show up at all (ok I just took a looka at cubiomes source and many structures including ancient city loot tables just arent there, guessing there will be support for them in the future)

Yeah, not all structures are supported for loot. Currently the supported ones are: Buried Treasures, Desert Pyramids End Cities, Igloos, Fortresses and Ruined Portals. I plan to add support for Bastions too. Ancient Cities are much more difficult and likely will not be supported for the foreseeable future.

locating stuff with desert temples is weird sometimes the temple just isnt there

This happens because Desert Temples rely a bit on the terrain for their generation, which Cubiomes cannot yet emulate. Most of the time Desert Temples should be correct though.

other times the enchants on the books are wrong

This is strange, I will look into that.

i havent checked other dimentions yet but there seems to be a really hard complete system freeze when loading loot tables for auto complete in the chat not quite sure what is causing that yet will do further investigation

I haven't had this issue personally, and I also wouldn't know why this would happen. The list of items and enchantments are hardcoded.

@vanvac
Copy link

vanvac commented Jun 15, 2025

idk if it was a system skill issue or the mod causing it but i didnt seem to get it anymore so idk what was going on ima try getting it to happen as it happened when spamming /loot give command once and a few more times b4 that entering commands for /sm:locate loot ... idk what is causing (ill keep trying on the newest build)

@xpple xpple marked this pull request as ready for review June 17, 2025 18:34
@xpple xpple changed the title [WIP] Add loot finding Add loot finding Jun 17, 2025
@vanvac
Copy link

vanvac commented Jun 17, 2025

ok so the issue is (i think) whenever you set it to look for something and that something is either impossible or stupidly rare, it will take a long time and at a certian point idk what causes it but there might be a overflow or a memory leak that just freezes the system
/sm:source in the_end run sm:locate loot 1 diamond_sword with sharpness 5 with unbreaking 3 with mending * with looting 3 with fire_aspect 2 with sweeping_edge 3 without knockback * is the command i did and eventally it just craps it self and dies so maybe adding a max search duration in the config or a suggestion to simplifiy loot requirements after a while as the thing you are looking for may be very difficult

also would be cool to see if the % chance of the item appearing in a chest with its enchants

maybe give a estimate search time for complex things or estimated distance from spawn but it just seems extra crap that isnt really needed

@xpple
Copy link
Owner Author

xpple commented Jun 18, 2025

Is this on the latest version?

@vanvac
Copy link

vanvac commented Jun 18, 2025

commit c3225b5, build artifact
image
the sm version didnt seem to match the commit so i added it there anyways (@{2c9d82b})

@xpple
Copy link
Owner Author

xpple commented Jun 18, 2025

Alright, thanks. It seems the /sm:buildinfo command is broken, but we can ignore that for now. Approximately how long does it take for your computer to freeze after executing the command? I tried it but couldn't reproduce any freezes.

@vanvac
Copy link

vanvac commented Jun 18, 2025

ok did some more reproducing and it just seems like a system skill issue cause without chrome open minecraft only seems to use around 5-6GB of memory plus some system swap

@vanvac
Copy link

vanvac commented Jun 18, 2025

but when i open chrome and try doing some stuff it start to freeze up around 30 min after starting the search
2025-06-18_17-37
seems to be the core being used by sm as all other cores are not as active
2025-06-18_17-47_1
with chrome open ^^^

2025-06-18_17-47
b4 freezing started

system specs below
image
the gpu has a weird vram error i dont have it enabled so im running of the 3rd gen intel graphics

@xpple
Copy link
Owner Author

xpple commented Jun 18, 2025

Could you try this latest version? I may have fixed something.

@vanvac
Copy link

vanvac commented Jun 18, 2025

whatever you did defo helped as memory usage is now reduced and i dont seem to be expirencing any freezes, going forward im going to increase the size for my swap storage cause of hardware skillissues and probably not having 20 tabs open in bg when this first happened

@vanvac
Copy link

vanvac commented Jun 18, 2025

could i theoritically take the cubiomes.so and directly use the loot finding funtion i wanna see if its a minecraft thing or a cubiomes(with ur modifications) problem

@xpple
Copy link
Owner Author

xpple commented Jun 18, 2025

It's a library, not an executable, so you need something that loads and invokes it. This can be in a C program using dlopen or in Java using System.load. You can't really use it directly though as you need quite a few functions from it, so it won't be a short program.

@xpple xpple merged commit dc58a3d into master Jun 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants