Cooldown and how to give a mob a life span

Started by Jamesthefool on

Topic category: Advanced modding

Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Cooldown and how to give a mob a life span

Ok, so all I want to know is how do I add a cooldown on an item which gives the player boosts and also how to make it so you can summon mobs for a short amount of time. EG:50 seconds

Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I tried: while not (i = 20) …
Sat, 07/14/2018 - 19:06

I tried:

while not (i = 20)

    set i = i + 1

//done

Thread.sleep(15)

The above creates an error:

le)8);Thread.sleep(15)for (int i

                                 ^

A semi-colon at the end didn't work either so I'll try putting a space. Sorry for not giving an answer but this might help

Joined Sep 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just give the mob wither, it…
Thu, 07/26/2018 - 14:54

Just give the mob wither, it will die after a while. As for the item, that is a tricky bit of coding.

Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i'm pretty sure while…
Thu, 02/13/2020 - 11:04

i'm pretty sure while cycling down some procedure blocks, i saw this procedure block that gives an item a cooldown. if that isn't what you wanted or if it doesn't exist sorry. but you can also make a cooldown timer using either variables, nbt data, scoreboards etc. and for the summon entities for a period of time, you can make a timer using the figures above as suggested and when the timer is over, you can either select the despawn provided entity procedure block or give the entity high damage.