Is there an event for when a FlyingBlock hits another block but doesn't settle

Discussion in 'Plugin Development' started by Tythus, Dec 20, 2015.

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

    Tythus

    Like this video I want an event to trigger when it hits the wall like an arrow would I've had a few ideas on this like maybe mounting the block to the arrow but it feels a bit cludgey any other ideas?
     
  2. Offline

    Zombie_Striker

    @Tythus
    Why do you need events?
    Code:
    projectile.setBounce(true);
     
  3. Offline

    Tythus

    @Zombie_Striker I don't see that method under projectile or Falling block?
     
  4. Offline

    Zombie_Striker

  5. Offline

    Tythus

  6. Offline

    Zombie_Striker

    @Tythus
    May I see what you use to spawn the projectile?
     
  7. Offline

    Tythus

    Code:
                Player p = (Player) e.getEntity();
                FallingBlock b = p.getWorld().spawnFallingBlock(p.getLocation(), Material.BEDROCK, (byte) 0);
                b.setVelocity(e.getProjectile().getVelocity());
                e.setProjectile(b);
                Projectile pr = (Projectile) e.getProjectile();
                pr.setBounce(true);
    I couldn't find any other way of making a falling block
     
  8. Offline

    Nibbit

    Probably because FallingBlock is not a projectile...
     
  9. Offline

    Tythus

    how else would I shoot a block I did think about try to mount the block to an arrow but that felt clunky at best
     
Thread Status:
Not open for further replies.

Share This Page