Interface ProjectileSource

    • Method Detail

      • launchProjectile

        <T extends Projectile> java.util.Optional<T> launchProjectile​(EntityType<T> projectileType)
        Launches a Projectile from this projectile source.
        Type Parameters:
        T - The Type of Projectile
        Parameters:
        projectileType - The type of the projectile
        Returns:
        The projectile instance if it was launched, or absent
      • launchProjectile

        default <T extends Projectile> java.util.Optional<T> launchProjectile​(java.util.function.Supplier<EntityType<T>> projectileType)
        Launches a Projectile from this projectile source.
        Type Parameters:
        T - The Type of Projectile
        Parameters:
        projectileType - The type of the projectile
        Returns:
        The projectile instance if it was launched, or absent
      • launchProjectile

        <T extends Projectile> java.util.Optional<T> launchProjectile​(EntityType<T> projectileType,
                                                                      Vector3d velocity)
        Launches a Projectile from this projectile source.
        Type Parameters:
        T - The Type of Projectile
        Parameters:
        projectileType - The type of the projectile
        velocity - The velocity to launch the projectile
        Returns:
        The projectile instance if it was launched, or absent
      • launchProjectile

        default <T extends Projectile> java.util.Optional<T> launchProjectile​(java.util.function.Supplier<EntityType<T>> projectileType,
                                                                              Vector3d velocity)
        Launches a Projectile from this projectile source.
        Type Parameters:
        T - The Type of Projectile
        Parameters:
        projectileType - The type of the projectile
        velocity - The velocity to launch the projectile
        Returns:
        The projectile instance if it was launched, or absent
      • launchProjectileTo

        <T extends Projectile> java.util.Optional<T> launchProjectileTo​(EntityType<T> projectileType,
                                                                        Entity target)
        Launches a new Projectile from this projectile source.
        Type Parameters:
        T - The Type of Projectile
        Parameters:
        projectileType - The type of the projectile
        target - the target to launch the projectile at
        Returns:
        the projectile if successfully launched, Optional.empty() otherwise
      • launchProjectileTo

        default <T extends Projectile> java.util.Optional<T> launchProjectileTo​(java.util.function.Supplier<EntityType<T>> projectileType,
                                                                                Entity target)
        Launches a new Projectile from this projectile source.
        Type Parameters:
        T - The Type of Projectile
        Parameters:
        projectileType - The type of the projectile
        target - the target to launch the projectile at
        Returns:
        the projectile if successfully launched, Optional.empty() otherwise