Hey guys! One question I have been working on and never got to actually get what I wanted to work,
I want to add the generic movement speed attribute to weapons along with many others, currently I don't have a way and am stumped at doing so, I have seen mods with some sort of trait built in that does so how ever I do not know how they work (What I mean, some mods will have attributes applied, even when the weapon is in creative mode)
Does anyone know how to help do such a thing without using any sort of commands? I am semi experienced with java and can write code so I am not entirely literate lol!
Alright thanks! If possible could I have an example? Sorry for asking if it's too much, I will look into the interface and see what I can do, might poke around some source code if I can find examples otherwise, thanks!
This will add 1.25 attack damage if the item is put in the boots slot. I'm not entirely certain what the UUID does, but it is the one used for armor and toughness for boots in ArmorItem.
Thanks this does seem to work, with a bit of massaging of course for 1.16.5 the current version I am updating for, I was able to add the main thing at this point was speed and attack speed and attack damage changes to weapons, one issue that I've noticed is some of the attributes such as Armor don't seem to be applicable through this method, for lets say a sword, I was unable to add armor to a sword when held via this method, have you had such an issue before or could this be just a 1.16.5 thing to look into?
Hey guys! One question I have been working on and never got to actually get what I wanted to work,
I want to add the generic movement speed attribute to weapons along with many others, currently I don't have a way and am stumped at doing so, I have seen mods with some sort of trait built in that does so how ever I do not know how they work (What I mean, some mods will have attributes applied, even when the weapon is in creative mode)
Does anyone know how to help do such a thing without using any sort of commands? I am semi experienced with java and can write code so I am not entirely literate lol!
Override getAttributeModifiers for the item, I would recommend looking at SwordItem to see how it is done.
Uncrafting Table (1.15.2): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/3032965-uncrafting-table
Ruins of Humanity (mod, no longer being developed): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/2898701-1-12-2-wip-early-alpha-ruins-of-humanity
Alright thanks! If possible could I have an example? Sorry for asking if it's too much, I will look into the interface and see what I can do, might poke around some source code if I can find examples otherwise, thanks!
This is in 1.15.2:
This will add 1.25 attack damage if the item is put in the boots slot. I'm not entirely certain what the UUID does, but it is the one used for armor and toughness for boots in ArmorItem.
Uncrafting Table (1.15.2): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/3032965-uncrafting-table
Ruins of Humanity (mod, no longer being developed): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/2898701-1-12-2-wip-early-alpha-ruins-of-humanity
Thanks this does seem to work, with a bit of massaging of course for 1.16.5 the current version I am updating for, I was able to add the main thing at this point was speed and attack speed and attack damage changes to weapons, one issue that I've noticed is some of the attributes such as Armor don't seem to be applicable through this method, for lets say a sword, I was unable to add armor to a sword when held via this method, have you had such an issue before or could this be just a 1.16.5 thing to look into?