Despawn procedure creates ghost mobs

Started by COMMANDO66 on Sat, 11/12/2022 - 13:53

Topic category: Help with modding (Java Edition)

Last seen on 22:46, 28. Jan 2023
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Despawn procedure creates ghost mobs
Sat, 11/12/2022 - 13:54 (edited)

Hello. I am working on a mod that has a procedure to replace half of all spawned spiders with custom Hunting Spiders. (Hunting Spiders are basically tameable spiders.)

It looks like this:

 

When entity is spawned
If (random > 0.5) AND (target entity is a spider) AND (world is not remote)
     Despawn target entity

    Spawn CUSTOM:TameableSpider
     While (Event/target) is alive
         Do 100 damage

As you can see by the bottom, occasionally I experienced the despawn target entity thing not working. The damage loop works just fine. (Also note that the ghost mobs started before I implemented that loop, so it cannot be the cause.)

I also tried to fix this by making this run on the server side only (world is not remote). That didn't change anything.

The problem I am experiencing is that the despawned spiders don't exactly go away a lot of the time. Instead they freeze and become immune to all damage (even /kill). They become ghost mobs. (Note that the Hunting Spiders spawn as they should). My mod is run on a server a few friends and I play on and ghost spiders can be found around the map. I have decided to try to fix this issue for the next update.

Does anyone know how to prevent ghost spiders from forming?

Edited by COMMANDO66 on Sat, 11/12/2022 - 13:54
Last seen on 02:40, 22. Jan 2023
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Don't know but I got a…
Wed, 11/16/2022 - 09:55

Don't know but I got a alternative fix. Just teleport the spiders into the void.