Class ExprSecCreateBossBar

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

@Name("Create Boss Bar") @Description("Creates a new boss bar.\nBoss bars can be pink/blue/red/green/yellow/purple/white, and will pick the closest valid color to the one you provide.\nBoss bars can have viewers removed or added to them.\nMaking the boss bar 'keyed' will add it to the persistent storage of the server and will be editable by commands and restored after restart.\n") @Example("on join:\n\tset {_bar} to a boss bar:\n\t\tset color of event-bossbar to white\n\t\tset title of event-bossbar to \"<green>Welcome %player%!\"\n\t\tset progress of event-bossbar to 50%\n\t\tset style of event-bossbar to 6 notches\n\t\tmake event-bossbar darken the sky\n\tadd player to viewers of {_bar}\n\twait 5 seconds\n\tremove player from viewers of {_bar}\n") @Since("2.16") public class ExprSecCreateBossBar extends ch.njol.skript.expressions.base.SectionExpression<org.bukkit.boss.BossBar>
  • Constructor Details

    • ExprSecCreateBossBar

      public ExprSecCreateBossBar()
  • Method Details

    • register

      public static void register(SyntaxRegistry syntaxRegistry, EventValueRegistry eventValueRegistry)
    • init

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

      protected org.bukkit.boss.BossBar @Nullable [] 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<org.bukkit.boss.BossBar>
      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 org.bukkit.boss.BossBar> 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