You could use the existing materials. In the constructor, just pass Material.IRON or something else. Then I believe you can do: this.setMaxDamage(someNumber);
I would like to know how to edit attributes too!
EDIT: for damage, I think there's a method (check the ItemSword.class) called getStrVsEntity, and you can override that to provide a straight-up number (float?)
You could use the existing materials. In the constructor, just pass Material.IRON or something else. Then I believe you can do: this.setMaxDamage(someNumber);
I would like to know how to edit attributes too!
EDIT: for damage, I think there's a method (check the ItemSword.class) called getStrVsEntity, and you can override that to provide a straight-up number (float?)
Woo! But what about attributes? I kind of looked around, and some people said they were final values. (Or, you'd have to "delete" and "set" a new one?)
Something like.... while it's activated that the tooltip would read:
I'm not sure what the video offered or what you want exactly but you could always take the class file for ItemSword then copy that into a new one and edit that. It will act like a sword but you can just edit everything to act exactly how you want it to.
I'm not sure what the video offered or what you want exactly but you could always take the class file for ItemSword then copy that into a new one and edit that. It will act like a sword but you can just edit everything to act exactly how you want it to.
I did that but I didn't find the modifier for durability
Not sure if this is old enough to count as necro or if this is off-topic, but...
Is there a way to change the attributes of an instance of an item?
NBTTagList list = itemStack.stackTagCompound.getTagList("AttributeModifiers");
//Now what can I do with list? list.tagAt() requires an "int" for the index, and I don't know where the generic.attackDamage is?
You can't create a tool without a material (like an axe etc.) when you want to extend the vanilla classes. But you can put a vanilla material that doesn't serve any purpose in this case and tell your item to use any durability you want. For the vanilla items, this is the tool material durability + x, but you can just replace it with x and make x whatever you want.
I would like to know how to edit attributes too!
EDIT: for damage, I think there's a method (check the ItemSword.class) called getStrVsEntity, and you can override that to provide a straight-up number (float?)
:3
I'll check out that vid
I meant WITHOUT a custom meaterial
You can simply put whatever default material, then override any method you want to be different from the default.
Something like.... while it's activated that the tooltip would read:
"+7 speed" -> "+9 speed"?
:3
I did that but I didn't find the modifier for durability
Is there a way to change the attributes of an instance of an item?
:3
Why not create a new material? You're twisting you're own ankle through a chain when you have the key XD
You can't create a tool without a material (like an axe etc.) when you want to extend the vanilla classes. But you can put a vanilla material that doesn't serve any purpose in this case and tell your item to use any durability you want. For the vanilla items, this is the tool material durability + x, but you can just replace it with x and make x whatever you want.
It's literally a small line of code in the items class and one word in the item's class (note the difference between items and item's).