Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Quick question, how do i add my item to the fishingrod as a fish.

 

i used to do it with addfish and with the weighted method but since i updated to 1.10 the last one doenst seem to work anymore, ideas?

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.

  • Author

And  what function of that class do i use to make my item spawn in the gameplay.fishing.fish loot table? do i do that in the same class or a seperate one?

  • Author

public static void addItemToTable(ResourceLocation gameplayFishingFish, Item item, int weight, float numRolls, float probability, int minQuantity, int maxQuantity, float minLootBonus, float maxLootBonus, String name) {

addItemToTable(LootTableList.GAMEPLAY_FISHING_FISH, RunecraftItems.RawAnchovies, 0, 0, weight, minQuantity, maxQuantity, minLootBonus, maxLootBonus, name);

}

 

And  what function of that class do i use to make my item spawn in the gameplay.fishing.fish loot table? do i do that in the same class or a seperate one?

 

No, you subscribe to the LootTableLoadEvent, and when the gameplay.fishing.fish loot table is loaded, you get it's loot table and call addItemToTable(...) passing the appropriate arguments.

e.g.:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/farming/FarmingEventHandler.java#L428

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.

  • Author

 

@SubscribeEvent

public void lootTableLoad(LootTableLoadEvent event) {

LootCondition[] chance;

LootCondition[] lootingEnchant;

LootFunction[] count;

LootEntryItem[] item;

LootPool newPool;

if(event.getName().getResourcePath().equals("gameplay.fishing.fish")) {

LootTable loot = event.getTable();

AddlootHandler.addItemToTable(loot, RunecraftItems.RawAnchovies, 10000000, 2, 1, 3, 5, 0, 1, "RawAnchovies");

}

}

}

 

 

Ok?  What's your question/problem?

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.

  • Author

Well, google told me that the weight is sort of a % of how common the item is i used the method i posted above and made the weight very high but it doesnt want to appear on the rod...

While that's what it's for I'm not sure it's actually used the way you think it is.  I know that for entities like cows, the weight is irrelevant because there's only one entry in the pool.

 

Let me look at fish for a minute.

 

Ah, ok.

 

So my LootUtils class is not constructed to properly handle adding items to the fishing tables because: I have them added as new pools and vanilla is going to ignore it.  Along with a few loot functions that aren't needed (unclear if having a stack other than size 1 is relevant, applicable, or allowed for fishing).

 

You'll want to get a reference to the LootPool named "main" (there's a

table#getPool(name)

method) and you'll want to insert a new LootEntry to it.

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.