Jump to content

My sword is just a purple and black block


ApolloCC

Recommended Posts

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
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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