java.lang.Object
ch.njol.skript.lang.util.SimpleExpression<SkriptPotionEffect>
ch.njol.skript.expressions.base.SectionExpression<SkriptPotionEffect>
org.skriptlang.skript.bukkit.potion.elements.expressions.ExprSecPotionEffect
All Implemented Interfaces:
Debuggable, Expression<SkriptPotionEffect>, Loopable<SkriptPotionEffect>, Simplifiable<Expression<? extends SkriptPotionEffect>>, SyntaxElement, RuntimeErrorProducer, SyntaxRuntimeErrorProducer

@Name("New Potion Effect") @Description("Create a new potion effect that can be applied to an entity or item type.") @Example("set {_potion} to a potion effect of speed 2 for 10 minutes:\n\thide the effect\'s icon\n\thide the effect\'s particles\n") @Example("add strength 5 to the potion effects of the player\'s tool") @Example("apply invisibility to the player for 5 minutes:\n\thide the effect\'s particles\n") @Example("add a potion effect of speed 1 to the potion effects of the player") @Example("# creates a potion effect with the properties of an existing potion effect\nset {_potion} to a potion effect of slowness based on the player\'s speed effect\n") @Since({"2.5.2","INSERT VERSION (syntax changes, infinite duration support)"}) public class ExprSecPotionEffect extends ch.njol.skript.expressions.base.SectionExpression<SkriptPotionEffect>
  • Constructor Details

    • ExprSecPotionEffect

      public ExprSecPotionEffect()
  • Method Details

    • register

      public static void register(SyntaxRegistry registry, Origin origin)
    • init

      public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean delayed, SkriptParser.ParseResult parseResult, @Nullable @Nullable SectionNode sectionNode, @Nullable @Nullable List<TriggerItem> triggerItems)
      Specified by:
      init in class ch.njol.skript.expressions.base.SectionExpression<SkriptPotionEffect>
    • get

      protected SkriptPotionEffect[] get(org.bukkit.event.Event event)
      Description copied from class: SimpleExpression
      This is the internal method to get an expression's values.
      To get the expression's value from the outside use SimpleExpression.getSingle(Event) or SimpleExpression.getArray(Event).
      Specified by:
      get in class SimpleExpression<SkriptPotionEffect>
      Parameters:
      event - The event with which this expression is evaluated.
      Returns:
      An array of values for this event. May not contain nulls.
    • isSingle

      public boolean isSingle()
      Returns:
      true if this expression will ever only return one value at most, false if it can return multiple values.
    • getReturnType

      public Class<? extends SkriptPotionEffect> getReturnType()
      Description copied from interface: Expression
      Gets the return type of this expression.
      Returns:
      A supertype of any objects returned by Expression.getSingle(Event) and the component type of any arrays returned by Expression.getArray(Event)
    • toString

      public String toString(@Nullable @Nullable org.bukkit.event.Event event, boolean debug)
      Parameters:
      event - The event to get information from. This is always null if debug == false.
      debug - If true this should print more information, if false this should print what is shown to the end user
      Returns:
      String representation of this object