Jump to content

drok0920

Forge Modder
  • Posts

    443
  • Joined

  • Last visited

Everything posted by drok0920

  1. I am using 1.12 but what do you mean by where i register my models. I didnt know i had to register them unless you mean where i register my item?
  2. Hello, I have an item which needs to change texture based on a special property, like broken for elytra, but the texxture is never applied to the item and there are no errors relating to the item in the console, there are however errors for another item. I cant figure out why the texture isnt being displayed.
  3. Ugh nevermind im an idiot it works i just didnt realize that i needed to spawn in new items for it to update. Thank you for all the help!
  4. Ok the max stack size is 1 but both methods still return zero no matter what.
  5. Hmm it seems that the two lines of code i tested both return 0 even though the item is clearly damaged ingame. I used: stack.getMetadata() and stack.getItemDamage() Is this not the proper way of getting how damaged the item is?
  6. I cannot help you with questions 2 or 3 but for 1 possibly try using Math.ceil(value) instead of casting to an integer. For example this should return one if the value is greater than 0 and less than or equal to 1.
  7. Ok i changed that but the unlocalized name still doesn't change.
  8. Here is the full item class. And i did not know that could be a problem so i will fix it ASAP. package net.drok.poverhaul.item; import javax.annotation.Nullable; import net.drok.poverhaul.POHMod; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.Item; import net.minecraft.item.ItemElytra; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ItemRock extends Item { public ItemRock() { this.setRegistryName(new ResourceLocation(POHMod.MODID, "rock")); this.setHasSubtypes(true); this.setMaxDamage(110); this.addPropertyOverride(new ResourceLocation("sharpness"), new IItemPropertyGetter() { @SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { return stack.getMetadata(); } }); } @Override public boolean showDurabilityBar(ItemStack stack) { return true; } @Override public String getUnlocalizedName(ItemStack stack) { return "item." + this.getRegistryName().getResourcePath() + "_" + (stack.getMetadata() % 25); } @SideOnly(Side.CLIENT) public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { if (this.isInCreativeTab(tab)) { items.add(new ItemStack(this, 1, 0)); items.add(new ItemStack(this, 1, 25)); items.add(new ItemStack(this, 1, 50)); items.add(new ItemStack(this, 1, 100)); } } }
  9. Sorry for the delay i took a short break from modding. Here is the code i use: @Override public String getUnlocalizedName(ItemStack stack) { return "item." + this.getRegistryName().getResourcePath() + "_" + (stack.getMetadata() % 25); } But it is always the same unlocalized name.
  10. Hello again, I have a tool that i would like to change the name of as it gets damaged. I have tried overriding getUnlocalizeName but that does not give the expected results, it always gives the unlocalized name for the item with 0 damage. So my question is how can i accomplish this.
  11. Thank you i suppose that would be much easier than what i though. I dont know why i thought my method was a good idea.
  12. Ok ill try again i have an item that when rightclicked on a block gets sharper i want that sharpness to change the texture.
  13. No Im sorry i guess i didnt explain very well. What i want is the value that controls for example the color of the dye in vanilla to be driven by the nbt data that i set. So i guess what i am really asking is where should i put check to change it because i'd like it to update on its own rather than whenever i set the nbt.
  14. Hello, How would i go about setting the meta data of an item based on a custom nbt tag. For example i have an nbt tag that ranges from 0-100 how can i convert that to a meta data of lets say 0-4 without having to manually change the itemstack. Is there an automated way to achieve this?
  15. Hello i have created a block state file that throws an error stating that it cannot find a variant which exists in the file. I cannot figure out why this is happening even after an hour of trying. Error: https://pastebin.com/9SRQnMJx BlockState: { "forge_marker": 1, "defaults": { "textures": { "#mat": "progressiveg:items/ak47_oak" //the identifier must be a name of a material defined by the "model" obj's .mtl file }, "model": "progressiveg:ak47_0.obj" }, "variants": { "acacia_0": [{ "textures": { "#mat": "progressiveg:items/ak47_acacia" //the identifier must be a name of a material defined by the "model" obj's .mtl file }, "model": "progressiveg:ak47_0.obj" }], "acacia_1": [{ "textures": { "#mat": "progressiveg:items/ak47_acacia" //the identifier must be a name of a material defined by the "model" obj's .mtl file }, "model": "progressiveg:ak47_1.obj" }] } }
  16. Hmm the UV coords dont seem to import correctly and i doing something wrong? They work in my modelling soft ware but not in minecraft.
  17. Ok so i have finally gotten obj models to load but it seems that i can only set one texture per material through the MTL file rather than threw the blockstate file by using: "#mat": "progressiveg:items/ak47_oak" How can i use that above method to change the texture rather than having to use the MTL.
  18. Hehe i just realized when i went to get the files for you that i have two copies of the files and i edited the wrong one which is why i still got the error. It works fine now thank you!
  19. I made it in blender and it did have a material it just exported the material with the name None but i edited it and changed the name on both the obj and the mtl but i still get the other errors like the one on like 232
  20. Ok here it is also does it matter if faces are triangulated or not? ak47_0.obj
  21. https://pastebin.com/whCW3B2h Sorry about the last paste bin didnt realize it thought it was spam lol.
  22. https://pastebin.com/R4HxgLqT I see that one of the problems is it's looking for the wrong material so ill fix that but there are alot of other errors
  23. Ok i have tried to implement this to no avail. Any idea what im doing wrong?
  24. Ok i have done some testing and it travels correctly when it comes to its position and collisions but visually it's incorrect. Why could this be happening and is there a way to fix it?
  25. I have made an item which shoots my custom projectile all is good until i bring the velocity of the projectile to around 15 or higher. At this point it begins to prefer aiming at 45 degree angles. rather than where i am actually aiming. I assume it has to do with how im calculating the motion of the projectile. Does anyone know how i can fix this problem.
×
×
  • Create New...

Important Information

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