Daomephsta / LootTweaker

A CraftTweaker addon that adds the ability to tweak loot tables
MIT License
17 stars 2 forks source link

Can't add loot to all things #85

Closed mistaboom closed 3 years ago

mistaboom commented 3 years ago

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(, 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

Daomephsta commented 3 years ago

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.

mistaboom commented 3 years ago

I am actually already using In Control and Scaling wealth for the adding of single entries. The problem I'm seeing is that you can't add a group of items to pull from. With these mods, if you try to add more than one item with the same set of conditions it only uses one of them because you no longer have unique json tags. I have tested this with both in control and scaling health. If I were to change some of the conditions I can add more items to the same mob but that defeats the purpose of the conditions. Am I conveying my point accurately? For example I want Electroblob's Evil wizards to drop one random bauble. There are 30+ baubles, I have added to a loot table for them to drop only if the player has a certain gamestage. This is currently possible with your mod and I've done that, but if I want to do the same with Electroblob's GOOD wizards, I'm out of luck because they don't have a loot table. Neither scaling wealth, or incontrol can accomplish this.

On Wed, May 5, 2021 at 12:19 AM Daomephsta @.***> wrote:

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! https://www.curseforge.com/minecraft/mc-mods/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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Daomephsta/LootTweaker/issues/85#issuecomment-832401197, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL4JKBJFHKORFNIZVUKYUTTTMDBNLANCNFSM437YPKSQ .

Daomephsta commented 3 years ago

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.

mistaboom commented 3 years ago

It says it can do it in the wiki but when you try to do it, it only drops the last entry for a set of conditions. I tested it with a minecraft zombie and some minecraft sticks and diamonds. It will only drop whichever one is last

On Wed, May 5, 2021, 6:54 AM Daomephsta @.***> wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Daomephsta/LootTweaker/issues/85#issuecomment-832596200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL4JKBMZRAXUKZGKWBCTNCTTMEPXLANCNFSM437YPKSQ .

Daomephsta commented 3 years ago

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"}
}
mistaboom commented 3 years ago

Oh my goodness I am so sorry. I am an idiot😭 You are completely right.

On Wed, May 5, 2021, 6:59 AM Daomephsta @.***> wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Daomephsta/LootTweaker/issues/85#issuecomment-832598728, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL4JKBPOV5KEDAG7MPH7WL3TMEQKDANCNFSM437YPKSQ .

Daomephsta commented 3 years ago

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