Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by Xemor, Jan 17, 2020.
Question in the title, is there any good way of doing that between two Location objects?
What exactly is it you are looking for?
An Entity or a Block? Use World#rayTrace
The distance? Use
The fastest way to go there, constraint to a certain x-z-plane? Use Dynamic Programming
To see if there is a path of air blocks inbetween two locations. That's what I'm looking for.
In that case, use World#rayTraceBlocks. You can define a maximum distance (that you can get from using the method described above). If RayTraceResult#getHitBlock() is null, you don't have a block in between, if the result is not null, you have a block.
Thank you a lot
Mark as solved