Block that despawns and spawns mob in certain radius

Started by Zainhargrove on

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:
  • MCreator plugins:
  • Comments:
Block that despawns and spawns mob in certain radius

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 15:46, 28. Mar 2024
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 13:58, 21. Jan 2023
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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