Tamed mob despawn

Started by seiun on

Topic category: Advanced modding

Active 10 months ago
Joined Mar 2023
Points:
278

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
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

 

Active 4 months ago
Joined Dec 2023
Points:
155

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 28
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)