Entity despawning a different entity of the same type when being spawned.

Started by Puglord123 on

Topic category: Help with modding (Java Edition)

Last seen on 09:24, 5. May 2024
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Entity despawning a different entity of the same type when being spawned.
Fri, 03/22/2024 - 10:40 (edited)

Hello, I am working on an update for one of my mods that adds things from the portal games and I am trying to make it so that when a let's say blue portal gets placed, it despawns (or just /kills) all other blue portals that are currently in the world. Would this be possible?

Edited by Puglord123 on Fri, 03/22/2024 - 10:40
Last seen on 00:19, 30. May 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you can run a procedure…
Fri, 03/22/2024 - 13:08

If you can run a procedure just before spawning the blue portal, there is a procedure block that lets you run a command. so you could use /kill @e[type=modid:blue_portal] or something like that. There are two different versions of the run a command procedure block, and one of them is in world procedures.