Jump to content

Recommended Posts

Posted (edited)

Okay, I feel like I should be able to figure this out on my own since I'm completely able to set up the JSON files for this by hand by myself and they work completely as intended. But now that I'm adding the entity themed collectible coins my sons have asked for, it's a lot of coins to add and doing it by hand means a lot of files to write. I thought that it would be easier to set up a datagen to write the file for me, and just add the coins to a master loot table with conditional entity tags on them and then inject the master loot table into all of the entity loot tables. I can still do this by writing the master file by hand, but I would really like to know what the command line is for the LootTableIdCondition is inside the DataGen.

I've found this: https://docs.minecraftforge.net/en/1.18.x/resources/server/loottables/#loot-table-id-condition
And this: https://github.com/MinecraftForge/Documentation/blob/1.19.2/docs/resources/server/loottables.md
And referred back to this: https://github.com/MinecraftForge/MinecraftForge/blob/1.19.2/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java

Edit: And yes, I've found this too, but nothing I try to target in this file within my datagen seems to work? So I know it's a matter of using the proper syntax here that I'm failing to do.
https://github.com/MinecraftForge/MinecraftForge/blob/42115d37d6a46856e3dc914b54a1ce6d33b9872a/src/main/java/net/minecraftforge/common/loot/LootTableIdCondition.java

And I've dug through the external libraries in my workspace program, so I know I'm probably missing something super simple and obvious here and thus, I feel really dumb even asking but after spending several days trying to puzzle this out without any luck, I'd just would like to know even though I can do it by hand and be done with it. I just want to understand how this stuff works and for the moment, I find the datagen stuff really cool.

Edited by Warren Tode
figured out the solution, answer provided in the comments
Posted

Okay, finally figured it out and it was - as I expected it would be - embarrassingly simple. Since I hadn't come across a working example of this, if anyone else every happens to have this question pop up for them, if they want to set up a datagen file to create a file using the LootTableIdCondition, which injects a loot table into another loot table, they need to set the file up like this in the second entry I have in here:

https://github.com/toadie-odie/TodeCoins/blob/1.3.4/src/main/java/net/warrentode/todecoins/datagen/ModLootModifierGenProvider.java

  • Warren Tode changed the title to [SOLVED] Command Line for the LootTableIdCondition when setting up DataGen

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.