Package net.citizensnpcs.trait
Class Controllable
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.Controllable
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static class
static class
static class
static interface
static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
onSpawn()
Called when anNPC
is spawned.void
run()
Called every tick if overridden.void
setControls
(Controllable.BuiltInControls controls) boolean
setEnabled
(boolean enabled) void
setOwnerRequired
(boolean ownerRequired) boolean
toggle()
-
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:Trait
Called when anNPC
is 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:Trait
Called every tick if overridden. -
setControls
-
setEnabled
public boolean setEnabled(boolean enabled) -
setOwnerRequired
public void setOwnerRequired(boolean ownerRequired) - See Also:
-
toggle
public boolean toggle()
-