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

I do know that the server-config.cfg in your world folder will have a loot table option, it /should/ default to false, but that would be the setting you want. Looks like we're having opposite issues, hah.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I encountered the same problem while executing 'setupDevWorkspace', and the log is as follows: Current status: 971/1305 74% Error downloading asset (try 5) : minecraft/sounds/mob/wither_skeleton/hurt4.ogg java.io.IOException: Server returned HTTP response code: 400 for URL: http://resources.download.minecraft.net/0f/0f1b391091236dadf8ab0108185d450639e54879 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) at java.net.URL.openStream(URL.java:1045) at net.minecraftforge.gradle.tasks.DownloadAssetsTask$GetAssetTask.call(DownloadAssetsTask.java:189) at net.minecraftforge.gradle.tasks.DownloadAssetsTask$GetAssetTask.call(DownloadAssetsTask.java:150) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Error downloading asset (try 4) : minecraft/sounds/mob/wither_skeleton/idle1.ogg java.io.IOException: Server returned HTTP response code: 400 for URL: http://resources.download.minecraft.net/0e/0e6d00d4c3f24a4e86eace20e63283a7d409854f at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) at java.net.URL.openStream(URL.java:1045) at net.minecraftforge.gradle.tasks.DownloadAssetsTask$GetAssetTask.call(DownloadAssetsTask.java:189) at net.minecraftforge.gradle.tasks.DownloadAssetsTask$GetAssetTask.call(DownloadAssetsTask.java:150) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Error downloading asset (try 1) : minecraft/sounds/mob/wither_skeleton/idle2.ogg java.io.IOException: Server returned HTTP response code: 400 for URL: http://resources.download.minecraft.net/8c/8c5427b9b55d9cdc3910e5c608be4c70f83f90ea at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) at java.net.URL.openStream(URL.java:1045) at net.minecraftforge.gradle.tasks.DownloadAssetsTask$GetAssetTask.call(DownloadAssetsTask.java:189) at net.minecraftforge.gradle.tasks.DownloadAssetsTask$GetAssetTask.call(DownloadAssetsTask.java:150) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Error downloading asset (try 5) : minecraft/sounds/mob/wither_skeleton/idle1.ogg java.io.IOException: Server returned HTTP response code: 400 for URL: http://resources.download.minecraft.net/0e/0e6d00d4c3f24a4e86eace20e63283a7d409854f at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) at java.net.URL.openStream(URL.java:1045) at net.minecraftforge.gradle.tasks.DownloadAssetsTask$GetAssetTask.call(DownloadAssetsTask.java:189) at net.minecraftforge.gradle.tasks.DownloadAssetsTask$GetAssetTask.call(DownloadAssetsTask.java:150) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Current status: 972/1305 74%  
    • Earlier today, I got forge. It started working fine, the suddenly it stopped opening. It keeps taking me back to the launcher and saying that an error occured. I dont know what to do
    • Safe Storage is the best company in Hyderabad which provides home and household items storage services and facility at economical prices. Rent a personal storage space in Hyderabad! Contact today for more info!   Storage Services
    • As seen in the CrossbowItem class, an NBT boolean tag “Charged” is attached to crossbows. I have a custom item that extends CrossbowItem, and I want to attach other data in addition to the “Charged” tag. Should I use capabilities or NBTs? I am wondering if there are any significant advantages of using one over another for ItemStacks.
    • Hey everyone! I come here out of desperation as either due to a lack of available info or my lackluster googling skills, I can't find answers elsewhere. I started hosting a vanilla server for my GF and some of her friends. We had zero issues with this server. Everything worked instantly and everyone could connect. After a little while, My GF decided she wanted a few light, mostly QOL mods. I put together a version of the server on forge with all the mods she wanted. We started it up with all the default server properties (basically what we did for the vanilla one), but now no one could connect except me (on the pc it is hosted on). I thought it could be a mod conflicting with something, so i set up a fresh forge server with nothing added to it, had her make a fresh forge client to connect from, and she still can't connect. Just says "Connection timed out: No further information". if I start the vanilla server again while she is on the modded client, she can see that it's up and that it's incompatible. I know for a fact my port forwarding is correct, and the the ports on the forge server are fine. I haven't changed the "server-ip" option in server properties. speaking of which, i imported the server properties from the vanilla server to the forge server to see if that fixed anything and it didn't. I don't understand what about forge is causing them to not be able to connect, but i have narrowed it down to that. We are playing 1.19.4 with the latest forge version if that changes anything. I can provide any info needed. Thanks in advance.
  • Topics

×
×
  • Create New...

Important Information

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