Class EffectSection

All Implemented Interfaces:
Debuggable, SyntaxElement

public abstract class EffectSection extends Section
A Section that may also be used as an effect, meaning there may be no section to parse.

When loading code, all EffectSections should first verify whether a section actually exists through the usage of hasSection. If this method returns true, it is safe to assert that the section node and list of trigger items are not null.

See Also:
  • Constructor Details

    • EffectSection

      public EffectSection()
  • Method Details

    • hasSection

      public boolean hasSection()
    • init

      public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult)
      This method should not be overridden unless you know what you are doing!
      Specified by:
      init in interface SyntaxElement
      Overrides:
      init in class Section
      Parameters:
      expressions - all %expr%s included in the matching pattern in the order they appear in the pattern. If an optional value was left out, it will still be included in this list holding the default value of the desired type, which usually depends on the event.
      matchedPattern - The index of the pattern which matched
      isDelayed - Whether this expression is used after a delay or not (i.e. if the event has already passed when this expression will be called)
      parseResult - Additional information about the match.
      Returns:
      Whether this expression was initialised successfully. An error should be printed prior to returning false to specify the cause.
      See Also:
    • init

      public abstract boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult, @Nullable @Nullable SectionNode sectionNode, @Nullable @Nullable List<TriggerItem> triggerItems)
      Specified by:
      init in class Section
    • parse

      @Nullable public static @Nullable EffectSection parse(String input, @Nullable @Nullable String defaultError, @Nullable @Nullable SectionNode sectionNode, @Nullable @Nullable List<TriggerItem> triggerItems)
      Similar to Section.parse(String, String, SectionNode, List), but will only attempt to parse from other EffectSections.