Class SecConditional

All Implemented Interfaces:
Debuggable, SyntaxElement

@Name("Conditionals") @Description("Conditional sections (parse if, if, else if, else) are only executed if the conditions provided are met or else-if blocks will be executed if the \'if/else-if\' blocks before didn\'t meet their conditions, otherwise \'else\' blocks will be executed (if used) if all of the conditions before were not met.") @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 e)
      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 e, boolean debug)
      Parameters:
      e - 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