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

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
								}
							}
						]
				}
			]
		}
	]
}

 

 

Question:

Do recipes and loot tables in general still work, or are all of them broken too?

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

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

  • Author
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

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?

  • Author
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

@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)

 

That is not the correct bus for that event.

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

There's only two options: FORGE and MOD. You're using the wrong one.

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

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

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());
        }
    }
}

 

5 minutes ago, Oliviafrostpaw said:

throws IOException 

Why do you have this?

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

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

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.

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.