Posted October 20, 20186 yr How would i change the texture used for an item in the model file based on nbt data? The seven became one and the one became two.
October 20, 20186 yr Author Not sure what i did wrong here. If anyone can help that would be nice, by the way thank you V0idWa1k3r. Code: https://github.com/Merthew/Empire-Of-Blood Working on the syringe item. The seven became one and the one became two.
October 20, 20186 yr 38 minutes ago, Merthew said: Not sure what i did wrong here. You didn't... do anything? I see no mentions of property overrides in your ItemSyringe. ModItem, ItemBase, etc is an anti-pattern. Don't use it. Oh also anything like IHasModel is stupid. All items need models and there is nothing about model registration that requires access to something private/protected in the item. And yes, your ModItem is basically a fancy IHasModel. Don't use it. Register your models in the ModelRegistryEvent. Quote ItemInit.ITEMS.add(this); Instantinate your items directly in the RegistryEvent. Not anywhere else. Not in pre init. If you need a reference to the item later use ObjectHolders. Quote private int blood = 0; There is no reason for this to exist. if(blood == cap || blood == cap - 1 || blood == cap - 2) { blood = cap; } else { blood += 3; } => blood = Math.min(this.cap, blood + 3); Quote nbt.setInteger("cap", cap); Any reason you are storing the cap in the NBT? You are only referencing the one declared by your Item instance.
October 20, 20186 yr Author sorry i forgot to push the code to github. clearly i have very little idea what i am doing. The seven became one and the one became two.
October 20, 20186 yr Quote stack.getTagCompound().getInteger("blood")/stack.getTagCompound().getInteger("cap") What is 10 divided by 100? It's 0. 99 / 100 is also 0. Only 100 / 100 is 1. Dividing anything that doesn't have decimal points will just discard anything beyond them. You need to cast one of these to something that has a decimal point, like a float.
October 21, 20186 yr Author How would i register the items/blocks in the registry event? would i create them in the registryhandler class? The seven became one and the one became two.
October 21, 20186 yr 29 minutes ago, Merthew said: How would i register the items/blocks in the registry event? would i create them in the registryhandler class? You can store a static field in a class and initialize it in the registry event and then register them. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 21, 20186 yr No one thought about CustomMeshDefinitions? Property overrides only work for number values. https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/industry/item/ItemCastingMold.java#L80 Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
October 21, 20186 yr Author Did i do it right? Also looking at the model registry. I have no idea if this was the "right" way. Thanks for your help by the way. Code: https://github.com/Merthew/Empire-Of-Blood The seven became one and the one became two.
October 21, 20186 yr Author Well right now, github doesn't seem to be working. it may not have updated. The seven became one and the one became two.
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.