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

Started by Puglord123 on

Topic category: Help with Minecraft modding (Java Edition)

Active 7 months ago
Joined Dec 2020
Points:
817

User statistics:

  • Modifications: 1
  • Forum topics: 36
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 80
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
Active 1 hour ago
Joined Apr 2023
Points:
661

User statistics:

  • Modifications: 4
  • Forum topics: 22
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 540
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.