Class SecConditional

All Implemented Interfaces:
Debuggable, SyntaxElement

@Name("Conditionals") @Description({"Conditional sections","if: executed when its condition is true","else if: executed if all previous chained conditionals weren\'t executed, and its condition is true","else: executed if all previous chained conditionals weren\'t executed","","parse if: a special case of \'if\' condition that its code will not be parsed if the condition is not true","else parse if: another special case of \'else if\' condition that its code will not be parsed if all previous chained conditionals weren\'t executed, and its condition is true"}) @Examples({"if player\'s health is greater than or equal to 4:","\tsend \"Your health is okay so far but be careful!\"","","else if player\'s health is greater than 2:","\tsend \"You need to heal ASAP, your health is very low!\"","","else: # Less than 2 hearts","\tsend \"You are about to DIE if you don\'t heal NOW. You have only %player\'s health% heart(s)!\"","","parse if plugin \"SomePluginName\" is enabled: # parse if %condition%","\t# This code will only be executed if the condition used is met otherwise Skript will not parse this section therefore will not give any errors/info about this section",""}) @Since("1.0") public class SecConditional extends Section
  • Constructor Details

    • SecConditional

      public SecConditional()
  • Method Details

    • init

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

      public @Nullable TriggerItem getNext()
      Overrides:
      getNext in class TriggerItem
    • getNormalNext

      public @Nullable TriggerItem getNormalNext()
    • walk

      protected @Nullable TriggerItem walk(org.bukkit.event.Event event)
      Description copied from class: TriggerItem
      Executes this item and returns the next item to run.

      Overriding classes must call TriggerItem.debug(Event, boolean). If this method is overridden, TriggerItem.run(Event) is not used anymore and can be ignored.

      Specified by:
      walk in class TriggerSection
      Returns:
      The next item to run or null to stop execution
    • toString

      public String toString(@Nullable org.bukkit.event.Event event, boolean debug)
      Parameters:
      event - The event to get information to. 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