Question How to convert an entity into a projectile

Discussion in 'Bukkit Help' started by NinjaMonkeyRulez, Mar 1, 2016.

Thread Status:
Not open for further replies.
  1. I am using the code
    @EventHandler
    public void onShoot(ProjectileLaunchEvent event) {
    if (event.getEntity() instanceof Arrow) {
    Arrow arrow = (Arrow) event.getEntity();
    if (arrow.getShooter() instanceof Player) {
    Player shooter = (Player) arrow.getShooter();

    event.setCancelled(true);
    shooter.launchProjectile(Fireball.class).setVelocity(arrow.getVelocity());
    }
    }
    }

    I want launch an Ocelot out of the bow instead of a normal projectile. I tried making an Ocelot class to implement Ocelot, but it was an interface. Is there a way to create a class that extends projectile and somehow is able to have the properties of an Ocelot.

    *edit*
    It seems what I am asking for is something not done very often. I will also take any ideas on how you think you would be able to replace projectiles when the bow is shot.
     
    Last edited: Mar 5, 2016
Thread Status:
Not open for further replies.

Share This Page