Falling block bug

Discussion in 'Plugin Development' started by ArthurHoeke, Aug 27, 2014.

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

    ArthurHoeke

    Hello,

    Im making a balloon plugin, And I have a bug that I can't fix,
    The plugin spawns a invinsible bat on the player's location with a falling block on the bat his head, But I have the problem that sometimes the block breakes itself!
    How to fix this? This is my code

    Code:
     Player player = (Player)sender;
                Location location = player.getEyeLocation().add(0.0D, 2.0D, 0.0D);
                FallingBlock fallingBlock = player.getWorld().spawnFallingBlock(location, Material.STAINED_CLAY, (byte) 15);
                Bat bat = (Bat)player.getWorld().spawn(location, Bat.class);
                bat.setPassenger(fallingBlock);
                bat.setLeashHolder(player);
                player.setPassenger(bat);
                bat.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 100000, 100000));
     
  2. Offline

    kalicat

    Wrong forum. please put under Plugin Development
     
  3. Offline

    JaguarJo

Thread Status:
Not open for further replies.

Share This Page