Block that despawns and spawns mob in certain radius

Started by Zainhargrove on Fri, 04/15/2022 - 13:57

Topic category: Help with modding (Java Edition)

Last seen on 05:51, 6. Jul 2022
Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Block that despawns and spawns mob in certain radius
Fri, 04/15/2022 - 13:57

Hello I'm working on a mod and i want a block that can detect a mob in a radius and then despawn that mob and spawn in mob2. I want it to do it without any player interaction.

I tried doing “If: does entiry exist in square cube size 32. Do: despawn event/target entity and spawn mob2” i put that procedure under the blocks Client Tick Update. I would appreciate some help. 

Last seen on 08:44, 7. Jul 2022
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
entity exist does not…
Fri, 04/15/2022 - 14:35

entity exist does not specify iterator

 

Just use for each entity as iterator and you're don

Last seen on 19:18, 4. Jun 2022
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You should use the "Update…
Sun, 05/15/2022 - 21:49

You should use the "Update Tick" instead of using the global on "Client Tick update" as it is a client Trigger that means that it is a total waste of Client Resources and is Client Side making it be dependent on any client being nearby also it could kill entities near the player, So update Tick is the most efficient use of resources and means the program you wrote will run only when neccesary instead of literally every tick a if statement runs