Started by
Shadowfemb
on
Topic category: Help with MCreator software
what the tittle says, im making a flying mob that acts similar to a vex but without going thru walls, how can i make it attack like one?
Topic category: Help with MCreator software
what the tittle says, im making a flying mob that acts similar to a vex but without going thru walls, how can i make it attack like one?
You'd need to use the 'override motion delta' block to add velocity to the entity. You'd also need to do some math to get the x/y/z components of a vector to the nearest player. (So you know how much velocity to add.) If you know how to do 2D vectors, (that is, get the x and z components of a line between two points), you can do something similar for a 3D vector. (getting all three components by getting the differences between the position of your entity and the player.) Then you just accelerate the entity along that vector, multiplying the x/y/z components by how powerful you want the launch to be.
That probably sounds like gibberish, but basic idea is you need to add x/y/z velocity to your entity based on the x/y/z distances between it and the player.