i need help with a cooldown for an entity

Started by thijs_films on Thu, 04/29/2021 - 12:00

Topic category: Help with MCreator software

Last seen on 13:52, 22. May 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
i need help with a cooldown for an entity
Thu, 04/29/2021 - 12:00

i have an entity that gives you an effect when you collide with it. but as of now you can basically spam it to constantly get the effect, which is not what i want.
how can i add a colldown so you have to wait a said amound of time before you can get the effect again.

any help is appreciated!

Last seen on 23:32, 17. May 2021
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
you can use "on entity tick…
Sun, 05/02/2021 - 00:18

you can use "on entity tick update" (this would make the cooldown shared, if one uses it all players must wait)
or also per player (each player would have his own cooldown).
Which one will you use?

Last seen on 13:52, 22. May 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
i would make it that all…
Mon, 05/03/2021 - 12:27

i would make it that all players share the same cooldown.

Last seen on 13:52, 22. May 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
ok, so it's not working…
Mon, 05/03/2021 - 18:08

ok, so it's not working. probebly because i dont fully understand how it works-
i'm sorry for not fully understanding and being a bit hard to work with, so to maybe give you a clearer view of whats going i've compiled everything i got and where it's placed in this one image! https://imgur.com/a/0xT1TYe

but so far i really appreciate you helping me, thank you verry, verry much!!

 

Last seen on 23:32, 17. May 2021
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
what I understand is: (I…
Mon, 05/03/2021 - 18:32

what I understand is: (I will not include sounds or particles).
If you have the entity tameada:
you have 20% that it will give you regeneration and remove the "dread" effect, the cooldown is reset.
you have 20% that it will not give you anything and will reset the account
you have 20% and if the player has low level food he will give you two heavies and the count will be reset.
you have 20% chance that he will not give you anything and the account will be reset
the rest of the time the account is restarted

if you don't have the entity tamed:
the cooldown of 100 ticks is reset causing 1 damage.

everything seems to be ok, nothing works?

 

 
Last seen on 13:52, 22. May 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
yes. that is what it does…
Mon, 05/03/2021 - 18:38

yes. that is what it does
but for some reason when i tested it out it still kept spamming every action with starting the countdown.
but all action it needs to do when checking certain things it does correct, like when the food level is low i get the two salmon and if i'm at full hunger i dont.
i thought maybe that is because i only have this in the "when player collides with entity" trigger. and nothing else.
but im not sure.

Last seen on 23:32, 17. May 2021
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I will do a similar…
Mon, 05/03/2021 - 18:55

I will do a similar procedure and try it out

 
Last seen on 13:52, 22. May 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
ok! goodluck!
Mon, 05/03/2021 - 18:56

ok! goodluck!

Last seen on 23:32, 17. May 2021
Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
it worked It probably didn't…
Mon, 05/03/2021 - 19:52

it worked
It probably didn't work before because of if inside if inside if
https://imgur.com/a/3RP2VFS
 

 
Last seen on 13:52, 22. May 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
it also worked for me!!…
Mon, 05/03/2021 - 20:19

it also worked for me!!
thank you so much! you've been a great help and i really appreciate it!
i couldn't have done it without you.
have a good day/night/afternoon!