Posted November 17, 20168 yr 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?
November 17, 20168 yr You may want to look at my helper class I use: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/util/LootUtils.java 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.
November 18, 20168 yr 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?
November 18, 20168 yr 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); }
November 18, 20168 yr 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.
November 19, 20168 yr 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"); } } }
November 19, 20168 yr 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.
November 20, 20168 yr 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...
November 20, 20168 yr 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.