Started by
Falkspyro
on
Topic category: Help with Minecraft modding (Java Edition)
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
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
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.
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.