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

My guess is, the png is in the wrong path within the project.

 

Mine are located in src/main/resources/assets/modname/textures/items/myitem.png

My model is in src/main/resources/assets/modname/models/item/myitem.json

 

For you, it looks like the json expects the file in:

src/main/resources/assets/sword/textures/items/my_sword.png

Edited by KindOfWay

Also post ExampleMod java, to make sure the registered name is correct, it should be registering as "my_sword" to work.

This looks like outdated code to me.

There is no reason for you to use CommonProxy to register the items.

The EventSubscriber is wrong the notation is

@EventBusSubscriber(modid = Mymod.modId, bus = EventBusSubscriber.Bus.<target>)
  
Where target is either MOD or FORGE depending which events you need

 

I register my items like this in 1.15.2

public final class ModItems {

	public static final DeferredRegister<Item> ITEMS = new DeferredRegister<>(ForgeRegistries.ITEMS, MyMod.modId);

	public static final RegistryObject<Item> sample_item = ITEMS.register("sample_item",
			() -> new Item(new Item.Properties().group(ModItemGroups.MOD_ITEM_GROUP)));
}

Then in my MyMod java

		final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
		
		ModItems.ITEMS.register(modEventBus);

 

  • Guest locked this topic
Guest
This topic is now closed to further replies.

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.