Class DroppedItemData

java.lang.Object
ch.njol.skript.entity.EntityData<org.bukkit.entity.Item>
ch.njol.skript.entity.DroppedItemData
All Implemented Interfaces:
SyntaxElement, YggdrasilSerializable, YggdrasilSerializable.YggdrasilExtendedSerializable

public class DroppedItemData extends EntityData<org.bukkit.entity.Item>
  • Constructor Details

    • DroppedItemData

      public DroppedItemData()
    • DroppedItemData

      public DroppedItemData(ItemType @Nullable [] types)
  • Method Details

    • init

      protected boolean init(Literal<?>[] expressions, int matchedPattern, SkriptParser.ParseResult parseResult)
      Specified by:
      init in class EntityData<org.bukkit.entity.Item>
    • init

      protected boolean init(@Nullable @Nullable Class<? extends org.bukkit.entity.Item> clazz, @Nullable @Nullable org.bukkit.entity.Item itemEntity)
      Specified by:
      init in class EntityData<org.bukkit.entity.Item>
      Parameters:
      clazz - An entity's class, e.g. Player
      itemEntity - An actual entity, or null to get an entity data for an entity class
      Returns:
      Whether initialisation was successful
    • match

      protected boolean match(org.bukkit.entity.Item entity)
      Specified by:
      match in class EntityData<org.bukkit.entity.Item>
    • set

      public void set(org.bukkit.entity.Item entity)
      Specified by:
      set in class EntityData<org.bukkit.entity.Item>
    • isSupertypeOf

      public boolean isSupertypeOf(EntityData<?> otherData)
      Specified by:
      isSupertypeOf in class EntityData<org.bukkit.entity.Item>
    • getType

      public Class<? extends org.bukkit.entity.Item> getType()
      Specified by:
      getType in class EntityData<org.bukkit.entity.Item>
    • getSuperType

      public EntityData getSuperType()
      Description copied from class: EntityData
      Returns the super type of this entity data, e.g. 'wolf' for 'angry wolf'.
      Specified by:
      getSuperType in class EntityData<org.bukkit.entity.Item>
      Returns:
      The supertype of this entity data. Must not be null.
    • toString

      public String toString(int flags)
      Overrides:
      toString in class EntityData<org.bukkit.entity.Item>
    • deserialize

      @Deprecated protected boolean deserialize(String s)
      Deprecated.
      Overrides:
      deserialize in class EntityData<org.bukkit.entity.Item>
    • equals_i

      protected boolean equals_i(EntityData<?> otherData)
      Specified by:
      equals_i in class EntityData<org.bukkit.entity.Item>
    • canSpawn

      public boolean canSpawn(@Nullable @Nullable org.bukkit.World world)
      Description copied from class: EntityData
      Check if this entity type can spawn.

      Some entity types may be restricted by experimental datapacks.

      Overrides:
      canSpawn in class EntityData<org.bukkit.entity.Item>
      Parameters:
      world - World to check if entity can spawn in
      Returns:
      True if entity can spawn else false
    • spawn

      @Nullable public @Nullable org.bukkit.entity.Item spawn(org.bukkit.Location location, @Nullable @Nullable Consumer<org.bukkit.entity.Item> consumer)
      Description copied from class: EntityData
      Spawn this entity data at a location. The consumer allows for modification to the entity before it actually gets spawned.
      Overrides:
      spawn in class EntityData<org.bukkit.entity.Item>
      Parameters:
      location - The Location to spawn the entity at.
      consumer - A Consumer to apply the entity changes to.
      Returns:
      The Entity object that is spawned.
    • hashCode_i

      protected int hashCode_i()
      Specified by:
      hashCode_i in class EntityData<org.bukkit.entity.Item>