How would I make an entity spawn behind the player

Started by amogus6116 on

Topic category: Help with modding (Java Edition)

Last seen on 20:25, 4. Jul 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How would I make an entity spawn behind the player
Mon, 07/01/2024 - 16:48 (edited)

I have a custom entity that I want to spawn behind the player. I don't know how to use direction procedures for this. Also, I do want to make the entity not spawn in walls and suffocate. Is this possible with procedures?

Edit: I did it by using x y z ray tracing blocks and lowering the distanc value if there's no air in the destination

 

Edited by amogus6116 on Mon, 07/01/2024 - 16:48
Last seen on 23:45, 4. Jul 2024
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
use the ray trace for xyz…
Wed, 07/03/2024 - 05:41

use the ray trace for xyz and put it negativa like, ray trace x -1

                                                                                      ray trace y -1

                                                                                      ray trace z-1

and you spawn the mob there