Changing Tool/Weapon Attack Speed Tutorial (Updated for MCR 1.8)

Started by Odahviing on

Topic category: User side tutorials

Last seen on 21:12, 14. Jul 2023
Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Changing Tool/Weapon Attack Speed Tutorial (Updated for MCR 1.8)
Fri, 12/14/2018 - 14:40 (edited)

We've been trying for ages, but I finally have the answer :P Here's how to make a weapon attack at whatever speed you like.

 

First of all, create your tool and make sure it is set to any tool except for Sword. (I'm currently unsure how to do a sword, the sword code does not copy the regular tool code)

Once you have created your tool, go to the Code tab. I would recommend locking your code so you don't have to redo this.

Scroll down to the middle section of the code, until you find this line:

this.AttackSpeed = -3.1F (or some other number)

If using MCreator 1.8.0/1.8.1, you will instead need to add this line. Below 'block.setCreativeTab(CreativeTabs.___), add this code:

block.speed = -3.1F;

Change the "-3.1F" to a different number. A higher number (remember this number is negative) will make your weapon faster, a lower number will make it slower.

 

You can figure out what number you want using this simple calculation:
 

 -4 + (speed you want) = (number you want)

for example, if I want 2 attack speed:

-4 + 2 = -2

So I put minus 2.

Or if i want 5 attack speed:

-4 + 5 = 1

 

Hope this helped you all :D

 

Edited by Odahviing on Fri, 12/14/2018 - 14:40
Last seen on 17:49, 25. Mar 2021
Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks! This is really…
Fri, 02/09/2018 - 22:39

Thanks! This is really useful for making new tools like battleaxes! :D

Last seen on 21:12, 14. Jul 2023
Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just updated this to work…
Fri, 12/14/2018 - 14:39

Just updated this to work for MCreator 1.8.0/1.8.1! :D