Package net.citizensnpcs.trait.versioned
Class PotionEffectsTrait
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.versioned.PotionEffectsTrait
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEffect(PotionEffect effect) voidaddPersistentEffect(String name, PotionEffect effect) voidonSpawn()Called when anNPCis spawned.static voidpotioneffect(CommandContext args, CommandSender sender, NPC npc, String operation, Integer duration, String name, Integer amplifier, PotionEffectType type, Boolean icon, Boolean ambient, Boolean particles) voidremovePersistentEffect(String name) voidrun()Called every tick if overridden.
-
Constructor Details
-
PotionEffectsTrait
public PotionEffectsTrait()
-
-
Method Details
-
addEffect
-
addPersistentEffect
-
getPersistentEffects
-
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. -
removePersistentEffect
-
run
public void run()Description copied from class:TraitCalled every tick if overridden. -
potioneffect
public static void potioneffect(CommandContext args, CommandSender sender, NPC npc, String operation, Integer duration, String name, Integer amplifier, PotionEffectType type, Boolean icon, Boolean ambient, Boolean particles) throws CommandException - Throws:
CommandException
-