Jump to content

Recommended Posts

Posted

I'm trying to make a mod using FML 1.13.2 but whenever I try running my mod, I get an error saying 

Quote

Project Lime (projectlime) encountered an error during the load_registries event phase

 

here is my log

[24Aug2019 15:49:12.600] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevclient, --fml.mcpVersion, 20190213.203750, --fml.mcVersion, 1.13.2, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 25.0.219, --version, MOD_DEV, --assetIndex, 1.13.1, --assetsDir, C:\Users\Istvan\.gradle\caches\forge_gradle\assets, --username, Dev, --accessToken, ????????, --userProperties, {}]
[24Aug2019 15:49:12.604] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher starting: java version 1.8.0_162
[24Aug2019 15:49:12.896] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[24Aug2019 15:49:14.424] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevclient' with arguments [--version, MOD_DEV, --gameDir, ., --assetsDir, C:\Users\Istvan\.gradle\caches\forge_gradle\assets, --assetIndex, 1.13.1, --username, Dev, --accessToken, ????????, --userProperties, {}]
[24Aug2019 15:49:16.638] [Client thread/INFO] [net.minecraft.client.Minecraft/]: Setting user: Dev
[24Aug2019 15:49:24.868] [Client thread/INFO] [net.minecraft.client.Minecraft/]: LWJGL Version: 3.1.6 build 14
[24Aug2019 15:49:25.892] [Client thread/INFO] [net.minecraftforge.fml.ModLoader/CORE]: Loading Network data for FML net version: FML2
[24Aug2019 15:49:26.107] [modloading-worker-2/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 25.0.219, for MC 1.13.2 with MCP 20190213.203750
[24Aug2019 15:49:26.108] [modloading-worker-2/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v25.0.219 Initialized
[24Aug2019 15:49:26.358] [Client thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: null
	Index: 1
	Listeners:
		0: NORMAL
		1: ASM: class istvan.projectLime.ProjectLime$RegistryEvents registerItems(Lnet/minecraftforge/event/RegistryEvent$Register;)V
java.lang.NullPointerException
	at istvan.projectLime.ProjectLime$RegistryEvents.registerItems(ProjectLime.java:81)
	at net.minecraftforge.eventbus.ASMEventHandler_0_RegistryEvents_registerItems_Register.invoke(.dynamic)
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:254)
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:105)
	at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
	at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
	at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:111)
	at net.minecraftforge.fml.ModList.lambda$dispatchSynchronousEvent$4(ModList.java:111)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at net.minecraftforge.fml.ModList.dispatchSynchronousEvent(ModList.java:111)
	at net.minecraftforge.fml.ModList.lambda$static$0(ModList.java:82)
	at net.minecraftforge.fml.LifecycleEventProvider.dispatch(LifecycleEventProvider.java:70)
	at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:153)
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:896)
	at net.minecraftforge.fml.ModLoader.loadMods(ModLoader.java:141)
	at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:63)
	at net.minecraft.client.Minecraft.init(Minecraft.java:455)
	at net.minecraft.client.Minecraft.run(Minecraft.java:385)
	at net.minecraft.client.main.Main.main(Main.java:117)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55)
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:19)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:32)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:50)
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:59)
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:44)
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:98)

