Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • 1.16.4 Fishing Loot Table
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
AsnDen

1.16.4 Fishing Loot Table

By AsnDen, January 14 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

AsnDen    0

AsnDen

AsnDen    0

  • Tree Puncher
  • AsnDen
  • Members
  • 0
  • 7 posts
Posted January 14

Hello, I'm newbie in minecraft modding and i'm stuck.

I need to add new items to fishing loot table but I don't know how. I created fish.json in loot_tables/gameplay/fishing and add here my fish.
But it don't work, as I understand I need to registry or smth else this "fish"(if not, please correct me).  

I saw code of some open sourse mods like "Aquacuture 2" and they do smth like this:

@Mod.EventBusSubscriber(modid = BetterFishing.MOD_ID)
public class LootTableInit {

    public static final ResourceLocation FISH = register("gameplay/fishing/fish");

    private static ResourceLocation register(String path) {
        return new ResourceLocation(BetterFishing.MOD_ID, path);
    }
}

Why are they doing this and should I use smth similar?

P.S. Sorry, if there are mistakes here and it looks unclear(Еnglish isn't my native language)

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7697

diesieben07

diesieben07    7697

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7697
  • 56430 posts
Posted January 14

If you want to modify, but not overwrite, the loot table, look at https://mcforge.readthedocs.io/en/latest/items/globallootmodifiers/.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

AsnDen    0

AsnDen

AsnDen    0

  • Tree Puncher
  • AsnDen
  • Members
  • 0
  • 7 posts
Posted January 14
1 hour ago, diesieben07 said:

If you want to modify, but not overwrite, the loot table, look at https://mcforge.readthedocs.io/en/latest/items/globallootmodifiers/.

How and for what I can use it?
I need to add items to fishing. I realized that I could change a vanilla fishing loot table(i tried it and it works) but i think that it isn't so easy

So, I'm newbie in modding and I can be dumb sometimes

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7697

diesieben07

diesieben07    7697

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7697
  • 56430 posts
Posted January 14

You could overwrite the vanilla fishing loot table, yes. However: Vanilla does not do any loot table merging. One datapack wins. So if you and another mod (or another data pack) both modify the fishing loot table, only one wins.

That's why Forge has added global loot modifiers, which allow you to specify modifiers that act on the result of loot tables, without replacing them.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

AsnDen    0

AsnDen

AsnDen    0

  • Tree Puncher
  • AsnDen
  • Members
  • 0
  • 7 posts
Posted January 14
44 minutes ago, diesieben07 said:

You could overwrite the vanilla fishing loot table, yes. However: Vanilla does not do any loot table merging. One datapack wins. So if you and another mod (or another data pack) both modify the fishing loot table, only one wins.

That's why Forge has added global loot modifiers, which allow you to specify modifiers that act on the result of loot tables, without replacing them.

I have done it! Yahooo ^-^

So, I didn't used your variant. I take part of code from 
https://github.com/TeamMetallurgy/Aquaculture/blob/b5a006328b298a6d61b1f26379da8809423c017c/src/main/java/com/teammetallurgy/aquaculture/init/AquaLootTables.java

and part from
https://github.com/TheIllusiveC4/CombustiveFishing/blob/master/src/main/java/top/theillusivec4/combustivefishing/common/registry/CombustiveFishingLoot.java
And make my own code

Anyways, thanks a lot :3

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7697

diesieben07

diesieben07    7697

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7697
  • 56430 posts
Posted January 14

Do not use LootTableLoad event. It is the wrong tool for this.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

AsnDen    0

AsnDen

AsnDen    0

  • Tree Puncher
  • AsnDen
  • Members
  • 0
  • 7 posts
Posted January 14
1 hour ago, diesieben07 said:

Do not use LootTableLoad event. It is the wrong tool for this.

Ok. What are the differences between this variant and Global Loot Modifiers?
As you explained(and as I understand)

  1. I can overwrite vanila loot table but if another mod do the same, 1 of us won't work 
  2. Global Loot Modifiers can "add" items to loot tables and if more than 1 mod change loot table it still  will work
  3. And this variant - it works, but as you said it wrong tool for it.

Why it's wrong tool, what's wrong?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7697

diesieben07

diesieben07    7697

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7697
  • 56430 posts
Posted January 14

LootTableLoadEvent completely bypasses the data driven system. Modpack makers or just "regular users" can not change your logic by using a datapack if you use LootTableLoadEvent.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

AsnDen    0

AsnDen

AsnDen    0

  • Tree Puncher
  • AsnDen
  • Members
  • 0
  • 7 posts
Posted January 14
4 minutes ago, diesieben07 said:

LootTableLoadEvent completely bypasses the data driven system. Modpack makers or just "regular users" can not change your logic by using a datapack if you use LootTableLoadEvent.

So, this variant doesn't allow modpack makers use datapacks.
And the best way without restriction is Global Loot Modifiers.

So, global_loot_modifiers.json and The serialized json look simple but The LootModifier Subclass...

Is it example for loot in chests? Or it is for every loot table 

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7697

diesieben07

diesieben07    7697

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7697
  • 56430 posts
Posted January 14
3 minutes ago, AsnDen said:

Is it example for loot in chests? Or it is for every loot table 

A loot modifier will be applied every time a loot table is "activated". You can use loot conditions to filter things out.

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2416

Draco18s

Draco18s    2416

  • Reality Controller
  • Draco18s
  • Members
  • 2416
  • 16010 posts
Posted January 14

Really high level nonsense, all modifiers are invoked any time any loot is dropped by anything.

The LootConditions result in most of those modifiers effects being skipped (because the conditions were false, and that includes things like "a zombie died? Well that wasn't iron ore..."), but they're still checked.
 

The point was to create a system that replaced HarvestDropsEvent in a way that was as data driven as possible and would layer properly so that multiple mods could modify the same loot table without conflict (eg. adding a new crop seed to tall grass).

 

As such its complicated to create, but it is more better than any other approach for all the reasons that those other approaches are broken.

  • Quote

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Share this post


Link to post
Share on other sites

AsnDen    0

AsnDen

AsnDen    0

  • Tree Puncher
  • AsnDen
  • Members
  • 0
  • 7 posts
Posted January 14
1 hour ago, Draco18s said:

As such its complicated to create, but it is more better than any other approach for all the reasons that those other approaches are broken.

It isn't for beginners at all. Yes?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7697

diesieben07

diesieben07    7697

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7697
  • 56430 posts
Posted January 14
11 minutes ago, AsnDen said:

It isn't for beginners at all. Yes?

Depends on what kind of beginner. In my opinion its not hard to create at all.

  • Quote

Share this post


Link to post
Share on other sites

AsnDen    0

AsnDen

AsnDen    0

  • Tree Puncher
  • AsnDen
  • Members
  • 0
  • 7 posts
Posted January 14
Just now, diesieben07 said:

Depends on what kind of beginner. In my opinion its not hard to create at all.

For me now it looks hard, for the first realization I will youse "me vatiant"

 

3 hours ago, AsnDen said:

And this variant - it works, but as you said it wrong tool for it.

I think soon I will change it to Global Loot Modifiers. When I will have more experiense.

Anyways thanks a lot. It was very helpful

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • chaskuchar
      is there any release i can play past 1.16.4

      By chaskuchar · Posted 18 minutes ago

      i was trying to play 21w0b8 and started it without the controller i use with forge helping me for the controller.  i can start using the lancher a new game like 21w0b8 and the save it after i start.  then i quit and restart the launcher and start forge.  i choose the new game which has 21w0b8 at the link and get a message that it might not be compatible but it starts and the controller is working ok.  now my question is, i think the game only loads for 1.16.4.  i can't find the copper or anything special for the new snapshot.  am i chasing a dead horse trying to play with a controller on a new release???  thanks.  chas
    • Herobrine510
      modded server problems

      By Herobrine510 · Posted 22 minutes ago

      so i just made a modded minecraft server yesterday but i've been getting multiple issues with it like yesterday it was java.lang.nullpointerexception and java.noclassdefounderror. i linked that crash report. and i wanted to link my mods folder but that didnt work so yeah. and now today it's been saying that it can't bind to the port and then it's like "Is there another server running?" when there isnt. i linked that crash report too and i would really appreciate some help.crash-2021-03-03_19.28.04-server.txt crash-2021-03-04_12.22.51-server.txt Oh it says "the state engine was in incorrect state POSTINITIIALIZATION and forced into state SERVER_STOPPED." At least that's what the run.bat file says.run.bat i linked that too but i dont know if it'll help much. crash-2021-03-04_12.22.51-server.txt
    • diesieben07
      java.lang.ExeptionInInitializerError: null

      By diesieben07 · Posted 50 minutes ago

      Show your code.
    • heavengel
      error minecraft this server has mod that requires forge to be installed on client

      By heavengel · Posted 56 minutes ago

      Hello   When I try to get in the server there's this message appearing : error minecraft this server has mod that requires forge to be installed on client But it happens that there is NO mod installed on the server, how is this message appearing then ?  Can someone help me please
    • diesieben07
      Can't launch Forge because of spongepowered.[...].MixinTweaker

      By diesieben07 · Posted 1 hour ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

    • chaskuchar
      0
      is there any release i can play past 1.16.4

      By chaskuchar
      Started 18 minutes ago

    • Herobrine510
      0
      modded server problems

      By Herobrine510
      Started 22 minutes ago

    • We Random
      1
      java.lang.ExeptionInInitializerError: null

      By We Random
      Started 1 hour ago

    • heavengel
      0
      error minecraft this server has mod that requires forge to be installed on client

      By heavengel
      Started 56 minutes ago

    • Leetram_519
      1
      Can't launch Forge because of spongepowered.[...].MixinTweaker

      By Leetram_519
      Started 1 hour ago

  • Who's Online (See full list)

    • loordgek
    • hammy3502
    • chaskuchar
    • Ommina
    • ivanbj
    • Herobrine510
    • elpanzas
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • 1.16.4 Fishing Loot Table
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community