Posted April 25, 20205 yr I don't know if I'm doing something wrong, or if it was removed and I'm using outdated tutorials, but I just started with this whole Minecraft Forge programming stuff (although I have programmed before) and I went to use LootEntryTable here: (I know it's not complete) @SubscribeEvent public void lootLoad(LootTableLoadEvent evt) { String name = evt.getName().toString(); if (name.contains("minecraft:entities")) { String entryName = name.split("/")[1]; entryName = "soulstone" + entryName; LootEntry ent = new LootEntryTable(); // ^^^^ } } The first time I added it, I hadn't added the import to use LootEntryTable so when it showed red I went to add the import, it said Create Class 'LootEntryTable'. LootTableList also doesn't work. The most annoying thing is that I couldn't find anything about it anywhere. I replaced all the files after redownloading the mdk and it still doesn't work. And I use IntelliJ, I'm not sure if that matters. Also, it's my first time posting here so if I forgot something just tell me what to add. Edited April 25, 20205 yr by Sparib Added screenshot
April 25, 20205 yr Author I want to add a possible drop to all entities. I was reading the docs and that is almost straight from it.
April 25, 20205 yr Author I'll do that. Thanks! I can't do it right now because my computer's hard drive is dead Edited April 25, 20205 yr by Sparib
April 25, 20205 yr Author When it says Create a global_loot_modifiers.json file at /data/forge/loot_modifiers/ does that mean I have to get something more than the mdk or do I create that directory myself.
April 25, 20205 yr Its a data file, like all other data files, you want to override it, then you have to supply an override at the correct location. That's the path, create it in your /src directory like any other resource. 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.
April 25, 20205 yr Author Thanks Draco (or Draco18s, idk how you like to be called), I got it now. Thanks for all your help, without you I would be absolutely lost. (And coffee)
April 25, 20205 yr 9 minutes ago, Sparib said: Thanks Draco (or Draco18s, idk how you like to be called) Either works. Technically the s is possessive and the number is just a uniquifier. 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.
April 26, 20205 yr Author When adding the loot modifiers registry(?) (I just kept the name from https://dragoness-e.dreamwidth.org/136561.html) I had to add the GlobalLootModifierSerializer (I just copied it) I got as far as GlobalLootModifierSerializer<T extends IGlobalLootModifier> and it said "cannot resolve symbol IGlobalLootModifier" That makes me think that I'm missing something or I'm just bad at this
April 26, 20205 yr Author Alright, I don't understand this stuff yet so I think I might try easier things before attempting this
April 26, 20205 yr 3 hours ago, Sparib said: When adding the loot modifiers registry(?) (I just kept the name from https://dragoness-e.dreamwidth.org/136561.html) I had to add the GlobalLootModifierSerializer (I just copied it) I got as far as GlobalLootModifierSerializer<T extends IGlobalLootModifier> and it said "cannot resolve symbol IGlobalLootModifier" That makes me think that I'm missing something or I'm just bad at this Sigh. Quote A class that extends `LootModifier` There's even DOCS on this stuff. /** * A base implementation of a Global Loot Modifier for modders to extend. * Takes care of ILootCondition matching and comes with a base serializer * implementation that takes care of Forge registry things. */ public abstract class LootModifier implements IGlobalLootModifier { A base implementation of a Global Loot Modifier for modders to extend. https://github.com/MinecraftForge/MinecraftForge/blob/1.15.x/src/main/java/net/minecraftforge/common/loot/LootModifier.java#L32-L37 /** * Abstract base deserializer for LootModifiers. Takes care of Forge registry things.<br/> * Modders should extend this class to return their modifier and implement the abstract * <code>read</code> method to deserialize from json. * @param <T> the Type to deserialize */ public abstract class GlobalLootModifierSerializer<T extends IGlobalLootModifier> implements IForgeRegistryEntry<GlobalLootModifierSerializer<?>> { Modders should extend this class to return their modifier and implement the abstract read method https://github.com/MinecraftForge/MinecraftForge/blob/1.15.x/src/main/java/net/minecraftforge/common/loot/GlobalLootModifierSerializer.java#L29-L35 Oh, and three existing implementations: https://github.com/MinecraftForge/MinecraftForge/blob/1.15.x/src/test/java/net/minecraftforge/debug/gameplay/loot/GlobalLootModifiersTest.java Edited April 26, 20205 yr by Draco18s 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.
April 26, 20205 yr Author So I switched to Eclipse and I made a class with an inner class that extends LootModifier and it still showed an error, and inside the forge snapshot with all the net.minecraftforge stuff I didn't have a net.minecraftforge.common.loot at all, which is used https://github.com/Sinhika/SimpleOres2/blob/1.15/src/main/java/mod/alexndr/simpleores/helpers/SimpleOresLootModifiers.java#L18 Attached it a screenshot showing the minecraftforge.common packages(?) and the LootModifierHandler with an inner class MobDropLootModifier that extends LootModifier. Both the import and LootHandler are errors. Edited April 26, 20205 yr by Sparib Forgot to add screenshot
April 26, 20205 yr Author Would that be the Forge Mdk you're talking about? If so I have the recommended version that is the latest (31.1.0) Edited April 26, 20205 yr by Sparib
April 26, 20205 yr Author Okay, I was trying as best as possible to say the recommended version, but the latest of it because the two versions are latest and recommended so it's confusing talking about the latest recommended. But I'll try that!
April 26, 20205 yr Author IT FINALLY WORKS THANK YOU SO MUCH It finally showed some hope, thank you so much. I shouldn't need any more help because of all the references you've all given me. Again, THANK YOU SO MUCH! Edited April 26, 20205 yr by Sparib
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.