[24Aug2019 15:49:26.362] [Client thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Caught exception during event RegistryEvent.Register<minecraft:items> dispatch for modid projectlime
java.lang.NullPointerException: null
	at istvan.projectLime.ProjectLime$RegistryEvents.registerItems(ProjectLime.java:81) ~[main/:?]
	at net.minecraftforge.eventbus.ASMEventHandler_0_RegistryEvents_registerItems_Register.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80) ~[eventbus-0.9.2-service.jar:?]
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:254) ~[eventbus-0.9.2-service.jar:?]
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:105) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:25.0]
	at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_162]
	at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_162]
	at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:111) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraftforge.fml.ModList.lambda$dispatchSynchronousEvent$4(ModList.java:111) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:1.8.0_162]
	at net.minecraftforge.fml.ModList.dispatchSynchronousEvent(ModList.java:111) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraftforge.fml.ModList.lambda$static$0(ModList.java:82) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraftforge.fml.LifecycleEventProvider.dispatch(LifecycleEventProvider.java:70) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:153) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:896) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraftforge.fml.ModLoader.loadMods(ModLoader.java:141) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:63) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:455) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:385) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:117) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162]
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:19) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:32) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:50) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:59) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:44) [modlauncher-2.1.1.jar:?]
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:98) [forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
[24Aug2019 15:49:26.404] [Client thread/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event LOAD_REGISTRIES, 1 errors found
[24Aug2019 15:49:26.404] [Client thread/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
java.lang.Exception: stacktrace
	at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:274) ~[eventbus-0.9.2-service.jar:?]
	at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:65) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:455) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:385) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:117) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162]
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:19) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:32) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:50) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:59) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:44) [modlauncher-2.1.1.jar:?]
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:98) [forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
[24Aug2019 15:49:26.424] [Client thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar, main, Default
[24Aug2019 15:49:27.767] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/]: Starting up SoundSystem version 201809301515...
[24Aug2019 15:49:27.991] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager/]: Initializing No Sound
[24Aug2019 15:49:27.991] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager/]: (Silent Mode)
[24Aug2019 15:49:28.129] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager/]: OpenAL initialized.
[24Aug2019 15:49:28.385] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/SOUNDS]: Preloading sound minecraft:sounds/ambient/underwater/underwater_ambience.ogg
[24Aug2019 15:49:28.389] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/SOUNDS]: Sound engine started
[24Aug2019 15:49:31.971] [Client thread/INFO] [net.minecraft.client.renderer.texture.TextureMap/]: Max texture size: 8192
[24Aug2019 15:49:33.184] [Client thread/INFO] [net.minecraft.client.renderer.texture.TextureMap/]: Created: 512x512 textures-atlas
[24Aug2019 15:49:35.851] [Client thread/ERROR] [net.minecraftforge.fml.ModLoader/LOADING]: Skipping lifecycle event ENQUEUE_IMC, 1 errors found.
[24Aug2019 15:49:35.851] [Client thread/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event ENQUEUE_IMC, 1 errors found
[24Aug2019 15:49:35.851] [Client thread/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
java.lang.Exception: stacktrace
	at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:274) ~[eventbus-0.9.2-service.jar:?]
	at net.minecraftforge.fml.client.ClientModLoader.end(ClientModLoader.java:76) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:522) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:385) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:117) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162]
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:19) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:32) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:50) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:59) [modlauncher-2.1.1.jar:?]
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:44) [modlauncher-2.1.1.jar:?]
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:98) [forge-1.13.2-25.0.219_mapped_snapshot_20180921-1.13-recomp.jar:?]
[24Aug2019 15:49:35.899] [Client thread/INFO] [com.mojang.text2speech.NarratorWindows/]: Narrator library for x64 successfully loaded
[24Aug2019 15:49:36.314] [Realms Notification Availability checker #1/INFO] [com.mojang.realmsclient.client.RealmsClient/]: Could not authorize you against Realms server: Invalid session id

and here is my main class

package istvan.projectLime;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import istvan.projectLime.items.ItemCustomAxe;
import istvan.projectLime.items.ItemCustomPickaxe;
import istvan.projectLime.lists.ArmorMaterialList;
import istvan.projectLime.lists.BlockList;
import istvan.projectLime.lists.ItemList;
import istvan.projectLime.lists.ToolMaterialList;
import istvan.projectLime.world.OreGeneration;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemSword;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

@Mod("projectlime")
public class ProjectLime 
{
	public static ProjectLime instance;
	public static final String modid = "projectlime";
	private static final Logger Logger = LogManager.getLogger(modid);
	public static final ItemGroup lime = new LimeItemGroup();
		
	public ProjectLime()
	{
		instance = this;
	
		FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
		FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientRegistries);
		
		MinecraftForge.EVENT_BUS.register(this);
	}
	private void setup(final FMLCommonSetupEvent event)
	{
		OreGeneration.setupOreGeneration();
		Logger.info("Setup method registered");
	}
	private void clientRegistries(final FMLClientSetupEvent event)
	{
		Logger.info("clientRegistries method registered");
	}
	
	@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
	public static class RegistryEvents
	{
		@SubscribeEvent
		public static void registerItems(final RegistryEvent.Register<Item> event)
		{
			event.getRegistry().registerAll
			(
			ItemList.lime_ingot = new Item(new Item.Properties().group(lime)).setRegistryName(location("lime_ingot")),
			ItemList.ruby = new Item(new Item.Properties().group(lime)).setRegistryName(location("ruby")),
			
			ItemList.lime_sword = new ItemSword(ToolMaterialList.lime, 0, 6.0f, new Item.Properties().group(lime)).setRegistryName(location("lime_sword")),
			ItemList.lime_axe = new ItemCustomAxe(ToolMaterialList.lime, -1.0f, 6.0f, new Item.Properties().group(lime)).setRegistryName(location("lime_axe")),
			ItemList.lime_hoe = new ItemHoe(ToolMaterialList.lime, 6.0f, new Item.Properties().group(lime)).setRegistryName(location("lime_hoe")),
			ItemList.lime_pickaxe = new ItemCustomPickaxe(ToolMaterialList.lime, -2, 6.0f, new Item.Properties().group(lime)).setRegistryName(location("lime_pickaxe")),
			ItemList.lime_shovel = new ItemSpade(ToolMaterialList.lime, -3.0f, 6.0f, new Item.Properties().group(lime)).setRegistryName(location("lime_shovel")),
			
			ItemList.lime_helmet = new ItemArmor(ArmorMaterialList.lime,  EntityEquipmentSlot.HEAD, new Item.Properties().group(lime)).setRegistryName(location("lime_helmet")),
			ItemList.lime_chestplate = new ItemArmor(ArmorMaterialList.lime,  EntityEquipmentSlot.CHEST, new Item.Properties().group(lime)).setRegistryName(location("lime_chestplate")),
			ItemList.lime_leggings = new ItemArmor(ArmorMaterialList.lime,  EntityEquipmentSlot.LEGS, new Item.Properties().group(lime)).setRegistryName(location("lime_leggings")),
			ItemList.lime_boots = new ItemArmor(ArmorMaterialList.lime,  EntityEquipmentSlot.FEET, new Item.Properties().group(lime)).setRegistryName(location("lime_boots")),
			
			ItemList.ruby_block = new ItemBlock(BlockList.ruby_block, new Item.Properties().group(lime)).setRegistryName(BlockList.ruby_block.getRegistryName()),
			ItemList.lime_block = new ItemBlock(BlockList.lime_block, new Item.Properties().group(lime)).setRegistryName(BlockList.lime_block.getRegistryName())
			);
			
			Logger.info("Items Registered");
		}
	}
	@SubscribeEvent
	public static void registerBlocks(final RegistryEvent.Register<Block> event)
	{
		event.getRegistry().registerAll
		(
			BlockList.ruby_block = new Block(Block.Properties.create(Material.IRON)).setRegistryName(location("ruby_block")),
			BlockList.lime_block = new Block(Block.Properties.create(Material.IRON)).setRegistryName(location("lime_block")),
			
			BlockList.lime_ore = new Block(Block.Properties.create(Material.GROUND)).setRegistryName(location("lime_ore")),
			BlockList.ruby_ore = new Block(Block.Properties.create(Material.GROUND)).setRegistryName(location("ruby_ore"))
		);
		
		Logger.info("Blocks Registered");
	}
	
	private static ResourceLocation location(String name)
	{
		return new ResourceLocation(modid, name);
	}
}
	

