Posted September 8, 20178 yr Hi! I was trying to make my first MC mod and I already got stuck. I can´t get the texture for my item into the game ... can you please help me? VapeMod.java Reference.java CommonProxy.java ClientProxy.java ServerProxy.java ModItems.java ItemVapeStick.java itemvapestick.json Console output when I run the game...
September 8, 20178 yr I believe that the JSON file names are case sensitive. Try renaming itemvapestick.json to ItemVapeStick.json
September 8, 20178 yr Author 2 minutes ago, Doublecaster said: I believe that the JSON file names are case sensitive. Try renaming itemvapestick.json to ItemVapeStick.json Nope, that didn´t help.
September 8, 20178 yr Items and other IForgeRegistryEntry implementations must be registered in RegistryEvent.Register<> event. Models must be registered with ModelLoader in ModelRegistryEvent event client-side. Documentation on events here. Documentation on 'registering things' here. A proper way to register a model of an item is ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); Please share this message to similar threads so people don't waste their time writing it over and over again.
September 8, 20178 yr 8 minutes ago, Doublecaster said: I believe that the JSON file names are case sensitive. Try renaming itemvapestick.json to ItemVapeStick.json Please don't mislead people providing information you understand nothing about.
September 8, 20178 yr Found your problem. You're assigning "ItemVapeStick" as a registry name. Everything related to resources must be lowercase. In order for models to function properly in IDE, you might need to have pack format set to 3. Create pack.mcmeta file in resources directory with the following content: { "pack": { "description": "Mod's resources", "pack_format": 3 } } By the way, what the pokemon is VapeItems enum in Reference.java? I kinda understand what it's for, but it only makes code hard to read and confuses everyone. Edited September 8, 20178 yr by MrBendelScrolls Sneaky 8-length tab
September 8, 20178 yr Author So... I tried to fix the ModItems.java but I feel like I just more screwed it up... Here is a result: public class ModItems { public static Item vapestick; public static void init() { vapestick = new ItemVapeStick(); } public static void register() { GameRegistry.register(vapestick); } public static void registerRenders() { registerRender(vapestick); } private static void registerRender(Item item) { System.out.println(item.getRegistryName()); ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } public class EventHandler { @SubscribeEvent public void pickupItem(EntityItemPickupEvent event) { System.out.println("Item picked up!"); } public void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(); } } } Then in resources, there was pack.mcmeta file already so I edited it (in nope pad) and NoBrainly changed the code to that one you wrote above and lost the original code. After that, I couldn´t run the game, so I was forced to delete the file. I am a real beginner in MC modding and I just feel like I´m not able to do it. Would you be so kind and explain to me how to Register that item. I´m super confused off that article. I just wanted to learn something new.
September 8, 20178 yr This is a good example of using registry events. One note: client-side ModelLoader can crash a server and shouldn't be used in common code. Solve it your way, just a call to proxy is ok. 18 minutes ago, Rasdek11 said: Then in resources, there was pack.mcmeta file already so I edited it (in nope pad) and NoBrainly changed the code to that one you wrote above and lost the original code. After that, I couldn´t run the game, so I was forced to delete the file. My fault, sorry. I gave you invalid code, there must be description field. { "pack": { "description": "Mod's resources", "pack_format": 3 } }
September 9, 20178 yr Author 11 hours ago, diesieben07 said: It's one of the many MrCrayfish abominations that everyone blindly copies. So what should I do then... Do you know any other tutorials with updated codes?
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.