Can't launch creeper

Discussion in 'Plugin Development' started by Krumb069, Jun 2, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Krumb069

    I can't launch a creeper on entitybowshoot. My code:
    İt gives error on "o.launchProjectile(creeper);"
    Code:
    if (o.hasPermission("bow.use.creeperbow")){
                      e.setCancelled(true);
                  Entity creeper = o.getWorld().spawnEntity(o.getLocation(), EntityType.CREEPER);
                  creeper.setVelocity(e.getProjectile().getVelocity());
                  o.launchProjectile(creeper);
                  }
     
  2. Because creeper isn't a projectile.
     
  3. Offline

    mine-care

    Exacly what @FisheyLP siad^
    If you want toi launch a creeper you need to set it's velocity to some vector dependin on the direction you wana shoot it.
     
  4. Offline

    Krumb069

    @mine-care @FisheyLP
    I already setted Velocity in
    creeper.setVelocity(e.getProjectile().getVelocity());
    ?
     
  5. @Krumb069 But you're still trying to launch a creeper. That's not possible with the method you're trying, because a creeper is not a Projectile.
     
  6. Offline

    Krumb069

    @AdamQpzm
    So how can I throw a creeper ?
     
  7. @Krumb069 Remove the launchProjectile line. I don't know why you have it there.
     
    KingFaris11 likes this.
Thread Status:
Not open for further replies.

Share This Page