LootTweaker

LootTweaker

17M Downloads

Can't add loot to all things

mistaboom opened this issue · 7 comments

commented

Describe the bug
Creating a new table using LootTweaker.newTable() function works, but there is no way to associate that table with an entity if it doesn't already have a table.

To Reproduce
Steps to reproduce the behavior:

  1. install crafttweaker, loottweaker, and thaumcraft
  2. try to create a loot table for thaumcraft:giantbrainyzombie and add some test loot to it
  3. boot minecraft /summon thaumcraft:giantbrainyzombie
  4. kill the mob
  5. it wont give you your loot

Expected behavior
I didn't expect anything to happen because there is no way to link the loot table with the mob in question if it doesn't have a loot table when you use /ct loottables all

heres a script
val giantBrainyZombieLoot = LootTweaker.newTable("thaumcraft:giantbrainyzombie");
val testPool = giantBrainyZombieLoot.addPool("testPool",1,1,0,0);
testPool.addItemEntry(minecraft:diamond_block, 1);

Version Info (Exact versions only):
LootTweaker: 0.2.0
CraftTweaker: 4.1.20.646
Forge:14.23.5.2855
Minecraft:1.12.2
Thaumcraft:6.1.BETA26

commented

API design for even the simple case is a headache. I'm leaving this to In Control! and similar mods.

commented

I'm open to adding a very basic feature for attaching loot tables to entities, to help with cases like this. No conditional attachment, just setting the DeathLootTable tag for all spawned instances of a particular entity.

Anything fancier than that would be out of scope. Mods like In Control! have been doing conditional NBT tag attachment for much longer, I don't think I can improve on that. So just the basics, with anything more advanced needing another mod to handle it.

commented
commented

In Control! can accomplish this. Another capability of In Control! is adding NBT tags to mobs on spawn. Thus, you can use In Control! to set the DeathLootTable tag.

commented
commented

Where are you getting this idea that I'm telling you to use In Control!'s loot mechanisms? I have not mentioned them any of the 3 times I've suggested In Control! I am suggesting the use of its ability to set NBT TAGS on newly spawned entities, to set the vanilla DeathLootTable tag.
i.e.
spawn.json

{
  "mob": "minecraft:zombie",
  "nbt": {"DeathLootTable": "my_modpack:my_zombie_table"}
}
commented