Class ExprSecDamageSource

java.lang.Object
ch.njol.skript.lang.util.SimpleExpression<org.bukkit.damage.DamageSource>
ch.njol.skript.expressions.base.SectionExpression<org.bukkit.damage.DamageSource>
org.skriptlang.skript.bukkit.damagesource.elements.ExprSecDamageSource
All Implemented Interfaces:
Debuggable, Expression<org.bukkit.damage.DamageSource>, Loopable<org.bukkit.damage.DamageSource>, Simplifiable<Expression<? extends org.bukkit.damage.DamageSource>>, SyntaxElement, DamageSourceExperimentSyntax, ExperimentalSyntax, SimpleExperimentalSyntax, RuntimeErrorProducer, SyntaxRuntimeErrorProducer

@Name("Damage Source") @Description({"Create a custom damage source and change the attributes.","When setting a \'causing entity\' you must also set a \'direct entity\'.","Attributes of a damage source cannot be changed once created, only while within the \'custom damage source\' section."}) @Example("set {_source} to a custom damage source:\n\tset the damage type to magic\n\tset the causing entity to {_player}\n\tset the direct entity to {_arrow}\n\tset the damage location to location(0, 0, 10)\ndamage all players by 5 using {_source}\n") @Example("on damage:\n\tif the damage type of event-damage source is magic:\n\t\tset the damage to damage * 2\n") @Since("2.12") @RequiredPlugins("Minecraft 1.20.4+") public class ExprSecDamageSource extends ch.njol.skript.expressions.base.SectionExpression<org.bukkit.damage.DamageSource> implements DamageSourceExperimentSyntax
  • Constructor Details

    • ExprSecDamageSource

      public ExprSecDamageSource()
  • Method Details

    • init

      public boolean init(Expression<?>[] exprs, int pattern, 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.damage.DamageSource>
    • get

      protected org.bukkit.damage.DamageSource @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.damage.DamageSource>
      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()
      Specified by:
      isSingle in interface Expression<org.bukkit.damage.DamageSource>
      Returns:
      true if this expression will ever only return one value at most, false if it can return multiple values.
    • getReturnType

      public Class<org.bukkit.damage.DamageSource> getReturnType()
      Description copied from interface: Expression
      Gets the return type of this expression.
      Specified by:
      getReturnType in interface Expression<org.bukkit.damage.DamageSource>
      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)
      Specified by:
      toString in interface Debuggable
      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