Started by
NatePlays95
on
Topic category: User side tutorials
I'm working on a mod with various melee weapon types like swords, axes and spears
But I don't know how to change the swords' attack speed (default 1.6), so greatswords feel diferente, slower than broadswords and daggers, in exchange for damage.
Does anyone know what code to add or change to modify the weapons' cooldowns?
(Also, how does one change the range of certain weapons, like seen in Aether2 and Kaishi's weapon pack?)
I'm pretty sure you can't do that without adding lines in your weapon's code. I would do some research for what weapon speed looks like in code for your version of minecraft. Google might be your very best friend for that. :^)
You can take the
part of the axe code, put it into your weapons class and adjust the numbers to your liking.
Hello, I am trying to achieve the same thing. k6u, where in the tool's code would I put that code you sent? And Nate, did you come up with a solution?
edit console
I came out with this trick (VIDEO) for MCreator 1.7.0 (it should work for newer versions) since I didn't find any code that could fit the MCreator one
It's pretty much like Kane's video, you guy should watch it, it has pretty much everything you should know
the default speed is 4
for sword speed (1.6), you write -2.4F
I used -3.1F (0.9) for axes and greatswords, -2.4F (1.6) for swords and -1F (3) for spears, lances and knives
I'll give more info about my mod soon
It doesn't work on the later versions of MCreator sadly :(
wait wrong video sorry
Again sorry. It doesn't work on later versions of Mcreator
Sorry for being so confused
here is how i did it:
-make a sword/tool
-click on your newly created sword/tool and edit the .java code
-scroll down and you should see either -2.4/2.4F if a sword and -3.1/3.1F if other tool ( speed may change dependign on the item)
how it works iis tha base attack speed is 4
for swords its 1.6 so 4 - 2.4
if you want to make your attack speed faster lower the value where it says "item_attack_speed" to make attack speed faster
if you want to make it slower make it higher (yes it can go into the negative but it will be verry slooooooooooow)
to make it faster than 4 wich is the basic cooldown when you hit with empty hand in the air just make the value positif (+) so instead of -2.4 its +2.4 wich is 6.4 attack speed (really fast)