Tamed mob despawn

Started by seiun on

Topic category: Advanced modding

Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Tamed mob despawn

Is there a way to make tamed mobs despawn I made a staff that summons a custom mob but i want it to despawn after some time and i dont know how

 

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Stick this in the summoned…
Sun, 09/29/2024 - 16:14

Stick this in the summoned mob’s tick method:


if (this.tickCount >= 200) this.discard();


Replace 200 with however long you want the mob to last (it’s measured in ticks)