Package net.citizensnpcs.trait
Class LookClose
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.LookClose
Persists the /npc lookclose metadata
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns whether the target can be seen.booleanvoidFinds a new look-close targetintfloat[]float[]doublegetRange()booleanbooleanbooleanvoidLoads a trait.voidlookClose(boolean lookClose) Enables/disables the traitvoidCalled just before the attachedNPCis despawned.voidrun()Called every tick if overridden.voidSaves a trait.voidsetDisableWhileNavigating(boolean set) voidsetHeadOnly(boolean headOnly) voidsetLinkedBody(boolean linkedBody) voidsetPerPlayer(boolean perPlayer) voidsetRandomLook(boolean enableRandomLook) Enables random looking - will look at a randomLocationevery so often if enabled.voidsetRandomLookDelay(int delay) Sets the delay between random looking in ticksvoidsetRandomLookPitchRange(float min, float max) voidsetRandomLookYawRange(float min, float max) voidsetRandomlySwitchTargets(boolean randomSwitchTargets) voidsetRange(double range) Sets the maximum range in blocks to look at other EntitiesvoidsetRealisticLooking(boolean realistic) Enables/disables realistic looking (using line of sight checks).voidsetTargetNPCs(boolean target) booleanbooleantoggle()toString()boolean
- 
Constructor Details- 
LookClosepublic LookClose()
 
- 
- 
Method Details- 
canSeeTargetpublic boolean canSeeTarget()Returns whether the target can be seen. Will use realistic line of sight ifsetRealisticLooking(boolean)is true.
- 
findNewTargetpublic void findNewTarget()Finds a new look-close target
- 
getRandomLookDelaypublic int getRandomLookDelay()
- 
getRandomLookPitchRangepublic float[] getRandomLookPitchRange()
- 
getRandomLookYawRangepublic float[] getRandomLookYawRange()
- 
getRangepublic double getRange()
- 
getTarget
- 
isEnabledpublic boolean isEnabled()
- 
isHeadOnlypublic boolean isHeadOnly()
- 
isRandomLookpublic boolean isRandomLook()
- 
loadDescription copied from class:TraitLoads a trait.
- 
lookClosepublic void lookClose(boolean lookClose) Enables/disables the trait
- 
onDespawnpublic void onDespawn()Description copied from class:TraitCalled just before the attachedNPCis despawned.NPC.getEntity()will be non-null.
- 
runpublic void run()Description copied from class:TraitCalled every tick if overridden.
- 
saveDescription copied from class:TraitSaves a trait.
- 
setHeadOnlypublic void setHeadOnly(boolean headOnly) 
- 
setLinkedBodypublic void setLinkedBody(boolean linkedBody) 
- 
setPerPlayerpublic void setPerPlayer(boolean perPlayer) 
- 
setRandomLookpublic void setRandomLook(boolean enableRandomLook) Enables random looking - will look at a randomLocationevery so often if enabled.
- 
setRandomLookDelaypublic void setRandomLookDelay(int delay) Sets the delay between random looking in ticks
- 
setRandomLookPitchRangepublic void setRandomLookPitchRange(float min, float max) 
- 
setRandomLookYawRangepublic void setRandomLookYawRange(float min, float max) 
- 
setRandomlySwitchTargetspublic void setRandomlySwitchTargets(boolean randomSwitchTargets) 
- 
setRangepublic void setRange(double range) Sets the maximum range in blocks to look at other Entities
- 
setRealisticLookingpublic void setRealisticLooking(boolean realistic) Enables/disables realistic looking (using line of sight checks). More computationally expensive.
- 
setTargetNPCspublic void setTargetNPCs(boolean target) 
- 
targetNPCspublic boolean targetNPCs()
- 
togglepublic boolean toggle()
- 
toString
- 
useRealisticLookingpublic boolean useRealisticLooking()
 
-