I want to make my creature disappear after 1 minute. but how???

Started by Dusttale Morshu on

Topic category: Help with modding (Java Edition)

Last seen on 12:20, 21. Apr 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I want to make my creature disappear after 1 minute. but how???

So I kill a creature, then spawns a creature with death animation. And i don't know how to make it despawn after 1 minute. Any help, please?

Last seen on 02:33, 27. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The easiest method would be…
Fri, 02/09/2024 - 12:14

The easiest method would be to just give it an invisible potion effect, (say, Luck, with particles disabled), and then on the entity's update tick, despawn it if it no longer has that potion effect. (You could do something similar with an NBT tag, but it's the same basic idea.)

Last seen on 12:20, 21. Apr 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you show tutorial,…
Sat, 02/10/2024 - 09:01

Can you show tutorial, please? Because with produces I'm kinda bad =/

Last seen on 02:33, 27. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
...I mean, sure, but it is…
Sat, 02/10/2024 - 15:22

...I mean, sure, but it is literally just those two steps. Here's a more detailed explanation:

  • Using the 'on initial entity spawned' trigger for your entity, make a new procedure.
  • In this procedure, use the 'give entity potion effect' to give your entity 1200 ticks of luck, with particles disabled. 
  • Then, using the 'on entity update tick' trigger for your entity, make another new procedure.
  • In this procedure, add an if bracket, and attach a 'NOT' function to it. Have the if bracket check if your entity has luck, (using the 'does entity have potion effect' function.) Because of the Not function, the if bracket will now trigger if your entity does not have luck. You could also check if the remaining ticks of luck = 0.
  • Then, inside the if bracket, add the 'despawn entity' function. So now, evey update tick, if your entity does not have luck, it will despawn.
Last seen on 12:20, 21. Apr 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks, It worked . Now get…
Sun, 02/11/2024 - 08:32

Thanks, It worked . Now get ready for next forum.

Last seen on 16:05, 20. Apr 2024
Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can use this as an…
Tue, 03/12/2024 - 14:02

You can use this as an alternative, i might be wrong tho.

Note: Oulined block converts seconds (60) to ticks (1 second = 20 ticks)
You should put this in "On initial spawn" trigger in your living entity so countdown starts when it spawns.

 

Procedure

Last seen on 16:05, 20. Apr 2024
Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I haven't noticed the topic…
Tue, 03/12/2024 - 14:13

I haven't noticed the topic was made month ago, im sorry for necroing this topic