Help! How to change weapon cooldown (attack speed)

Started by NatePlays95 on Fri, 12/15/2017 - 21:35

Topic category: User side tutorials

Last seen on 01:12, 24. Nov 2020
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Help! How to change weapon cooldown (attack speed)
Fri, 12/15/2017 - 21:35

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?)

Last seen on 15:18, 10. Nov 2019
Joined Nov 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I'm pretty sure you can't do…
Fri, 12/15/2017 - 23:00

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. :^)

Last seen on 22:42, 16. Jul 2019
Joined Sep 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can take the …
Mon, 12/18/2017 - 05:15

You can take the 

this.damageVsEntity = 5;
			this.attackSpeed = -3.1F;

part of the axe code, put it into your weapons class and adjust the numbers to your liking.

Last seen on 16:40, 4. Oct 2018
Joined Sep 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hello, I am trying to…
Mon, 04/16/2018 - 05:04

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?

Last seen on 15:27, 21. Aug 2020
Joined Dec 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
edit console
Mon, 04/16/2018 - 11:55

edit console

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I came out with this trick …
Mon, 04/16/2018 - 12:44

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 

Last seen on 01:12, 24. Nov 2020
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It's pretty much like Kane's…
Mon, 05/07/2018 - 00:19

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

Last seen on 01:34, 21. May 2020
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It doesn't work on the later…
Wed, 10/23/2019 - 08:42

It doesn't work on the later versions of MCreator sadly :(

Last seen on 01:34, 21. May 2020
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
wait wrong video sorry  
Wed, 10/23/2019 - 08:43

wait wrong video sorry

 

Last seen on 01:34, 21. May 2020
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Again sorry. It doesn't work…
Wed, 10/23/2019 - 09:25

Again sorry. It doesn't work on later versions of Mcreator

Sorry for being so confused

Last seen on 23:44, 7. Jul 2020
Joined Jun 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
here is how i did it:      …
Tue, 07/07/2020 - 14:59

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)