public class EntityRayBuilder extends Object
| Constructor and Description |
|---|
EntityRayBuilder(Location position,
@Nullable Entity entity)
Create a new BlockRayBuilder
|
EntityRayBuilder(Location position,
Vector vector)
Create a new BlockRayBuilder
|
EntityRayBuilder(Player p)
Create a new BlockRayBuilder
|
| Modifier and Type | Method and Description |
|---|---|
EntityRay |
build()
Build BlockRay
Warn: this method have to be runned as sync. |
EntityRayBuilder |
bypassEntities(Entity... entities)
Add entity that bypass the ray
|
EntityRayBuilder |
maxDistance(int max)
Change the max ray distance
|
EntityRayBuilder |
onlyPlayers(boolean b)
Change which entity are selected
|
EntityRayBuilder |
vector(Vector vec)
Edit the vector which correspond to ray direction
|
public EntityRayBuilder(Location position, @Nullable Entity entity)
position - the started position of rayentity - which will give the rotation (and so the vector)public EntityRayBuilder(Player p)
p - the player where the ray startpublic EntityRayBuilder vector(Vector vec)
vec - the new direction vectorpublic EntityRayBuilder maxDistance(int max)
max - the max distance of raypublic EntityRayBuilder onlyPlayers(boolean b)
b - true if we are only looking for playerspublic EntityRayBuilder bypassEntities(Entity... entities)
entities - all entities that should bypass raypublic EntityRay build()