Package net.citizensnpcs.trait
Class Gravity
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.Gravity
Enable/disable Minecraft's gravity.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
onSpawn()
Called when anNPC
is spawned.void
run()
Called every tick if overridden.void
setHasGravity
(boolean hasGravity) Set whether to have gravity or notboolean
toggle()
-
Constructor Details
-
Gravity
public Gravity()
-
-
Method Details
-
hasGravity
public boolean hasGravity() -
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. -
setHasGravity
public void setHasGravity(boolean hasGravity) Set whether to have gravity or not -
toggle
public boolean toggle()
-