any help is appreciated.

  • MsaterSgnt changed the title to [1.13.2] I cant find my error
Posted
29 minutes ago, MsaterSgnt said:

at istvan.projectLime.ProjectLime$RegistryEvents.registerItems(ProjectLime.java:81)

What's on line 81? Also

 

29 minutes ago, MsaterSgnt said:

FML 1.13.2

Update to 1.14.4

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
8 minutes ago, CAS_ual_TY said:

Does the block registry fire before the item registry in 1.13?

The Block Registry has always fired before the Item registry. Because you need the block to create the ItemBlocks.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I know that this may be a basic question, but I am very new to modding. I am trying to have it so that I can create modified Vanilla loot tables that use a custom enchantment as a condition (i.e. enchantment present = item). However, I am having trouble trying to implement this; the LootItemRandomChanceWithEnchantedBonusCondition constructor needs a Holder<Enchantment> and I am unable to use the getOrThrow() method on the custom enchantment declared in my mod's enchantments class. Here is what I have so far in the GLM:   protected void start(HolderLookup.Provider registries) { HolderLookup.RegistryLookup<Enchantment> registrylookup = registries.lookupOrThrow(Registries.ENCHANTMENT); LootItemRandomChanceWithEnchantedBonusCondition lootItemRandomChanceWithEnchantedBonusCondition = new LootItemRandomChanceWithEnchantedBonusCondition(0.0f, LevelBasedValue.perLevel(0.07f), registrylookup.getOrThrow(*enchantment here*)); this.add("nebu_from_deepslate", new AddItemModifier(new LootItemCondition[]{ LootItemBlockStatePropertyCondition.hasBlockStateProperties(Blocks.DEEPSLATE).build(), LootItemRandomChanceCondition.randomChance(0.25f).build(), lootItemRandomChanceWithEnchantedBonusCondition }, OrichalcumItems.NEBU.get())); }   Inserting Enchantments.[vanilla enchantment here] actually works but trying to declare an enchantment from my custom enchantments class as [mod enchantment class].[custom enchantment] does not work even though they are both a ResourceKey and are registered in Registries.ENCHANTMENT. Basically, how would I go about making it so that a custom enchantment declared as a ResourceKey<Enchantment> of value ResourceKey.create(Registries.ENCHANTMENT, ResourceLocation.fromNamespaceAndPath([modid], [name])), declared in a seperate enchantments class, can be used in the LootItemRandomChanceWithEnchantedBonusCondition constructor as a Holder? I can't use getOrThrow() because there is no level or block entity/entity in the start() method and it is running as datagen. It's driving me nuts.
    • Hi here is an update. I was able to fix the code so my mod does not crash Minecraft. Please understand that I am new to modding but I honestly am having a hard time understanding how anyone can get this to work without having extensive programming and debugging experience as well as searching across the Internet, multiple gen AI bots (claude, grok, openai), and examining source code hidden in the gradle directory and in various github repositories. I guess I am wrong because clearly there are thousands of mods so maybe I am just a newbie. Ok, rant over, here is a step by step summary so others can save the 3 days it took me to figure this out.   1. First, I am using forge 54.1.0 and Minecraft 1.21.4 2. I am creating a mod to add a shotgun to Minecraft 3. After creating the mod and compiling it, I installed the .jar file to the proper directory in Minecraft and used 1.21.4-forge-54.1.0 4. The mod immediately crashed with the error: Caused by: java.lang.NullPointerException: Item id not set 5. Using the stack trace, I determined that the Exception was being thrown from the net.minecraft.world.item.Item.Properties class 6. It seems that there are no javadocs for this class, so I used IntelliJ which was able to provide a decompiled version of the class, which I then examined to see the source of the error. Side question: Are there javadocs? 7. This method, specifically, was the culprit: protected String effectiveDescriptionId() {      return this.descriptionId.get(Objects.requireNonNull(this.id, "Item id not set"));  } 8. Now my quest was to determine how to set this.id. Looking at the same source file, I determined there was another method:  public Item.Properties setId(ResourceKey<Item> pId) {             this.id = pId;             return this;   } 9. So now, I need to figure out how to call setId(). This required working backwards a bit. Starting from the constructor, I stubbed out the variable p which is of type Item.Properties public static final RegistryObject<Item> SHOTGUN = ITEMS.register("shotgun", () -> new ShotgunItem(p)); Rather than putting this all on one line, I split it up for readability like this: private static final Item.Properties p = new Item.Properties().useItemDescriptionPrefix().setId(rk); Here is was the missing function, setId(), which takes a type of ResourceKey<Item>. My next problem is that due to the apparent lack of documentation (I tried searching the docs on this site) I could not determine the full import path to ResourceKey. I did some random searching on the Internet and stumbled across a Github repository which gave two clues: import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; Then I created the rk variable like this: private static ResourceKey<Item> rk = ResourceKey.create(Registries.ITEM, ResourceLocation.parse("modid:shotgunmod")); And now putting it all together in order: private static ResourceKey<Item> rk = ResourceKey.create(Registries.ITEM, ResourceLocation.parse("modid:shotgunmod")); private static final Item.Properties p = new Item.Properties().useItemDescriptionPrefix().setId(rk); public static final RegistryObject<Item> SHOTGUN = ITEMS.register("shotgun", () -> new ShotgunItem(p)); This compiled and the mod no longer crashes. I still have more to do on it, but hopefully this will save someone hours. I welcome any feedback and if I missed some obvious modding resource or tutorial that has this information. If not, I might suggest we add it somewhere for people trying to write a mod that doesn't crash. Thank you !!!  
    • I will keep adding to this thread with more information in case anyone can help, or at the very least I can keep my troubleshooting organized. I decided to downgrade to 54.1.0 in the hopes that this would fix the issue but it didn't. At least now I am on a "recommended" version. The crash report did confirm my earlier post that the Exception is coming from effectiveDescriptionId(). I'll continue to see if I can find a way to set the ID manually.   Caused by: java.lang.NullPointerException: Item id not set         at java.base/java.util.Objects.requireNonNull(Objects.java:259) ~[?:?]         at TRANSFORMER/[email protected]/net.minecraft.world.item.Item$Properties.effectiveDescriptionId(Item.java:465) ~[forge-1.21.4-54.1.0-client.jar!/:?]         at TRANSFORMER/[email protected]/net.minecraft.world.item.Item.<init>(Item.java:111) ~[forge-1.21.4-54.1.0-client.jar!/:?]         at TRANSFORMER/[email protected]/com.example.shotgunmod.ShotgunItem.<init>(ShotgunItem.java:19) ~[shotgunmod-1.0.0.jar!/:1.0.0]         at TRANSFORMER/[email protected]/com.example.shotgunmod.ModItems.lambda$static$0(ModItems.java:15) ~[shotgunmod-1.0.0.jar!/:1.0.0]         at TRANSFORMER/[email protected]/net.minecraftforge.registries.DeferredRegister$EventDispatcher.lambda$handleEvent      
    • It just randomly stop working after a rebooted my dedicated server PLEASE HELP!   com.google.gson   Failed to start the minecraft server com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive; at path $  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.