Oliviafrostpaw Posted December 8, 2019 Share Posted December 8, 2019 Couldn't find what I was doing wrong so apologies for wasting anyone's time if its stupid and simple, when trying to add an item to the existing grass block (the one that drops seeds) I got it to work originally, and then continued working on my mod and then it inexplicably stopped working. Item is in the game so I know that its just not due to the item being registered. Current Forge version being 28.1.87 Please see code below, thank you for assistance in advance. Spoiler Code inside of main Java Class @Mod("untitledmess") public class UntitledMess { //.... - Unrelated Code Here @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { //... Unrelated Code Here @SubscribeEvent public static void onLootLoad(LootTableLoadEvent event) { if (event.getName().equals(new ResourceLocation("minecraft","blocks/grass"))) { event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation(modid,"blocks/grass"))).build()); } } } } Json in data.untitledmess.loot_tables.blocks { "pools": [ { "name": "main", "rolls": 1, "entries": [ { "type": "minecraft:item", "name": "untitledmess:grass_fiber", "conditions": [ { "condition": "minecraft:random_chance", "chance": 0.25 } ], "functions": [ { "function": "minecraft:set_count", "count": { "min": 1, "max": 2 } } ] } ] } ] } Quote Link to comment Share on other sites More sharing options...
Draco18s Posted December 8, 2019 Share Posted December 8, 2019 Question: Do recipes and loot tables in general still work, or are all of them broken too? 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. Link to comment Share on other sites More sharing options...
Oliviafrostpaw Posted December 8, 2019 Author Share Posted December 8, 2019 Other loot tables for block drops are currently working fine, and the recipes also work fine, only the injection into the vanilla block seems to be affected Quote Link to comment Share on other sites More sharing options...
Oliviafrostpaw Posted December 12, 2019 Author Share Posted December 12, 2019 Bump? Quote Link to comment Share on other sites More sharing options...
RaphGamingz Posted December 13, 2019 Share Posted December 13, 2019 are there any console errors? Quote Link to comment Share on other sites More sharing options...
Oliviafrostpaw Posted December 13, 2019 Author Share Posted December 13, 2019 10 hours ago, RaphGamingz said: are there any console errors? The only error in the logs I can find is a warning on looking up profile properties, Logs gathered from the console posted in Spoiler <==[18:20:57] [pool-3-thread-1/WARN] [mojang/YggdrasilMinecraftSessionService]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@44c4268d[id=380df991-f603-344c-a090-369bad2a924a,name=Dev,properties={},legacy=false] com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[authlib-1.5.25.jar:?] {} at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) ~[authlib-1.5.25.jar:?] {} at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) ~[authlib-1.5.25.jar:?] {} at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) ~[authlib-1.5.25.jar:?] {} at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716) ~[guava-21.0.jar:?] {} at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) ~[guava-21.0.jar:?] {} at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) ~[guava-21.0.jar:?] {} at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) ~[guava-21.0.jar:?] {} at com.google.common.cache.LocalCache.get(LocalCache.java:4154) ~[guava-21.0.jar:?] {} at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158) ~[guava-21.0.jar:?] {} at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147) ~[guava-21.0.jar:?] {} at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153) ~[guava-21.0.jar:?] {} at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) ~[authlib-1.5.25.jar:?] {} at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:1953) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.resources.SkinManager.lambda$loadProfileTextures$1(SkinManager.java:111) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_231] {} at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_231] {} at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_231] {} at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_231] {} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_231] {} Logs Post Game Load - During world load.txt Logs During Game load.txt Quote Link to comment Share on other sites More sharing options...
RaphGamingz Posted December 14, 2019 Share Posted December 14, 2019 On 12/8/2019 at 8:06 PM, Oliviafrostpaw said: new ResourceLocation("minecraft","blocks/grass" Are you sure this is correct, shouldn’t it be new ResourceLocation(“minecraft”,”grass”) And is the function firing? Quote Link to comment Share on other sites More sharing options...
Oliviafrostpaw Posted December 14, 2019 Author Share Posted December 14, 2019 56 minutes ago, RaphGamingz said: Are you sure this is correct, shouldn’t it be new ResourceLocation(“minecraft”,”grass”) And is the function firing? After some poking, the function is not firing whatsoever Quote Link to comment Share on other sites More sharing options...
Oliviafrostpaw Posted December 14, 2019 Author Share Posted December 14, 2019 Making it easier for showing the code, please see GitHub repository that I ideally should have set up to begin with so that I would have known when exactly all of this broke Github Link Quote Link to comment Share on other sites More sharing options...
Draco18s Posted December 14, 2019 Share Posted December 14, 2019 @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) That is not the correct bus for that event. 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. Link to comment Share on other sites More sharing options...
Oliviafrostpaw Posted December 14, 2019 Author Share Posted December 14, 2019 35 minutes ago, Draco18s said: @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) That is not the correct bus for that event. Ah, thank you very very much. Having attempted to look and find the correct bus/subscriber and or examples for its usage I found no instance of @Mod.EventBusSubscriber on the classes, is this necessary or am I just looking in the wrong places? Any Guidance would be appreciated Quote Link to comment Share on other sites More sharing options...
Draco18s Posted December 14, 2019 Share Posted December 14, 2019 There's only two options: FORGE and MOD. You're using the wrong one. 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. Link to comment Share on other sites More sharing options...
Oliviafrostpaw Posted December 14, 2019 Author Share Posted December 14, 2019 1 hour ago, Draco18s said: There's only two options: FORGE and MOD. You're using the wrong one. So, I have attempted with changing the whole class EventBusSubscriber to being Forge, which didnt trigger the event, I attempted creating a new class inside of the main class that has the Forge Subscriber, tried with having no conditions on the Mod.EventBusSubscriber, and finally tried with a whole new class, InjectionHandler.java, that has Mod.EventBusSubscriber with and without Mod.EventBusSubscriber.Bus.FORGE as a condition and just the onLootLoad function inside and still didnt trigger So Im about as lost as before. Once again, apologies for my lack of knowledge about the EventBus Intricacies. Spent the time the last few days and few hours searching for examples and other peoples questions on the topic and never came up with much conclusive Quote Link to comment Share on other sites More sharing options...
Draco18s Posted December 14, 2019 Share Posted December 14, 2019 I don't know why you're having so much trouble. https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderfarming/EventHandlers.java#L42-L57 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. Link to comment Share on other sites More sharing options...
Oliviafrostpaw Posted December 16, 2019 Author Share Posted December 16, 2019 I dont know how Im having this much trouble either haha So, implementing the code as a new class and it still does nothing package com.oliviafrostpaw.untitledmess; import java.io.IOException; import net.minecraft.util.ResourceLocation; import net.minecraft.world.storage.loot.LootPool; import net.minecraft.world.storage.loot.TableLootEntry; import net.minecraftforge.event.LootTableLoadEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid = UntitledMess.modid) public class EventHandlers { private static ResourceLocation grass = new ResourceLocation("minecraft", "blocks/grass"); @SubscribeEvent public static void onLootLoad(LootTableLoadEvent event) throws IOException { if (event.getName().equals(grass)) { event.getTable().addPool(LootPool.builder().addEntry(TableLootEntry.builder(new ResourceLocation(UntitledMess.modid, "blocks/grass"))).build()); } } } Quote Link to comment Share on other sites More sharing options...
Draco18s Posted December 16, 2019 Share Posted December 16, 2019 5 minutes ago, Oliviafrostpaw said: throws IOException Why do you have this? 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. Link to comment Share on other sites More sharing options...
Oliviafrostpaw Posted December 16, 2019 Author Share Posted December 16, 2019 I had this previously because I was attempting to log any movement inside of the function to a separate file, which required an IO Exception on the function, though before and after adding and removal it still didnt trigger Quote Link to comment Share on other sites More sharing options...
Draco18s Posted December 16, 2019 Share Posted December 16, 2019 1 hour ago, Oliviafrostpaw said: because I was attempting to log any movement inside of the function to a separate file Christ, use the given-to-you-logger. It does all that for you. 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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.