#Minecraft Loot Finder Program using c Library

17 messages · Page 1 of 1 (latest)

karmic badge
#

Hello,
I'm new and don't know how to code. I need some help with this library: https://github.com/ScriptLineStudios/loot_library.h - this library simulates loot (items from chests) from ruined portals (a structure in minecraft) would it be possible to make something that checks for specific loot out of a list of seeds (long numbers that minecraft uses to generate world). I have an IDE so no compiling needed.

GitHub

A C library for emulating Minecraft loot table generation - ScriptLineStudios/loot_library.h

midnight forumBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

nocturne vapor
#

would it be possible to make something that checks for specific loot out of a list of seeds
sure. iterate over the seeds, get the loot table(s) for each seed - check for the items you're intersted in

solar parcel
#

I have an IDE so no compiling needed.
Yeah... That's not how this works.
An IDE is basically just an advanced text editor, that is designed to work with lots of tools helpful for programming, including compilers. This means that your IDE will compile and execute the code for you on the press of a button, but in the background it still has to do all that compiling and executing, and it does that just like you would do it if you tried to do it manually via the terminal

solar parcel
radiant sleet
#

so, this is the example given:

#include <stdio.h>

#define LOOT_LIBRARY
#include "src/loot_library.h"

int main(void) {
    LootTable table = init_ruined_portal_loot_table();

    uint64_t loot_seed = 1111L;

    LootItem items[64] = {0};
    size_t num_items;
    ruined_portal_loot(&table, loot_seed, items, &num_items);

    for (size_t i = 0; i < num_items; i++) {
        printf("%s x %d\n", item_names[items[i].item], items[i].quantity);
        if (items[i].enchanted) {
            printf("   %s %d\n", enchant_names[items[i].enchant], items[i].enchant_level);
        }
    }

    return 0;
}
#

im not gonna tell you word for word what to do here but im gonna point out a couple things i think might help you figure this out on your own

radiant sleet
#

the goal: take some minimum seed number, run through the entire loot logic per seed, up to some maximum seed number

#

this example gives you a clue on how to iterate through something. note the for (...), which says that i starts at 0, and runs until it's no longer less than num_items

#

as far as what that's running, well that's just the stuff in the curly brackets

#

what i would say, is you'd want to run through everything starting with the first line that actually uses the seed

nocturne vapor
#

the OP left. don't bother

radiant sleet
#

oh

#

damn

#

ah well