Jump to content

Recommended Posts

Posted (edited)

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
Posted

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

 

Posted

1.12 is no longer supported on these forums due to age.

Please update to a modern version to receive support.

 

See the LTS link at the top of every page for more information.

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

Announcements



×
×
  • Create New...

Important Information

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