Balloon

Discussion in 'Plugin Development' started by FloopThatGuy5, May 17, 2015.

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

    FloopThatGuy5

    Code:
        @EventHandler(priority=EventPriority.HIGHEST)
        public void onPlayerUse(PlayerInteractEvent e){
             Player player = e.getPlayer();
            
             if(player.getItemInHand().getItemMeta().getDisplayName().equalsIgnoreCase("§4§lMickey Balloon")){      
                 Location location = player.getEyeLocation().add(0.0D, 5.0D, 0.0D);
                 FallingBlock fallingBlock = player.getWorld().spawnFallingBlock(location, Material.SKULL_ITEM, (byte)3);
                 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));
                 bat.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 100000, 100000));
       
             }
        }
    }
    
    Im trying to make a Mickey Balloon, But this wont spawn or work. I have the ItemStack in a different class. I can't get the spawnFallingBlock tobe the Mickey head and It won't spawn. (I want it to stay move the player when its held) does anyone have any ideas?
     
  2. Offline

    I Al Istannen

    Last edited: May 17, 2015
  3. Offline

    FloopThatGuy5

    @I Al Istannen Thankyou, That link does not work, How do I set the Mickey head tobe the block, and do u know why it wont spawn?
     
  4. Offline

    I Al Istannen

    @FloopThatGuy5
    Now it works ;D Strange... Replace the "Material.SKULL_ITEM" with "MATERIAL.SKULL" to get the block material. This can be used to set the type of the falling block.
     
  5. Offline

    FloopThatGuy5

    Thanks!
     
  6. Offline

    I Al Istannen

  7. Offline

    FloopThatGuy5

    @I Al Istannen Sorry to keep bothering you, Im kinda a noob. How do I set the block head. and It still won't spawn
     
  8. Offline

    I Al Istannen

    @FloopThatGuy5
    I have tried it and it turned out, that the falling block gets spawned and places a block where it lands, but doesn't get shown falling. I don't really know why that happens ;/ It works with the other blocks I have tested though.

    EDIT: If you do this on 1.8 you can use an armorstand to display it.
     
Thread Status:
Not open for further replies.

Share This Page