Posted June 15, 20205 yr I working on my mod RareMetalsRevised, and have currently hit a roadblock. Im trying to create a custom effect that makes the ore drop the ingot form of the item.
June 15, 20205 yr You want a global loot modifier, some example code here https://github.com/MinecraftForge/MinecraftForge/blob/1.15.x/src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java it also involves some json files, there's a little writeup here: https://dragoness-e.dreamwidth.org/136561.html
June 15, 20205 yr Author got in game but enchantment does not work as intended https://pastebin.com/b01Abr7y https://pastebin.com/VMe7kDdf https://pastebin.com/Sbj6U5SW Edited June 15, 20205 yr by 00doggie
June 16, 20205 yr Well yeah. You didn't register the modifier. https://github.com/MinecraftForge/MinecraftForge/blob/1.15.x/src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java#L75 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.
June 16, 20205 yr ...what's the error? 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.
June 16, 20205 yr Author Says Make "SmeltingEnchantmnetModifier" not public and when I do that it just creates more errors
June 16, 20205 yr You're calling new on something that's private. It needs to either be in the same scope (it was private in the sample code because it was all one file) or public. Make it public, post the errors. 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.
June 16, 20205 yr Author Class 'SmeltingEnchantmentModifier' is public, should be declared in a file named 'SmeltingEnchantmentModifier.java'
June 16, 20205 yr Author Item is in the game but does not do anything on the ores Edited June 16, 20205 yr by 00doggie
June 16, 20205 yr 53 minutes ago, 00doggie said: Class 'SmeltingEnchantmentModifier' is public, should be declared in a file named 'SmeltingEnchantmentModifier.java' So...do that thing. 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.
June 16, 20205 yr 1) Check the log for errors 2) Set a break point in the doApply method and make sure its being called 3) Set a break point in the LootModifierManager to see if it is even being registered, loaded, and applied 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.
June 16, 20205 yr Author dont think i have a loot modifier manager and what happens with breakpoint Edited June 16, 20205 yr by 00doggie
June 16, 20205 yr LootModifierManager is a Forge class that actually deals with the modifier loading. https://github.com/MinecraftForge/MinecraftForge/blob/1.15.x/src/main/java/net/minecraftforge/common/loot/LootModifierManager.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.
June 16, 20205 yr Author well here is my github so you see the errors. https://github.com/00doggie/RareMetalsRevised
June 16, 20205 yr Yep, this is not java school (I am sorry if it sounds rude). Go learn some java. What you are proposing here requires some java knowledge.
June 16, 20205 yr https://github.com/00doggie/RareMetalsRevised/blob/master/src/main/java/com/doggie/raremetalsrevised/enchantments/AutoSmelterEnchantment.java#L78 Move this to its own class file. Make it public. 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.