You need to add loot by subscribing to the LootTableLoadEvent and if the name of the event matches the loot table you want to add to, you add your entries to the LootPool.
That has really changed since last time I used that kind of functionality. Last time it was in DungeonHooks class and you had to use a method or something. This was back in 1.3.2/1.5 so it was a long time ago. Glad you provided an example!
Yeah, now that Minecraft uses .json files for their loot tables, it makes it a little more difficult to add to existing loot generation. Luckily we have the event to sneak in anything we want
The weight is the chance that the item will get spawned in the chest. The higher the number, the higher the chance. It's worth checking out the vanilla loot tables to see their values for an idea of what they're like, or even just playing with the values yourself. But since it's an integer, 1 is the lowest value.
i have a new question: gives a way to use ItemStacks for it?
Never thought about it before, but I don't see any reason why you can't create a new class extending LootEntryItem which can handle ItemStacks
Just create instances of your new class instead to add to the LootPool. Don't know why I hadn't thought of that before! But seems pretty easy.
i have a new question: gives a way to use ItemStacks for it?
Use Loot Functions to add metadata/NBT to the Loot Entry's ItemStack.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Use Loot Functions to add metadata/NBT to the Loot Entry's ItemStack.
Is it possible to create a loot table json and merge it into an existing loot table, for example the mineshaft chests? I was only aware of the method I posted earlier using the event handler, so it'd be handy to know!
Is it possible to create a loot table json and merge it into an existing loot table, for example the mineshaft chests? I was only aware of the method I posted earlier using the event handler, so it'd be handy to know!
You can add a LootEntryTable to a LootPool in an existing LootTable during LootTableLoadEvent, this will generate its items from another LootTable.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
how can i add items to a dungeon/mineshaft chest?
>> https://minecraft.curseforge.com/members/XxRexRaptorxX/projects
You need to add loot by subscribing to the LootTableLoadEvent and if the name of the event matches the loot table you want to add to, you add your entries to the LootPool.
I have a good example which works for me in a mod here
Just don't forget to register your event class.
That has really changed since last time I used that kind of functionality. Last time it was in DungeonHooks class and you had to use a method or something. This was back in 1.3.2/1.5 so it was a long time ago. Glad you provided an example!
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Yeah, now that Minecraft uses .json files for their loot tables, it makes it a little more difficult to add to existing loot generation. Luckily we have the event to sneak in anything we want
No problem.
thanks but can you say me how the weight are handeled or what the number exactly says
>> https://minecraft.curseforge.com/members/XxRexRaptorxX/projects
The weight is the chance that the item will get spawned in the chest. The higher the number, the higher the chance. It's worth checking out the vanilla loot tables to see their values for an idea of what they're like, or even just playing with the values yourself. But since it's an integer, 1 is the lowest value.
i have a new question: gives a way to use ItemStacks for it?
>> https://minecraft.curseforge.com/members/XxRexRaptorxX/projects
Never thought about it before, but I don't see any reason why you can't create a new class extending LootEntryItem which can handle ItemStacks
Just create instances of your new class instead to add to the LootPool. Don't know why I hadn't thought of that before! But seems pretty easy.
Use Loot Functions to add metadata/NBT to the Loot Entry's ItemStack.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Is it possible to create a loot table json and merge it into an existing loot table, for example the mineshaft chests? I was only aware of the method I posted earlier using the event handler, so it'd be handy to know!
You can add a LootEntryTable to a LootPool in an existing LootTable during LootTableLoadEvent, this will generate its items from another LootTable.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oh I see! Thanks a lot
how i exactly use this? i´m reeeelatively new at modding ^^
>> https://minecraft.curseforge.com/members/XxRexRaptorxX/projects
You can see an example here.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
thanks!
>> https://minecraft.curseforge.com/members/XxRexRaptorxX/projects