Class ExprItemOfEntity

java.lang.Object
ch.njol.skript.lang.util.SimpleExpression<Slot>
ch.njol.skript.expressions.base.PropertyExpression<org.bukkit.entity.Entity,Slot>
ch.njol.skript.expressions.base.SimplePropertyExpression<org.bukkit.entity.Entity,Slot>
org.skriptlang.skript.bukkit.misc.expressions.ExprItemOfEntity
All Implemented Interfaces:
Converter<org.bukkit.entity.Entity,Slot>, Debuggable, Expression<Slot>, SyntaxElement

@Name("Item of an Entity") @Description({"An item associated with an entity. For dropped item entities, it gets the item that was dropped.","For item frames, the item inside the frame is returned.","For throwable projectiles (snowballs, enderpearls etc.) or item displays, it gets the displayed item.","Other entities do not have items associated with them."}) @Examples({"item of event-entity","","set the item inside of event-entity to a diamond sword named \"Example\""}) @Since("2.2-dev35, 2.2-dev36 (improved), 2.5.2 (throwable projectiles), 2.10.0 (item displays)") public class ExprItemOfEntity extends ch.njol.skript.expressions.base.SimplePropertyExpression<org.bukkit.entity.Entity,Slot>
  • Constructor Details

    • ExprItemOfEntity

      public ExprItemOfEntity()
  • Method Details

    • convert

      @Nullable public @Nullable Slot convert(org.bukkit.entity.Entity entity)
      Description copied from interface: Converter
      Converts an object from the given to the desired type.
      Specified by:
      convert in interface Converter<org.bukkit.entity.Entity,Slot>
      Specified by:
      convert in class ch.njol.skript.expressions.base.SimplePropertyExpression<org.bukkit.entity.Entity,Slot>
      Parameters:
      entity - The object to convert.
      Returns:
      the converted object
    • getReturnType

      public Class<? extends Slot> 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)
    • getPropertyName

      protected String getPropertyName()
      Specified by:
      getPropertyName in class ch.njol.skript.expressions.base.SimplePropertyExpression<org.bukkit.entity.Entity,Slot>