How to find out how long an entity has existed

Started by TheBiscuit on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to find out how long an entity has existed

Hi! I have an entity that I want to despawn after 1 second if it existing, but I currently don't know how to measure how long an entity has existed. There is some other logic that needs to run, so a wait 20 ticks loop wouldn't work. Thanks for the help!

If it is a custom entity,…
Tue, 07/22/2025 - 14:47

If it is a custom entity, increase a variable / sycne entity data every tick and check if it reached given value there