Projectile spawns mob when hitting block

Started by Falkspyro on

Topic category: Help with modding (Java Edition)

Last seen on 13:37, 12. Jun 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Projectile spawns mob when hitting block
Mon, 08/01/2022 - 21:53 (edited)

I have made a mod where you can shoot creatures at people. However if they hit a block they should be able to spawn safely, but they often just end up suffocating. Is there a way to spawn them in the nearest air block? 

Help would be great! ;D 

I'm looking for a way to spawn in the nearest safe spot! You can't do y+1 if you hit a wall infront of you. The entity will still suffocate, however it works if you only hit the ground.

 

Edited by Falkspyro on Mon, 08/01/2022 - 21:53
Last seen on 08:29, 9. Jul 2023
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make them spawn 1 block more…
Mon, 08/01/2022 - 10:02

Make them spawn 1 block more up. You can drag out the "y" of the "spawn entity" block and put it into a plus block. Now plus 1. So it should end up being:

Spawn at: X (Y + 1) Z with yaw: 0 pitch: 0 vx: 0 vy: 0 vz: 0 entity: YOUR ENTITY

Last seen on 13:37, 12. Jun 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have already dont this,…
Mon, 08/01/2022 - 19:51

I have already dont this, but when i hit a wall. It spawns inside of it. It isn't a problem when it hits the ground.

Last seen on 13:37, 12. Jun 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I seem to have been tired…
Tue, 08/02/2022 - 22:31

I seem to have been tired when replying. Thanks for your reply. What i meant with the question is, how would i spawn the entity somewhere in air blocks, so when it hits a wall it won't suffocate. I have already added; Spawn at: X (Y + 1) Z with yaw: 0 pitch: 0 vx: 0 vy: 0 vz: 0 entity: YOUR ENTITY.