Interface SpawnEggMeta

All Superinterfaces:
Cloneable, ConfigurationSerializable, ItemMeta, PersistentDataHolder

public interface SpawnEggMeta extends ItemMeta
Represents a spawn egg and it's spawned type.
  • Method Details Link icon

    • getSpawnedType Link icon

      @Deprecated(since="1.13") @Contract("-> fail") EntityType getSpawnedType()
      Deprecated.
      different types are different items
      Get the type of entity this egg will spawn.
      Returns:
      The entity type. May be null for implementation specific default.
    • setSpawnedType Link icon

      @Deprecated(since="1.13") @Contract("_ -> fail") void setSpawnedType(EntityType type)
      Deprecated.
      different types are different items
      Set the type of entity this egg will spawn.
      Parameters:
      type - The entity type. May be null for implementation specific default.
    • getSpawnedEntity Link icon

      @Nullable EntitySnapshot getSpawnedEntity()
      Gets the EntitySnapshot that will be spawned by this spawn egg or null if no entity has been set.

      All applicable data from the egg will be copied, such as custom name, health, and velocity.

      Returns:
      the entity snapshot or null if no entity has been set
    • setSpawnedEntity Link icon

      void setSpawnedEntity(@NotNull EntitySnapshot snapshot)
      Sets the EntitySnapshot that will be spawned by this spawn egg.

      All applicable data from the entity will be copied, such as custom name, health, and velocity.

      Parameters:
      snapshot - the snapshot
    • clone Link icon

      @NotNull SpawnEggMeta clone()
      Specified by:
      clone in interface ItemMeta