Item with cooldown

Started by DragonOfAsparas on

Topic category: Advanced modding

Last seen on 13:32, 28. Aug 2021
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Item with cooldown

Hey, i'm trying to make an item that has a cooldown just like the enderpearl in 1.9. When the item is right clicked it summons lightning (example) and then it has like 10 seconds cooldown before it can used again. Or if someone know the code for the cooldown so i can paste it in the code somehow. Anyone who has a solution?
Thanks

Last seen on 19:01, 30. May 2022
Joined Dec 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am currently looking into
Fri, 11/11/2016 - 01:22

I am currently looking into this, and if I find a solution I will let you know.

Last seen on 13:32, 28. Aug 2021
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:I am currently looking into
Fri, 11/11/2016 - 09:48

Thanx i'll be looking forward if you find a solution :)

Last seen on 20:14, 17. Nov 2016
Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I feel like there's a lot of
Thu, 11/17/2016 - 10:26

I feel like there's a lot of modding mechanics that are possible through code, and not as many through MCreator...
 

Last seen on 19:01, 30. May 2022
Joined Dec 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:RE:I am currently looking into
Thu, 11/17/2016 - 16:02

Of course there is Twizzy. Mcreator itself has been coded, the problem is, that there is only a couple people that work on MCreator. Thats why MCreator allows users to implement their own coding as well. If you code a mod yourself then that mod could be better because you dont have restrictions. Most people who use MCreator do not have coding knowledge.

Last seen on 13:32, 28. Aug 2021
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:I am currently looking into
Tue, 11/22/2016 - 08:56

Btw i kind of found a way how to make an item with cooldown...only it's quite a pain to make. So when you have an item you want to add the event "when right clicked remove item from inventory" then you make another item, i named it timer 1. Then u go back to the item that you want to have a cooldown on and go to the events . you add the event "when update tick inventory add item timer1. Unfortunately you can't set a tick rate on items so you will have to make like 10 "timer items" for just 10 seconds... So when the cooldown item is right clicked it does it's function or whatever you selected, then it gets removed and adds timer1, then event to remove timer1 and add item timer2. I hope you guys understand this it's quite hard to explain.

Last seen on 19:01, 30. May 2022
Joined Dec 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:RE:I am currently looking into
Tue, 11/22/2016 - 17:19

@#5 Hmmm, Very interesting. I can Cleary see the concept of how this works, which is quite ingenius. Yes, a pain,  but could be utilized effectively. I am quite amazed at this. I will be trying this out, and if it works then I will do a video of it on my channel, plus, you will receive 100% credit for its discovery! 

 

My channel if you are curious:

[Spoiler]

www.youtube.com/c/RsKingGifted

[/spoiler]

Last seen on 13:32, 28. Aug 2021
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:I am currently looking into
Tue, 11/22/2016 - 18:47

Thanx! I will be watching the video! :)

Last seen on 20:43, 14. Feb 2024
Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am really close to find a
Mon, 01/30/2017 - 21:41

I am really close to find a way. Here is what I got yet:

if(true){
synchronized (obj) {
          while (<notify>)
             obj.wait(10);
             // Perform action appropriate to condition
     }

 

20 ticks is equal to 1 second

Last seen on 11:42, 20. May 2018
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Did you get this to work?
Sat, 02/17/2018 - 22:59

Did you get this to work?

Last seen on 11:42, 20. May 2018
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Did you get this to work?
Sat, 02/17/2018 - 23:00

Did you get this to work?

Last seen on 11:40, 8. Dec 2021
Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Where should I put the…
Mon, 02/26/2018 - 13:07

Where should I put the script?

Last seen on 13:32, 28. Aug 2021
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have found out the code on…
Mon, 03/05/2018 - 11:05

I have found out the code on how to do this but thank you for the effort :)

Last seen on 23:59, 6. Jul 2022
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
where do i put this code ?
Mon, 09/09/2019 - 09:12

where do i put this code ?

Last seen on 14:43, 2. Aug 2022
Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've found a WAY easier way…
Mon, 09/09/2019 - 17:35

I've found a WAY easier way to do this by using entity nbt data! 

Just add a nbt data to the player, for example : ("LghtRodCooldown", 100) and a true/false nbt statement : ("LghtRodToggle", true) when the player logs in, (join event). Then when on the right click event of the rod, (add an if statement that (if the toggle is true) summon lightning and make the current entities "LghtRodToggle" false). Then add an event for the player tick update event and make the cooldown decrease if it is not zero && if the "LghtRodToggle" is false. Then if the cooldown is zero, set the toggle to true and set the cooldown back to 100.

 

(100ticks is the equivalent of 5 real life seconds)