How to make a weapon with specific cooldown

Started by zerosevenine on

Topic category: Help with modding (Java Edition)

Last seen on 17:56, 9. Nov 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a weapon with specific cooldown

Hello, dear forum readers.

I have come back to trying to update my old mod again and this time, i want to make something big.
I already have a texture for a sniper rifle, sound effects too. But there is one thing i'd like to know..
Is there somehow a way to cooldown the weapon for 80 seconds after either:
- firing four shots out of the weapon
- 10 seconds pass from activating (right clicking) the weapon.

So in theory, what i'd specifically like to do is quite complicated but here goes:

The procedure itself

1. Rightclick with the weapon having 0 ammo. Cannot be reloaded anyhow. 
2. Rightclicking loads four shots (the maximum capacity) into said gun, starting the 10 seconds countdown, during which the four bullets can be shot.
3. After these ten seconds, the gun clears any left ammo and is set on a cooldown for a minute or so.

I bow before anyone even trying to read this whole, since i guess noone will. But for those who may help, thanks beforehand.

Last seen on 22:26, 19. Nov 2023
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
that is rather complicated…
Thu, 04/21/2022 - 11:36

that is rather complicated......

Last seen on 12:15, 30. Jul 2024
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeaaaaaa i just made my…
Fri, 08/04/2023 - 23:29

yeaaaaaa i just made my first tutorial i have no idea how to do this