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

Hello, I have tried my best do do a Forgemod for the MC 1.15.2. (Forgeversion: 31.2), but I keep getting this error:

Quote

[m[1;31m[20:32:46] [modloading-worker-1/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to register automatic subscribers. ModID: vanillaedits, class xtay2.vanillaedits.VanillaEdits
java.lang.NoSuchFieldError: field_151576_e
    at xtay2.vanillaedits.init.BlocksInit.<clinit>(BlocksInit.java:21) ~[?:1.0] {re:classloading}

My whole log https://pastebin.com/D3109NaF

The "error" is displayed to be in the class BlocksInit:

package xtay2.vanillaedits.init;

import xtay2.vanillaedits.VanillaEdits;
import net.minecraft.block.Block;
import net.minecraft.block.Block.Properties;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.registries.IForgeRegistry;

@Mod.EventBusSubscriber(modid = VanillaEdits.MODID, bus = Bus.MOD)
public class BlocksInit 
{
	public static final Block ep_ore = new Block(Properties.create(Material.ROCK).harvestLevel(2).hardnessAndResistance(3.0F).harvestTool(ToolType.PICKAXE).sound(SoundType.STONE).lightValue(1)).setRegistryName("ep_ore");

	public static final Item ep_ore_item = new BlockItem(ep_ore, new Item.Properties().group(ItemGroup.BUILDING_BLOCKS).maxStackSize(64)).setRegistryName("ep_ore");    

	
	@SubscribeEvent    
	public static void registerBlocks(final RegistryEvent.Register<Block> event) {
		final IForgeRegistry<Block> registry = event.getRegistry();
		registry.register(ep_ore);
	}    
	@SubscribeEvent
	public static void registerItems(final RegistryEvent.Register<Item> event) {
		final IForgeRegistry<Item> registry = event.getRegistry();
		registry.register(ep_ore_item);
	}   	
}

When I load the mod.jar in normal MC and not Eclipse/Forge the Textures of my added block "ep_ore" wont load at all and I get the purple/black unassigned texture.

 

I hope you can help me, have a wonderful day!

You should not be creating your blocks and items with static initializers.

You should user DeferredRegister.

The class is documented in the sources and here: https://mcforge.readthedocs.io/en/latest/concepts/registries/

 

As a side note, you should create a github repository for your project, then share the link here when you need help. It makes it easier for people to help you when they can see all your code, it gives the big picture. :) 

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.