Jump to content

1.19.2 - Looking to modify a mod's loot table


Psistorm

Recommended Posts

I'm running a small server for some friends, and we run Dragon Mounts Legacy as part of our small selection of mods. We wanted to up the drop rate for the dragon eggs, and thus - total noob as far as creating datapacks/etc goes - I am now trying to find a way to modify the drop rates.

The github for the loot_modifier part of the mod is here:
https://github.com/Kay9Unit/Dragon-Mounts-Legacy/tree/master/src/generated/resources/data/dragonmounts/loot_modifiers/dragonmounts

And my question basically is: loot_modifier is a forge specific thing, but can I possibly run a datapack to override these modifications with my own? Or what would be the most straightforward way for me to basically control the drop rates for the eggs myself?

Link to comment
Share on other sites

Yes, they are designed to be used in datapacks.

But the global loot modifiers are a bit subtle. They are additive by default, like tags. So it will run both the mod's and your loot modifier.

If you don't want this, you need a data/forge/loot_modifiers/global_loot_modifiers.json and use the "replace" option  to stop the mod's loot modifier from being run.

That's not something I have ever done, so I don't have an example.

See: https://forge.gemwire.uk/wiki/Dynamic_Loot_Modification#The_global_loot_modifiers.json for more details.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

TO update, no dice, sadly. I switched replace to true, but it's not showing up. I found something odd though. I installed JER to verify the loot tables for the dragon eggs, but it's not working on those items. I made sure that the server-config to allow loot tables was enabled for the single player world I'm testing in as well. It almost seems like the mod itself is not spawning eggs at all for some reason, but I figure a loot modifier should still make that happen regardless?

Link to comment
Share on other sites

Okay, I have ZERO understanding how loot tables work via Forge. But, before I started modding, I had no trouble altering existing loot tables or adding new ones via datapacks alone - whether these loot tables were mine, from a mod, or vanilla. This link is a good starting point for that if you'd like to do it via a datapack alone: here. You can also go here to help you build a loot table as well. I'm sure there are probably other tutorials out there for this if you need to find them. I wish I had an answer for Forge specifically though. Maybe someone else does?

Edited by Warren Tode
Corrected spelling error
Link to comment
Share on other sites

Thank you for the links, I used the first one to learn about loot tables before beginning, it was quite helpful actually, the second one should definitely come in handy if I do make my own from scratch, too!

To provide some more info, I'll put the global_loot_modifiers.json here, as well as list the file structure, just to make sure everything is correct.

{
  "replace": true,
  "entries": [
    "dragonmounts:dragonmounts/aether/chests/simple_dungeon",
    "dragonmounts:dragonmounts/ghost/chests/woodland_mansion",
    "dragonmounts:dragonmounts/water/chests/buried_treasure",
    "dragonmounts:dragonmounts/fire/chests/desert_pyramid",
    "dragonmounts:dragonmounts/forest/chests/jungle_temple",
    "dragonmounts:dragonmounts/ghost/chests/abandoned_mineshaft",
    "dragonmounts:dragonmounts/ice/chests/igloo_chest",
    "dragonmounts:dragonmounts/nether/chests/bastion_treasure"
  ]
}

 

file structure:

[datapack name] / data / forge / loot_modifiers / global_loot_modifiers.json

[datapack name] / data / dragonmounts / loot_modifiers / ghost / chests / abandoned_mineshaft.json

there are more folders in loot_modifiers for the other dungeon chests, all intended - as a test right now - to convey a 100% spawn chance for a dragon egg (usually it is around 7.5 to 30%). However testing with this I found no eggs anywhere, and like I said, JER does not show any drop information for dragon eggs, but does show drop information for other items, chests and mob drops both.

For completness sake, an excerpt of one of the loot table modifiers, this one for the mineshaft:

{
  "conditions": [
    {
      "condition": "forge:loot_table_id",
      "loot_table_id": "minecraft:chests/abandoned_mineshaft"
    },
    {
      "condition": "minecraft:random_chance",
      "chance": 1.0
    }
  ],
  "breed": "dragonmounts:ghost",
  "type": "dragonmounts:dragon_egg_loot"
}

I appreciate all the feedback here so far, by the way, thanks for everyone who replied!

Link to comment
Share on other sites

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.