public class LookClose extends Trait implements Toggleable, CommandConfigurable
Constructor and Description |
---|
LookClose() |
Modifier and Type | Method and Description |
---|---|
boolean |
canSeeTarget()
Returns whether the target can be seen.
|
void |
configure(CommandContext args) |
void |
findNewTarget()
Finds a new look-close target
|
int |
getRandomLookDelay() |
float[] |
getRandomLookPitchRange() |
float[] |
getRandomLookYawRange() |
double |
getRange() |
org.bukkit.entity.Player |
getTarget() |
boolean |
isRandomLook() |
void |
load(DataKey key)
Loads a trait.
|
void |
lookClose(boolean lookClose)
Enables/disables the trait
|
void |
onDespawn()
Called just before the attached
NPC is despawned. |
void |
run()
Called every tick if overridden.
|
void |
save(DataKey key)
Saves a trait.
|
void |
setRandomLook(boolean enableRandomLook)
Enables random looking - will look at a random
Location every so often if enabled. |
void |
setRandomLookDelay(int delay)
Sets the delay between random looking in ticks
|
void |
setRandomLookPitchRange(float min,
float max) |
void |
setRandomLookYawRange(float min,
float max) |
void |
setRange(int range)
Sets the maximum range in blocks to look at other Entities
|
void |
setRealisticLooking(boolean realistic)
Enables/disables realistic looking (using line of sight checks).
|
boolean |
toggle() |
String |
toString() |
boolean |
useRealisticLooking() |
public boolean canSeeTarget()
setRealisticLooking(boolean)
is true.public void configure(CommandContext args)
configure
in interface CommandConfigurable
public void findNewTarget()
public int getRandomLookDelay()
public float[] getRandomLookPitchRange()
public float[] getRandomLookYawRange()
public double getRange()
public org.bukkit.entity.Player getTarget()
public boolean isRandomLook()
public void lookClose(boolean lookClose)
public void onDespawn()
Trait
NPC
is despawned. NPC.getEntity()
will be non-null.public void run()
Trait
public void setRandomLook(boolean enableRandomLook)
Location
every so often if enabled.public void setRandomLookDelay(int delay)
public void setRandomLookPitchRange(float min, float max)
public void setRandomLookYawRange(float min, float max)
public void setRange(int range)
public void setRealisticLooking(boolean realistic)
public boolean toggle()
toggle
in interface Toggleable
public boolean useRealisticLooking()
Copyright © 2021. All rights reserved.