Package net.citizensnpcs.trait
Class Controllable
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.Controllable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic classstatic classstatic interfacestatic class -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanvoidonSpawn()Called when anNPCis spawned.voidrun()Called every tick if overridden.voidsetControls(Controllable.BuiltInControls controls) booleansetEnabled(boolean enabled) voidsetOwnerRequired(boolean ownerRequired) booleantoggle()
-
Constructor Details
-
Controllable
public Controllable()
-
-
Method Details
-
isEnabled
public boolean isEnabled() -
mount
- Parameters:
toMount- the player to mount- Returns:
- whether the mount was successful
-
onSpawn
public void onSpawn()Description copied from class:TraitCalled when anNPCis spawned.NPC.getEntity()will return null until this is called. This is also called onAttach when the NPC is already spawned. -
run
public void run()Description copied from class:TraitCalled every tick if overridden. -
setControls
-
setEnabled
public boolean setEnabled(boolean enabled) -
setOwnerRequired
public void setOwnerRequired(boolean ownerRequired) - See Also:
-
toggle
public boolean toggle()
-