Interface ProjectileSource
- All Known Subinterfaces:
AbstractCow, AbstractHorse, AbstractNautilus, AbstractSkeleton, AbstractVillager, Ageable, Allay, Ambient, Animals, Armadillo, ArmorStand, Axolotl, Bat, Bee, Blaze, BlockProjectileSource, Bogged, Breedable, Breeze, Camel, CamelHusk, Cat, CaveSpider, ChestedHorse, Chicken, Cod, ComplexLivingEntity, CopperGolem, Cow, Creaking, Creature, Creeper, Dolphin, Donkey, Drowned, ElderGuardian, EnderDragon, Enderman, Endermite, Enemy, Evoker, Fish, Flying, Fox, Frog, Ghast, Giant, GlowSquid, Goat, Golem, Guardian, HappyGhast, Hoglin, Horse, HumanEntity, Husk, Illager, Illusioner, IronGolem, LivingEntity, Llama, MagmaCube, Mannequin, Mob, Monster, Mule, MushroomCow, Nautilus, NPC, Ocelot, Panda, Parched, Parrot, Phantom, Pig, Piglin, PiglinAbstract, PiglinBrute, PigZombie, Pillager, Player, PolarBear, PufferFish, Rabbit, Raider, Ravager, Salmon, Sheep, Shulker, Silverfish, Skeleton, SkeletonHorse, Slime, Sniffer, Snowman, Spellcaster, Spider, Squid, Steerable, Stray, Strider, Tadpole, Tameable, TraderLlama, TropicalFish, Turtle, Vex, Villager, Vindicator, WanderingTrader, Warden, WaterMob, Witch, Wither, WitherSkeleton, Wolf, Zoglin, Zombie, ZombieHorse, ZombieNautilus, ZombieVillager
public interface ProjectileSource
Represents a valid source of a projectile.
-
Method Summary
Modifier and TypeMethodDescription<T extends Projectile>
TlaunchProjectile(Class<? extends T> projectile) Launches aProjectilefrom the ProjectileSource.<T extends Projectile>
TlaunchProjectile(Class<? extends T> projectile, Vector velocity) Launches aProjectilefrom the ProjectileSource with an initial velocity.
-
Method Details
-
launchProjectile
Launches aProjectilefrom the ProjectileSource.- Type Parameters:
T- a projectile subclass- Parameters:
projectile- class of the projectile to launch- Returns:
- the launched projectile
-
launchProjectile
@NotNull <T extends Projectile> T launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity) Launches aProjectilefrom the ProjectileSource with an initial velocity.- Type Parameters:
T- a projectile subclass- Parameters:
projectile- class of the projectile to launchvelocity- the velocity with which to launch- Returns:
- the launched projectile
-