Interface ProjectileSource
- All Known Subinterfaces:
AcceleratingProjectile, Aerial, Ageable, Agent, Allay, Ambient, Angerable, Animal, Aquatic, AreaEffectCloud, Armadillo, ArmorStand, Arrow, ArrowLike, Attackable, Axolotl, Bat, Bee, Blaze, BlockDisplay, BlockOccupiedMinecart, BlockProjectileSource, Boat, Bogged, Boss, Breedable, Breeze, BreezeWindCharge, Camel, CamelHusk, CarrierMinecart<M>, Cat, CaveSpider, Chargeable, ChestBoat, ChestMinecart, Chicken, ClientPlayer, Cod, CommandBlockMinecart, ComplexLiving<T>, ComplexLivingPart<P>, CopperGolem, Cow, Creaking, Creeper, Dispenser, DisplayEntity, Dolphin, Donkey, DragonFireball, Drowned, Egg, ElderGuardian, EndCrystal, EnderDragon, EnderDragonPart, Enderman, Endermite, EnderPearl, Entity, EntityProjectileSource, Evoker, EvokerFangs, ExperienceBottle, ExperienceOrb, Explosive, ExplosiveFireball, EyeOfEnder, FallingBlock, FireworkRocket, Fish, FishingBobber, Fox, Frog, FurnaceMinecart, FusedExplosive, Ghast, Giant, GlowItemFrame, GlowSquid, Goat, Golem, Guardian, Hanging, HappyGhast, Hoglin, HopperMinecart, Horse, HorseLike, Hostile, Human, Humanoid, Husk, IgnitingProjectile, Illager, Illusioner, Interaction, IronGolem, Item, ItemDisplay, ItemFrame, ItemRepresentable, Leashable, LeashKnot, LightningBolt, Living, Llama, LlamaSpit, LocalPlayer, MagmaCube, Mannequin, Marker, Minecart, MinecartLike, Monster, Mooshroom, Mule, Nautilus, NautilusLike, Ocelot, OminousItemSpawner, Ownable, PackHorse, Painting, Panda, Parched, Parrot, PathfinderAgent, Patroller, Phantom, Pig, Piglin, PiglinBrute, PiglinLike, Pillager, Player, PolarBear, Potion, PrimedTNT, Projectile, Pufferfish, Rabbit, Raft, Raider, RangedAgent, Ranger, Ravager, RemotePlayer, Saddleable, Salmon, SchoolingFish, ServerPlayer, Sheep, Shulker, ShulkerBullet, Silverfish, Sittable, Skeleton, SkeletonHorse, SkeletonLike, Slime, SmallFireball, Sniffer, Snowball, SnowGolem, SpawnerMinecart, SpectralArrow, Spellcaster, Spider, Squid, Stray, Strider, Tadpole, TameableAnimal, Targeting, TextDisplay, ThrowableItemProjectile, TNTMinecart, TraderLlama, Trident, TropicalFish, Turtle, Vehicle, Vex, Villager, VillagerLike, Vindicator, WanderingTrader, Warden, WindCharge, WindChargeLike, Witch, Wither, WitherSkeleton, WitherSkull, Wolf, Zoglin, Zombie, ZombieHorse, ZombieNautilus, ZombieVillager, ZombifiedPiglin
public interface ProjectileSource
Represents a valid source of a projectile.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends Projectile>
Optional<T> launchProjectile(Supplier<EntityType<T>> projectileType) Launches aProjectilefrom this projectile source.default <T extends Projectile>
Optional<T> launchProjectile(Supplier<EntityType<T>> projectileType, Vector3d velocity) Launches aProjectilefrom this projectile source.<T extends Projectile>
Optional<T> launchProjectile(EntityType<T> projectileType) Launches aProjectilefrom this projectile source.<T extends Projectile>
Optional<T> launchProjectile(EntityType<T> projectileType, Vector3d velocity) Launches aProjectilefrom this projectile source.default <T extends Projectile>
Optional<T> launchProjectileTo(Supplier<EntityType<T>> projectileType, Entity target) Launches a newProjectilefrom this projectile source.<T extends Projectile>
Optional<T> launchProjectileTo(EntityType<T> projectileType, Entity target) Launches a newProjectilefrom this projectile source.
-
Method Details
-
launchProjectile
Launches aProjectilefrom 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
Launches aProjectilefrom 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> Optional<T> launchProjectile(EntityType<T> projectileType, Vector3d velocity) Launches aProjectilefrom this projectile source.- Type Parameters:
T- The Type of Projectile- Parameters:
projectileType- The type of the projectilevelocity- The velocity to launch the projectile- Returns:
- The projectile instance if it was launched, or absent
-
launchProjectile
default <T extends Projectile> Optional<T> launchProjectile(Supplier<EntityType<T>> projectileType, Vector3d velocity) Launches aProjectilefrom this projectile source.- Type Parameters:
T- The Type of Projectile- Parameters:
projectileType- The type of the projectilevelocity- The velocity to launch the projectile- Returns:
- The projectile instance if it was launched, or absent
-
launchProjectileTo
Launches a newProjectilefrom this projectile source.- Type Parameters:
T- The Type of Projectile- Parameters:
projectileType- The type of the projectiletarget- the target to launch the projectile at- Returns:
- the projectile if successfully launched,
Optional.empty()otherwise
-
launchProjectileTo
default <T extends Projectile> Optional<T> launchProjectileTo(Supplier<EntityType<T>> projectileType, Entity target) Launches a newProjectilefrom this projectile source.- Type Parameters:
T- The Type of Projectile- Parameters:
projectileType- The type of the projectiletarget- the target to launch the projectile at- Returns:
- the projectile if successfully launched,
Optional.empty()otherwise
-